From df2db492d4141986a7b0540d51060cfba56aef6c Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 8 May 2026 15:12:22 +0100 Subject: [PATCH 1/7] refactor: extract chat helpers --- .../webassets/dist/assets/index-BcyKZwkK.js | 72 ---- .../webassets/dist/assets/index-DlqdWfBs.js | 72 ++++ apps/api/internal/webassets/dist/index.html | 2 +- apps/web/src/ChatApp.svelte | 342 ++---------------- apps/web/src/lib/actions/autogrow.ts | 23 ++ apps/web/src/lib/chat/messages.ts | 78 ++++ apps/web/src/lib/chat/people.ts | 64 ++++ apps/web/src/lib/chat/typeToFocus.ts | 119 ++++++ apps/web/src/lib/gifs.ts | 38 ++ apps/web/src/lib/uploads.ts | 19 + 10 files changed, 447 insertions(+), 382 deletions(-) delete mode 100644 apps/api/internal/webassets/dist/assets/index-BcyKZwkK.js create mode 100644 apps/api/internal/webassets/dist/assets/index-DlqdWfBs.js create mode 100644 apps/web/src/lib/actions/autogrow.ts create mode 100644 apps/web/src/lib/chat/messages.ts create mode 100644 apps/web/src/lib/chat/people.ts create mode 100644 apps/web/src/lib/chat/typeToFocus.ts create mode 100644 apps/web/src/lib/gifs.ts create mode 100644 apps/web/src/lib/uploads.ts diff --git a/apps/api/internal/webassets/dist/assets/index-BcyKZwkK.js b/apps/api/internal/webassets/dist/assets/index-BcyKZwkK.js deleted file mode 100644 index a0cda20..0000000 --- a/apps/api/internal/webassets/dist/assets/index-BcyKZwkK.js +++ /dev/null @@ -1,72 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();const Wc=!1;var Ll=Array.isArray,jc=Array.prototype.indexOf,Fr=Array.prototype.includes,ni=Array.from,Zc=Object.defineProperty,_a=Object.getOwnPropertyDescriptor,Dl=Object.getOwnPropertyDescriptors,Yc=Object.prototype,Xc=Array.prototype,Xi=Object.getPrototypeOf,el=Object.isExtensible;const Vc=()=>{};function Kc(e){return e()}function Li(e){for(var t=0;t{e=i,t=a});return{promise:n,resolve:e,reject:t}}const st=2,Ur=4,xa=8,Ol=1<<24,xn=16,un=32,Xn=64,Di=128,Bt=512,Ge=1024,at=2048,fn=4096,pt=8192,Ht=16384,_r=32768,Mi=1<<25,Br=65536,Oi=1<<17,Nl=1<<18,mr=1<<19,Pl=1<<20,yn=1<<25,pr=65536,Va=1<<21,ka=1<<22,Zn=1<<23,zr=Symbol("$state"),Jc=Symbol(""),Pn=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function zl(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Qc(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function eu(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function tu(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function nu(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ru(e){throw new Error("https://svelte.dev/e/effect_orphan")}function au(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function iu(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function su(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function lu(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ou(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const cu=1,uu=2,Fl=4,fu=8,du=16,pu=1,hu=2,Je=Symbol(),Ul="http://www.w3.org/1999/xhtml",vu="http://www.w3.org/2000/svg",gu="http://www.w3.org/1998/Math/MathML";function _u(){console.warn("https://svelte.dev/e/derived_inert")}function mu(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Bl(e){return e===this.v}function Hl(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function $l(e){return!Hl(e,this.v)}let Ta=!1,bu=!1;function ku(){Ta=!0}let Re=null;function Hr(e){Re=e}function ri(e,t=!1,n){Re={p:Re,i:!1,c:null,e:null,s:e,x:null,r:re,l:Ta&&!t?{s:null,u:null,$:[]}:null}}function ai(e){var t=Re,n=t.e;if(n!==null){t.e=null;for(var i of n)co(i)}return t.i=!0,Re=t.p,{}}function Ea(){return!Ta||Re!==null&&Re.l===null}let or=[];function ql(){var e=or;or=[],Li(e)}function Yn(e){if(or.length===0&&!ma){var t=or;queueMicrotask(()=>{t===or&&ql()})}or.push(e)}function wu(){for(;or.length>0;)ql()}function Gl(e){var t=re;if(t===null)return ue.f|=Zn,e;if((t.f&_r)===0&&(t.f&Ur)===0)throw e;Wn(e,t)}function Wn(e,t){for(;t!==null;){if((t.f&Di)!==0){if((t.f&_r)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const yu=-7169;function Pe(e,t){e.f=e.f&yu|t}function Vi(e){(e.f&Bt)!==0||e.deps===null?Pe(e,Ge):Pe(e,fn)}function Wl(e){if(e!==null)for(const t of e)(t.f&st)===0||(t.f&pr)===0||(t.f^=pr,Wl(t.deps))}function jl(e,t,n){(e.f&at)!==0?t.add(e):(e.f&fn)!==0&&n.add(e),Wl(e.deps),Pe(e,Ge)}const sr=new Set;let ne=null,on=null,Ni=null,ma=!1,wi=!1,Nr=null,Za=null;var tl=0;let xu=1;class Vn{id=xu++;current=new Map;previous=new Map;#n=new Set;#o=new Set;#e=new Set;#a=new Map;#r=new Map;#i=null;#t=[];#s=[];#c=new Set;#u=new Set;#l=new Map;#d=new Set;is_fork=!1;#h=!1;#p=new Set;#f(){return this.is_fork||this.#r.size>0}#_(){for(const i of this.#p)for(const a of i.#r.keys()){for(var t=!1,n=a;n.parent!==null;){if(this.#l.has(n)){t=!0;break}n=n.parent}if(!t)return!0}return!1}skip_effect(t){this.#l.has(t)||this.#l.set(t,{d:[],m:[]}),this.#d.delete(t)}unskip_effect(t,n=i=>this.schedule(i)){var i=this.#l.get(t);if(i){this.#l.delete(t);for(var a of i.d)Pe(a,at),n(a);for(a of i.m)Pe(a,fn),n(a)}this.#d.add(t)}#v(){if(tl++>1e3&&(sr.delete(this),Eu()),!this.#f()){for(const c of this.#c)this.#u.delete(c),Pe(c,at),this.schedule(c);for(const c of this.#u)Pe(c,fn),this.schedule(c)}const t=this.#t;this.#t=[],this.apply();var n=Nr=[],i=[],a=Za=[];for(const c of t)try{this.#m(c,n,i)}catch(o){throw Xl(c),o}if(ne=null,a.length>0){var s=Vn.ensure();for(const c of a)s.schedule(c)}if(Nr=null,Za=null,this.#f()||this.#_()){this.#g(i),this.#g(n);for(const[c,o]of this.#l)Yl(c,o)}else{this.#a.size===0&&sr.delete(this),this.#c.clear(),this.#u.clear();for(const c of this.#n)c(this);this.#n.clear(),nl(i),nl(n),this.#i?.resolve()}var l=ne;if(this.#t.length>0){const c=l??=this;c.#t.push(...this.#t.filter(o=>!c.#t.includes(o)))}l!==null&&(sr.add(l),l.#v())}#m(t,n,i){t.f^=Ge;for(var a=t.first;a!==null;){var s=a.f,l=(s&(un|Xn))!==0,c=l&&(s&Ge)!==0,o=c||(s&pt)!==0||this.#l.has(a);if(!o&&a.fn!==null){l?a.f^=Ge:(s&Ur)!==0?n.push(a):Wr(a)&&((s&xn)!==0&&this.#u.add(a),vr(a));var u=a.first;if(u!==null){a=u;continue}}for(;a!==null;){var h=a.next;if(h!==null){a=h;break}a=a.parent}}}#g(t){for(var n=0;n!this.current.has(w));if(a.length===0)t&&h.discard();else if(n.length>0){if(t)for(const w of this.#d)h.unskip_effect(w,m=>{(m.f&(xn|ka))!==0?h.schedule(m):h.#g([m])});h.activate();var s=new Set,l=new Map;for(var c of n)Zl(c,a,s,l);l=new Map;var o=[...h.current.keys()].filter(w=>this.current.has(w)?this.current.get(w)[0]!==w:!0);for(const w of this.#s)(w.f&(Ht|pt|Oi))===0&&Ki(w,o,l)&&((w.f&(ka|xn))!==0?(Pe(w,at),h.schedule(w)):h.#c.add(w));if(h.#t.length>0){h.apply();for(var u of h.#t)h.#m(u,[],[]);h.#t=[]}h.deactivate()}}for(const h of sr)h.#p.has(this)&&(h.#p.delete(this),h.#p.size===0&&!h.#f()&&(h.activate(),h.#v()))}increment(t,n){let i=this.#a.get(n)??0;if(this.#a.set(n,i+1),t){let a=this.#r.get(n)??0;this.#r.set(n,a+1)}}decrement(t,n,i){let a=this.#a.get(n)??0;if(a===1?this.#a.delete(n):this.#a.set(n,a-1),t){let s=this.#r.get(n)??0;s===1?this.#r.delete(n):this.#r.set(n,s-1)}this.#h||i||(this.#h=!0,Yn(()=>{this.#h=!1,this.flush()}))}transfer_effects(t,n){for(const i of t)this.#c.add(i);for(const i of n)this.#u.add(i);t.clear(),n.clear()}oncommit(t){this.#n.add(t)}ondiscard(t){this.#o.add(t)}on_fork_commit(t){this.#e.add(t)}run_fork_commit_callbacks(){for(const t of this.#e)t(this);this.#e.clear()}settled(){return(this.#i??=Ml()).promise}static ensure(){if(ne===null){const t=ne=new Vn;wi||(sr.add(ne),ma||Yn(()=>{ne===t&&t.flush()}))}return ne}apply(){{on=null;return}}schedule(t){if(Ni=t,t.b?.is_pending&&(t.f&(Ur|xa|Ol))!==0&&(t.f&_r)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var i=n.f;if(Nr!==null&&n===re&&(ue===null||(ue.f&st)===0))return;if((i&(Xn|un))!==0){if((i&Ge)===0)return;n.f^=Ge}}this.#t.push(n)}}function Tu(e){var t=ma;ma=!0;try{for(var n;;){if(wu(),ne===null)return n;ne.flush()}}finally{ma=t}}function Eu(){try{au()}catch(e){Wn(e,Ni)}}let Nn=null;function nl(e){var t=e.length;if(t!==0){for(var n=0;n0)){ur.clear();for(const a of Nn){if((a.f&(Ht|pt))!==0)continue;const s=[a];let l=a.parent;for(;l!==null;)Nn.has(l)&&(Nn.delete(l),s.push(l)),l=l.parent;for(let c=s.length-1;c>=0;c--){const o=s[c];(o.f&(Ht|pt))===0&&vr(o)}}Nn.clear()}}Nn=null}}function Zl(e,t,n,i){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const a of e.reactions){const s=a.f;(s&st)!==0?Zl(a,t,n,i):(s&(ka|xn))!==0&&(s&at)===0&&Ki(a,t,i)&&(Pe(a,at),Ji(a))}}function Ki(e,t,n){const i=n.get(e);if(i!==void 0)return i;if(e.deps!==null)for(const a of e.deps){if(Fr.call(t,a))return!0;if((a.f&st)!==0&&Ki(a,t,n))return n.set(a,!0),!0}return n.set(e,!1),!1}function Ji(e){ne.schedule(e)}function Yl(e,t){if(!((e.f&un)!==0&&(e.f&Ge)!==0)){(e.f&at)!==0?t.d.push(e):(e.f&fn)!==0&&t.m.push(e),Pe(e,Ge);for(var n=e.first;n!==null;)Yl(n,t),n=n.next}}function Xl(e){Pe(e,Ge);for(var t=e.first;t!==null;)Xl(t),t=t.next}function Su(e){let t=0,n=hr(0),i;return()=>{es()&&(r(n),Gr(()=>(t===0&&(i=_(()=>e(()=>ba(n)))),t+=1,()=>{Yn(()=>{t-=1,t===0&&(i?.(),i=void 0,ba(n))})})))}}var Au=Br|mr;function Ru(e,t,n,i){new Cu(e,t,n,i)}class Cu{parent;is_pending=!1;transform_error;#n;#o=null;#e;#a;#r;#i=null;#t=null;#s=null;#c=null;#u=0;#l=0;#d=!1;#h=new Set;#p=new Set;#f=null;#_=Su(()=>(this.#f=hr(this.#u),()=>{this.#f=null}));constructor(t,n,i,a){this.#n=t,this.#e=n,this.#a=s=>{var l=re;l.b=this,l.f|=Di,i(s)},this.parent=re.b,this.transform_error=a??this.parent?.transform_error??(s=>s),this.#r=li(()=>{this.#b()},Au)}#v(){try{this.#i=Ut(()=>this.#a(this.#n))}catch(t){this.error(t)}}#m(t){const n=this.#e.failed;n&&(this.#s=Ut(()=>{n(this.#n,()=>t,()=>()=>{})}))}#g(){const t=this.#e.pending;t&&(this.is_pending=!0,this.#t=Ut(()=>t(this.#n)),Yn(()=>{var n=this.#c=document.createDocumentFragment(),i=Tn();n.append(i),this.#i=this.#w(()=>Ut(()=>this.#a(i))),this.#l===0&&(this.#n.before(n),this.#c=null,fr(this.#t,()=>{this.#t=null}),this.#k(ne))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#u=0,this.#i=Ut(()=>{this.#a(this.#n)}),this.#l>0){var t=this.#c=document.createDocumentFragment();rs(this.#i,t);const n=this.#e.pending;this.#t=Ut(()=>n(this.#n))}else this.#k(ne)}catch(n){this.error(n)}}#k(t){this.is_pending=!1,t.transfer_effects(this.#h,this.#p)}defer_effect(t){jl(t,this.#h,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#e.pending}#w(t){var n=re,i=ue,a=Re;Gt(this.#r),qt(this.#r),Hr(this.#r.ctx);try{return Vn.ensure(),t()}catch(s){return Gl(s),null}finally{Gt(n),qt(i),Hr(a)}}#y(t,n){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(t,n);return}this.#l+=t,this.#l===0&&(this.#k(n),this.#t&&fr(this.#t,()=>{this.#t=null}),this.#c&&(this.#n.before(this.#c),this.#c=null))}update_pending_count(t,n){this.#y(t,n),this.#u+=t,!(!this.#f||this.#d)&&(this.#d=!0,Yn(()=>{this.#d=!1,this.#f&&$r(this.#f,this.#u)}))}get_effect_pending(){return this.#_(),r(this.#f)}error(t){if(!this.#e.onerror&&!this.#e.failed)throw t;ne?.is_fork?(this.#i&&ne.skip_effect(this.#i),this.#t&&ne.skip_effect(this.#t),this.#s&&ne.skip_effect(this.#s),ne.on_fork_commit(()=>{this.#x(t)})):this.#x(t)}#x(t){this.#i&&(kt(this.#i),this.#i=null),this.#t&&(kt(this.#t),this.#t=null),this.#s&&(kt(this.#s),this.#s=null);var n=this.#e.onerror;let i=this.#e.failed;var a=!1,s=!1;const l=()=>{if(a){mu();return}a=!0,s&&ou(),this.#s!==null&&fr(this.#s,()=>{this.#s=null}),this.#w(()=>{this.#b()})},c=o=>{try{s=!0,n?.(o,l),s=!1}catch(u){Wn(u,this.#r&&this.#r.parent)}i&&(this.#s=this.#w(()=>{try{return Ut(()=>{var u=re;u.b=this,u.f|=Di,i(this.#n,()=>o,()=>l)})}catch(u){return Wn(u,this.#r.parent),null}}))};Yn(()=>{var o;try{o=this.transform_error(t)}catch(u){Wn(u,this.#r&&this.#r.parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(c,u=>Wn(u,this.#r&&this.#r.parent)):c(o)})}}function Iu(e,t,n,i){const a=Ea()?ii:Pr;var s=e.filter(m=>!m.settled);if(n.length===0&&s.length===0){i(t.map(a));return}var l=re,c=Lu(),o=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(m=>m.promise)):null;function u(m){c();try{i(m)}catch(E){(l.f&Ht)===0&&Wn(E,l)}Ka()}if(n.length===0){o.then(()=>u(t.map(a)));return}var h=Vl();function w(){Promise.all(n.map(m=>Du(m))).then(m=>u([...t.map(a),...m])).catch(m=>Wn(m,l)).finally(()=>h())}o?o.then(()=>{c(),w(),Ka()}):w()}function Lu(){var e=re,t=ue,n=Re,i=ne;return function(s=!0){Gt(e),qt(t),Hr(n),s&&(e.f&Ht)===0&&(i?.activate(),i?.apply())}}function Ka(e=!0){Gt(null),qt(null),Hr(null),e&&ne?.deactivate()}function Vl(){var e=re,t=e.b,n=ne,i=t.is_rendered();return t.update_pending_count(1,n),n.increment(i,e),(a=!1)=>{t.update_pending_count(-1,n),n.decrement(i,e,a)}}function ii(e){var t=st|at;return re!==null&&(re.f|=mr),{ctx:Re,deps:null,effects:null,equals:Bl,f:t,fn:e,reactions:null,rv:0,v:Je,wv:0,parent:re,ac:null}}function Du(e,t,n){let i=re;i===null&&Qc();var a=void 0,s=hr(Je),l=!ue,c=new Map;return Wu(()=>{var o=re,u=Ml();a=u.promise;try{Promise.resolve(e()).then(u.resolve,u.reject).finally(Ka)}catch(E){u.reject(E),Ka()}var h=ne;if(l){if((o.f&_r)!==0)var w=Vl();if(i.b.is_rendered())c.get(h)?.reject(Pn),c.delete(h);else{for(const E of c.values())E.reject(Pn);c.clear()}c.set(h,u)}const m=(E,T=void 0)=>{if(w){var L=T===Pn;w(L)}if(!(T===Pn||(o.f&Ht)!==0)){if(h.activate(),T)s.f|=Zn,$r(s,T);else{(s.f&Zn)!==0&&(s.f^=Zn),$r(s,E);for(const[S,I]of c){if(c.delete(S),S===h)break;I.reject(Pn)}}h.deactivate()}};u.promise.then(m,E=>m(null,E||"unknown"))}),oo(()=>{for(const o of c.values())o.reject(Pn)}),new Promise(o=>{function u(h){function w(){h===a?o(s):u(a)}h.then(w,w)}u(a)})}function Ja(e){const t=ii(e);return go(t),t}function Pr(e){const t=ii(e);return t.equals=$l,t}function Mu(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;nr(e))),t}function v(e,t,n=!1){ue!==null&&(!cn||(ue.f&Oi)!==0)&&Ea()&&(ue.f&(st|xn|ka|Oi))!==0&&($t===null||!Fr.call($t,e))&&lu();let i=n?da(t):t;return $r(e,i,Za)}function $r(e,t,n=null){if(!e.equals(t)){ur.set(e,Kn?t:e.v);var i=Vn.ensure();if(i.capture(e,t),(e.f&st)!==0){const a=e;(e.f&at)!==0&&Qi(a),on===null&&Vi(a)}e.wv=mo(),eo(e,at,n),Ea()&&re!==null&&(re.f&Ge)!==0&&(re.f&(un|Xn))===0&&(Ft===null?Zu([e]):Ft.push(e)),!i.is_fork&&Pi.size>0&&!Ql&&Pu()}return t}function Pu(){Ql=!1;for(const e of Pi)(e.f&Ge)!==0&&Pe(e,fn),Wr(e)&&vr(e);Pi.clear()}function ba(e){v(e,e.v+1)}function eo(e,t,n){var i=e.reactions;if(i!==null)for(var a=Ea(),s=i.length,l=0;l{if(dr===s)return c();var o=ue,u=dr;qt(null),il(s);var h=c();return qt(o),il(u),h};return i&&n.set("length",an(e.length)),new Proxy(e,{defineProperty(c,o,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&iu();var h=n.get(o);return h===void 0?l(()=>{var w=an(u.value);return n.set(o,w),w}):v(h,u.value,!0),!0},deleteProperty(c,o){var u=n.get(o);if(u===void 0){if(o in c){const h=l(()=>an(Je));n.set(o,h),ba(a)}}else v(u,Je),ba(a);return!0},get(c,o,u){if(o===zr)return e;var h=n.get(o),w=o in c;if(h===void 0&&(!w||_a(c,o)?.writable)&&(h=l(()=>{var E=da(w?c[o]:Je),T=an(E);return T}),n.set(o,h)),h!==void 0){var m=r(h);return m===Je?void 0:m}return Reflect.get(c,o,u)},getOwnPropertyDescriptor(c,o){var u=Reflect.getOwnPropertyDescriptor(c,o);if(u&&"value"in u){var h=n.get(o);h&&(u.value=r(h))}else if(u===void 0){var w=n.get(o),m=w?.v;if(w!==void 0&&m!==Je)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return u},has(c,o){if(o===zr)return!0;var u=n.get(o),h=u!==void 0&&u.v!==Je||Reflect.has(c,o);if(u!==void 0||re!==null&&(!h||_a(c,o)?.writable)){u===void 0&&(u=l(()=>{var m=h?da(c[o]):Je,E=an(m);return E}),n.set(o,u));var w=r(u);if(w===Je)return!1}return h},set(c,o,u,h){var w=n.get(o),m=o in c;if(i&&o==="length")for(var E=u;Ean(Je)),n.set(E+"",T))}if(w===void 0)(!m||_a(c,o)?.writable)&&(w=l(()=>an(void 0)),v(w,da(u)),n.set(o,w));else{m=w.v!==Je;var L=l(()=>da(u));v(w,L)}var S=Reflect.getOwnPropertyDescriptor(c,o);if(S?.set&&S.set.call(h,u),!m){if(i&&typeof o=="string"){var I=n.get("length"),A=Number(o);Number.isInteger(A)&&A>=I.v&&v(I,A+1)}ba(a)}return!0},ownKeys(c){r(a);var o=Reflect.ownKeys(c).filter(w=>{var m=n.get(w);return m===void 0||m.v!==Je});for(var[u,h]of n)h.v!==Je&&!(u in c)&&o.push(u);return o},setPrototypeOf(){su()}})}var zi,to,no,ro,ao;function zu(){if(zi===void 0){zi=window,to=document,no=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;ro=_a(t,"firstChild").get,ao=_a(t,"nextSibling").get,el(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),el(n)&&(n.__t=void 0)}}function Tn(e=""){return document.createTextNode(e)}function jn(e){return ro.call(e)}function Sa(e){return ao.call(e)}function p(e,t){return jn(e)}function Gn(e,t=!1){{var n=jn(e);return n instanceof Comment&&n.data===""?Sa(n):n}}function g(e,t=1,n=!1){let i=e;for(;t--;)i=Sa(i);return i}function Fu(e){e.textContent=""}function io(){return!1}function so(e,t,n){return document.createElementNS(t??Ul,e,void 0)}let rl=!1;function Uu(){rl||(rl=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function si(e){var t=ue,n=re;qt(null),Gt(null);try{return e()}finally{qt(t),Gt(n)}}function Bu(e,t,n,i=n){e.addEventListener(t,()=>si(n));const a=e.__on_r;a?e.__on_r=()=>{a(),i(!0)}:e.__on_r=()=>i(!0),Uu()}function lo(e){re===null&&(ue===null&&ru(),nu()),Kn&&tu()}function Hu(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function En(e,t){var n=re;n!==null&&(n.f&pt)!==0&&(e|=pt);var i={ctx:Re,deps:null,nodes:null,f:e|at|Bt,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};ne?.register_created_effect(i);var a=i;if((e&Ur)!==0)Nr!==null?Nr.push(i):Vn.ensure().schedule(i);else if(t!==null){try{vr(i)}catch(l){throw kt(i),l}a.deps===null&&a.teardown===null&&a.nodes===null&&a.first===a.last&&(a.f&mr)===0&&(a=a.first,(e&xn)!==0&&(e&Br)!==0&&a!==null&&(a.f|=Br))}if(a!==null&&(a.parent=n,n!==null&&Hu(a,n),ue!==null&&(ue.f&st)!==0&&(e&Xn)===0)){var s=ue;(s.effects??=[]).push(a)}return i}function es(){return ue!==null&&!cn}function oo(e){const t=En(xa,null);return Pe(t,Ge),t.teardown=e,t}function Fi(e){lo();var t=re.f,n=!ue&&(t&un)!==0&&(t&_r)===0;if(n){var i=Re;(i.e??=[]).push(e)}else return co(e)}function co(e){return En(Ur|Pl,e)}function $u(e){return lo(),En(xa|Pl,e)}function qu(e){Vn.ensure();const t=En(Xn|mr,e);return(n={})=>new Promise(i=>{n.outro?fr(t,()=>{kt(t),i(void 0)}):(kt(t),i(void 0))})}function wa(e){return En(Ur,e)}function mn(e,t){var n=Re,i={effect:null,ran:!1,deps:e};n.l.$.push(i),i.effect=Gr(()=>{if(e(),!i.ran){i.ran=!0;var a=re;try{Gt(a.parent),_(t)}finally{Gt(a)}}})}function Gu(){var e=Re;Gr(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&Ge)!==0&&n.deps!==null&&Pe(n,fn),Wr(n)&&vr(n),t.ran=!1}})}function Wu(e){return En(ka|mr,e)}function Gr(e,t=0){return En(xa|t,e)}function z(e,t=[],n=[],i=[]){Iu(i,t,n,a=>{En(xa,()=>e(...a.map(r)))})}function li(e,t=0){var n=En(xn|t,e);return n}function Ut(e){return En(un|mr,e)}function uo(e){var t=e.teardown;if(t!==null){const n=Kn,i=ue;al(!0),qt(null);try{t.call(null)}finally{al(n),qt(i)}}}function ts(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const a=n.ac;a!==null&&si(()=>{a.abort(Pn)});var i=n.next;(n.f&Xn)!==0?n.parent=null:kt(n,t),n=i}}function ju(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&un)===0&&kt(t),t=n}}function kt(e,t=!0){var n=!1;(t||(e.f&Nl)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(fo(e.nodes.start,e.nodes.end),n=!0),Pe(e,Mi),ts(e,t&&!n),ya(e,0);var i=e.nodes&&e.nodes.t;if(i!==null)for(const s of i)s.stop();uo(e),e.f^=Mi,e.f|=Ht;var a=e.parent;a!==null&&a.first!==null&&po(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function fo(e,t){for(;e!==null;){var n=e===t?null:Sa(e);e.remove(),e=n}}function po(e){var t=e.parent,n=e.prev,i=e.next;n!==null&&(n.next=i),i!==null&&(i.prev=n),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=n))}function fr(e,t,n=!0){var i=[];ho(e,i,!0);var a=()=>{n&&kt(e),t&&t()},s=i.length;if(s>0){var l=()=>--s||a();for(var c of i)c.out(l)}else a()}function ho(e,t,n){if((e.f&pt)===0){e.f^=pt;var i=e.nodes&&e.nodes.t;if(i!==null)for(const c of i)(c.is_global||n)&&t.push(c);for(var a=e.first;a!==null;){var s=a.next;if((a.f&Xn)===0){var l=(a.f&Br)!==0||(a.f&un)!==0&&(e.f&xn)!==0;ho(a,t,l?n:!1)}a=s}}}function ns(e){vo(e,!0)}function vo(e,t){if((e.f&pt)!==0){e.f^=pt,(e.f&Ge)===0&&(Pe(e,at),Vn.ensure().schedule(e));for(var n=e.first;n!==null;){var i=n.next,a=(n.f&Br)!==0||(n.f&un)!==0;vo(n,a?t:!1),n=i}var s=e.nodes&&e.nodes.t;if(s!==null)for(const l of s)(l.is_global||t)&&l.in()}}function rs(e,t){if(e.nodes)for(var n=e.nodes.start,i=e.nodes.end;n!==null;){var a=n===i?null:Sa(n);t.append(n),n=a}}let Ya=!1,Kn=!1;function al(e){Kn=e}let ue=null,cn=!1;function qt(e){ue=e}let re=null;function Gt(e){re=e}let $t=null;function go(e){ue!==null&&($t===null?$t=[e]:$t.push(e))}let bt=null,St=0,Ft=null;function Zu(e){Ft=e}let _o=1,cr=0,dr=cr;function il(e){dr=e}function mo(){return++_o}function Wr(e){var t=e.f;if((t&at)!==0)return!0;if(t&st&&(e.f&=~pr),(t&fn)!==0){for(var n=e.deps,i=n.length,a=0;ae.wv)return!0}(t&Bt)!==0&&on===null&&Pe(e,Ge)}return!1}function bo(e,t,n=!0){var i=e.reactions;if(i!==null&&!($t!==null&&Fr.call($t,e)))for(var a=0;a{e.ac.abort(Pn)}),e.ac=null);try{e.f|=Va;var h=e.fn,w=h();e.f|=_r;var m=e.deps,E=ne?.is_fork;if(bt!==null){var T;if(E||ya(e,St),m!==null&&St>0)for(m.length=St+bt.length,T=0;Tn?.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Yn(()=>{t.addEventListener(e,a,i)}):t.addEventListener(e,a,i),a}function zt(e,t,n,i,a){var s={capture:i,passive:a},l=Ku(e,t,n,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&oo(()=>{t.removeEventListener(e,l,s)})}function G(e,t,n){(t[pa]??={})[e]=n}function To(e){for(var t=0;t{throw S});throw m}}finally{e[pa]=t,delete e.currentTarget,qt(h),Gt(w)}}}const Ju=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Qu(e){return Ju?.createHTML(e)??e}function ef(e){var t=so("template");return t.innerHTML=Qu(e.replaceAll("","")),t.content}function qr(e,t){var n=re;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function O(e,t){var n=(t&pu)!==0,i=(t&hu)!==0,a,s=!e.startsWith("");return()=>{a===void 0&&(a=ef(s?e:""+e),n||(a=jn(a)));var l=i||no?document.importNode(a,!0):a.cloneNode(!0);if(n){var c=jn(l),o=l.lastChild;qr(c,o)}else qr(l,l);return l}}function ut(e=""){{var t=Tn(e+"");return qr(t,t),t}}function as(){var e=document.createDocumentFragment(),t=document.createComment(""),n=Tn();return e.append(t,n),qr(t,n),e}function C(e,t){e!==null&&e.before(t)}function M(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function tf(e,t){return nf(e,t)}const qa=new Map;function nf(e,{target:t,anchor:n,props:i={},events:a,context:s,intro:l=!0,transformError:c}){zu();var o=void 0,u=qu(()=>{var h=n??t.appendChild(Tn());Ru(h,{pending:()=>{}},E=>{ri({});var T=Re;s&&(T.c=s),a&&(i.$$events=a),o=e(E,i)||{},ai()},c);var w=new Set,m=E=>{for(var T=0;T{for(var E of w)for(const S of[t,document]){var T=qa.get(S),L=T.get(E);--L==0?(S.removeEventListener(E,$i),T.delete(E),T.size===0&&qa.delete(S)):T.set(E,L)}Hi.delete(m),h!==n&&h.parentNode?.removeChild(h)}});return rf.set(o,u),o}let rf=new WeakMap;class af{anchor;#n=new Map;#o=new Map;#e=new Map;#a=new Set;#r=!0;constructor(t,n=!0){this.anchor=t,this.#r=n}#i=t=>{if(this.#n.has(t)){var n=this.#n.get(t),i=this.#o.get(n);if(i)ns(i),this.#a.delete(n);else{var a=this.#e.get(n);a&&(this.#o.set(n,a.effect),this.#e.delete(n),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),i=a.effect)}for(const[s,l]of this.#n){if(this.#n.delete(s),s===t)break;const c=this.#e.get(l);c&&(kt(c.effect),this.#e.delete(l))}for(const[s,l]of this.#o){if(s===n||this.#a.has(s))continue;const c=()=>{if(Array.from(this.#n.values()).includes(s)){var u=document.createDocumentFragment();rs(l,u),u.append(Tn()),this.#e.set(s,{effect:l,fragment:u})}else kt(l);this.#a.delete(s),this.#o.delete(s)};this.#r||!i?(this.#a.add(s),fr(l,c,!1)):c()}}};#t=t=>{this.#n.delete(t);const n=Array.from(this.#n.values());for(const[i,a]of this.#e)n.includes(i)||(kt(a.effect),this.#e.delete(i))};ensure(t,n){var i=ne,a=io();if(n&&!this.#o.has(t)&&!this.#e.has(t))if(a){var s=document.createDocumentFragment(),l=Tn();s.append(l),this.#e.set(t,{effect:Ut(()=>n(l)),fragment:s})}else this.#o.set(t,Ut(()=>n(this.anchor)));if(this.#n.set(i,t),a){for(const[c,o]of this.#o)c===t?i.unskip_effect(o):i.skip_effect(o);for(const[c,o]of this.#e)c===t?i.unskip_effect(o.effect):i.skip_effect(o.effect);i.oncommit(this.#i),i.ondiscard(this.#t)}else this.#i(i)}}function j(e,t,n=!1){var i=new af(e),a=n?Br:0;function s(l,c){i.ensure(l,c)}li(()=>{var l=!1;t((c,o=0)=>{l=!0,s(o,c)}),l||s(-1,null)},a)}function sf(e,t){return t}function lf(e,t,n){for(var i=[],a=t.length,s,l=t.length,c=0;c{if(s){if(s.pending.delete(w),s.done.add(w),s.pending.size===0){var m=e.outrogroups;qi(e,ni(s.done)),m.delete(s),m.size===0&&(e.outrogroups=null)}}else l-=1},!1)}if(l===0){var o=i.length===0&&n!==null;if(o){var u=n,h=u.parentNode;Fu(h),h.append(u),e.items.clear()}qi(e,t,!o)}else s={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(s)}function qi(e,t,n=!0){var i;if(e.pending.size>0){i=new Set;for(const l of e.pending.values())for(const c of l)i.add(e.items.get(c).e)}for(var a=0;a{var W=n();return Ll(W)?W:W==null?[]:ni(W)}),m,E=new Map,T=!0;function L(W){(A.effect.f&Ht)===0&&(A.pending.delete(W),A.fallback=h,of(A,m,l,t,i),h!==null&&(m.length===0?(h.f&yn)===0?ns(h):(h.f^=yn,ha(h,null,l)):fr(h,()=>{h=null})))}function S(W){A.pending.delete(W)}var I=li(()=>{m=r(w);for(var W=m.length,R=new Set,K=ne,te=io(),de=0;des(l)):(h=Ut(()=>s(ll??=Tn())),h.f|=yn)),W>R.size&&eu(),!T)if(E.set(K,R),te){for(const[pe,ce]of c)R.has(pe)||K.skip_effect(ce.e);K.oncommit(L),K.ondiscard(S)}else L(K);r(w)}),A={effect:I,items:c,pending:E,outrogroups:null,fallback:h};T=!1}function ia(e){for(;e!==null&&(e.f&un)===0;)e=e.next;return e}function of(e,t,n,i,a){var s=(i&fu)!==0,l=t.length,c=e.items,o=ia(e.effect.first),u,h=null,w,m=[],E=[],T,L,S,I;if(s)for(I=0;I0){var De=(i&Fl)!==0&&l===0?n:null;if(s){for(I=0;I{if(w!==void 0)for(S of w)S.nodes?.a?.apply()})}function cf(e,t,n,i,a,s,l,c){var o=(l&cu)!==0?(l&du)===0?Z(n,!1,!1):hr(n):null,u=(l&uu)!==0?hr(a):null;return{v:o,i:u,e:Ut(()=>(s(t,o??n,u??a,c),()=>{e.delete(i)}))}}function ha(e,t,n){if(e.nodes)for(var i=e.nodes.start,a=e.nodes.end,s=t&&(t.f&yn)===0?t.nodes.start:n;i!==null;){var l=Sa(i);if(s.before(i),i===a)return;i=l}}function qn(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function yi(e,t,n=!1,i=!1,a=!1,s=!1){var l=e,c="";if(n)var o=e;z(()=>{var u=re;if(c!==(c=t()??"")){if(n){u.nodes=null,o.innerHTML=c,c!==""&&qr(jn(o),o.lastChild);return}if(u.nodes!==null&&(fo(u.nodes.start,u.nodes.end),u.nodes=null),c!==""){var h=i?vu:a?gu:void 0,w=so(i?"svg":a?"math":"template",h);w.innerHTML=c;var m=i||a?w:w.content;if(qr(jn(m),m.lastChild),i||a)for(;jn(m);)l.before(jn(m));else l.before(m)}}})}function Eo(e,t){var n;n=document.head.appendChild(Tn()),li(()=>t(n),Nl|mr)}function ol(e,t,n){wa(()=>{var i=_(()=>t(e,n?.())||{});if(n&&i?.update){var a=!1,s={};Gr(()=>{var l=n();rn(l),a&&Hl(s,l)&&(s=l,i.update(l))}),a=!0}if(i?.destroy)return()=>i.destroy()})}const cl=[...` -\r\f \v\uFEFF`];function uf(e,t,n){var i=e==null?"":""+e;if(n){for(var a of Object.keys(n))if(n[a])i=i?i+" "+a:a;else if(i.length)for(var s=a.length,l=0;(l=i.indexOf(a,l))>=0;){var c=l+s;(l===0||cl.includes(i[l-1]))&&(c===i.length||cl.includes(i[c]))?i=(l===0?"":i.substring(0,l))+i.substring(c+1):l=c}}return i===""?null:i}function ff(e,t){return e==null?null:String(e)}function _t(e,t,n,i,a,s){var l=e.__className;if(l!==n||l===void 0){var c=uf(n,i,s);c==null?e.removeAttribute("class"):e.className=c,e.__className=n}else if(s&&a!==s)for(var o in s){var u=!!s[o];(a==null||u!==!!a[o])&&e.classList.toggle(o,u)}return s}function On(e,t,n,i){var a=e.__style;if(a!==t){var s=ff(t);s==null?e.removeAttribute("style"):e.style.cssText=s,e.__style=t}return i}const df=Symbol("is custom element"),pf=Symbol("is html");function q(e,t,n,i){var a=hf(e);a[t]!==(a[t]=n)&&(t==="loading"&&(e[Jc]=n),n==null?e.removeAttribute(t):typeof n!="string"&&vf(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function hf(e){return e.__attributes??={[df]:e.nodeName.includes("-"),[pf]:e.namespaceURI===Ul}}var ul=new Map;function vf(e){var t=e.getAttribute("is")||e.nodeName,n=ul.get(t);if(n)return n;ul.set(t,n=[]);for(var i,a=e,s=Element.prototype;s!==a;){i=Dl(a);for(var l in i)i[l].set&&n.push(l);a=Xi(a)}return n}function bn(e,t,n=t){var i=new WeakSet;Bu(e,"input",async a=>{var s=a?e.defaultValue:e.value;if(s=xi(e)?Ti(s):s,n(s),ne!==null&&i.add(ne),await Ui(),s!==(s=t())){var l=e.selectionStart,c=e.selectionEnd,o=e.value.length;if(e.value=s??"",c!==null){var u=e.value.length;l===c&&c===o&&u>o?(e.selectionStart=u,e.selectionEnd=u):(e.selectionStart=l,e.selectionEnd=Math.min(c,u))}}}),_(t)==null&&e.value&&(n(xi(e)?Ti(e.value):e.value),ne!==null&&i.add(ne)),Gr(()=>{var a=t();if(e===document.activeElement){var s=ne;if(i.has(s))return}xi(e)&&a===Ti(e.value)||e.type==="date"&&!a&&!e.value||a!==e.value&&(e.value=a??"")})}function xi(e){var t=e.type;return t==="number"||t==="range"}function Ti(e){return e===""?null:+e}function fl(e,t){return e===t||e?.[zr]===t}function Xa(e={},t,n,i){var a=Re.r,s=re;return wa(()=>{var l,c;return Gr(()=>{l=c,c=[],_(()=>{e!==n(...c)&&(t(e,...c),l&&fl(n(...l),e)&&t(null,...l))})}),()=>{let o=s;for(;o!==a&&o.parent!==null&&o.parent.f&Mi;)o=o.parent;const u=()=>{c&&fl(n(...c),e)&&t(null,...c)},h=o.teardown;o.teardown=()=>{u(),h?.()}}}),e}function So(e=!1){const t=Re,n=t.l.u;if(!n)return;let i=()=>rn(t.s);if(e){let a=0,s={};const l=ii(()=>{let c=!1;const o=t.s;for(const u in o)o[u]!==s[u]&&(s[u]=o[u],c=!0);return c&&a++,a});i=()=>r(l)}n.b.length&&$u(()=>{dl(t,i),Li(n.b)}),Fi(()=>{const a=_(()=>n.m.map(Kc));return()=>{for(const s of a)typeof s=="function"&&s()}}),n.a.length&&Fi(()=>{dl(t,i),Li(n.a)})}function dl(e,t){if(e.l.s)for(const n of e.l.s)r(n);t()}function gf(e,t,n,i){var a=i,s=!0,l=()=>(s&&(s=!1,a=i),a),c;c=e[t],c===void 0&&i!==void 0&&(c=l());var o;return o=()=>{var u=e[t];return u===void 0?l():(s=!0,u)},o}function Ao(e){Re===null&&zl(),Ta&&Re.l!==null?mf(Re).m.push(e):Fi(()=>{const t=_(e);if(typeof t=="function")return t})}function _f(e){Re===null&&zl(),Ao(()=>()=>_(e))}function mf(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}const bf="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(bf);ku();class Ro extends Error{constructor(t,n){super(n),this.status=t}status}async function nt(e,t={}){const n=new Headers(t.headers);n.set("Accept","application/json"),t.body&&!(t.body instanceof FormData)&&n.set("Content-Type","application/json");const i=await fetch(e,{...t,headers:n});if(!i.ok)throw new Ro(i.status,await i.text());return i.json()}const{entries:Co,setPrototypeOf:pl,isFrozen:kf,getPrototypeOf:wf,getOwnPropertyDescriptor:yf}=Object;let{freeze:ht,seal:Wt,create:Mr}=Object,{apply:Gi,construct:Wi}=typeof Reflect<"u"&&Reflect;ht||(ht=function(t){return t});Wt||(Wt=function(t){return t});Gi||(Gi=function(t,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),s=2;s1?n-1:0),a=1;a"u"?null:We(BigInt.prototype.toString),ml=typeof Symbol>"u"?null:We(Symbol.prototype.toString),Ne=We(Object.prototype.hasOwnProperty),oa=We(Object.prototype.toString),rt=We(RegExp.prototype.test),Ga=Rf(TypeError);function We(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a2&&arguments[2]!==void 0?arguments[2]:va;if(pl&&pl(e,null),!ft(t))return e;let i=t.length;for(;i--;){let a=t[i];if(typeof a=="string"){const s=n(a);s!==a&&(kf(t)||(t[i]=s),a=s)}e[a]=!0}return e}function Cf(e){for(let t=0;t/gm),Pf=Wt(/\$\{[\w\W]*/gm),zf=Wt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ff=Wt(/^aria-[\-\w]+$/),Io=Wt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Uf=Wt(/^(?:\w+script|data):/i),Bf=Wt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Lo=Wt(/^html$/i),Hf=Wt(/^[a-z][.\w]*(-[.\w]+)+$/i);var xl=Object.freeze({__proto__:null,ARIA_ATTR:Ff,ATTR_WHITESPACE:Bf,CUSTOM_ELEMENT:Hf,DATA_ATTR:zf,DOCTYPE_NAME:Lo,ERB_EXPR:Nf,IS_ALLOWED_URI:Io,IS_SCRIPT_OR_DATA:Uf,MUSTACHE_EXPR:Of,TMPLIT_EXPR:Pf});const ca={element:1,text:3,progressingInstruction:7,comment:8,document:9},$f=function(){return typeof window>"u"?null:window},qf=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(i=n.getAttribute(a));const s="dompurify"+(i?"#"+i:"");try{return t.createPolicy(s,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Tl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Do(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$f();const t=H=>Do(H);if(t.version="3.4.2",t.removed=[],!e||!e.document||e.document.nodeType!==ca.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const i=n,a=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:c,Element:o,NodeFilter:u,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:w,DOMParser:m,trustedTypes:E}=e,T=o.prototype,L=Or(T,"cloneNode"),S=Or(T,"remove"),I=Or(T,"nextSibling"),A=Or(T,"childNodes"),W=Or(T,"parentNode");if(typeof l=="function"){const H=n.createElement("template");H.content&&H.content.ownerDocument&&(n=H.content.ownerDocument)}let R,K="";const{implementation:te,createNodeIterator:de,createDocumentFragment:Te,getElementsByTagName:De}=n,{importNode:be}=i;let pe=Tl();t.isSupported=typeof Co=="function"&&typeof W=="function"&&te&&te.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ce,ERB_EXPR:ke,TMPLIT_EXPR:Qe,DATA_ATTR:At,ARIA_ATTR:jt,IS_SCRIPT_OR_DATA:it,ATTR_WHITESPACE:vt,CUSTOM_ELEMENT:dn}=xl;let{IS_ALLOWED_URI:Sn}=xl,Ie=null;const Rt=J({},[...bl,...Si,...Ai,...Ri,...kl]);let ze=null;const pn=J({},[...wl,...Ci,...yl,...Wa]);let ge=Object.seal(Mr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Zt=null,Yt=null;const wt=Object.seal(Mr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let An=!0,Xt=!0,fe=!1,Ye=!0,Ct=!1,Vt=!0,Le=!1,Zr=!1,Yr=!1,Kt=!1,kr=!1,wr=!1,Ra=!0,Jn=!1;const Ca="user-content-";let lt=!0,Rn=!1,Cn={},yt=null;const yr=J({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let xr=null;const Ia=J({},["audio","video","img","source","image","track"]);let Xr=null;const Vr=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Tr="http://www.w3.org/1998/Math/MathML",Er="http://www.w3.org/2000/svg",It="http://www.w3.org/1999/xhtml";let zn=It,Kr=!1,Jr=null;const ui=J({},[Tr,Er,It],Ei);let ot=J({},["mi","mo","mn","ms","mtext"]),Sr=J({},["annotation-xml"]);const Fn=J({},["title","style","font","a","script"]);let hn=null;const La=["application/xhtml+xml","text/html"],fi="text/html";let Fe=null,vn=null;const di=n.createElement("form"),Da=function(f){return f instanceof RegExp||f instanceof Function},Un=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(vn&&vn===f)return;(!f||typeof f!="object")&&(f={}),f=mt(f),hn=La.indexOf(f.PARSER_MEDIA_TYPE)===-1?fi:f.PARSER_MEDIA_TYPE,Fe=hn==="application/xhtml+xml"?Ei:va,Ie=Ne(f,"ALLOWED_TAGS")&&ft(f.ALLOWED_TAGS)?J({},f.ALLOWED_TAGS,Fe):Rt,ze=Ne(f,"ALLOWED_ATTR")&&ft(f.ALLOWED_ATTR)?J({},f.ALLOWED_ATTR,Fe):pn,Jr=Ne(f,"ALLOWED_NAMESPACES")&&ft(f.ALLOWED_NAMESPACES)?J({},f.ALLOWED_NAMESPACES,Ei):ui,Xr=Ne(f,"ADD_URI_SAFE_ATTR")&&ft(f.ADD_URI_SAFE_ATTR)?J(mt(Vr),f.ADD_URI_SAFE_ATTR,Fe):Vr,xr=Ne(f,"ADD_DATA_URI_TAGS")&&ft(f.ADD_DATA_URI_TAGS)?J(mt(Ia),f.ADD_DATA_URI_TAGS,Fe):Ia,yt=Ne(f,"FORBID_CONTENTS")&&ft(f.FORBID_CONTENTS)?J({},f.FORBID_CONTENTS,Fe):yr,Zt=Ne(f,"FORBID_TAGS")&&ft(f.FORBID_TAGS)?J({},f.FORBID_TAGS,Fe):mt({}),Yt=Ne(f,"FORBID_ATTR")&&ft(f.FORBID_ATTR)?J({},f.FORBID_ATTR,Fe):mt({}),Cn=Ne(f,"USE_PROFILES")?f.USE_PROFILES&&typeof f.USE_PROFILES=="object"?mt(f.USE_PROFILES):f.USE_PROFILES:!1,An=f.ALLOW_ARIA_ATTR!==!1,Xt=f.ALLOW_DATA_ATTR!==!1,fe=f.ALLOW_UNKNOWN_PROTOCOLS||!1,Ye=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ct=f.SAFE_FOR_TEMPLATES||!1,Vt=f.SAFE_FOR_XML!==!1,Le=f.WHOLE_DOCUMENT||!1,Kt=f.RETURN_DOM||!1,kr=f.RETURN_DOM_FRAGMENT||!1,wr=f.RETURN_TRUSTED_TYPE||!1,Yr=f.FORCE_BODY||!1,Ra=f.SANITIZE_DOM!==!1,Jn=f.SANITIZE_NAMED_PROPS||!1,lt=f.KEEP_CONTENT!==!1,Rn=f.IN_PLACE||!1,Sn=Lf(f.ALLOWED_URI_REGEXP)?f.ALLOWED_URI_REGEXP:Io,zn=typeof f.NAMESPACE=="string"?f.NAMESPACE:It,ot=Ne(f,"MATHML_TEXT_INTEGRATION_POINTS")&&f.MATHML_TEXT_INTEGRATION_POINTS&&typeof f.MATHML_TEXT_INTEGRATION_POINTS=="object"?mt(f.MATHML_TEXT_INTEGRATION_POINTS):J({},["mi","mo","mn","ms","mtext"]),Sr=Ne(f,"HTML_INTEGRATION_POINTS")&&f.HTML_INTEGRATION_POINTS&&typeof f.HTML_INTEGRATION_POINTS=="object"?mt(f.HTML_INTEGRATION_POINTS):J({},["annotation-xml"]);const x=Ne(f,"CUSTOM_ELEMENT_HANDLING")&&f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING=="object"?mt(f.CUSTOM_ELEMENT_HANDLING):Mr(null);if(ge=Mr(null),Ne(x,"tagNameCheck")&&Da(x.tagNameCheck)&&(ge.tagNameCheck=x.tagNameCheck),Ne(x,"attributeNameCheck")&&Da(x.attributeNameCheck)&&(ge.attributeNameCheck=x.attributeNameCheck),Ne(x,"allowCustomizedBuiltInElements")&&typeof x.allowCustomizedBuiltInElements=="boolean"&&(ge.allowCustomizedBuiltInElements=x.allowCustomizedBuiltInElements),Ct&&(Xt=!1),kr&&(Kt=!0),Cn&&(Ie=J({},kl),ze=Mr(null),Cn.html===!0&&(J(Ie,bl),J(ze,wl)),Cn.svg===!0&&(J(Ie,Si),J(ze,Ci),J(ze,Wa)),Cn.svgFilters===!0&&(J(Ie,Ai),J(ze,Ci),J(ze,Wa)),Cn.mathMl===!0&&(J(Ie,Ri),J(ze,yl),J(ze,Wa))),wt.tagCheck=null,wt.attributeCheck=null,Ne(f,"ADD_TAGS")&&(typeof f.ADD_TAGS=="function"?wt.tagCheck=f.ADD_TAGS:ft(f.ADD_TAGS)&&(Ie===Rt&&(Ie=mt(Ie)),J(Ie,f.ADD_TAGS,Fe))),Ne(f,"ADD_ATTR")&&(typeof f.ADD_ATTR=="function"?wt.attributeCheck=f.ADD_ATTR:ft(f.ADD_ATTR)&&(ze===pn&&(ze=mt(ze)),J(ze,f.ADD_ATTR,Fe))),Ne(f,"ADD_URI_SAFE_ATTR")&&ft(f.ADD_URI_SAFE_ATTR)&&J(Xr,f.ADD_URI_SAFE_ATTR,Fe),Ne(f,"FORBID_CONTENTS")&&ft(f.FORBID_CONTENTS)&&(yt===yr&&(yt=mt(yt)),J(yt,f.FORBID_CONTENTS,Fe)),Ne(f,"ADD_FORBID_CONTENTS")&&ft(f.ADD_FORBID_CONTENTS)&&(yt===yr&&(yt=mt(yt)),J(yt,f.ADD_FORBID_CONTENTS,Fe)),lt&&(Ie["#text"]=!0),Le&&J(Ie,["html","head","body"]),Ie.table&&(J(Ie,["tbody"]),delete Zt.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ga('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ga('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=f.TRUSTED_TYPES_POLICY,K=R.createHTML("")}else R===void 0&&(R=qf(E,a)),R!==null&&typeof K=="string"&&(K=R.createHTML(""));ht&&ht(f),vn=f},Ma=J({},[...Si,...Ai,...Df]),Oa=J({},[...Ri,...Mf]),Jt=function(f){let x=W(f);(!x||!x.tagName)&&(x={namespaceURI:zn,tagName:"template"});const P=va(f.tagName),he=va(x.tagName);return Jr[f.namespaceURI]?f.namespaceURI===Er?x.namespaceURI===It?P==="svg":x.namespaceURI===Tr?P==="svg"&&(he==="annotation-xml"||ot[he]):!!Ma[P]:f.namespaceURI===Tr?x.namespaceURI===It?P==="math":x.namespaceURI===Er?P==="math"&&Sr[he]:!!Oa[P]:f.namespaceURI===It?x.namespaceURI===Er&&!Sr[he]||x.namespaceURI===Tr&&!ot[he]?!1:!Oa[P]&&(Fn[P]||!Ma[P]):!!(hn==="application/xhtml+xml"&&Jr[f.namespaceURI]):!1},Ue=function(f){la(t.removed,{element:f});try{W(f).removeChild(f)}catch{S(f)}},Lt=function(f,x){try{la(t.removed,{attribute:x.getAttributeNode(f),from:x})}catch{la(t.removed,{attribute:null,from:x})}if(x.removeAttribute(f),f==="is")if(Kt||kr)try{Ue(x)}catch{}else try{x.setAttribute(f,"")}catch{}},Na=function(f){let x=null,P=null;if(Yr)f=""+f;else{const Me=vl(f,/^[\r\n\t ]+/);P=Me&&Me[0]}hn==="application/xhtml+xml"&&zn===It&&(f=''+f+"");const he=R?R.createHTML(f):f;if(zn===It)try{x=new m().parseFromString(he,hn)}catch{}if(!x||!x.documentElement){x=te.createDocument(zn,"template",null);try{x.documentElement.innerHTML=Kr?K:he}catch{}}const Xe=x.body||x.documentElement;return f&&P&&Xe.insertBefore(n.createTextNode(P),Xe.childNodes[0]||null),zn===It?De.call(x,Le?"html":"body")[0]:Le?x.documentElement:Xe},Pa=function(f){return de.call(f.ownerDocument||f,f,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Qn=function(f){return f instanceof w&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof h)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},xt=function(f){return typeof c=="function"&&f instanceof c};function Qt(H,f,x){sa(H,P=>{P.call(t,f,x,vn)})}const za=function(f){let x=null;if(Qt(pe.beforeSanitizeElements,f,null),Qn(f))return Ue(f),!0;const P=Fe(f.nodeName);if(Qt(pe.uponSanitizeElement,f,{tagName:P,allowedTags:Ie}),Vt&&f.hasChildNodes()&&!xt(f.firstElementChild)&&rt(/<[/\w!]/g,f.innerHTML)&&rt(/<[/\w!]/g,f.textContent)||Vt&&f.namespaceURI===It&&P==="style"&&xt(f.firstElementChild)||f.nodeType===ca.progressingInstruction||Vt&&f.nodeType===ca.comment&&rt(/<[/\w]/g,f.data))return Ue(f),!0;if(Zt[P]||!(wt.tagCheck instanceof Function&&wt.tagCheck(P))&&!Ie[P]){if(!Zt[P]&&Fa(P)&&(ge.tagNameCheck instanceof RegExp&&rt(ge.tagNameCheck,P)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(P)))return!1;if(lt&&!yt[P]){const he=W(f)||f.parentNode,Xe=A(f)||f.childNodes;if(Xe&&he){const Me=Xe.length;for(let Ve=Me-1;Ve>=0;--Ve){const je=L(Xe[Ve],!0);he.insertBefore(je,I(f))}}}return Ue(f),!0}return f instanceof o&&!Jt(f)||(P==="noscript"||P==="noembed"||P==="noframes")&&rt(/<\/no(script|embed|frames)/i,f.innerHTML)?(Ue(f),!0):(Ct&&f.nodeType===ca.text&&(x=f.textContent,sa([ce,ke,Qe],he=>{x=Lr(x,he," ")}),f.textContent!==x&&(la(t.removed,{element:f.cloneNode()}),f.textContent=x)),Qt(pe.afterSanitizeElements,f,null),!1)},er=function(f,x,P){if(Yt[x]||Ra&&(x==="id"||x==="name")&&(P in n||P in di))return!1;const he=ze[x]||wt.attributeCheck instanceof Function&&wt.attributeCheck(x,f);if(!(Xt&&!Yt[x]&&rt(At,x))){if(!(An&&rt(jt,x))){if(!he||Yt[x]){if(!(Fa(f)&&(ge.tagNameCheck instanceof RegExp&&rt(ge.tagNameCheck,f)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(f))&&(ge.attributeNameCheck instanceof RegExp&&rt(ge.attributeNameCheck,x)||ge.attributeNameCheck instanceof Function&&ge.attributeNameCheck(x,f))||x==="is"&&ge.allowCustomizedBuiltInElements&&(ge.tagNameCheck instanceof RegExp&&rt(ge.tagNameCheck,P)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(P))))return!1}else if(!Xr[x]){if(!rt(Sn,Lr(P,vt,""))){if(!((x==="src"||x==="xlink:href"||x==="href")&&f!=="script"&&gl(P,"data:")===0&&xr[f])){if(!(fe&&!rt(it,Lr(P,vt,"")))){if(P)return!1}}}}}}return!0},pi=J({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Fa=function(f){return!pi[va(f)]&&rt(dn,f)},tr=function(f){Qt(pe.beforeSanitizeAttributes,f,null);const{attributes:x}=f;if(!x||Qn(f))return;const P={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ze,forceKeepAttr:void 0};let he=x.length;for(;he--;){const Xe=x[he],{name:Me,namespaceURI:Ve,value:je}=Xe,gt=Fe(Me),Qr=je;let Be=Me==="value"?Qr:Ef(Qr);if(P.attrName=gt,P.attrValue=Be,P.keepAttr=!0,P.forceKeepAttr=void 0,Qt(pe.uponSanitizeAttribute,f,P),Be=P.attrValue,Jn&&(gt==="id"||gt==="name")&&gl(Be,Ca)!==0&&(Lt(Me,f),Be=Ca+Be),Vt&&rt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Be)){Lt(Me,f);continue}if(gt==="attributename"&&vl(Be,"href")){Lt(Me,f);continue}if(P.forceKeepAttr)continue;if(!P.keepAttr){Lt(Me,f);continue}if(!Ye&&rt(/\/>/i,Be)){Lt(Me,f);continue}Ct&&sa([ce,ke,Qe],d=>{Be=Lr(Be,d," ")});const Ua=Fe(f.nodeName);if(!er(Ua,gt,Be)){Lt(Me,f);continue}if(R&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!Ve)switch(E.getAttributeType(Ua,gt)){case"TrustedHTML":{Be=R.createHTML(Be);break}case"TrustedScriptURL":{Be=R.createScriptURL(Be);break}}if(Be!==Qr)try{Ve?f.setAttributeNS(Ve,Me,Be):f.setAttribute(Me,Be),Qn(f)?Ue(f):hl(t.removed)}catch{Lt(Me,f)}}Qt(pe.afterSanitizeAttributes,f,null)},nr=function(f){let x=null;const P=Pa(f);for(Qt(pe.beforeSanitizeShadowDOM,f,null);x=P.nextNode();)Qt(pe.uponSanitizeShadowNode,x,null),za(x),tr(x),x.content instanceof s&&nr(x.content);Qt(pe.afterSanitizeShadowDOM,f,null)};return t.sanitize=function(H){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=null,P=null,he=null,Xe=null;if(Kr=!H,Kr&&(H=""),typeof H!="string"&&!xt(H)&&(H=If(H),typeof H!="string"))throw Ga("dirty is not a string, aborting");if(!t.isSupported)return H;if(Zr||Un(f),t.removed=[],typeof H=="string"&&(Rn=!1),Rn){const je=H.nodeName;if(typeof je=="string"){const gt=Fe(je);if(!Ie[gt]||Zt[gt])throw Ga("root node is forbidden and cannot be sanitized in-place")}}else if(H instanceof c)x=Na(""),P=x.ownerDocument.importNode(H,!0),P.nodeType===ca.element&&P.nodeName==="BODY"||P.nodeName==="HTML"?x=P:x.appendChild(P);else{if(!Kt&&!Ct&&!Le&&H.indexOf("<")===-1)return R&&wr?R.createHTML(H):H;if(x=Na(H),!x)return Kt?null:wr?K:""}x&&Yr&&Ue(x.firstChild);const Me=Pa(Rn?H:x);for(;he=Me.nextNode();)za(he),tr(he),he.content instanceof s&&nr(he.content);if(Rn)return H;if(Kt){if(Ct){x.normalize();let je=x.innerHTML;sa([ce,ke,Qe],gt=>{je=Lr(je,gt," ")}),x.innerHTML=je}if(kr)for(Xe=Te.call(x.ownerDocument);x.firstChild;)Xe.appendChild(x.firstChild);else Xe=x;return(ze.shadowroot||ze.shadowrootmode)&&(Xe=be.call(i,Xe,!0)),Xe}let Ve=Le?x.outerHTML:x.innerHTML;return Le&&Ie["!doctype"]&&x.ownerDocument&&x.ownerDocument.doctype&&x.ownerDocument.doctype.name&&rt(Lo,x.ownerDocument.doctype.name)&&(Ve=" -`+Ve),Ct&&sa([ce,ke,Qe],je=>{Ve=Lr(Ve,je," ")}),R&&wr?R.createHTML(Ve):Ve},t.setConfig=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Un(H),Zr=!0},t.clearConfig=function(){vn=null,Zr=!1},t.isValidAttribute=function(H,f,x){vn||Un({});const P=Fe(H),he=Fe(f);return er(P,he,x)},t.addHook=function(H,f){typeof f=="function"&&la(pe[H],f)},t.removeHook=function(H,f){if(f!==void 0){const x=xf(pe[H],f);return x===-1?void 0:Tf(pe[H],x,1)[0]}return hl(pe[H])},t.removeHooks=function(H){pe[H]=[]},t.removeAllHooks=function(){pe=Tl()},t}var Gf=Do();function is(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var br=is();function Mo(e){br=e}var lr={exec:()=>null};function oe(e,t=""){let n=typeof e=="string"?e:e.source,i={replace:(a,s)=>{let l=typeof s=="string"?s:s.source;return l=l.replace(dt.caret,"$1"),n=n.replace(a,l),i},getRegex:()=>new RegExp(n,t)};return i}var Wf=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},jf=/^(?:[ \t]*(?:\n|$))+/,Zf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Aa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ss=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Oo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,No=oe(Oo).replace(/bull/g,ss).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vf=oe(Oo).replace(/bull/g,ss).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ls=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Kf=/^[^\n]+/,os=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Jf=oe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",os).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Qf=oe(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ss).getRegex(),oi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",cs=/|$))/,ed=oe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",cs).replace("tag",oi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Po=oe(ls).replace("hr",Aa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oi).getRegex(),td=oe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Po).getRegex(),us={blockquote:td,code:Zf,def:Jf,fences:Yf,heading:Xf,hr:Aa,html:ed,lheading:No,list:Qf,newline:jf,paragraph:Po,table:lr,text:Kf},El=oe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Aa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oi).getRegex(),nd={...us,lheading:Vf,table:El,paragraph:oe(ls).replace("hr",Aa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",El).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oi).getRegex()},rd={...us,html:oe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",cs).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:lr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:oe(ls).replace("hr",Aa).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",No).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ad=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,id=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,zo=/^( {2,}|\\)\n(?!\s*$)/,sd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Wf?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Uo=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,fd=oe(Uo,"u").replace(/punct/g,jr).getRegex(),dd=oe(Uo,"u").replace(/punct/g,Fo).getRegex(),Bo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pd=oe(Bo,"gu").replace(/notPunctSpace/g,fs).replace(/punctSpace/g,ci).replace(/punct/g,jr).getRegex(),hd=oe(Bo,"gu").replace(/notPunctSpace/g,cd).replace(/punctSpace/g,od).replace(/punct/g,Fo).getRegex(),vd=oe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,fs).replace(/punctSpace/g,ci).replace(/punct/g,jr).getRegex(),gd=oe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,jr).getRegex(),_d="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",md=oe(_d,"gu").replace(/notPunctSpace/g,fs).replace(/punctSpace/g,ci).replace(/punct/g,jr).getRegex(),bd=oe(/\\(punct)/,"gu").replace(/punct/g,jr).getRegex(),kd=oe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),wd=oe(cs).replace("(?:-->|$)","-->").getRegex(),yd=oe("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",wd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qa=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,xd=oe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Qa).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ho=oe(/^!?\[(label)\]\[(ref)\]/).replace("label",Qa).replace("ref",os).getRegex(),$o=oe(/^!?\[(ref)\](?:\[\])?/).replace("ref",os).getRegex(),Td=oe("reflink|nolink(?!\\()","g").replace("reflink",Ho).replace("nolink",$o).getRegex(),Sl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ds={_backpedal:lr,anyPunctuation:bd,autolink:kd,blockSkip:ud,br:zo,code:id,del:lr,delLDelim:lr,delRDelim:lr,emStrongLDelim:fd,emStrongRDelimAst:pd,emStrongRDelimUnd:vd,escape:ad,link:xd,nolink:$o,punctuation:ld,reflink:Ho,reflinkSearch:Td,tag:yd,text:sd,url:lr},Ed={...ds,link:oe(/^!?\[(label)\]\((.*?)\)/).replace("label",Qa).getRegex(),reflink:oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qa).getRegex()},ji={...ds,emStrongRDelimAst:hd,emStrongLDelim:dd,delLDelim:gd,delRDelim:md,url:oe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Sl).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:oe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Al=e=>Ad[e];function wn(e,t){if(t){if(dt.escapeTest.test(e))return e.replace(dt.escapeReplace,Al)}else if(dt.escapeTestNoEncode.test(e))return e.replace(dt.escapeReplaceNoEncode,Al);return e}function Rl(e){try{e=encodeURI(e).replace(dt.percentDecode,"%")}catch{return null}return e}function Cl(e,t){let n=e.replace(dt.findPipe,(s,l,c)=>{let o=!1,u=l;for(;--u>=0&&c[u]==="\\";)o=!o;return o?"|":" |"}),i=n.split(dt.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length0?-2:-1}function Cd(e,t=0){let n=t,i="";for(let a of e)if(a===" "){let s=4-n%4;i+=" ".repeat(s),n+=s}else i+=a,n++;return i}function Il(e,t,n,i,a){let s=t.href,l=t.title||null,c=e[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let o={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:l,text:c,tokens:i.inlineTokens(c)};return i.state.inLink=!1,o}function Id(e,t,n){let i=e.match(n.other.indentCodeCompensation);if(i===null)return t;let a=i[1];return t.split(` -`).map(s=>{let l=s.match(n.other.beginningSpace);if(l===null)return s;let[c]=l;return c.length>=a.length?s.slice(a.length):s}).join(` -`)}var ei=class{options;rules;lexer;constructor(e){this.options=e||br}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:fa(n,` -`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],i=Id(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let i=fa(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:fa(t[0],` -`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=fa(t[0],` -`).split(` -`),i="",a="",s=[];for(;n.length>0;){let l=!1,c=[],o;for(o=0;o1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),l=!1;for(;e;){let o=!1,u="",h="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let w=Cd(t[2].split(` -`,1)[0],t[1].length),m=e.split(` -`,1)[0],E=!w.trim(),T=0;if(this.options.pedantic?(T=2,h=w.trimStart()):E?T=t[1].length+1:(T=w.search(this.rules.other.nonSpaceChar),T=T>4?1:T,h=w.slice(T),T+=t[1].length),E&&this.rules.other.blankLine.test(m)&&(u+=m+` -`,e=e.substring(m.length+1),o=!0),!o){let L=this.rules.other.nextBulletRegex(T),S=this.rules.other.hrRegex(T),I=this.rules.other.fencesBeginRegex(T),A=this.rules.other.headingBeginRegex(T),W=this.rules.other.htmlBeginRegex(T),R=this.rules.other.blockquoteBeginRegex(T);for(;e;){let K=e.split(` -`,1)[0],te;if(m=K,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),te=m):te=m.replace(this.rules.other.tabCharGlobal," "),I.test(m)||A.test(m)||W.test(m)||R.test(m)||L.test(m)||S.test(m))break;if(te.search(this.rules.other.nonSpaceChar)>=T||!m.trim())h+=` -`+te.slice(T);else{if(E||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||I.test(w)||A.test(w)||S.test(w))break;h+=` -`+m}E=!m.trim(),u+=K+` -`,e=e.substring(K.length+1),w=te.slice(T)}}a.loose||(l?a.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(l=!0)),a.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),a.raw+=u}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let o of a.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(o.raw);if(u){let h={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};o.checked=h.checked,a.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=h.raw+o.tokens[0].raw,o.tokens[0].text=h.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(h)):o.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):o.tokens.unshift(h)}}if(!a.loose){let u=o.tokens.filter(w=>w.type==="space"),h=u.length>0&&u.some(w=>this.rules.other.anyLine.test(w.raw));a.loose=h}}if(a.loose)for(let o of a.items){o.loose=!0;for(let u of o.tokens)u.type==="text"&&(u.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:a}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Cl(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(` -`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let l of i)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[o]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===` -`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=fa(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Rd(t[2],"()");if(s===-2)return;if(s>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let i=t[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Il(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=t[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return Il(n,a,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,l,c=a,o=0,u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+a);(i=u.exec(t))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(l=[...s].length,i[3]||i[4]){c+=l;continue}else if((i[5]||i[6])&&a%3&&!((a+l)%3)){o+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+o);let h=[...i[0]][0].length,w=e.slice(0,a+i.index+h+l);if(Math.min(a,l)%2){let E=w.slice(1,-1);return{type:"em",raw:w,text:E,tokens:this.lexer.inlineTokens(E)}}let m=w.slice(2,-2);return{type:"strong",raw:w,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let i=this.rules.inline.delLDelim.exec(e);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,l,c=a,o=this.rules.inline.delRDelim;for(o.lastIndex=0,t=t.slice(-1*e.length+a);(i=o.exec(t))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s||(l=[...s].length,l!==a))continue;if(i[3]||i[4]){c+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c);let u=[...i[0]][0].length,h=e.slice(0,a+i.index+u+l),w=h.slice(a,-a);return{type:"del",raw:h,text:w,tokens:this.lexer.inlineTokens(w)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=t[1],i="mailto:"+n):(n=t[1],i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,i;if(t[2]==="@")n=t[0],i="mailto:"+n;else{let a;do a=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(a!==t[0]);n=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},sn=class Zi{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||br,this.options.tokenizer=this.options.tokenizer||new ei,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:dt,block:ja.normal,inline:ua.normal};this.options.pedantic?(n.block=ja.pedantic,n.inline=ua.pedantic):this.options.gfm&&(n.block=ja.gfm,this.options.breaks?n.inline=ua.breaks:n.inline=ua.gfm),this.tokenizer.rules=n}static get rules(){return{block:ja,inline:ua}}static lex(t,n){return new Zi(n).lex(t)}static lexInline(t,n){return new Zi(n).inlineTokens(t)}lex(t){t=t.replace(dt.carriageReturn,` -`),this.blockTokens(t,this.tokens);for(let n=0;n(a=l.call({lexer:this},t,n))?(t=t.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);let l=n.at(-1);a.raw.length===1&&l!==void 0?l.raw+=` -`:n.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(` -`)?"":` -`)+a.raw,l.text+=` -`+a.text,this.inlineQueue.at(-1).src=l.text):n.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(` -`)?"":` -`)+a.raw,l.text+=` -`+a.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},n.push(a));continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),n.push(a);continue}let s=t;if(this.options.extensions?.startBlock){let l=1/0,c=t.slice(1),o;this.options.extensions.startBlock.forEach(u=>{o=u.call({lexer:this},c),typeof o=="number"&&o>=0&&(l=Math.min(l,o))}),l<1/0&&l>=0&&(s=t.substring(0,l+1))}if(this.state.top&&(a=this.tokenizer.paragraph(s))){let l=n.at(-1);i&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(` -`)?"":` -`)+a.raw,l.text+=` -`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(a),i=s.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(` -`)?"":` -`)+a.raw,l.text+=` -`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(a);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let i=t,a=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)o.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)s=a[2]?a[2].length:0,i=i.slice(0,a.index+s)+"["+"a".repeat(a[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let l=!1,c="";for(;t;){l||(c=""),l=!1;let o;if(this.options.extensions?.inline?.some(h=>(o=h.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let h=n.at(-1);o.type==="text"&&h?.type==="text"?(h.raw+=o.raw,h.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(t,i,c)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(t,i,c)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),n.push(o);continue}let u=t;if(this.options.extensions?.startInline){let h=1/0,w=t.slice(1),m;this.options.extensions.startInline.forEach(E=>{m=E.call({lexer:this},w),typeof m=="number"&&m>=0&&(h=Math.min(h,m))}),h<1/0&&h>=0&&(u=t.substring(0,h+1))}if(o=this.tokenizer.inlineText(u)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(c=o.raw.slice(-1)),l=!0;let h=n.at(-1);h?.type==="text"?(h.raw+=o.raw,h.text+=o.text):n.push(o);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}},ti=class{options;parser;constructor(e){this.options=e||br}space(e){return""}code({text:e,lang:t,escaped:n}){let i=(t||"").match(dt.notSpaceStart)?.[0],a=e.replace(dt.endingNewline,"")+` -`;return i?'
'+(n?a:wn(a,!0))+`
-`:"
"+(n?a:wn(a,!0))+`
-`}blockquote({tokens:e}){return`
-${this.parser.parse(e)}
-`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} -`}hr(e){return`
-`}list(e){let t=e.ordered,n=e.start,i="";for(let l=0;l -`+i+" -`}listitem(e){return`
  • ${this.parser.parse(e.tokens)}
  • -`}checkbox({checked:e}){return" '}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    -`}table(e){let t="",n="";for(let a=0;a${i}`),` - -`+t+` -`+i+`
    -`}tablerow({text:e}){return` -${e} -`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${wn(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let i=this.parser.parseInline(n),a=Rl(e);if(a===null)return i;e=a;let s='
    ",s}image({href:e,title:t,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=Rl(e);if(a===null)return wn(n);e=a;let s=`${wn(n)}{let l=a[s].flat(1/0);n=n.concat(this.walkTokens(l,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=t.renderers[a.name];s?t.renderers[a.name]=function(...l){let c=a.renderer.apply(this,l);return c===!1&&(c=s.apply(this,l)),c}:t.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[a.level];s?s.unshift(a.tokenizer):t[a.level]=[a.tokenizer],a.start&&(a.level==="block"?t.startBlock?t.startBlock.push(a.start):t.startBlock=[a.start]:a.level==="inline"&&(t.startInline?t.startInline.push(a.start):t.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(t.childTokens[a.name]=a.childTokens)}),i.extensions=t),n.renderer){let a=this.defaults.renderer||new ti(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let l=s,c=n.renderer[l],o=a[l];a[l]=(...u)=>{let h=c.apply(a,u);return h===!1&&(h=o.apply(a,u)),h||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new ei(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let l=s,c=n.tokenizer[l],o=a[l];a[l]=(...u)=>{let h=c.apply(a,u);return h===!1&&(h=o.apply(a,u)),h}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new ga;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let l=s,c=n.hooks[l],o=a[l];ga.passThroughHooks.has(s)?a[l]=u=>{if(this.defaults.async&&ga.passThroughHooksRespectAsync.has(s))return(async()=>{let w=await c.call(a,u);return o.call(a,w)})();let h=c.call(a,u);return o.call(a,h)}:a[l]=(...u)=>{if(this.defaults.async)return(async()=>{let w=await c.apply(a,u);return w===!1&&(w=await o.apply(a,u)),w})();let h=c.apply(a,u);return h===!1&&(h=o.apply(a,u)),h}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(l){let c=[];return c.push(s.call(this,l)),a&&(c=c.concat(a.call(this,l))),c}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return sn.lex(e,t??this.defaults)}parser(e,t){return ln.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let l=a.hooks?await a.hooks.preprocess(t):t,c=await(a.hooks?await a.hooks.provideLexer(e):e?sn.lex:sn.lexInline)(l,a),o=a.hooks?await a.hooks.processAllTokens(c):c;a.walkTokens&&await Promise.all(this.walkTokens(o,a.walkTokens));let u=await(a.hooks?await a.hooks.provideParser(e):e?ln.parse:ln.parseInline)(o,a);return a.hooks?await a.hooks.postprocess(u):u})().catch(s);try{a.hooks&&(t=a.hooks.preprocess(t));let l=(a.hooks?a.hooks.provideLexer(e):e?sn.lex:sn.lexInline)(t,a);a.hooks&&(l=a.hooks.processAllTokens(l)),a.walkTokens&&this.walkTokens(l,a.walkTokens);let c=(a.hooks?a.hooks.provideParser(e):e?ln.parse:ln.parseInline)(l,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(l){return s(l)}}}onError(e,t){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+wn(n.message+"",!0)+"
    ";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}},gr=new Ld;function ye(e,t){return gr.parse(e,t)}ye.options=ye.setOptions=function(e){return gr.setOptions(e),ye.defaults=gr.defaults,Mo(ye.defaults),ye};ye.getDefaults=is;ye.defaults=br;ye.use=function(...e){return gr.use(...e),ye.defaults=gr.defaults,Mo(ye.defaults),ye};ye.walkTokens=function(e,t){return gr.walkTokens(e,t)};ye.parseInline=gr.parseInline;ye.Parser=ln;ye.parser=ln.parse;ye.Renderer=ti;ye.TextRenderer=ps;ye.Lexer=sn;ye.lexer=sn.lex;ye.Tokenizer=ei;ye.Hooks=ga;ye.parse=ye;ye.options;ye.setOptions;ye.use;ye.walkTokens;ye.parseInline;ln.parse;sn.lex;function Dr(e){return Gf.sanitize(ye.parse(e,{async:!1,breaks:!0,gfm:!0}))}function kn(e){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}var Dd=O('
    '),Md=O(''),Od=O(' ',1),Nd=O('
    ',2),Pd=O(' ');function Ii(e,t){ri(t,!0);let n=gf(t,"onOpenImage",3,()=>{}),i=an(null),a=an(!1),s=an(""),l=Ja(()=>t.upload.content_type?.startsWith("image/")??!1),c=Ja(()=>t.upload.content_type?.startsWith("video/")??!1);function o(){v(a,!0)}function u(){if(!r(i)||!isFinite(r(i).duration))return;const I=Math.floor(r(i).duration),A=Math.floor(I/60),W=I%60;v(s,`${A}:${W.toString().padStart(2,"0")}`)}function h(){r(i)&&(v(a,!0),r(i).play())}function w(I){return I<1024?`${I} B`:I<1024*1024?`${Math.round(I/1024)} KB`:`${(I/(1024*1024)).toFixed(1)} MB`}var m=as(),E=Gn(m);{var T=I=>{var A=Dd(),W=p(A),R=p(W),K=g(W,2),te=p(K),de=p(te),Te=g(te,2);z(()=>{q(W,"aria-label",`Open image ${t.upload.filename}`),q(R,"src",t.url),q(R,"alt",t.upload.filename),M(de,t.upload.filename),q(Te,"href",t.url),q(Te,"download",t.upload.filename),q(Te,"aria-label",`Download ${t.upload.filename}`)}),G("click",W,()=>n()(t.url,t.upload.filename)),G("click",Te,De=>De.stopPropagation()),C(I,A)},L=I=>{var A=Nd();let W;var R=p(A),K=p(R);Xa(R,ce=>v(i,ce),()=>r(i));var te=g(R,2);{var de=ce=>{var ke=Od(),Qe=Gn(ke),At=g(Qe,2);{var jt=it=>{var vt=Md(),dn=p(vt);z(()=>M(dn,r(s))),C(it,vt)};j(At,it=>{r(s)&&it(jt)})}z(()=>q(Qe,"aria-label",`Play ${t.upload.filename}`)),G("click",Qe,h),C(ce,ke)};j(te,ce=>{r(a)||ce(de)})}var Te=g(te,2),De=p(Te),be=p(De),pe=g(De,2);z(()=>{W=_t(A,1,"media-tile media-tile--video",null,W,{"is-started":r(a)}),R.controls=r(a),q(R,"aria-label",t.upload.filename),q(K,"src",t.url),q(K,"type",t.upload.content_type),M(be,t.upload.filename),q(pe,"href",t.url),q(pe,"download",t.upload.filename),q(pe,"aria-label",`Download ${t.upload.filename}`)}),zt("play",R,o),zt("loadedmetadata",R,u),G("click",pe,ce=>ce.stopPropagation()),C(I,A)},S=I=>{var A=Pd(),W=g(p(A),2),R=p(W),K=p(R),te=g(R,2),de=p(te);z(Te=>{q(A,"href",t.url),M(K,t.upload.filename),M(de,Te)},[()=>w(t.upload.byte_size)]),C(I,A)};j(E,I=>{r(l)?I(T):r(c)?I(L,1):I(S,-1)})}C(e,m),ai()}To(["click"]);var zd=O(''),Fd=O(`
    cc
    ClickClack OpenClaw workspace chat

    Welcome back.

    Workspace chat for the OpenClaw crew. Sign in with the GitHub account that's a member of the org.

    Limited to active members of the OpenClaw org.

    `),Ud=O(''),Bd=O('
    '),Hd=O('
    '),$d=O(''),qd=O(''),Gd=O(''),Wd=O(''),jd=O(''),Zd=O(''),Yd=O(''),Xd=O(''),Vd=O(''),Kd=O(''),Jd=O('

    '),Qd=O('

    '),ep=O('

    ClickClack

    '),tp=O(''),np=O(''),rp=O(''),ap=O('
    '),ip=O('
    Send a message in Markdown — code fences, lists, links all work. Threads open from any message.
    '),sp=O('
    '),lp=O(''),op=O(" "),cp=O(' '),up=O(' '),fp=O(''),dp=O('
    '),pp=O('
    '),hp=O('
    ',1),vp=O(''),gp=O('
    GIFs
    '),_p=O(''),mp=O('
    '),bp=O('
    Replying to
    '),kp=O(''),wp=O(" "),yp=O('
    '),xp=O(''),Tp=O(" "),Ep=O(' '),Sp=O(' '),Ap=O(''),Rp=O('
    '),Cp=O('
    '),Ip=O('
    Replying to
    '),Lp=O('

    Thread

    ',1),Dp=O(''),Mp=O(" "),Op=O(''),Np=O(''),Pp=O(''),zp=O('

    Profile

    Active
    Contact information
    Handle
    User ID
    About

    ',1),Fp=O('
    No thread open Hover any message and tap the bubble to keep side conversations tidy.
    '),Up=O(''),Bp=O("

    "),Hp=O(''),$p=O(''),qp=O('

    ',1);function Gp(e,t){ri(t,!1);const n=Z(),i=Z(),a=Z(),s=Z(),l=Z(),c=Z(),o=Z();let u=Z(null),h=Z([]),w=Z([]),m=Z([]),E=Z([]),T=Z([]),L=Z(""),S=Z(""),I=Z(""),A=Z(null),W=Z(null),R=Z(null),K=Z(null),te=Z(""),de=Z(""),Te=Z(""),De=Z(""),be=Z(""),pe=Z(""),ce=Z([]),ke=Z(null),Qe=Z(!1),At=Z(!1),jt=Z(""),it=Z(""),vt=Z(""),dn=Z(""),Sn=Z(""),Ie=Z(!1),Rt=Z("loading"),ze=Z(!1),pn=null,ge=Z(!1),Zt,Yt=Z(null),wt=Z(!1),An=Z(!1),Xt=Z(!1),fe=Z(null),Ye=Z(null),Ct=Z(null),Vt=Z(null),Le=Z("message");const Zr=[{title:"Ship it",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYjJ1bm1meHE4N2x3bnN0djJkMWtjNGc5bXYzZDFiOHBsbG16M3F0ZSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/l0HlHFRbmaZtBRhXG/giphy.gif",tags:["ship","launch","done"]},{title:"Approved",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExazBpbzJ6ODZ3bXQ3OHBvNGJidWZoajc0cHV6YnVub3MzZ3c1a2Z2dSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/111ebonMs90YLu/giphy.gif",tags:["yes","approved","nice"]},{title:"Deploy dance",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExY3NkaTVmZW9ydWNnZnl0ZWQ5aHQyeGNrd2k3NG4wZWNqYzNmd3k1ZCZlcD12MV9naWZzX3NlYXJjaCZjdD1n/GeimqsH0TLDt4tScGw/giphy.gif",tags:["deploy","dance","celebrate"]},{title:"Looking",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYWZ3emE0dm5mN2h0bGVsY2w0OXBodGd2cGJlNDRiZXo1YWNtdWRmZyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/26n6WywJyh39n1pBu/giphy.gif",tags:["search","looking","debug"]},{title:"Typing faster",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExOWFlbnJnbnIzbHYxcDIzdXZ3NGF3N2FocHNvMmR5enU3bHpycHBlZSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/13HgwGsXF0aiGY/giphy.gif",tags:["typing","code","work"]},{title:"Tiny victory",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdjJ2b2tqNmF4dG16NjE0eXhuc3h5bTlvamgwNTR0Zmd6ZjhtM2JuaSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/3o7abKhOpu0NwenH3O/giphy.gif",tags:["win","victory","celebrate"]}];Ao(()=>{Yr()}),_f(()=>{const d=pn;pn=null,v(ge,!1),d?.close(),Zt&&window.clearTimeout(Zt)});async function Yr(){try{const d=await nt("/api/me");v(u,d.user),await wr(),v(Rt,"ready")}catch(d){if(d instanceof Ro&&(d.status===401||d.status===403)){v(ze,!0),v(Rt,"auth");return}v(Rt,d instanceof Error?d.message:"Could not load ClickClack")}}function Kt(){r(u)&&(v(it,r(u).display_name),v(vt,r(u).handle?`@${r(u).handle}`:""),v(dn,r(u).avatar_url),v(Sn,""),v(Ie,!1),v(At,!0))}async function kr(){v(Sn,""),v(Ie,!1);try{const d=await nt("/api/me",{method:"PATCH",body:JSON.stringify({display_name:r(it),handle:r(vt),avatar_url:r(dn)})});v(u,d.user),v(E,r(E).map(b=>b.author?.id===r(u)?.id?{...b,author:d.user}:b)),v(T,r(T).map(b=>b.author?.id===r(u)?.id?{...b,author:d.user}:b)),r(A)?.author?.id===r(u).id&&v(A,{...r(A),author:d.user}),v(Sn,"Saved"),v(At,!1)}catch(d){v(Sn,d instanceof Error?d.message:"Could not save profile"),v(Ie,!0)}}async function wr(){const d=await nt("/api/workspaces");v(h,d.workspaces),v(L,r(L)||r(h)[0]?.id||""),await Jn(),await vn(),r(h).length===0&&v(Rt,"create a workspace"),Un()}async function Ra(){if(!r(Te).trim())return;const d=await nt("/api/workspaces",{method:"POST",body:JSON.stringify({name:r(Te)})});v(Te,""),v(wt,!1),v(h,[...r(h),d.workspace]),v(L,d.workspace.id),await Jn(),await vn(),Un()}async function Jn(){if(!r(L))return;const d=await nt(`/api/workspaces/${r(L)}/channels`);v(w,d.channels),v(S,r(w).find(b=>b.id===r(S))?.id||r(w)[0]?.id||""),v(A,null),v(R,null),v(Le,"message"),v(T,[]),await lt()}async function Ca(){if(!r(L)||!r(De).trim())return;const d=await nt(`/api/workspaces/${r(L)}/channels`,{method:"POST",body:JSON.stringify({name:r(De),kind:"public"})});v(De,""),v(w,[...r(w),d.channel]),v(S,d.channel.id),v(I,""),await lt()}async function lt(){if(r(I)){const b=await nt(`/api/dms/${r(I)}/messages`);v(E,b.messages),await Rn();return}if(!r(S)){v(E,[]);return}const d=await nt(`/api/channels/${r(S)}/messages`);v(E,d.messages),await Rn()}async function Rn(){await Ui(),r(Yt)&&Nu(Yt,r(Yt).scrollTop=r(Yt).scrollHeight)}async function Cn(){const d=r(te).trim();if(!d)return;if(!r(S)&&!r(I)){v(Rt,"pick or create a channel");return}const b=r(I)?"dm":"channel",N=r(fe)&&r(Ye)===b?r(fe):null;v(te,"");const Q=r(I)?`/api/dms/${r(I)}/messages`:`/api/channels/${r(S)}/messages`,we={body:d};N&&(we.quoted_message_id=N.id);const ae=await nt(Q,{method:"POST",body:JSON.stringify(we)});let He=ae.message;if(N&&ot(),r(ke)){const Dt=r(ke);await nt(`/api/messages/${ae.message.id}/attachments`,{method:"POST",body:JSON.stringify({upload_id:Dt.id})}),v(ke,null),He={...He,attachments:[...He.attachments||[],Dt]}}r(E).some(Dt=>Dt.id===He.id)?v(E,r(E).map(Dt=>Dt.id===He.id?He:Dt)):v(E,[...r(E),He]),await Rn()}async function yt(d){v(R,null),v(A,d),v(Le,"thread");const b=await nt(`/api/messages/${d.id}/thread`);v(A,b.root),v(T,b.replies),v(W,b.thread_state)}async function yr(){const d=r(de).trim();if(!d||!r(A))return;const b=r(fe)&&r(Ye)==="thread"?r(fe):null;v(de,"");const N={body:d};b&&(N.quoted_message_id=b.id);const Q=await nt(`/api/messages/${r(A).id}/thread/replies`,{method:"POST",body:JSON.stringify(N)});b&&ot(),r(T).some(we=>we.id===Q.message.id)||v(T,[...r(T),Q.message]),v(W,Q.thread_state)}function xr(d,b){v(fe,d),v(Ye,b),v(Le,b==="thread"?"thread":"message")}const Ia=new Set(["button","checkbox","combobox","link","listbox","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","option","radio","radiogroup","slider","spinbutton","switch","tab","tablist","textbox","tree","treeitem"]),Xr=new Set(["INPUT","TEXTAREA","SELECT","BUTTON","A","DETAILS","SUMMARY","VIDEO","AUDIO"]);function Vr(){return r(K)!==null||r(At)}function Tr(d){if(!d)return!1;if(d.isContentEditable)return!0;if(d instanceof HTMLInputElement){const b=(d.type||"text").toLowerCase();return b!=="checkbox"&&b!=="radio"&&b!=="button"&&b!=="submit"&&b!=="reset"&&b!=="file"}return d instanceof HTMLTextAreaElement}function Er(d){if(!d||It(d))return!1;if(Xr.has(d.tagName))return!0;const b=d.getAttribute("role");if(b&&Ia.has(b))return!0;const N=d.getAttribute("tabindex");return!!(N!==null&&N!=="-1"&&d.hasAttribute("aria-keyshortcuts"))}function It(d){if(!d.closest(".messages, .thread"))return!1;if(d instanceof HTMLButtonElement||d instanceof HTMLAnchorElement)return!0;const b=d.getAttribute("role");return b==="button"||b==="link"}function zn(){const d=typeof window<"u"?window.getSelection():null;if(!d||d.isCollapsed||d.rangeCount===0)return!1;const b=d.getRangeAt(0).commonAncestorContainer;return b?!!(b.nodeType===Node.ELEMENT_NODE?b:b.parentElement)?.closest(".messages, .thread, .markdown"):!1}function Kr(d){if(r(ze)||Vr()||d.defaultPrevented||d.isComposing||d.keyCode===229||d.ctrlKey||d.metaKey||d.altKey||d.key.length!==1||zn())return!1;const b=document.activeElement;return!(b===r(Ct)||b===r(Vt)||Tr(b)||Er(b))}function Jr(d){if(!Kr(d))return;const b=ui();if(!b||b.disabled||b.readOnly)return;d.key===" "&&d.preventDefault(),b.focus({preventScroll:!0});const N=b.value.length;if(b.setSelectionRange(N,N),d.key===" "){const Q=b.selectionStart??N,we=b.selectionEnd??N;b.setRangeText(" ",Q,we,"end"),b.dispatchEvent(new Event("input",{bubbles:!0}))}}function ui(){return r(Le)==="thread"&&r(A)&&r(Vt)?r(Vt):r(Ct)}function ot(){v(fe,null),v(Ye,null)}function Sr(d,b){const N=()=>{const ae=d.style.height;d.style.height="auto";const He=`${d.scrollHeight}px`;ae!==He?d.style.height=He:d.style.height=ae},Q=()=>N(),we=()=>N();return requestAnimationFrame(N),d.addEventListener("input",Q),window.addEventListener("resize",we),{update(){requestAnimationFrame(N)},destroy(){d.removeEventListener("input",Q),window.removeEventListener("resize",we)}}}function Fn(d,b=120){if(!d)return"";const N=d.replace(/\s+/g," ").trim();return N.length>b?N.slice(0,b-1)+"…":N}function hn(d){return d.quoted_author?.display_name||"Unknown"}async function La(d){const b=d.quoted_message_id;if(!b)return;await Ui();const N=document.querySelector(`[data-message-id="${CSS.escape(b)}"]`);N&&(N.scrollIntoView({behavior:"smooth",block:"center"}),N.classList.add("highlight"),window.setTimeout(()=>N.classList.remove("highlight"),1500))}async function fi(){if(!r(L)||!r(pe).trim()){v(ce,[]);return}const d=await nt(`/api/search?workspace_id=${encodeURIComponent(r(L))}&q=${encodeURIComponent(r(pe).trim())}`);v(ce,d.results)}async function Fe(d){const b=d.currentTarget,N=b.files?.[0];if(!N||!r(L))return;const Q=new FormData;Q.set("workspace_id",r(L)),Q.set("file",N);const we=await nt("/api/uploads",{method:"POST",body:Q});v(ke,we.upload),b.value=""}async function vn(){if(!r(L))return;const d=await nt(`/api/dms?workspace_id=${r(L)}`);v(m,d.conversations)}async function di(){if(!r(L)||!r(be).trim())return;const d=await nt("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:r(L),member_ids:[r(be).trim()]})});v(be,""),v(m,[...r(m),d.conversation]),v(I,d.conversation.id),v(S,""),v(A,null),v(R,null),v(Le,"message"),await lt()}async function Da(d){if(!r(L)||!d)return;const b=r(m).find(Q=>Q.members.some(we=>we.id===d));if(b){v(I,b.id),v(S,""),v(A,null),v(R,null),v(Le,"message"),await lt();return}const N=await nt("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:r(L),member_ids:[d]})});v(m,[...r(m),N.conversation]),v(I,N.conversation.id),v(S,""),v(A,null),v(R,null),v(Le,"message"),await lt()}function Un(){Zt&&window.clearTimeout(Zt);const d=pn;if(pn=null,v(ge,!1),d?.close(),!r(L))return;const b=localStorage.getItem(`clickclack:${r(L)}:cursor`)||"",N=new URL("/api/realtime/ws",window.location.href);N.protocol=window.location.protocol==="https:"?"wss:":"ws:",N.searchParams.set("workspace_id",r(L)),b&&N.searchParams.set("after_cursor",b);const Q=new WebSocket(N);pn=Q,Q.addEventListener("open",()=>{pn===Q&&v(ge,!0)}),Q.addEventListener("message",we=>{const ae=JSON.parse(String(we.data));ae.cursor&&localStorage.setItem(`clickclack:${r(L)}:cursor`,ae.cursor),Ma(ae)}),Q.addEventListener("close",()=>{pn===Q&&(v(ge,!1),Zt=window.setTimeout(Un,1200))})}async function Ma(d){if((d.type==="channel.created"||d.type==="channel.updated")&&d.workspace_id===r(L)){await Jn();return}(d.channel_id===r(S)||d.payload.direct_conversation_id===r(I))&&(d.type==="message.created"||d.type==="message.updated"||d.type==="message.deleted")&&await lt();const b=d.payload.root_message_id||d.payload.message_id;r(A)&&b===r(A).id&&await yt(r(A))}function Oa(d){const b=d.trim();if(!b)return"?";const N=b.split(/\s+/);return N.length>=2?(N[0][0]+N[1][0]).toUpperCase():b.slice(0,2).toUpperCase()}function Jt(d){if(!d)return"?";const b=d.trim();return b?b[0].toUpperCase():"?"}function Ue(d){return d?`@${d}`:""}function Lt(d){return d.members.find(b=>b.id!==r(u)?.id)||d.members[0]}function Na(d,b,N){const Q=new Map;for(const we of b)for(const ae of we.members)ae.id&&ae.id!==N&&Q.set(ae.id,ae);for(const we of[...d].reverse()){const ae=we.author;ae?.id&&ae.id!==N&&Q.set(ae.id,ae)}return[...Q.values()].slice(0,12)}function Pa(d){return r(m).find(b=>b.members.some(N=>N.id===d))}function Qn(d){d&&(v(A,null),v(R,d))}function xt(d){let b=0;for(let N=0;N>>0;return b%360}function Qt(d){const b=new Date(d),N=new Date,Q=new Date;Q.setDate(N.getDate()-1);const we=(ae,He)=>ae.getFullYear()===He.getFullYear()&&ae.getMonth()===He.getMonth()&&ae.getDate()===He.getDate();return we(b,N)?"Today":we(b,Q)?"Yesterday":new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric"}).format(b)}function za(d){const b=[];let N="",Q="",we=0;for(const ae of d){const He=new Date(ae.created_at),Dt=He.toDateString(),Ar=ae.author?.id||ae.author_id||"local",ea=Dt!==N,Ba=Ar!==Q,hi=He.getTime()-we>300*1e3;ea||Ba||hi||b.length===0?b.push({key:ae.id,dayLabel:ea?Qt(ae.created_at):null,messages:[ae],authorName:ae.author?.display_name||"Local User",authorHandle:ae.author?.handle||"",authorAvatarURL:ae.author?.avatar_url||"",authorID:Ar,timestamp:ae.created_at}):b[b.length-1].messages.push(ae),N=Dt,Q=Ar,we=He.getTime()}return b}function er(d){const b=d.members.filter(Q=>Q.id!==r(u)?.id);return(b.length>0?b:d.members).map(Q=>Q.display_name).join(", ")}function pi(d){if(d.key==="Escape"&&r(fe)&&r(Ye)!=="thread"){d.preventDefault(),ot();return}d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),Cn())}function Fa(d){if(d.key==="Escape"&&r(fe)&&r(Ye)==="thread"){d.preventDefault(),ot();return}d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),yr())}function tr(d){return`/api/uploads/${encodeURIComponent(d.id)}`}function nr(d,b){v(K,{url:d,title:b})}function H(d){const b=d.target;b instanceof HTMLImageElement&&b.closest(".markdown")&&(d.preventDefault(),nr(b.currentSrc||b.src,b.alt||"Image"))}function f(d){return d.content_type.startsWith("image/")}function x(d){return d<1024?`${d} B`:d<1024*1024?`${Math.round(d/1024)} KB`:`${(d/(1024*1024)).toFixed(1)} MB`}function P(d){const b=r(te)&&!r(te).endsWith(` -`)?` -`:"";v(te,`${r(te)}${b}${d}`)}function he(d,b=d){P(`${d}${d==="```"?` -code -`:"text"}${b}`)}function Xe(d,b){P(`![${b}](${d})`),v(Qe,!1),v(jt,"")}function Me(d){return r(A)?.id===d.id?"Open":"Thread"}function Ve(){r(Ye)==="thread"&&ot(),v(A,null),v(R,null),v(Le,"message"),v(T,[])}function je(){v(K,null),v(At,!1)}mn(()=>(r(h),r(L)),()=>{v(n,r(h).find(d=>d.id===r(L)))}),mn(()=>(r(w),r(S)),()=>{v(i,r(w).find(d=>d.id===r(S)))}),mn(()=>(r(m),r(I)),()=>{v(a,r(m).find(d=>d.id===r(I)))}),mn(()=>(r(A),r(R)),()=>{v(s,r(A)!==null||r(R)!==null)}),mn(()=>r(E),()=>{v(l,za(r(E)))}),mn(()=>(r(E),r(m),r(u)),()=>{v(c,Na(r(E),r(m),r(u)?.id||""))}),mn(()=>(r(Ye),r(fe),r(E)),()=>{r(Ye)==="channel"&&r(fe)&&!r(E).some(d=>d.id===r(fe)?.id)&&ot()}),mn(()=>(r(Ye),r(fe),r(E)),()=>{r(Ye)==="dm"&&r(fe)&&!r(E).some(d=>d.id===r(fe)?.id)&&ot()}),mn(()=>(r(Ye),r(fe),r(A),r(T)),()=>{r(Ye)==="thread"&&r(fe)&&r(A)&&r(fe).id!==r(A).id&&!r(T).some(d=>d.id===r(fe)?.id)&&ot()}),mn(()=>r(jt),()=>{v(o,Zr.filter(d=>{const b=r(jt).trim().toLowerCase();return!b||d.title.toLowerCase().includes(b)||d.tags.some(N=>N.includes(b))}))}),Gu(),So();var gt=as();Eo("1oa2eo8",d=>{var b=zd();C(d,b)}),zt("keydown",zi,d=>{if(d.key==="Escape"){if(Vr())je();else if(r(fe)){d.preventDefault(),ot();return}}Jr(d)});var Qr=Gn(gt);{var Be=d=>{var b=Fd();C(d,b)},Ua=d=>{var b=qp(),N=Gn(b);let Q;var we=p(N),ae=p(we);{var He=y=>{var k=ut("×");C(y,k)},Dt=y=>{var k=Ud();C(y,k)};j(ae,y=>{r(Xt)?y(He):y(Dt,-1)})}var Ar=g(we,2),ea=g(p(Ar),4),Ba=p(ea);Et(Ba,1,()=>r(h),y=>y.id,(y,k)=>{var U=Bd();let Y;var se=p(U),ie=p(se),ee=p(ie);z(le=>{Y=_t(U,1,"guild-wrap",null,Y,{active:r(k).id===r(L)}),q(se,"title",(r(k),_(()=>r(k).name))),M(ee,le)},[()=>(r(k),_(()=>Oa(r(k).name)))]),G("click",se,async()=>{v(L,r(k).id),await Jn(),await vn(),Un()}),C(y,U)});var hi=g(Ba,2),qo=g(ea,2);{var Go=y=>{var k=Hd(),U=p(k);zt("submit",k,Y=>{Y.preventDefault(),Ra()}),bn(U,()=>r(Te),Y=>v(Te,Y)),C(y,k)};j(qo,y=>{r(wt)&&y(Go)})}var hs=g(Ar,2),vs=p(hs),gs=p(vs),_s=p(gs),Wo=p(_s),ms=g(_s,2);let bs;var jo=p(ms),Ha=g(gs,2),Zo=p(Ha),Yo=p(Zo),ks=g(vs,2),ws=p(ks),ys=g(p(ws),2),xs=p(ys);Et(xs,1,()=>r(w),y=>y.id,(y,k)=>{var U=$d();let Y;var se=g(p(U),2),ie=p(se);z(()=>{Y=_t(U,1,"nav-item channel",null,Y,{active:r(k).id===r(S)&&!r(I)}),M(ie,(r(k),_(()=>r(k).name)))}),G("click",U,async()=>{v(S,r(k).id),v(I,""),v(A,null),v(R,null),v(Le,"message"),v(Xt,!1),await lt()}),C(y,U)});var Xo=g(xs,2);{var Vo=y=>{var k=qd();C(y,k)};j(Xo,y=>{r(w),_(()=>r(w).length===0)&&y(Vo)})}var Ts=g(ys,2),Ko=p(Ts),Es=g(ws,2),Ss=g(p(Es),2),As=p(Ss);Et(As,1,()=>r(m),y=>y.id,(y,k)=>{var U=Wd();let Y;var se=p(U),ie=p(se);{var ee=F=>{var V=Gd();z(Oe=>q(V,"src",Oe),[()=>(r(k),_(()=>Lt(r(k))?.avatar_url))]),C(F,V)},le=Ja(()=>(r(k),_(()=>Lt(r(k))?.avatar_url))),B=F=>{var V=ut();z(Oe=>M(V,Oe),[()=>(r(k),_(()=>Jt(Lt(r(k))?.display_name)))]),C(F,V)};j(ie,F=>{r(le)?F(ee):F(B,-1)})}var ve=g(se,2),Ee=p(ve);z((F,V)=>{Y=_t(U,1,"nav-item dm",null,Y,{active:r(k).id===r(I)}),On(se,`--hue: ${F??""}deg`),M(Ee,V)},[()=>(r(k),_(()=>xt(Lt(r(k))?.id||r(k).id))),()=>(r(k),_(()=>er(r(k))))]),G("click",U,async()=>{v(I,r(k).id),v(S,""),v(A,null),v(R,null),v(Le,"message"),v(Xt,!1),await lt()}),C(y,U)});var Jo=g(As,2);{var Qo=y=>{var k=jd();C(y,k)};j(Jo,y=>{r(m),_(()=>r(m).length===0)&&y(Qo)})}var Rs=g(Ss,2),ec=p(Rs),tc=g(Es,2),nc=g(p(tc),2),Cs=p(nc);Et(Cs,1,()=>r(c),y=>y.id,(y,k)=>{const U=Pr(()=>(r(k),_(()=>Pa(r(k).id))));var Y=Yd();let se;var ie=p(Y),ee=p(ie);{var le=F=>{var V=Zd();z(()=>q(V,"src",(r(k),_(()=>r(k).avatar_url)))),C(F,V)},B=F=>{var V=ut();z(Oe=>M(V,Oe),[()=>(r(k),_(()=>Jt(r(k).display_name)))]),C(F,V)};j(ee,F=>{r(k),_(()=>r(k).avatar_url)?F(le):F(B,-1)})}var ve=g(ie,2),Ee=p(ve);z(F=>{se=_t(Y,1,"nav-item dm",null,se,{active:r(U)?.id===r(I)||r(R)?.id===r(k).id}),On(ie,`--hue: ${F??""}deg`),M(Ee,(r(k),_(()=>r(k).display_name)))},[()=>(r(k),_(()=>xt(r(k).id)))]),G("click",Y,async()=>{r(U)?(v(I,r(U).id),v(S,""),v(A,null),v(R,null),v(Le,"message"),v(Xt,!1),await lt()):Qn(r(k))}),C(y,Y)});var rc=g(Cs,2);{var ac=y=>{var k=Xd();C(y,k)};j(rc,y=>{r(c),_(()=>r(c).length===0)&&y(ac)})}var ic=g(ks,2);{var sc=y=>{var k=Kd(),U=p(k),Y=p(U);{var se=F=>{var V=Vd();z(()=>q(V,"src",(r(u),_(()=>r(u).avatar_url)))),C(F,V)},ie=F=>{var V=ut();z(Oe=>M(V,Oe),[()=>(r(u),_(()=>Jt(r(u).display_name)))]),C(F,V)};j(Y,F=>{r(u),_(()=>r(u).avatar_url)?F(se):F(ie,-1)})}var ee=g(U,2),le=p(ee),B=p(le),ve=g(le,2),Ee=p(ve);z((F,V,Oe)=>{q(k,"aria-label",F),On(U,`--hue: ${V??""}deg`),M(B,(r(u),_(()=>r(u).display_name))),M(Ee,Oe)},[()=>(r(u),_(()=>`Account settings for ${r(u).display_name} ${Ue(r(u).handle)}`)),()=>(r(u),_(()=>xt(r(u).id))),()=>(r(u),r(ge),_(()=>r(u).handle?Ue(r(u).handle):r(ge)?"Active":"Reconnecting…"))]),G("click",k,Kt),G("contextmenu",k,F=>{F.preventDefault(),Kt()}),C(y,k)};j(ic,y=>{r(u)&&y(sc)})}var Is=g(hs,2),Ls=p(Is),Ds=p(Ls),Ms=p(Ds);{var lc=y=>{var k=Jd(),U=p(k);z(Y=>M(U,Y),[()=>(r(a),_(()=>`@${er(r(a))}`))]),C(y,k)},oc=y=>{var k=Qd(),U=p(k);z(()=>M(U,(r(i),_(()=>`#${r(i).name}`)))),C(y,k)},cc=y=>{var k=ep();C(y,k)};j(Ms,y=>{r(a)?y(lc):r(i)?y(oc,1):y(cc,-1)})}var uc=g(Ms,4),fc=p(uc),vi=g(Ds,2),Os=g(p(vi),2),dc=g(Os,2);{var pc=y=>{var k=tp();G("click",k,()=>{v(pe,""),v(ce,[])}),C(y,k)};j(dc,y=>{r(pe)&&y(pc)})}var hc=g(vi,2),ta=p(hc);let Ns;var vc=g(ta,2),Ps=g(Ls,2);{var gc=y=>{var k=ap(),U=p(k),Y=p(U),se=p(Y),ie=g(Y,2),ee=g(U,2);Et(ee,1,()=>r(ce),le=>le.message.id,(le,B)=>{var ve=rp(),Ee=p(ve),F=p(Ee);{var V=Se=>{var Ke=np();z(()=>q(Ke,"src",(r(B),_(()=>r(B).message.author.avatar_url)))),C(Se,Ke)},Oe=Se=>{var Ke=ut();z(gn=>M(Ke,gn),[()=>(r(B),_(()=>Jt(r(B).message.author?.display_name)))]),C(Se,Ke)};j(F,Se=>{r(B),_(()=>r(B).message.author?.avatar_url)?Se(V):Se(Oe,-1)})}var Mt=g(Ee,2),Ot=p(Mt),en=p(Ot),tn=p(en),In=g(en,2),_e=p(In),$=g(Ot,2),et=p($);z((Se,Ke)=>{On(Ee,`--hue: ${Se??""}deg`),M(tn,(r(B),_(()=>r(B).message.author?.display_name||"Local User"))),M(_e,Ke),M(et,(r(B),_(()=>r(B).message.body)))},[()=>(r(B),_(()=>xt(r(B).message.author?.id||r(B).message.author_id||"x"))),()=>(rn(kn),r(B),_(()=>kn(r(B).message.created_at)))]),G("click",ve,async()=>{v(ce,[]),r(B).message.channel_id&&(v(S,r(B).message.channel_id),v(I,""),await lt()),r(B).message.direct_conversation_id&&(v(I,r(B).message.direct_conversation_id),v(S,""),await lt())}),C(le,ve)}),z(()=>M(se,`${r(ce),_(()=>r(ce).length)??""} ${r(ce),_(()=>r(ce).length===1?"result":"results")??""}`)),G("click",ie,()=>{v(ce,[])}),C(y,k)};j(Ps,y=>{r(ce),_(()=>r(ce).length>0)&&y(gc)})}var na=g(Ps,2),zs=p(na);{var _c=y=>{var k=ip(),U=p(k),Y=p(U);{var se=F=>{var V=ut("@");C(F,V)},ie=F=>{var V=ut("#");C(F,V)};j(Y,F=>{r(a)?F(se):F(ie,-1)})}var ee=g(U,2),le=p(ee);{var B=F=>{var V=ut();z(Oe=>M(V,`This is the start of your conversation with ${Oe??""}.`),[()=>(r(a),_(()=>er(r(a))))]),C(F,V)},ve=F=>{var V=ut();z(()=>M(V,`Welcome to #${r(i),_(()=>r(i).name)??""}!`)),C(F,V)},Ee=F=>{var V=ut("Pick a channel to get started.");C(F,V)};j(le,F=>{r(a)?F(B):r(i)?F(ve,1):F(Ee,-1)})}C(y,k)};j(zs,y=>{r(E),_(()=>r(E).length===0)&&y(_c)})}var mc=g(zs,2);Et(mc,1,()=>r(l),y=>y.key,(y,k)=>{var U=hp(),Y=Gn(U);{var se=_e=>{var $=sp(),et=p($),Se=p(et);z(()=>M(Se,(r(k),_(()=>r(k).dayLabel)))),C(_e,$)};j(Y,_e=>{r(k),_(()=>r(k).dayLabel)&&_e(se)})}var ie=g(Y,2),ee=p(ie),le=p(ee);{var B=_e=>{var $=lp();z(()=>q($,"src",(r(k),_(()=>r(k).authorAvatarURL)))),C(_e,$)},ve=_e=>{var $=ut();z(et=>M($,et),[()=>(r(k),_(()=>Jt(r(k).authorName)))]),C(_e,$)};j(le,_e=>{r(k),_(()=>r(k).authorAvatarURL)?_e(B):_e(ve,-1)})}var Ee=g(ee,2),F=p(Ee),V=p(F),Oe=p(V),Mt=g(V,2);{var Ot=_e=>{var $=op(),et=p($);z(Se=>M(et,Se),[()=>(r(k),_(()=>Ue(r(k).authorHandle)))]),C(_e,$)};j(Mt,_e=>{r(k),_(()=>r(k).authorHandle)&&_e(Ot)})}var en=g(Mt,2),tn=p(en),In=g(F,2);Et(In,3,()=>(r(k),_(()=>r(k).messages)),_e=>_e.id,(_e,$,et)=>{var Se=pp();let Ke;var gn=p(Se),Bn=p(gn),Ln=g(gn,2),xe=p(Ln);{var tt=Tt=>{var X=fp();let D;var Ce=g(p(X),2),Ze=p(Ce),Dn=p(Ze),me=g(Ze,2);{var Ae=ct=>{var Pt=cp(),aa=p(Pt);z(Ir=>M(aa,Ir),[()=>(r($),_(()=>Fn(r($).quoted_body_snapshot)))]),C(ct,Pt)},Mn=ct=>{var Pt=up(),aa=p(Pt);z(Ir=>M(aa,`[original deleted] ${Ir??""}`),[()=>(r($),_(()=>Fn(r($).quoted_body_snapshot)))]),C(ct,Pt)};j(me,ct=>{r($),_(()=>r($).quoted_message_id)?ct(Ae):ct(Mn,-1)})}z((ct,Pt)=>{D=_t(X,1,"quote-block",null,D,{dangling:!r($).quoted_message_id}),X.disabled=(r($),_(()=>!r($).quoted_message_id)),q(X,"aria-label",ct),M(Dn,Pt)},[()=>(r($),_(()=>r($).quoted_message_id?`Jump to quoted message from ${hn(r($))}`:"Original message was deleted")),()=>(r($),_(()=>hn(r($))))]),G("click",X,()=>La(r($))),C(Tt,X)};j(xe,Tt=>{r($),_(()=>r($).quoted_message_id||r($).quoted_body_snapshot)&&Tt(tt)})}var Nt=g(xe,2);yi(Nt,()=>(rn(Dr),r($),_(()=>Dr(r($).body))),!0);var Hn=g(Nt,2);{var Rr=Tt=>{var X=dp();Et(X,5,()=>(r($),_(()=>r($).attachments)),D=>D.id,(D,Ce)=>{{let Ze=Pr(()=>(r(Ce),_(()=>tr(r(Ce)))));Ii(D,{get upload(){return r(Ce)},get url(){return r(Ze)},onOpenImage:nr})}}),C(Tt,X)};j(Hn,Tt=>{r($),_(()=>r($).attachments?.length)&&Tt(Rr)})}var ra=g(Ln,2),Cr=p(ra),nn=g(Cr,2);z((Tt,X)=>{Ke=_t(Se,1,"message-row",null,Ke,{selected:r(A)?.id===r($).id}),q(Se,"data-message-id",(r($),_(()=>r($).id))),M(Bn,Tt),q(nn,"data-tooltip",X)},[()=>(rn(r(et)),rn(kn),r($),_(()=>r(et)===0?"":kn(r($).created_at))),()=>(r($),_(()=>Me(r($))))]),G("click",Cr,()=>xr(r($),r(I)?"dm":"channel")),G("click",nn,()=>yt(r($))),C(_e,Se)}),z((_e,$)=>{On(ee,`--hue: ${_e??""}deg`),q(ee,"aria-label",(r(k),_(()=>`View profile for ${r(k).authorName}`))),M(Oe,(r(k),_(()=>r(k).authorName))),M(tn,$)},[()=>(r(k),_(()=>xt(r(k).authorID))),()=>(rn(kn),r(k),_(()=>kn(r(k).timestamp)))]),G("click",ee,()=>Qn(r(k).messages[0]?.author)),G("click",V,()=>Qn(r(k).messages[0]?.author)),C(y,U)}),Xa(na,y=>v(Yt,y),()=>r(Yt));var Fs=g(na,2),Us=p(Fs);{var bc=y=>{var k=gp(),U=p(k),Y=g(p(U),2),se=g(U,2);Et(se,5,()=>r(o),ie=>ie.url,(ie,ee)=>{var le=vp(),B=p(le),ve=g(B,2),Ee=p(ve);z(()=>{q(B,"src",(r(ee),_(()=>r(ee).url))),q(B,"alt",(r(ee),_(()=>r(ee).title))),M(Ee,(r(ee),_(()=>r(ee).title)))}),G("click",le,()=>Xe(r(ee).url,r(ee).title)),C(ie,le)}),bn(Y,()=>r(jt),ie=>v(jt,ie)),C(y,k)};j(Us,y=>{r(Qe)&&y(bc)})}var kc=g(Us,2),Bs=p(kc);{var wc=y=>{var k=mp(),U=g(p(k),2);{var Y=B=>{var ve=_p();z(Ee=>{q(ve,"src",Ee),q(ve,"alt",(r(ke),_(()=>r(ke).filename)))},[()=>(r(ke),_(()=>tr(r(ke))))]),C(B,ve)},se=Ja(()=>(r(ke),_(()=>f(r(ke)))));j(U,B=>{r(se)&&B(Y)})}var ie=g(U,2),ee=p(ie),le=g(ie,2);z(B=>M(ee,`${r(ke),_(()=>r(ke).filename)??""} · ${B??""}`),[()=>(r(ke),_(()=>x(r(ke).byte_size)))]),G("click",le,()=>v(ke,null)),C(y,k)};j(Bs,y=>{r(ke)&&y(wc)})}var Hs=g(Bs,2);{var yc=y=>{var k=bp(),U=g(p(k),2),Y=p(U),se=g(p(Y)),ie=p(se),ee=g(Y,2),le=p(ee),B=g(U,2);z(ve=>{M(ie,(r(fe),_(()=>r(fe).author?.display_name||"Local User"))),M(le,ve)},[()=>(r(fe),_(()=>Fn(r(fe).body)))]),G("click",B,ot),C(y,k)};j(Hs,y=>{r(fe)&&r(Ye)===(r(I)?"dm":"channel")&&y(yc)})}var $s=g(Hs,2),qs=p($s),xc=p(qs),rr=g(qs,2);Xa(rr,y=>v(Ct,y),()=>r(Ct)),wa(()=>bn(rr,()=>r(te),y=>v(te,y))),ol(rr,(y,k)=>Sr?.(y),()=>r(te));var Tc=g(rr,2),Ec=g($s,2),Gs=p(Ec),Ws=g(Gs,2),gi=g(Ws,2),Sc=p(gi);Sc.textContent="<>";var _i=g(gi,2),Ac=p(_i);Ac.textContent="{}";var js=g(_i,2),Zs=g(js,2);let Ys;var mi=g(Is,2);let Xs;var Rc=p(mi);{var Cc=y=>{var k=Lp(),U=Gn(k),Y=p(U),se=g(p(Y),2),ie=p(se),ee=g(Y,2),le=g(U,2),B=p(le),ve=p(B),Ee=p(ve);{var F=X=>{var D=kp();z(()=>q(D,"src",(r(A),_(()=>r(A).author.avatar_url)))),C(X,D)},V=X=>{var D=ut();z(Ce=>M(D,Ce),[()=>(r(A),_(()=>Jt(r(A).author?.display_name)))]),C(X,D)};j(Ee,X=>{r(A),_(()=>r(A).author?.avatar_url)?X(F):X(V,-1)})}var Oe=g(ve,2),Mt=p(Oe),Ot=p(Mt),en=p(Ot),tn=g(Ot,2);{var In=X=>{var D=wp(),Ce=p(D);z(Ze=>M(Ce,Ze),[()=>(r(A),_(()=>Ue(r(A).author.handle)))]),C(X,D)};j(tn,X=>{r(A),_(()=>r(A).author?.handle)&&X(In)})}var _e=g(tn,2),$=p(_e),et=g(_e,2),Se=g(Mt,2);yi(Se,()=>(rn(Dr),r(A),_(()=>Dr(r(A).body))),!0);var Ke=g(Se,2);{var gn=X=>{var D=yp();Et(D,5,()=>(r(A),_(()=>r(A).attachments)),Ce=>Ce.id,(Ce,Ze)=>{{let Dn=Pr(()=>(r(Ze),_(()=>tr(r(Ze)))));Ii(Ce,{get upload(){return r(Ze)},get url(){return r(Dn)},onOpenImage:nr})}}),C(X,D)};j(Ke,X=>{r(A),_(()=>r(A).attachments?.length)&&X(gn)})}var Bn=g(B,2),Ln=p(Bn),xe=p(Ln),tt=g(Bn,2);Et(tt,5,()=>r(T),X=>X.id,(X,D)=>{var Ce=Cp(),Ze=p(Ce),Dn=p(Ze);{var me=$e=>{var qe=xp();z(()=>q(qe,"src",(r(D),_(()=>r(D).author.avatar_url)))),C($e,qe)},Ae=$e=>{var qe=ut();z(_n=>M(qe,_n),[()=>(r(D),_(()=>Jt(r(D).author?.display_name)))]),C($e,qe)};j(Dn,$e=>{r(D),_(()=>r(D).author?.avatar_url)?$e(me):$e(Ae,-1)})}var Mn=g(Ze,2),ct=p(Mn),Pt=p(ct),aa=p(Pt),Ir=g(Pt,2);{var Nc=$e=>{var qe=Tp(),_n=p(qe);z(ar=>M(_n,ar),[()=>(r(D),_(()=>Ue(r(D).author.handle)))]),C($e,qe)};j(Ir,$e=>{r(D),_(()=>r(D).author?.handle)&&$e(Nc)})}var Ks=g(Ir,2),Pc=p(Ks),zc=g(Ks,2),Js=g(ct,2);{var Fc=$e=>{var qe=Ap();let _n;var ar=g(p(qe),2),$a=p(ar),Hc=p($a),$c=g($a,2);{var qc=$n=>{var ir=Ep(),bi=p(ir);z(ki=>M(bi,ki),[()=>(r(D),_(()=>Fn(r(D).quoted_body_snapshot)))]),C($n,ir)},Gc=$n=>{var ir=Sp(),bi=p(ir);z(ki=>M(bi,`[original deleted] ${ki??""}`),[()=>(r(D),_(()=>Fn(r(D).quoted_body_snapshot)))]),C($n,ir)};j($c,$n=>{r(D),_(()=>r(D).quoted_message_id)?$n(qc):$n(Gc,-1)})}z(($n,ir)=>{_n=_t(qe,1,"quote-block",null,_n,{dangling:!r(D).quoted_message_id}),qe.disabled=(r(D),_(()=>!r(D).quoted_message_id)),q(qe,"aria-label",$n),M(Hc,ir)},[()=>(r(D),_(()=>r(D).quoted_message_id?`Jump to quoted message from ${hn(r(D))}`:"Original message was deleted")),()=>(r(D),_(()=>hn(r(D))))]),G("click",qe,()=>La(r(D))),C($e,qe)};j(Js,$e=>{r(D),_(()=>r(D).quoted_message_id||r(D).quoted_body_snapshot)&&$e(Fc)})}var Qs=g(Js,2);yi(Qs,()=>(rn(Dr),r(D),_(()=>Dr(r(D).body))),!0);var Uc=g(Qs,2);{var Bc=$e=>{var qe=Rp();Et(qe,5,()=>(r(D),_(()=>r(D).attachments)),_n=>_n.id,(_n,ar)=>{{let $a=Pr(()=>(r(ar),_(()=>tr(r(ar)))));Ii(_n,{get upload(){return r(ar)},get url(){return r($a)},onOpenImage:nr})}}),C($e,qe)};j(Uc,$e=>{r(D),_(()=>r(D).attachments?.length)&&$e(Bc)})}z(($e,qe)=>{q(Ce,"data-message-id",(r(D),_(()=>r(D).id))),On(Ze,`--hue: ${$e??""}deg`),M(aa,(r(D),_(()=>r(D).author?.display_name||"Local User"))),M(Pc,qe)},[()=>(r(D),_(()=>xt(r(D).author?.id||r(D).author_id||"x"))),()=>(rn(kn),r(D),_(()=>kn(r(D).created_at)))]),G("click",zc,()=>xr(r(D),"thread")),C(X,Ce)});var Nt=g(le,2),Hn=p(Nt),Rr=p(Hn);{var ra=X=>{var D=Ip(),Ce=g(p(D),2),Ze=p(Ce),Dn=g(p(Ze)),me=p(Dn),Ae=g(Ze,2),Mn=p(Ae),ct=g(Ce,2);z(Pt=>{M(me,(r(fe),_(()=>r(fe).author?.display_name||"Local User"))),M(Mn,Pt)},[()=>(r(fe),_(()=>Fn(r(fe).body)))]),G("click",ct,ot),C(X,D)};j(Rr,X=>{r(fe)&&r(Ye)==="thread"&&X(ra)})}var Cr=g(Rr,2),nn=p(Cr);Xa(nn,X=>v(Vt,X),()=>r(Vt)),wa(()=>bn(nn,()=>r(de),X=>v(de,X))),ol(nn,(X,D)=>Sr?.(X),()=>r(de));var Tt=g(nn,2);z((X,D,Ce)=>{M(ie,`${r(W),r(T),_(()=>r(W)?.reply_count??r(T).length)??""} ${r(W),r(T),_(()=>(r(W)?.reply_count??r(T).length)===1?"reply":"replies")??""}`),q(B,"data-message-id",(r(A),_(()=>r(A).id))),On(ve,`--hue: ${X??""}deg`),M(en,(r(A),_(()=>r(A).author?.display_name||"Local User"))),M($,D),M(xe,`${r(T),_(()=>r(T).length)??""} ${r(T),_(()=>r(T).length===1?"reply":"replies")??""}`),Tt.disabled=Ce},[()=>(r(A),_(()=>xt(r(A).author?.id||r(A).author_id||"x"))),()=>(rn(kn),r(A),_(()=>kn(r(A).created_at))),()=>(r(de),_(()=>!r(de).trim()))]),G("click",ee,()=>{Ve()}),G("pointerdown",le,()=>v(Le,"thread")),G("pointerup",le,H),G("click",et,()=>r(A)&&xr(r(A),"thread")),zt("submit",Nt,X=>{X.preventDefault(),yr()}),zt("focus",nn,()=>v(Le,"thread")),G("keydown",nn,Fa),C(y,k)},Ic=y=>{var k=zp(),U=Gn(k),Y=p(U),se=g(p(Y),2),ie=p(se),ee=g(Y,2),le=g(U,2),B=p(le),ve=p(B),Ee=p(ve);{var F=me=>{var Ae=Dp();z(()=>q(Ae,"src",(r(R),_(()=>r(R).avatar_url)))),C(me,Ae)},V=me=>{var Ae=ut();z(Mn=>M(Ae,Mn),[()=>(r(R),_(()=>Jt(r(R).display_name)))]),C(me,Ae)};j(Ee,me=>{r(R),_(()=>r(R).avatar_url)?me(F):me(V,-1)})}var Oe=g(B,2),Mt=p(Oe),Ot=p(Mt),en=p(Ot),tn=p(en),In=g(en,2);{var _e=me=>{var Ae=Mp(),Mn=p(Ae);z(ct=>M(Mn,ct),[()=>(r(R),_(()=>Ue(r(R).handle)))]),C(me,Ae)};j(In,me=>{r(R),_(()=>r(R).handle)&&me(_e)})}var $=g(Ot,2);{var et=me=>{var Ae=Op();G("click",Ae,Kt),C(me,Ae)};j($,me=>{r(u),r(R),_(()=>r(u)?.id===r(R).id)&&me(et)})}var Se=g(Mt,4),Ke=p(Se);{var gn=me=>{var Ae=Np();G("click",Ae,()=>Da(r(R)?.id||"")),C(me,Ae)};j(Ke,me=>{r(u),r(R),_(()=>r(u)?.id!==r(R).id)&&me(gn)})}var Bn=g(Ke,2),Ln=g(Se,2),xe=p(Ln),tt=g(p(xe),2);{var Nt=me=>{var Ae=Pp();G("click",Ae,Kt),C(me,Ae)};j(tt,me=>{r(u),r(R),_(()=>r(u)?.id===r(R).id)&&me(Nt)})}var Hn=g(xe,2),Rr=g(p(Hn),2),ra=g(p(Rr),2),Cr=p(ra),nn=g(Hn,2),Tt=g(p(nn),2),X=g(p(Tt),2),D=p(X),Ce=g(Ln,2),Ze=g(p(Ce),2),Dn=p(Ze);z((me,Ae)=>{M(ie,(r(R),_(()=>r(R).display_name))),On(B,`--hue: ${me??""}deg`),M(tn,(r(R),_(()=>r(R).display_name))),M(Cr,Ae),M(D,(r(R),_(()=>r(R).id))),M(Dn,`Member of ${r(n),_(()=>r(n)?.name||"this workspace")??""}. Click Message to keep the conversation in your sidebar.`)},[()=>(r(R),_(()=>xt(r(R).id))),()=>(r(R),_(()=>r(R).handle?Ue(r(R).handle):"No handle set"))]),G("click",ee,Ve),G("click",Bn,()=>v(Rt,"status messages are coming soon")),C(y,k)},Lc=y=>{var k=Fp();C(y,k)};j(Rc,y=>{r(A)?y(Cc):r(R)?y(Ic,1):y(Lc,-1)})}var Vs=g(N,2);{var Dc=y=>{var k=Hp(),U=p(k),Y=g(U,2),se=p(Y),ie=g(p(se),2),ee=g(se,2),le=p(ee),B=p(le),ve=p(B);{var Ee=xe=>{var tt=Up();z(()=>q(tt,"src",r(dn))),C(xe,tt)},F=xe=>{var tt=ut();z(Nt=>M(tt,Nt),[()=>(r(it),_(()=>Jt(r(it))))]),C(xe,tt)};j(ve,xe=>{r(dn)?xe(Ee):xe(F,-1)})}var V=g(B,2),Oe=p(V),Mt=p(Oe),Ot=g(Oe,2),en=p(Ot),tn=g(le,2),In=g(p(tn),2),_e=g(tn,2),$=g(p(_e),2),et=g(_e,2),Se=g(p(et),2),Ke=g(et,2);{var gn=xe=>{var tt=Bp();let Nt;var Hn=p(tt);z(()=>{Nt=_t(tt,1,"profile-status",null,Nt,{error:r(Ie)}),M(Hn,r(Sn))}),C(xe,tt)};j(Ke,xe=>{r(Sn)&&xe(gn)})}var Bn=g(Ke,2),Ln=p(Bn);z((xe,tt)=>{On(B,`--hue: ${xe??""}deg`),M(Mt,(r(it),r(u),_(()=>r(it)||r(u).display_name))),M(en,tt)},[()=>(r(u),_(()=>xt(r(u).id))),()=>(r(vt),r(u),_(()=>r(vt)||Ue(r(u).handle)||"No handle set"))]),G("click",U,je),G("click",ie,je),zt("submit",ee,xe=>{xe.preventDefault(),kr()}),bn(In,()=>r(it),xe=>v(it,xe)),bn($,()=>r(vt),xe=>v(vt,xe)),bn(Se,()=>r(dn),xe=>v(dn,xe)),G("click",Ln,je),C(y,k)};j(Vs,y=>{r(At)&&r(u)&&y(Dc)})}var Mc=g(Vs,2);{var Oc=y=>{var k=$p(),U=p(k),Y=g(U,2),se=p(Y),ie=p(se),ee=p(ie),le=g(ie,2),B=p(le),ve=g(B,2),Ee=g(se,2),F=p(Ee);z(()=>{M(ee,(r(K),_(()=>r(K).title))),q(B,"href",(r(K),_(()=>r(K).url))),q(F,"src",(r(K),_(()=>r(K).url))),q(F,"alt",(r(K),_(()=>r(K).title)))}),G("click",U,je),G("click",ve,je),C(y,k)};j(Mc,y=>{r(K)&&y(Oc)})}z((y,k)=>{Q=_t(N,1,"shell",null,Q,{"nav-open":r(Xt),"sidebar-collapsed":r(An),"thread-open":r(s)}),M(Wo,(r(n),_(()=>r(n)?.name||"Pick a workspace"))),bs=_t(ms,1,"presence",null,bs,{online:r(ge)}),M(jo,r(ge)?"Connected":r(Rt)),q(Ha,"aria-label",r(An)?"Expand sidebar":"Collapse sidebar"),q(Ha,"title",r(An)?"Expand sidebar":"Collapse sidebar"),q(Yo,"d",r(An)?"m9 6 6 6-6 6":"m15 6-6 6 6 6"),M(fc,(r(n),_(()=>r(n)?.name||"no workspace"))),q(ta,"title",r(A)?"Close thread":"Open a message thread"),q(ta,"aria-label",r(A)?"Close thread":"Open a message thread"),Ns=_t(ta,1,"",null,Ns,{active:r(s)}),q(rr,"placeholder",y),Tc.disabled=k,Ys=_t(Zs,1,"",null,Ys,{active:r(Qe)}),Xs=_t(mi,1,"thread",null,Xs,{open:r(s)}),q(mi,"aria-label",r(R)?"Profile pane":"Thread pane")},[()=>(r(a),r(i),_(()=>r(a)?`Message ${er(r(a))}`:r(i)?`Message #${r(i).name}`:"Pick a channel to start")),()=>(r(te),_(()=>!r(te).trim()))]),G("click",we,()=>v(Xt,!r(Xt))),G("click",hi,()=>v(wt,!r(wt))),G("click",Ha,()=>v(An,!r(An))),zt("submit",Ts,y=>{y.preventDefault(),Ca()}),bn(Ko,()=>r(De),y=>v(De,y)),zt("submit",Rs,y=>{y.preventDefault(),di()}),bn(ec,()=>r(be),y=>v(be,y)),zt("submit",vi,y=>{y.preventDefault(),fi()}),bn(Os,()=>r(pe),y=>v(pe,y)),G("click",ta,()=>{r(s)?Ve():v(Rt,"pick a message to open its thread")}),G("click",vc,()=>v(Rt,"no pinned items")),G("pointerdown",na,()=>v(Le,"message")),G("pointerup",na,H),zt("submit",Fs,y=>{y.preventDefault(),Cn()}),G("change",xc,Fe),zt("focus",rr,()=>v(Le,"message")),G("keydown",rr,pi),G("click",Gs,()=>he("**")),G("click",Ws,()=>he("_")),G("click",gi,()=>he("`")),G("click",_i,()=>he("```","\n```")),G("click",js,()=>P("[label](https://)")),G("click",Zs,()=>v(Qe,!r(Qe))),C(d,b)};j(Qr,d=>{r(ze)?d(Be):d(Ua,-1)})}C(e,gt),ai()}To(["click","contextmenu","pointerdown","pointerup","change","keydown"]);var Wp=O(' ',1),jp=O("

    "),Zp=O(`

    Self-hostable chat. Serious tool. Mild brine.

    ClickClack

    A single-binary chat app for teams, communities, bots, and agents: - Slack-style threads, durable realtime, OpenAPI, SQLite, and a CLI that - can drive the whole thing from a shell.

    What it is

    Chat infrastructure that stays boring when the socket drops.

    WebSocket is the pipe. The database is the truth. Every durable message, - thread reply, reaction, and channel update can be recovered over HTTP with - a cursor, so clients and agents can reconnect without drama.

    Agent path

    A friendly CLI, no LLM baked in.

    External agents, CI jobs, and humans use the same public API as the web - app. Tokens and workspace defaults are scoped per server, so switching - hosts does not leak credentials or stale IDs.

     

    Destinations

    Product at the root. Docs and app where people expect them.

    `);function Yp(e,t){ri(t,!1);const n="https://docs.clickclack.chat",i=["localhost","127.0.0.1","::1"].includes(window.location.hostname)?"/app":"https://app.clickclack.chat",a="https://github.com/openclaw/clickclack",s=[["Single binary","Go server, embedded Svelte app, embedded migrations, local SQLite and uploads."],["Threads that recover","Slack-style one-level threads with durable event replay after reconnects."],["Agent-friendly","A CLI, OpenAPI contract, TypeScript SDK, webhooks, and slash-command shapes."],["Self-host first","SQLite is the default, not the demo. Postgres can arrive behind the store layer."]],l=["clickclack serve --data ./data","clickclack login --magic-token mgt_...",'clickclack send --channel general "deploy started"',"clickclack threads reply msg_... --stdin {var ke=Wp();wa(()=>{to.title="ClickClack - Self-hostable chat with claws"}),C(ce,ke)});var o=p(c),u=g(p(o),2),h=g(p(u),2),w=p(h);q(w,"href",n);var m=g(w,2),E=g(m,2);q(E,"href",a);var T=g(u,2),L=g(p(T),6),S=p(L),I=g(S,2);q(I,"href",n);var A=g(I,2);q(A,"href",a);var W=g(o,4);Et(W,5,()=>s,sf,(ce,ke)=>{var Qe=jp(),At=p(Qe),jt=p(At),it=g(At,2),vt=p(it);z(()=>{M(jt,r(ke)[0]),M(vt,r(ke)[1])}),C(ce,Qe)});var R=g(W,2),K=g(p(R),2),te=p(K),de=g(R,2),Te=g(p(de),2),De=g(p(Te),2);q(De,"href",n);var be=g(De,2),pe=g(be,2);q(pe,"href",a),z(ce=>{q(m,"href",i),q(S,"href",i),M(te,ce),q(be,"href",i)},[()=>l.join(` -`)]),C(e,c),ai()}function Xp(e){const t=window.location.pathname,i=window.location.hostname.startsWith("app.")||t==="/app"||t.startsWith("/app/");var a=as(),s=Gn(a);{var l=o=>{Gp(o,{})},c=o=>{Yp(o,{})};j(s,o=>{i?o(l):o(c,-1)})}C(e,a)}tf(Xp,{target:document.getElementById("app")}); diff --git a/apps/api/internal/webassets/dist/assets/index-DlqdWfBs.js b/apps/api/internal/webassets/dist/assets/index-DlqdWfBs.js new file mode 100644 index 0000000..54e1533 --- /dev/null +++ b/apps/api/internal/webassets/dist/assets/index-DlqdWfBs.js @@ -0,0 +1,72 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();const Mc=!1;var El=Array.isArray,Oc=Array.prototype.indexOf,zr=Array.prototype.includes,Ja=Array.from,Nc=Object.defineProperty,ka=Object.getOwnPropertyDescriptor,Sl=Object.getOwnPropertyDescriptors,Pc=Object.prototype,zc=Array.prototype,Gi=Object.getPrototypeOf,Hs=Object.isExtensible;const Fc=()=>{};function Uc(e){return e()}function Ei(e){for(var t=0;t{e=i,t=a});return{promise:n,resolve:e,reject:t}}const ot=2,Fr=4,Sa=8,Rl=1<<24,kn=16,on=32,Jn=64,Si=128,$t=512,He=1024,at=2048,cn=4096,ht=8192,qt=16384,kr=32768,Ai=1<<25,Ur=65536,Ri=1<<17,Cl=1<<18,wr=1<<19,Il=1<<20,bn=1<<25,gr=65536,Za=1<<21,xa=1<<22,Vn=1<<23,Pr=Symbol("$state"),Bc=Symbol(""),Mn=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function Ll(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Hc(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function $c(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function qc(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Gc(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Wc(e){throw new Error("https://svelte.dev/e/effect_orphan")}function jc(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Zc(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Yc(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Xc(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Vc(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Kc=1,Jc=2,Dl=4,Qc=8,eu=16,tu=1,nu=2,Ke=Symbol(),Ml="http://www.w3.org/1999/xhtml",ru="http://www.w3.org/2000/svg",au="http://www.w3.org/1998/Math/MathML";function iu(){console.warn("https://svelte.dev/e/derived_inert")}function su(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Ol(e){return e===this.v}function Nl(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Pl(e){return!Nl(e,this.v)}let Aa=!1,lu=!1;function ou(){Aa=!0}let Se=null;function Br(e){Se=e}function Qa(e,t=!1,n){Se={p:Se,i:!1,c:null,e:null,s:e,x:null,r:re,l:Aa&&!t?{s:null,u:null,$:[]}:null}}function ei(e){var t=Se,n=t.e;if(n!==null){t.e=null;for(var i of n)ro(i)}return t.i=!0,Se=t.p,{}}function Ra(){return!Aa||Se!==null&&Se.l===null}let fr=[];function zl(){var e=fr;fr=[],Ei(e)}function Kn(e){if(fr.length===0&&!wa){var t=fr;queueMicrotask(()=>{t===fr&&zl()})}fr.push(e)}function cu(){for(;fr.length>0;)zl()}function Fl(e){var t=re;if(t===null)return oe.f|=Vn,e;if((t.f&kr)===0&&(t.f&Fr)===0)throw e;Yn(e,t)}function Yn(e,t){for(;t!==null;){if((t.f&Si)!==0){if((t.f&kr)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const uu=-7169;function Ne(e,t){e.f=e.f&uu|t}function Wi(e){(e.f&$t)!==0||e.deps===null?Ne(e,He):Ne(e,cn)}function Ul(e){if(e!==null)for(const t of e)(t.f&ot)===0||(t.f&gr)===0||(t.f^=gr,Ul(t.deps))}function Bl(e,t,n){(e.f&at)!==0?t.add(e):(e.f&cn)!==0&&n.add(e),Ul(e.deps),Ne(e,He)}const or=new Set;let ne=null,sn=null,Ci=null,wa=!1,vi=!1,Nr=null,Ga=null;var $s=0;let fu=1;class Qn{id=fu++;current=new Map;previous=new Map;#n=new Set;#o=new Set;#e=new Set;#a=new Map;#r=new Map;#i=null;#t=[];#s=[];#c=new Set;#u=new Set;#l=new Map;#d=new Set;is_fork=!1;#h=!1;#p=new Set;#f(){return this.is_fork||this.#r.size>0}#_(){for(const i of this.#p)for(const a of i.#r.keys()){for(var t=!1,n=a;n.parent!==null;){if(this.#l.has(n)){t=!0;break}n=n.parent}if(!t)return!0}return!1}skip_effect(t){this.#l.has(t)||this.#l.set(t,{d:[],m:[]}),this.#d.delete(t)}unskip_effect(t,n=i=>this.schedule(i)){var i=this.#l.get(t);if(i){this.#l.delete(t);for(var a of i.d)Ne(a,at),n(a);for(a of i.m)Ne(a,cn),n(a)}this.#d.add(t)}#v(){if($s++>1e3&&(or.delete(this),pu()),!this.#f()){for(const c of this.#c)this.#u.delete(c),Ne(c,at),this.schedule(c);for(const c of this.#u)Ne(c,cn),this.schedule(c)}const t=this.#t;this.#t=[],this.apply();var n=Nr=[],i=[],a=Ga=[];for(const c of t)try{this.#m(c,n,i)}catch(o){throw ql(c),o}if(ne=null,a.length>0){var s=Qn.ensure();for(const c of a)s.schedule(c)}if(Nr=null,Ga=null,this.#f()||this.#_()){this.#g(i),this.#g(n);for(const[c,o]of this.#l)$l(c,o)}else{this.#a.size===0&&or.delete(this),this.#c.clear(),this.#u.clear();for(const c of this.#n)c(this);this.#n.clear(),qs(i),qs(n),this.#i?.resolve()}var l=ne;if(this.#t.length>0){const c=l??=this;c.#t.push(...this.#t.filter(o=>!c.#t.includes(o)))}l!==null&&(or.add(l),l.#v())}#m(t,n,i){t.f^=He;for(var a=t.first;a!==null;){var s=a.f,l=(s&(on|Jn))!==0,c=l&&(s&He)!==0,o=c||(s&ht)!==0||this.#l.has(a);if(!o&&a.fn!==null){l?a.f^=He:(s&Fr)!==0?n.push(a):Gr(a)&&((s&kn)!==0&&this.#u.add(a),mr(a));var u=a.first;if(u!==null){a=u;continue}}for(;a!==null;){var p=a.next;if(p!==null){a=p;break}a=a.parent}}}#g(t){for(var n=0;n!this.current.has(b));if(a.length===0)t&&p.discard();else if(n.length>0){if(t)for(const b of this.#d)p.unskip_effect(b,_=>{(_.f&(kn|xa))!==0?p.schedule(_):p.#g([_])});p.activate();var s=new Set,l=new Map;for(var c of n)Hl(c,a,s,l);l=new Map;var o=[...p.current.keys()].filter(b=>this.current.has(b)?this.current.get(b)[0]!==b:!0);for(const b of this.#s)(b.f&(qt|ht|Ri))===0&&ji(b,o,l)&&((b.f&(xa|kn))!==0?(Ne(b,at),p.schedule(b)):p.#c.add(b));if(p.#t.length>0){p.apply();for(var u of p.#t)p.#m(u,[],[]);p.#t=[]}p.deactivate()}}for(const p of or)p.#p.has(this)&&(p.#p.delete(this),p.#p.size===0&&!p.#f()&&(p.activate(),p.#v()))}increment(t,n){let i=this.#a.get(n)??0;if(this.#a.set(n,i+1),t){let a=this.#r.get(n)??0;this.#r.set(n,a+1)}}decrement(t,n,i){let a=this.#a.get(n)??0;if(a===1?this.#a.delete(n):this.#a.set(n,a-1),t){let s=this.#r.get(n)??0;s===1?this.#r.delete(n):this.#r.set(n,s-1)}this.#h||i||(this.#h=!0,Kn(()=>{this.#h=!1,this.flush()}))}transfer_effects(t,n){for(const i of t)this.#c.add(i);for(const i of n)this.#u.add(i);t.clear(),n.clear()}oncommit(t){this.#n.add(t)}ondiscard(t){this.#o.add(t)}on_fork_commit(t){this.#e.add(t)}run_fork_commit_callbacks(){for(const t of this.#e)t(this);this.#e.clear()}settled(){return(this.#i??=Al()).promise}static ensure(){if(ne===null){const t=ne=new Qn;vi||(or.add(ne),wa||Kn(()=>{ne===t&&t.flush()}))}return ne}apply(){{sn=null;return}}schedule(t){if(Ci=t,t.b?.is_pending&&(t.f&(Fr|Sa|Rl))!==0&&(t.f&kr)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var i=n.f;if(Nr!==null&&n===re&&(oe===null||(oe.f&ot)===0))return;if((i&(Jn|on))!==0){if((i&He)===0)return;n.f^=He}}this.#t.push(n)}}function du(e){var t=wa;wa=!0;try{for(var n;;){if(cu(),ne===null)return n;ne.flush()}}finally{wa=t}}function pu(){try{jc()}catch(e){Yn(e,Ci)}}let Dn=null;function qs(e){var t=e.length;if(t!==0){for(var n=0;n0)){pr.clear();for(const a of Dn){if((a.f&(qt|ht))!==0)continue;const s=[a];let l=a.parent;for(;l!==null;)Dn.has(l)&&(Dn.delete(l),s.push(l)),l=l.parent;for(let c=s.length-1;c>=0;c--){const o=s[c];(o.f&(qt|ht))===0&&mr(o)}}Dn.clear()}}Dn=null}}function Hl(e,t,n,i){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const a of e.reactions){const s=a.f;(s&ot)!==0?Hl(a,t,n,i):(s&(xa|kn))!==0&&(s&at)===0&&ji(a,t,i)&&(Ne(a,at),Zi(a))}}function ji(e,t,n){const i=n.get(e);if(i!==void 0)return i;if(e.deps!==null)for(const a of e.deps){if(zr.call(t,a))return!0;if((a.f&ot)!==0&&ji(a,t,n))return n.set(a,!0),!0}return n.set(e,!1),!1}function Zi(e){ne.schedule(e)}function $l(e,t){if(!((e.f&on)!==0&&(e.f&He)!==0)){(e.f&at)!==0?t.d.push(e):(e.f&cn)!==0&&t.m.push(e),Ne(e,He);for(var n=e.first;n!==null;)$l(n,t),n=n.next}}function ql(e){Ne(e,He);for(var t=e.first;t!==null;)ql(t),t=t.next}function hu(e){let t=0,n=_r(0),i;return()=>{Xi()&&(r(n),qr(()=>(t===0&&(i=g(()=>e(()=>ya(n)))),t+=1,()=>{Kn(()=>{t-=1,t===0&&(i?.(),i=void 0,ya(n))})})))}}var vu=Ur|wr;function gu(e,t,n,i){new _u(e,t,n,i)}class _u{parent;is_pending=!1;transform_error;#n;#o=null;#e;#a;#r;#i=null;#t=null;#s=null;#c=null;#u=0;#l=0;#d=!1;#h=new Set;#p=new Set;#f=null;#_=hu(()=>(this.#f=_r(this.#u),()=>{this.#f=null}));constructor(t,n,i,a){this.#n=t,this.#e=n,this.#a=s=>{var l=re;l.b=this,l.f|=Si,i(s)},this.parent=re.b,this.transform_error=a??this.parent?.transform_error??(s=>s),this.#r=ri(()=>{this.#b()},vu)}#v(){try{this.#i=Ht(()=>this.#a(this.#n))}catch(t){this.error(t)}}#m(t){const n=this.#e.failed;n&&(this.#s=Ht(()=>{n(this.#n,()=>t,()=>()=>{})}))}#g(){const t=this.#e.pending;t&&(this.is_pending=!0,this.#t=Ht(()=>t(this.#n)),Kn(()=>{var n=this.#c=document.createDocumentFragment(),i=wn();n.append(i),this.#i=this.#w(()=>Ht(()=>this.#a(i))),this.#l===0&&(this.#n.before(n),this.#c=null,hr(this.#t,()=>{this.#t=null}),this.#k(ne))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#u=0,this.#i=Ht(()=>{this.#a(this.#n)}),this.#l>0){var t=this.#c=document.createDocumentFragment();Ji(this.#i,t);const n=this.#e.pending;this.#t=Ht(()=>n(this.#n))}else this.#k(ne)}catch(n){this.error(n)}}#k(t){this.is_pending=!1,t.transfer_effects(this.#h,this.#p)}defer_effect(t){Bl(t,this.#h,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#e.pending}#w(t){var n=re,i=oe,a=Se;jt(this.#r),Wt(this.#r),Br(this.#r.ctx);try{return Qn.ensure(),t()}catch(s){return Fl(s),null}finally{jt(n),Wt(i),Br(a)}}#y(t,n){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(t,n);return}this.#l+=t,this.#l===0&&(this.#k(n),this.#t&&hr(this.#t,()=>{this.#t=null}),this.#c&&(this.#n.before(this.#c),this.#c=null))}update_pending_count(t,n){this.#y(t,n),this.#u+=t,!(!this.#f||this.#d)&&(this.#d=!0,Kn(()=>{this.#d=!1,this.#f&&Hr(this.#f,this.#u)}))}get_effect_pending(){return this.#_(),r(this.#f)}error(t){if(!this.#e.onerror&&!this.#e.failed)throw t;ne?.is_fork?(this.#i&&ne.skip_effect(this.#i),this.#t&&ne.skip_effect(this.#t),this.#s&&ne.skip_effect(this.#s),ne.on_fork_commit(()=>{this.#x(t)})):this.#x(t)}#x(t){this.#i&&(xt(this.#i),this.#i=null),this.#t&&(xt(this.#t),this.#t=null),this.#s&&(xt(this.#s),this.#s=null);var n=this.#e.onerror;let i=this.#e.failed;var a=!1,s=!1;const l=()=>{if(a){su();return}a=!0,s&&Vc(),this.#s!==null&&hr(this.#s,()=>{this.#s=null}),this.#w(()=>{this.#b()})},c=o=>{try{s=!0,n?.(o,l),s=!1}catch(u){Yn(u,this.#r&&this.#r.parent)}i&&(this.#s=this.#w(()=>{try{return Ht(()=>{var u=re;u.b=this,u.f|=Si,i(this.#n,()=>o,()=>l)})}catch(u){return Yn(u,this.#r.parent),null}}))};Kn(()=>{var o;try{o=this.transform_error(t)}catch(u){Yn(u,this.#r&&this.#r.parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(c,u=>Yn(u,this.#r&&this.#r.parent)):c(o)})}}function mu(e,t,n,i){const a=Ra()?ti:cr;var s=e.filter(_=>!_.settled);if(n.length===0&&s.length===0){i(t.map(a));return}var l=re,c=bu(),o=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(_=>_.promise)):null;function u(_){c();try{i(_)}catch(T){(l.f&qt)===0&&Yn(T,l)}Ya()}if(n.length===0){o.then(()=>u(t.map(a)));return}var p=Gl();function b(){Promise.all(n.map(_=>ku(_))).then(_=>u([...t.map(a),..._])).catch(_=>Yn(_,l)).finally(()=>p())}o?o.then(()=>{c(),b(),Ya()}):b()}function bu(){var e=re,t=oe,n=Se,i=ne;return function(s=!0){jt(e),Wt(t),Br(n),s&&(e.f&qt)===0&&(i?.activate(),i?.apply())}}function Ya(e=!0){jt(null),Wt(null),Br(null),e&&ne?.deactivate()}function Gl(){var e=re,t=e.b,n=ne,i=t.is_rendered();return t.update_pending_count(1,n),n.increment(i,e),(a=!1)=>{t.update_pending_count(-1,n),n.decrement(i,e,a)}}function ti(e){var t=ot|at;return re!==null&&(re.f|=wr),{ctx:Se,deps:null,effects:null,equals:Ol,f:t,fn:e,reactions:null,rv:0,v:Ke,wv:0,parent:re,ac:null}}function ku(e,t,n){let i=re;i===null&&Hc();var a=void 0,s=_r(Ke),l=!oe,c=new Map;return Mu(()=>{var o=re,u=Al();a=u.promise;try{Promise.resolve(e()).then(u.resolve,u.reject).finally(Ya)}catch(T){u.reject(T),Ya()}var p=ne;if(l){if((o.f&kr)!==0)var b=Gl();if(i.b.is_rendered())c.get(p)?.reject(Mn),c.delete(p);else{for(const T of c.values())T.reject(Mn);c.clear()}c.set(p,u)}const _=(T,x=void 0)=>{if(b){var I=x===Mn;b(I)}if(!(x===Mn||(o.f&qt)!==0)){if(p.activate(),x)s.f|=Vn,Hr(s,x);else{(s.f&Vn)!==0&&(s.f^=Vn),Hr(s,T);for(const[E,C]of c){if(c.delete(E),E===p)break;C.reject(Mn)}}p.deactivate()}};u.promise.then(_,T=>_(null,T||"unknown"))}),no(()=>{for(const o of c.values())o.reject(Mn)}),new Promise(o=>{function u(p){function b(){p===a?o(s):u(a)}p.then(b,b)}u(a)})}function Ii(e){const t=ti(e);return co(t),t}function cr(e){const t=ti(e);return t.equals=Pl,t}function wu(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;nr(e))),t}function h(e,t,n=!1){oe!==null&&(!ln||(oe.f&Ri)!==0)&&Ra()&&(oe.f&(ot|kn|xa|Ri))!==0&&(Gt===null||!zr.call(Gt,e))&&Xc();let i=n?va(t):t;return Hr(e,i,Ga)}function Hr(e,t,n=null){if(!e.equals(t)){pr.set(e,er?t:e.v);var i=Qn.ensure();if(i.capture(e,t),(e.f&ot)!==0){const a=e;(e.f&at)!==0&&Yi(a),sn===null&&Wi(a)}e.wv=fo(),Yl(e,at,n),Ra()&&re!==null&&(re.f&He)!==0&&(re.f&(on|Jn))===0&&(Bt===null?Nu([e]):Bt.push(e)),!i.is_fork&&Li.size>0&&!Zl&&Tu()}return t}function Tu(){Zl=!1;for(const e of Li)(e.f&He)!==0&&Ne(e,cn),Gr(e)&&mr(e);Li.clear()}function ya(e){h(e,e.v+1)}function Yl(e,t,n){var i=e.reactions;if(i!==null)for(var a=Ra(),s=i.length,l=0;l{if(vr===s)return c();var o=oe,u=vr;Wt(null),js(s);var p=c();return Wt(o),js(u),p};return i&&n.set("length",nn(e.length)),new Proxy(e,{defineProperty(c,o,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Zc();var p=n.get(o);return p===void 0?l(()=>{var b=nn(u.value);return n.set(o,b),b}):h(p,u.value,!0),!0},deleteProperty(c,o){var u=n.get(o);if(u===void 0){if(o in c){const p=l(()=>nn(Ke));n.set(o,p),ya(a)}}else h(u,Ke),ya(a);return!0},get(c,o,u){if(o===Pr)return e;var p=n.get(o),b=o in c;if(p===void 0&&(!b||ka(c,o)?.writable)&&(p=l(()=>{var T=va(b?c[o]:Ke),x=nn(T);return x}),n.set(o,p)),p!==void 0){var _=r(p);return _===Ke?void 0:_}return Reflect.get(c,o,u)},getOwnPropertyDescriptor(c,o){var u=Reflect.getOwnPropertyDescriptor(c,o);if(u&&"value"in u){var p=n.get(o);p&&(u.value=r(p))}else if(u===void 0){var b=n.get(o),_=b?.v;if(b!==void 0&&_!==Ke)return{enumerable:!0,configurable:!0,value:_,writable:!0}}return u},has(c,o){if(o===Pr)return!0;var u=n.get(o),p=u!==void 0&&u.v!==Ke||Reflect.has(c,o);if(u!==void 0||re!==null&&(!p||ka(c,o)?.writable)){u===void 0&&(u=l(()=>{var _=p?va(c[o]):Ke,T=nn(_);return T}),n.set(o,u));var b=r(u);if(b===Ke)return!1}return p},set(c,o,u,p){var b=n.get(o),_=o in c;if(i&&o==="length")for(var T=u;Tnn(Ke)),n.set(T+"",x))}if(b===void 0)(!_||ka(c,o)?.writable)&&(b=l(()=>nn(void 0)),h(b,va(u)),n.set(o,b));else{_=b.v!==Ke;var I=l(()=>va(u));h(b,I)}var E=Reflect.getOwnPropertyDescriptor(c,o);if(E?.set&&E.set.call(p,u),!_){if(i&&typeof o=="string"){var C=n.get("length"),S=Number(o);Number.isInteger(S)&&S>=C.v&&h(C,S+1)}ya(a)}return!0},ownKeys(c){r(a);var o=Reflect.ownKeys(c).filter(b=>{var _=n.get(b);return _===void 0||_.v!==Ke});for(var[u,p]of n)p.v!==Ke&&!(u in c)&&o.push(u);return o},setPrototypeOf(){Yc()}})}var Di,Xl,Vl,Kl,Jl;function Eu(){if(Di===void 0){Di=window,Xl=document,Vl=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Kl=ka(t,"firstChild").get,Jl=ka(t,"nextSibling").get,Hs(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Hs(n)&&(n.__t=void 0)}}function wn(e=""){return document.createTextNode(e)}function Xn(e){return Kl.call(e)}function Ca(e){return Jl.call(e)}function d(e,t){return Xn(e)}function Zn(e,t=!1){{var n=Xn(e);return n instanceof Comment&&n.data===""?Ca(n):n}}function v(e,t=1,n=!1){let i=e;for(;t--;)i=Ca(i);return i}function Su(e){e.textContent=""}function Ql(){return!1}function eo(e,t,n){return document.createElementNS(t??Ml,e,void 0)}let Gs=!1;function Au(){Gs||(Gs=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function ni(e){var t=oe,n=re;Wt(null),jt(null);try{return e()}finally{Wt(t),jt(n)}}function Ru(e,t,n,i=n){e.addEventListener(t,()=>ni(n));const a=e.__on_r;a?e.__on_r=()=>{a(),i(!0)}:e.__on_r=()=>i(!0),Au()}function to(e){re===null&&(oe===null&&Wc(),Gc()),er&&qc()}function Cu(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function yn(e,t){var n=re;n!==null&&(n.f&ht)!==0&&(e|=ht);var i={ctx:Se,deps:null,nodes:null,f:e|at|$t,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};ne?.register_created_effect(i);var a=i;if((e&Fr)!==0)Nr!==null?Nr.push(i):Qn.ensure().schedule(i);else if(t!==null){try{mr(i)}catch(l){throw xt(i),l}a.deps===null&&a.teardown===null&&a.nodes===null&&a.first===a.last&&(a.f&wr)===0&&(a=a.first,(e&kn)!==0&&(e&Ur)!==0&&a!==null&&(a.f|=Ur))}if(a!==null&&(a.parent=n,n!==null&&Cu(a,n),oe!==null&&(oe.f&ot)!==0&&(e&Jn)===0)){var s=oe;(s.effects??=[]).push(a)}return i}function Xi(){return oe!==null&&!ln}function no(e){const t=yn(Sa,null);return Ne(t,He),t.teardown=e,t}function Mi(e){to();var t=re.f,n=!oe&&(t&on)!==0&&(t&kr)===0;if(n){var i=Se;(i.e??=[]).push(e)}else return ro(e)}function ro(e){return yn(Fr|Il,e)}function Iu(e){return to(),yn(Sa|Il,e)}function Lu(e){Qn.ensure();const t=yn(Jn|wr,e);return(n={})=>new Promise(i=>{n.outro?hr(t,()=>{xt(t),i(void 0)}):(xt(t),i(void 0))})}function Ta(e){return yn(Fr,e)}function vn(e,t){var n=Se,i={effect:null,ran:!1,deps:e};n.l.$.push(i),i.effect=qr(()=>{if(e(),!i.ran){i.ran=!0;var a=re;try{jt(a.parent),g(t)}finally{jt(a)}}})}function Du(){var e=Se;qr(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&He)!==0&&n.deps!==null&&Ne(n,cn),Gr(n)&&mr(n),t.ran=!1}})}function Mu(e){return yn(xa|wr,e)}function qr(e,t=0){return yn(Sa|t,e)}function z(e,t=[],n=[],i=[]){mu(i,t,n,a=>{yn(Sa,()=>e(...a.map(r)))})}function ri(e,t=0){var n=yn(kn|t,e);return n}function Ht(e){return yn(on|wr,e)}function ao(e){var t=e.teardown;if(t!==null){const n=er,i=oe;Ws(!0),Wt(null);try{t.call(null)}finally{Ws(n),Wt(i)}}}function Vi(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const a=n.ac;a!==null&&ni(()=>{a.abort(Mn)});var i=n.next;(n.f&Jn)!==0?n.parent=null:xt(n,t),n=i}}function Ou(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&on)===0&&xt(t),t=n}}function xt(e,t=!0){var n=!1;(t||(e.f&Cl)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(io(e.nodes.start,e.nodes.end),n=!0),Ne(e,Ai),Vi(e,t&&!n),Ea(e,0);var i=e.nodes&&e.nodes.t;if(i!==null)for(const s of i)s.stop();ao(e),e.f^=Ai,e.f|=qt;var a=e.parent;a!==null&&a.first!==null&&so(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function io(e,t){for(;e!==null;){var n=e===t?null:Ca(e);e.remove(),e=n}}function so(e){var t=e.parent,n=e.prev,i=e.next;n!==null&&(n.next=i),i!==null&&(i.prev=n),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=n))}function hr(e,t,n=!0){var i=[];lo(e,i,!0);var a=()=>{n&&xt(e),t&&t()},s=i.length;if(s>0){var l=()=>--s||a();for(var c of i)c.out(l)}else a()}function lo(e,t,n){if((e.f&ht)===0){e.f^=ht;var i=e.nodes&&e.nodes.t;if(i!==null)for(const c of i)(c.is_global||n)&&t.push(c);for(var a=e.first;a!==null;){var s=a.next;if((a.f&Jn)===0){var l=(a.f&Ur)!==0||(a.f&on)!==0&&(e.f&kn)!==0;lo(a,t,l?n:!1)}a=s}}}function Ki(e){oo(e,!0)}function oo(e,t){if((e.f&ht)!==0){e.f^=ht,(e.f&He)===0&&(Ne(e,at),Qn.ensure().schedule(e));for(var n=e.first;n!==null;){var i=n.next,a=(n.f&Ur)!==0||(n.f&on)!==0;oo(n,a?t:!1),n=i}var s=e.nodes&&e.nodes.t;if(s!==null)for(const l of s)(l.is_global||t)&&l.in()}}function Ji(e,t){if(e.nodes)for(var n=e.nodes.start,i=e.nodes.end;n!==null;){var a=n===i?null:Ca(n);t.append(n),n=a}}let Wa=!1,er=!1;function Ws(e){er=e}let oe=null,ln=!1;function Wt(e){oe=e}let re=null;function jt(e){re=e}let Gt=null;function co(e){oe!==null&&(Gt===null?Gt=[e]:Gt.push(e))}let yt=null,Rt=0,Bt=null;function Nu(e){Bt=e}let uo=1,dr=0,vr=dr;function js(e){vr=e}function fo(){return++uo}function Gr(e){var t=e.f;if((t&at)!==0)return!0;if(t&ot&&(e.f&=~gr),(t&cn)!==0){for(var n=e.deps,i=n.length,a=0;ae.wv)return!0}(t&$t)!==0&&sn===null&&Ne(e,He)}return!1}function po(e,t,n=!0){var i=e.reactions;if(i!==null&&!(Gt!==null&&zr.call(Gt,e)))for(var a=0;a{e.ac.abort(Mn)}),e.ac=null);try{e.f|=Za;var p=e.fn,b=p();e.f|=kr;var _=e.deps,T=ne?.is_fork;if(yt!==null){var x;if(T||Ea(e,Rt),_!==null&&Rt>0)for(_.length=Rt+yt.length,x=0;xn?.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Kn(()=>{t.addEventListener(e,a,i)}):t.addEventListener(e,a,i),a}function Ut(e,t,n,i,a){var s={capture:i,passive:a},l=Uu(e,t,n,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&no(()=>{t.removeEventListener(e,l,s)})}function G(e,t,n){(t[ga]??={})[e]=n}function mo(e){for(var t=0;t{throw E});throw _}}finally{e[ga]=t,delete e.currentTarget,Wt(p),jt(b)}}}const Bu=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Hu(e){return Bu?.createHTML(e)??e}function $u(e){var t=eo("template");return t.innerHTML=Hu(e.replaceAll("","")),t.content}function $r(e,t){var n=re;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function O(e,t){var n=(t&tu)!==0,i=(t&nu)!==0,a,s=!e.startsWith("");return()=>{a===void 0&&(a=$u(s?e:""+e),n||(a=Xn(a)));var l=i||Vl?document.importNode(a,!0):a.cloneNode(!0);if(n){var c=Xn(l),o=l.lastChild;$r(c,o)}else $r(l,l);return l}}function ft(e=""){{var t=wn(e+"");return $r(t,t),t}}function Qi(){var e=document.createDocumentFragment(),t=document.createComment(""),n=wn();return e.append(t,n),$r(t,n),e}function R(e,t){e!==null&&e.before(t)}function M(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function qu(e,t){return Gu(e,t)}const Ba=new Map;function Gu(e,{target:t,anchor:n,props:i={},events:a,context:s,intro:l=!0,transformError:c}){Eu();var o=void 0,u=Lu(()=>{var p=n??t.appendChild(wn());gu(p,{pending:()=>{}},T=>{Qa({});var x=Se;s&&(x.c=s),a&&(i.$$events=a),o=e(T,i)||{},ei()},c);var b=new Set,_=T=>{for(var x=0;x{for(var T of b)for(const E of[t,document]){var x=Ba.get(E),I=x.get(T);--I==0?(E.removeEventListener(T,zi),x.delete(T),x.size===0&&Ba.delete(E)):x.set(T,I)}Pi.delete(_),p!==n&&p.parentNode?.removeChild(p)}});return Wu.set(o,u),o}let Wu=new WeakMap;class ju{anchor;#n=new Map;#o=new Map;#e=new Map;#a=new Set;#r=!0;constructor(t,n=!0){this.anchor=t,this.#r=n}#i=t=>{if(this.#n.has(t)){var n=this.#n.get(t),i=this.#o.get(n);if(i)Ki(i),this.#a.delete(n);else{var a=this.#e.get(n);a&&(this.#o.set(n,a.effect),this.#e.delete(n),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),i=a.effect)}for(const[s,l]of this.#n){if(this.#n.delete(s),s===t)break;const c=this.#e.get(l);c&&(xt(c.effect),this.#e.delete(l))}for(const[s,l]of this.#o){if(s===n||this.#a.has(s))continue;const c=()=>{if(Array.from(this.#n.values()).includes(s)){var u=document.createDocumentFragment();Ji(l,u),u.append(wn()),this.#e.set(s,{effect:l,fragment:u})}else xt(l);this.#a.delete(s),this.#o.delete(s)};this.#r||!i?(this.#a.add(s),hr(l,c,!1)):c()}}};#t=t=>{this.#n.delete(t);const n=Array.from(this.#n.values());for(const[i,a]of this.#e)n.includes(i)||(xt(a.effect),this.#e.delete(i))};ensure(t,n){var i=ne,a=Ql();if(n&&!this.#o.has(t)&&!this.#e.has(t))if(a){var s=document.createDocumentFragment(),l=wn();s.append(l),this.#e.set(t,{effect:Ht(()=>n(l)),fragment:s})}else this.#o.set(t,Ht(()=>n(this.anchor)));if(this.#n.set(i,t),a){for(const[c,o]of this.#o)c===t?i.unskip_effect(o):i.skip_effect(o);for(const[c,o]of this.#e)c===t?i.unskip_effect(o.effect):i.skip_effect(o.effect);i.oncommit(this.#i),i.ondiscard(this.#t)}else this.#i(i)}}function j(e,t,n=!1){var i=new ju(e),a=n?Ur:0;function s(l,c){i.ensure(l,c)}ri(()=>{var l=!1;t((c,o=0)=>{l=!0,s(o,c)}),l||s(-1,null)},a)}function Zu(e,t){return t}function Yu(e,t,n){for(var i=[],a=t.length,s,l=t.length,c=0;c{if(s){if(s.pending.delete(b),s.done.add(b),s.pending.size===0){var _=e.outrogroups;Fi(e,Ja(s.done)),_.delete(s),_.size===0&&(e.outrogroups=null)}}else l-=1},!1)}if(l===0){var o=i.length===0&&n!==null;if(o){var u=n,p=u.parentNode;Su(p),p.append(u),e.items.clear()}Fi(e,t,!o)}else s={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(s)}function Fi(e,t,n=!0){var i;if(e.pending.size>0){i=new Set;for(const l of e.pending.values())for(const c of l)i.add(e.items.get(c).e)}for(var a=0;a{var W=n();return El(W)?W:W==null?[]:Ja(W)}),_,T=new Map,x=!0;function I(W){(S.effect.f&qt)===0&&(S.pending.delete(W),S.fallback=p,Xu(S,_,l,t,i),p!==null&&(_.length===0?(p.f&bn)===0?Ki(p):(p.f^=bn,_a(p,null,l)):hr(p,()=>{p=null})))}function E(W){S.pending.delete(W)}var C=ri(()=>{_=r(b);for(var W=_.length,A=new Set,K=ne,te=Ql(),fe=0;fes(l)):(p=Ht(()=>s(Ys??=wn())),p.f|=bn)),W>A.size&&$c(),!x)if(T.set(K,A),te){for(const[de,le]of c)A.has(de)||K.skip_effect(le.e);K.oncommit(I),K.ondiscard(E)}else I(K);r(b)}),S={effect:C,items:c,pending:T,outrogroups:null,fallback:p};x=!1}function oa(e){for(;e!==null&&(e.f&on)===0;)e=e.next;return e}function Xu(e,t,n,i,a){var s=(i&Qc)!==0,l=t.length,c=e.items,o=oa(e.effect.first),u,p=null,b,_=[],T=[],x,I,E,C;if(s)for(C=0;C0){var Me=(i&Dl)!==0&&l===0?n:null;if(s){for(C=0;C{if(b!==void 0)for(E of b)E.nodes?.a?.apply()})}function Vu(e,t,n,i,a,s,l,c){var o=(l&Kc)!==0?(l&eu)===0?Z(n,!1,!1):_r(n):null,u=(l&Jc)!==0?_r(a):null;return{v:o,i:u,e:Ht(()=>(s(t,o??n,u??a,c),()=>{e.delete(i)}))}}function _a(e,t,n){if(e.nodes)for(var i=e.nodes.start,a=e.nodes.end,s=t&&(t.f&bn)===0?t.nodes.start:n;i!==null;){var l=Ca(i);if(s.before(i),i===a)return;i=l}}function qn(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function gi(e,t,n=!1,i=!1,a=!1,s=!1){var l=e,c="";if(n)var o=e;z(()=>{var u=re;if(c!==(c=t()??"")){if(n){u.nodes=null,o.innerHTML=c,c!==""&&$r(Xn(o),o.lastChild);return}if(u.nodes!==null&&(io(u.nodes.start,u.nodes.end),u.nodes=null),c!==""){var p=i?ru:a?au:void 0,b=eo(i?"svg":a?"math":"template",p);b.innerHTML=c;var _=i||a?b:b.content;if($r(Xn(_),_.lastChild),i||a)for(;Xn(_);)l.before(Xn(_));else l.before(_)}}})}function bo(e,t){var n;n=document.head.appendChild(wn()),ri(()=>t(n),Cl|wr)}function Xs(e,t,n){Ta(()=>{var i=g(()=>t(e,n?.())||{});if(n&&i?.update){var a=!1,s={};qr(()=>{var l=n();P(l),a&&Nl(s,l)&&(s=l,i.update(l))}),a=!0}if(i?.destroy)return()=>i.destroy()})}const Vs=[...` +\r\f \v\uFEFF`];function Ku(e,t,n){var i=e==null?"":""+e;if(n){for(var a of Object.keys(n))if(n[a])i=i?i+" "+a:a;else if(i.length)for(var s=a.length,l=0;(l=i.indexOf(a,l))>=0;){var c=l+s;(l===0||Vs.includes(i[l-1]))&&(c===i.length||Vs.includes(i[c]))?i=(l===0?"":i.substring(0,l))+i.substring(c+1):l=c}}return i===""?null:i}function Ju(e,t){return e==null?null:String(e)}function kt(e,t,n,i,a,s){var l=e.__className;if(l!==n||l===void 0){var c=Ku(n,i,s);c==null?e.removeAttribute("class"):e.className=c,e.__className=n}else if(s&&a!==s)for(var o in s){var u=!!s[o];(a==null||u!==!!a[o])&&e.classList.toggle(o,u)}return s}function Ln(e,t,n,i){var a=e.__style;if(a!==t){var s=Ju(t);s==null?e.removeAttribute("style"):e.style.cssText=s,e.__style=t}return i}const Qu=Symbol("is custom element"),ef=Symbol("is html");function $(e,t,n,i){var a=tf(e);a[t]!==(a[t]=n)&&(t==="loading"&&(e[Bc]=n),n==null?e.removeAttribute(t):typeof n!="string"&&nf(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function tf(e){return e.__attributes??={[Qu]:e.nodeName.includes("-"),[ef]:e.namespaceURI===Ml}}var Ks=new Map;function nf(e){var t=e.getAttribute("is")||e.nodeName,n=Ks.get(t);if(n)return n;Ks.set(t,n=[]);for(var i,a=e,s=Element.prototype;s!==a;){i=Sl(a);for(var l in i)i[l].set&&n.push(l);a=Gi(a)}return n}function gn(e,t,n=t){var i=new WeakSet;Ru(e,"input",async a=>{var s=a?e.defaultValue:e.value;if(s=_i(e)?mi(s):s,n(s),ne!==null&&i.add(ne),await Oi(),s!==(s=t())){var l=e.selectionStart,c=e.selectionEnd,o=e.value.length;if(e.value=s??"",c!==null){var u=e.value.length;l===c&&c===o&&u>o?(e.selectionStart=u,e.selectionEnd=u):(e.selectionStart=l,e.selectionEnd=Math.min(c,u))}}}),g(t)==null&&e.value&&(n(_i(e)?mi(e.value):e.value),ne!==null&&i.add(ne)),qr(()=>{var a=t();if(e===document.activeElement){var s=ne;if(i.has(s))return}_i(e)&&a===mi(e.value)||e.type==="date"&&!a&&!e.value||a!==e.value&&(e.value=a??"")})}function _i(e){var t=e.type;return t==="number"||t==="range"}function mi(e){return e===""?null:+e}function Js(e,t){return e===t||e?.[Pr]===t}function ja(e={},t,n,i){var a=Se.r,s=re;return Ta(()=>{var l,c;return qr(()=>{l=c,c=[],g(()=>{e!==n(...c)&&(t(e,...c),l&&Js(n(...l),e)&&t(null,...l))})}),()=>{let o=s;for(;o!==a&&o.parent!==null&&o.parent.f&Ai;)o=o.parent;const u=()=>{c&&Js(n(...c),e)&&t(null,...c)},p=o.teardown;o.teardown=()=>{u(),p?.()}}}),e}function ko(e=!1){const t=Se,n=t.l.u;if(!n)return;let i=()=>P(t.s);if(e){let a=0,s={};const l=ti(()=>{let c=!1;const o=t.s;for(const u in o)o[u]!==s[u]&&(s[u]=o[u],c=!0);return c&&a++,a});i=()=>r(l)}n.b.length&&Iu(()=>{Qs(t,i),Ei(n.b)}),Mi(()=>{const a=g(()=>n.m.map(Uc));return()=>{for(const s of a)typeof s=="function"&&s()}}),n.a.length&&Mi(()=>{Qs(t,i),Ei(n.a)})}function Qs(e,t){if(e.l.s)for(const n of e.l.s)r(n);t()}function rf(e,t,n,i){var a=i,s=!0,l=()=>(s&&(s=!1,a=i),a),c;c=e[t],c===void 0&&i!==void 0&&(c=l());var o;return o=()=>{var u=e[t];return u===void 0?l():(s=!0,u)},o}function wo(e){Se===null&&Ll(),Aa&&Se.l!==null?sf(Se).m.push(e):Mi(()=>{const t=g(e);if(typeof t=="function")return t})}function af(e){Se===null&&Ll(),wo(()=>()=>g(e))}function sf(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}const lf="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(lf);ou();class yo extends Error{constructor(t,n){super(n),this.status=t}status}async function nt(e,t={}){const n=new Headers(t.headers);n.set("Accept","application/json"),t.body&&!(t.body instanceof FormData)&&n.set("Content-Type","application/json");const i=await fetch(e,{...t,headers:n});if(!i.ok)throw new yo(i.status,await i.text());return i.json()}function el(e,t){const n=()=>{const s=e.style.height;e.style.height="auto";const l=`${e.scrollHeight}px`;s!==l?e.style.height=l:e.style.height=s},i=()=>n(),a=()=>n();return requestAnimationFrame(n),e.addEventListener("input",i),window.addEventListener("resize",a),{update(){requestAnimationFrame(n)},destroy(){e.removeEventListener("input",i),window.removeEventListener("resize",a)}}}const of=[{title:"Ship it",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYjJ1bm1meHE4N2x3bnN0djJkMWtjNGc5bXYzZDFiOHBsbG16M3F0ZSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/l0HlHFRbmaZtBRhXG/giphy.gif",tags:["ship","launch","done"]},{title:"Approved",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExazBpbzJ6ODZ3bXQ3OHBvNGJidWZoajc0cHV6YnVub3MzZ3c1a2Z2dSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/111ebonMs90YLu/giphy.gif",tags:["yes","approved","nice"]},{title:"Deploy dance",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExY3NkaTVmZW9ydWNnZnl0ZWQ5aHQyeGNrd2k3NG4wZWNqYzNmd3k1ZCZlcD12MV9naWZzX3NlYXJjaCZjdD1n/GeimqsH0TLDt4tScGw/giphy.gif",tags:["deploy","dance","celebrate"]},{title:"Looking",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYWZ3emE0dm5mN2h0bGVsY2w0OXBodGd2cGJlNDRiZXo1YWNtdWRmZyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/26n6WywJyh39n1pBu/giphy.gif",tags:["search","looking","debug"]},{title:"Typing faster",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExOWFlbnJnbnIzbHYxcDIzdXZ3NGF3N2FocHNvMmR5enU3bHpycHBlZSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/13HgwGsXF0aiGY/giphy.gif",tags:["typing","code","work"]},{title:"Tiny victory",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdjJ2b2tqNmF4dG16NjE0eXhuc3h5bTlvamgwNTR0Zmd6ZjhtM2JuaSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/3o7abKhOpu0NwenH3O/giphy.gif",tags:["win","victory","celebrate"]}];function Ft(e,t=120){if(!e)return"";const n=e.replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t-1)+"...":n}function Gn(e){return e.quoted_author?.display_name||"Unknown"}function tl(e,t){return t===e.id?"Open":"Thread"}function cf(e){const t=new Date(e),n=new Date,i=new Date;i.setDate(n.getDate()-1);const a=(s,l)=>s.getFullYear()===l.getFullYear()&&s.getMonth()===l.getMonth()&&s.getDate()===l.getDate();return a(t,n)?"Today":a(t,i)?"Yesterday":new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric"}).format(t)}function uf(e){const t=[];let n="",i="",a=0;for(const s of e){const l=new Date(s.created_at),c=l.toDateString(),o=s.author?.id||s.author_id||"local",u=c!==n,p=o!==i,b=l.getTime()-a>300*1e3;u||p||b||t.length===0?t.push({key:s.id,dayLabel:u?cf(s.created_at):null,messages:[s],authorName:s.author?.display_name||"Local User",authorHandle:s.author?.handle||"",authorAvatarURL:s.author?.avatar_url||"",authorID:o,timestamp:s.created_at}):t[t.length-1].messages.push(s),n=c,i=o,a=l.getTime()}return t}function nl(e){const t=e.trim();if(!t)return"?";const n=t.split(/\s+/);return n.length>=2?(n[0][0]+n[1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function Xe(e){if(!e)return"?";const t=e.trim();return t?t[0].toUpperCase():"?"}function lt(e){return e?`@${e}`:""}function Ve(e){let t=0;for(let n=0;n>>0;return t%360}function rl(e,t){return e.members.find(n=>n.id!==t)||e.members[0]}function Wn(e,t){const n=e.members.filter(a=>a.id!==t);return(n.length>0?n:e.members).map(a=>a.display_name).join(", ")}function ff(e,t,n){const i=new Map;for(const a of t)for(const s of a.members)s.id&&s.id!==n&&i.set(s.id,s);for(const a of[...e].reverse()){const s=a.author;s?.id&&s.id!==n&&i.set(s.id,s)}return[...i.values()].slice(0,12)}function al(e,t){return e.find(n=>n.members.some(i=>i.id===t))}const df=new Set(["button","checkbox","combobox","link","listbox","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","option","radio","radiogroup","slider","spinbutton","switch","tab","tablist","textbox","tree","treeitem"]),pf=new Set(["INPUT","TEXTAREA","SELECT","BUTTON","A","DETAILS","SUMMARY","VIDEO","AUDIO"]);function hf(e){if(!e)return!1;if(e.isContentEditable)return!0;if(e instanceof HTMLInputElement){const t=(e.type||"text").toLowerCase();return t!=="checkbox"&&t!=="radio"&&t!=="button"&&t!=="submit"&&t!=="reset"&&t!=="file"}return e instanceof HTMLTextAreaElement}function vf(e){if(!e||gf(e))return!1;if(pf.has(e.tagName))return!0;const t=e.getAttribute("role");if(t&&df.has(t))return!0;const n=e.getAttribute("tabindex");return!!(n!==null&&n!=="-1"&&e.hasAttribute("aria-keyshortcuts"))}function gf(e){if(!e.closest(".messages, .thread"))return!1;if(e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement)return!0;const t=e.getAttribute("role");return t==="button"||t==="link"}function _f(){const e=typeof window<"u"?window.getSelection():null;if(!e||e.isCollapsed||e.rangeCount===0)return!1;const t=e.getRangeAt(0).commonAncestorContainer;return t?!!(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest(".messages, .thread, .markdown"):!1}function mf(e,t){if(t.authRequired||t.isModalOpen()||e.defaultPrevented||e.isComposing||e.keyCode===229||e.ctrlKey||e.metaKey||e.altKey||e.key.length!==1||_f())return!1;const n=document.activeElement;return!(n===t.messageInput||n===t.replyInput||hf(n)||vf(n))}function bf(e,t){if(!mf(e,t))return;const n=t.target();if(!n||n.disabled||n.readOnly)return;e.key===" "&&e.preventDefault(),n.focus({preventScroll:!0});const i=n.value.length;if(n.setSelectionRange(i,i),e.key===" "){const a=n.selectionStart??i,s=n.selectionEnd??i;n.setRangeText(" ",a,s,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))}}const{entries:xo,setPrototypeOf:il,isFrozen:kf,getPrototypeOf:wf,getOwnPropertyDescriptor:yf}=Object;let{freeze:vt,seal:Zt,create:Mr}=Object,{apply:Ui,construct:Bi}=typeof Reflect<"u"&&Reflect;vt||(vt=function(t){return t});Zt||(Zt=function(t){return t});Ui||(Ui=function(t,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),s=2;s1?n-1:0),a=1;a"u"?null:$e(BigInt.prototype.toString),ul=typeof Symbol>"u"?null:$e(Symbol.prototype.toString),Oe=$e(Object.prototype.hasOwnProperty),fa=$e(Object.prototype.toString),rt=$e(RegExp.prototype.test),Ha=Rf(TypeError);function $e(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a2&&arguments[2]!==void 0?arguments[2]:ma;if(il&&il(e,null),!dt(t))return e;let i=t.length;for(;i--;){let a=t[i];if(typeof a=="string"){const s=n(a);s!==a&&(kf(t)||(t[i]=s),a=s)}e[a]=!0}return e}function Cf(e){for(let t=0;t/gm),Pf=Zt(/\$\{[\w\W]*/gm),zf=Zt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ff=Zt(/^aria-[\-\w]+$/),To=Zt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Uf=Zt(/^(?:\w+script|data):/i),Bf=Zt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Eo=Zt(/^html$/i),Hf=Zt(/^[a-z][.\w]*(-[.\w]+)+$/i);var vl=Object.freeze({__proto__:null,ARIA_ATTR:Ff,ATTR_WHITESPACE:Bf,CUSTOM_ELEMENT:Hf,DATA_ATTR:zf,DOCTYPE_NAME:Eo,ERB_EXPR:Nf,IS_ALLOWED_URI:To,IS_SCRIPT_OR_DATA:Uf,MUSTACHE_EXPR:Of,TMPLIT_EXPR:Pf});const da={element:1,text:3,progressingInstruction:7,comment:8,document:9},$f=function(){return typeof window>"u"?null:window},qf=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(i=n.getAttribute(a));const s="dompurify"+(i?"#"+i:"");try{return t.createPolicy(s,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},gl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function So(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$f();const t=q=>So(q);if(t.version="3.4.2",t.removed=[],!e||!e.document||e.document.nodeType!==da.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const i=n,a=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:c,Element:o,NodeFilter:u,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:b,DOMParser:_,trustedTypes:T}=e,x=o.prototype,I=Or(x,"cloneNode"),E=Or(x,"remove"),C=Or(x,"nextSibling"),S=Or(x,"childNodes"),W=Or(x,"parentNode");if(typeof l=="function"){const q=n.createElement("template");q.content&&q.content.ownerDocument&&(n=q.content.ownerDocument)}let A,K="";const{implementation:te,createNodeIterator:fe,createDocumentFragment:ye,getElementsByTagName:Me}=n,{importNode:_e}=i;let de=gl();t.isSupported=typeof xo=="function"&&typeof W=="function"&&te&&te.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:le,ERB_EXPR:me,TMPLIT_EXPR:Je,DATA_ATTR:Ct,ARIA_ATTR:Yt,IS_SCRIPT_OR_DATA:it,ATTR_WHITESPACE:gt,CUSTOM_ELEMENT:un}=vl;let{IS_ALLOWED_URI:xn}=vl,Ie=null;const It=J({},[...fl,...ki,...wi,...yi,...dl]);let Pe=null;const fn=J({},[...pl,...xi,...hl,...$a]);let he=Object.seal(Mr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Xt=null,Vt=null;const Tt=Object.seal(Mr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Tn=!0,Kt=!0,ce=!1,We=!0,Lt=!1,Jt=!0,Le=!1,jr=!1,On=!1,Nn=!1,xr=!1,Tr=!1,tr=!0,La=!1;const _t="user-content-";let nr=!0,Pn=!1,En={},Et=null;const rr=J({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Zr=null;const Da=J({},["audio","video","img","source","image","track"]);let ct=null;const Yr=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Er="http://www.w3.org/1998/Math/MathML",Sr="http://www.w3.org/2000/svg",mt="http://www.w3.org/1999/xhtml";let zn=mt,Xr=!1,Fn=null;const si=J({},[Er,Sr,mt],bi);let ar=J({},["mi","mo","mn","ms","mtext"]),Vr=J({},["annotation-xml"]);const li=J({},["title","style","font","a","script"]);let dn=null;const Ma=["application/xhtml+xml","text/html"],Kr="text/html";let Ae=null,Un=null;const Jr=n.createElement("form"),Sn=function(f){return f instanceof RegExp||f instanceof Function},Ar=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Un&&Un===f)return;(!f||typeof f!="object")&&(f={}),f=wt(f),dn=Ma.indexOf(f.PARSER_MEDIA_TYPE)===-1?Kr:f.PARSER_MEDIA_TYPE,Ae=dn==="application/xhtml+xml"?bi:ma,Ie=Oe(f,"ALLOWED_TAGS")&&dt(f.ALLOWED_TAGS)?J({},f.ALLOWED_TAGS,Ae):It,Pe=Oe(f,"ALLOWED_ATTR")&&dt(f.ALLOWED_ATTR)?J({},f.ALLOWED_ATTR,Ae):fn,Fn=Oe(f,"ALLOWED_NAMESPACES")&&dt(f.ALLOWED_NAMESPACES)?J({},f.ALLOWED_NAMESPACES,bi):si,ct=Oe(f,"ADD_URI_SAFE_ATTR")&&dt(f.ADD_URI_SAFE_ATTR)?J(wt(Yr),f.ADD_URI_SAFE_ATTR,Ae):Yr,Zr=Oe(f,"ADD_DATA_URI_TAGS")&&dt(f.ADD_DATA_URI_TAGS)?J(wt(Da),f.ADD_DATA_URI_TAGS,Ae):Da,Et=Oe(f,"FORBID_CONTENTS")&&dt(f.FORBID_CONTENTS)?J({},f.FORBID_CONTENTS,Ae):rr,Xt=Oe(f,"FORBID_TAGS")&&dt(f.FORBID_TAGS)?J({},f.FORBID_TAGS,Ae):wt({}),Vt=Oe(f,"FORBID_ATTR")&&dt(f.FORBID_ATTR)?J({},f.FORBID_ATTR,Ae):wt({}),En=Oe(f,"USE_PROFILES")?f.USE_PROFILES&&typeof f.USE_PROFILES=="object"?wt(f.USE_PROFILES):f.USE_PROFILES:!1,Tn=f.ALLOW_ARIA_ATTR!==!1,Kt=f.ALLOW_DATA_ATTR!==!1,ce=f.ALLOW_UNKNOWN_PROTOCOLS||!1,We=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Lt=f.SAFE_FOR_TEMPLATES||!1,Jt=f.SAFE_FOR_XML!==!1,Le=f.WHOLE_DOCUMENT||!1,Nn=f.RETURN_DOM||!1,xr=f.RETURN_DOM_FRAGMENT||!1,Tr=f.RETURN_TRUSTED_TYPE||!1,On=f.FORCE_BODY||!1,tr=f.SANITIZE_DOM!==!1,La=f.SANITIZE_NAMED_PROPS||!1,nr=f.KEEP_CONTENT!==!1,Pn=f.IN_PLACE||!1,xn=Lf(f.ALLOWED_URI_REGEXP)?f.ALLOWED_URI_REGEXP:To,zn=typeof f.NAMESPACE=="string"?f.NAMESPACE:mt,ar=Oe(f,"MATHML_TEXT_INTEGRATION_POINTS")&&f.MATHML_TEXT_INTEGRATION_POINTS&&typeof f.MATHML_TEXT_INTEGRATION_POINTS=="object"?wt(f.MATHML_TEXT_INTEGRATION_POINTS):J({},["mi","mo","mn","ms","mtext"]),Vr=Oe(f,"HTML_INTEGRATION_POINTS")&&f.HTML_INTEGRATION_POINTS&&typeof f.HTML_INTEGRATION_POINTS=="object"?wt(f.HTML_INTEGRATION_POINTS):J({},["annotation-xml"]);const y=Oe(f,"CUSTOM_ELEMENT_HANDLING")&&f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING=="object"?wt(f.CUSTOM_ELEMENT_HANDLING):Mr(null);if(he=Mr(null),Oe(y,"tagNameCheck")&&Sn(y.tagNameCheck)&&(he.tagNameCheck=y.tagNameCheck),Oe(y,"attributeNameCheck")&&Sn(y.attributeNameCheck)&&(he.attributeNameCheck=y.attributeNameCheck),Oe(y,"allowCustomizedBuiltInElements")&&typeof y.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=y.allowCustomizedBuiltInElements),Lt&&(Kt=!1),xr&&(Nn=!0),En&&(Ie=J({},dl),Pe=Mr(null),En.html===!0&&(J(Ie,fl),J(Pe,pl)),En.svg===!0&&(J(Ie,ki),J(Pe,xi),J(Pe,$a)),En.svgFilters===!0&&(J(Ie,wi),J(Pe,xi),J(Pe,$a)),En.mathMl===!0&&(J(Ie,yi),J(Pe,hl),J(Pe,$a))),Tt.tagCheck=null,Tt.attributeCheck=null,Oe(f,"ADD_TAGS")&&(typeof f.ADD_TAGS=="function"?Tt.tagCheck=f.ADD_TAGS:dt(f.ADD_TAGS)&&(Ie===It&&(Ie=wt(Ie)),J(Ie,f.ADD_TAGS,Ae))),Oe(f,"ADD_ATTR")&&(typeof f.ADD_ATTR=="function"?Tt.attributeCheck=f.ADD_ATTR:dt(f.ADD_ATTR)&&(Pe===fn&&(Pe=wt(Pe)),J(Pe,f.ADD_ATTR,Ae))),Oe(f,"ADD_URI_SAFE_ATTR")&&dt(f.ADD_URI_SAFE_ATTR)&&J(ct,f.ADD_URI_SAFE_ATTR,Ae),Oe(f,"FORBID_CONTENTS")&&dt(f.FORBID_CONTENTS)&&(Et===rr&&(Et=wt(Et)),J(Et,f.FORBID_CONTENTS,Ae)),Oe(f,"ADD_FORBID_CONTENTS")&&dt(f.ADD_FORBID_CONTENTS)&&(Et===rr&&(Et=wt(Et)),J(Et,f.ADD_FORBID_CONTENTS,Ae)),nr&&(Ie["#text"]=!0),Le&&J(Ie,["html","head","body"]),Ie.table&&(J(Ie,["tbody"]),delete Xt.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ha('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ha('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=f.TRUSTED_TYPES_POLICY,K=A.createHTML("")}else A===void 0&&(A=qf(T,a)),A!==null&&typeof K=="string"&&(K=A.createHTML(""));vt&&vt(f),Un=f},Oa=J({},[...ki,...wi,...Df]),Na=J({},[...yi,...Mf]),oi=function(f){let y=W(f);(!y||!y.tagName)&&(y={namespaceURI:zn,tagName:"template"});const N=ma(f.tagName),be=ma(y.tagName);return Fn[f.namespaceURI]?f.namespaceURI===Sr?y.namespaceURI===mt?N==="svg":y.namespaceURI===Er?N==="svg"&&(be==="annotation-xml"||ar[be]):!!Oa[N]:f.namespaceURI===Er?y.namespaceURI===mt?N==="math":y.namespaceURI===Sr?N==="math"&&Vr[be]:!!Na[N]:f.namespaceURI===mt?y.namespaceURI===Sr&&!Vr[be]||y.namespaceURI===Er&&!ar[be]?!1:!Na[N]&&(li[N]||!Oa[N]):!!(dn==="application/xhtml+xml"&&Fn[f.namespaceURI]):!1},m=function(f){ua(t.removed,{element:f});try{W(f).removeChild(f)}catch{E(f)}},L=function(f,y){try{ua(t.removed,{attribute:y.getAttributeNode(f),from:y})}catch{ua(t.removed,{attribute:null,from:y})}if(y.removeAttribute(f),f==="is")if(Nn||xr)try{m(y)}catch{}else try{y.setAttribute(f,"")}catch{}},ue=function(f){let y=null,N=null;if(On)f=""+f;else{const De=ll(f,/^[\r\n\t ]+/);N=De&&De[0]}dn==="application/xhtml+xml"&&zn===mt&&(f=''+f+"");const be=A?A.createHTML(f):f;if(zn===mt)try{y=new _().parseFromString(be,dn)}catch{}if(!y||!y.documentElement){y=te.createDocument(zn,"template",null);try{y.documentElement.innerHTML=Xr?K:be}catch{}}const Ze=y.body||y.documentElement;return f&&N&&Ze.insertBefore(n.createTextNode(N),Ze.childNodes[0]||null),zn===mt?Me.call(y,Le?"html":"body")[0]:Le?y.documentElement:Ze},Re=function(f){return fe.call(f.ownerDocument||f,f,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},je=function(f){return f instanceof b&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof p)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Dt=function(f){return typeof c=="function"&&f instanceof c};function qe(q,f,y){ca(q,N=>{N.call(t,f,y,Un)})}const Mt=function(f){let y=null;if(qe(de.beforeSanitizeElements,f,null),je(f))return m(f),!0;const N=Ae(f.nodeName);if(qe(de.uponSanitizeElement,f,{tagName:N,allowedTags:Ie}),Jt&&f.hasChildNodes()&&!Dt(f.firstElementChild)&&rt(/<[/\w!]/g,f.innerHTML)&&rt(/<[/\w!]/g,f.textContent)||Jt&&f.namespaceURI===mt&&N==="style"&&Dt(f.firstElementChild)||f.nodeType===da.progressingInstruction||Jt&&f.nodeType===da.comment&&rt(/<[/\w]/g,f.data))return m(f),!0;if(Xt[N]||!(Tt.tagCheck instanceof Function&&Tt.tagCheck(N))&&!Ie[N]){if(!Xt[N]&&ea(N)&&(he.tagNameCheck instanceof RegExp&&rt(he.tagNameCheck,N)||he.tagNameCheck instanceof Function&&he.tagNameCheck(N)))return!1;if(nr&&!Et[N]){const be=W(f)||f.parentNode,Ze=S(f)||f.childNodes;if(Ze&&be){const De=Ze.length;for(let Qe=De-1;Qe>=0;--Qe){const bt=I(Ze[Qe],!0);be.insertBefore(bt,C(f))}}}return m(f),!0}return f instanceof o&&!oi(f)||(N==="noscript"||N==="noembed"||N==="noframes")&&rt(/<\/no(script|embed|frames)/i,f.innerHTML)?(m(f),!0):(Lt&&f.nodeType===da.text&&(y=f.textContent,ca([le,me,Je],be=>{y=Lr(y,be," ")}),f.textContent!==y&&(ua(t.removed,{element:f.cloneNode()}),f.textContent=y)),qe(de.afterSanitizeElements,f,null),!1)},Qr=function(f,y,N){if(Vt[y]||tr&&(y==="id"||y==="name")&&(N in n||N in Jr))return!1;const be=Pe[y]||Tt.attributeCheck instanceof Function&&Tt.attributeCheck(y,f);if(!(Kt&&!Vt[y]&&rt(Ct,y))){if(!(Tn&&rt(Yt,y))){if(!be||Vt[y]){if(!(ea(f)&&(he.tagNameCheck instanceof RegExp&&rt(he.tagNameCheck,f)||he.tagNameCheck instanceof Function&&he.tagNameCheck(f))&&(he.attributeNameCheck instanceof RegExp&&rt(he.attributeNameCheck,y)||he.attributeNameCheck instanceof Function&&he.attributeNameCheck(y,f))||y==="is"&&he.allowCustomizedBuiltInElements&&(he.tagNameCheck instanceof RegExp&&rt(he.tagNameCheck,N)||he.tagNameCheck instanceof Function&&he.tagNameCheck(N))))return!1}else if(!ct[y]){if(!rt(xn,Lr(N,gt,""))){if(!((y==="src"||y==="xlink:href"||y==="href")&&f!=="script"&&ol(N,"data:")===0&&Zr[f])){if(!(ce&&!rt(it,Lr(N,gt,"")))){if(N)return!1}}}}}}return!0},Pa=J({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ea=function(f){return!Pa[ma(f)]&&rt(un,f)},za=function(f){qe(de.beforeSanitizeAttributes,f,null);const{attributes:y}=f;if(!y||je(f))return;const N={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Pe,forceKeepAttr:void 0};let be=y.length;for(;be--;){const Ze=y[be],{name:De,namespaceURI:Qe,value:bt}=Ze,st=Ae(De),ta=bt;let ze=De==="value"?ta:Ef(ta);if(N.attrName=st,N.attrValue=ze,N.keepAttr=!0,N.forceKeepAttr=void 0,qe(de.uponSanitizeAttribute,f,N),ze=N.attrValue,La&&(st==="id"||st==="name")&&ol(ze,_t)!==0&&(L(De,f),ze=_t+ze),Jt&&rt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ze)){L(De,f);continue}if(st==="attributename"&&ll(ze,"href")){L(De,f);continue}if(N.forceKeepAttr)continue;if(!N.keepAttr){L(De,f);continue}if(!We&&rt(/\/>/i,ze)){L(De,f);continue}Lt&&ca([le,me,Je],ra=>{ze=Lr(ze,ra," ")});const na=Ae(f.nodeName);if(!Qr(na,st,ze)){L(De,f);continue}if(A&&typeof T=="object"&&typeof T.getAttributeType=="function"&&!Qe)switch(T.getAttributeType(na,st)){case"TrustedHTML":{ze=A.createHTML(ze);break}case"TrustedScriptURL":{ze=A.createScriptURL(ze);break}}if(ze!==ta)try{Qe?f.setAttributeNS(Qe,De,ze):f.setAttribute(De,ze),je(f)?m(f):sl(t.removed)}catch{L(De,f)}}qe(de.afterSanitizeAttributes,f,null)},Fa=function(f){let y=null;const N=Re(f);for(qe(de.beforeSanitizeShadowDOM,f,null);y=N.nextNode();)qe(de.uponSanitizeShadowNode,y,null),Mt(y),za(y),y.content instanceof s&&Fa(y.content);qe(de.afterSanitizeShadowDOM,f,null)};return t.sanitize=function(q){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=null,N=null,be=null,Ze=null;if(Xr=!q,Xr&&(q=""),typeof q!="string"&&!Dt(q)&&(q=If(q),typeof q!="string"))throw Ha("dirty is not a string, aborting");if(!t.isSupported)return q;if(jr||Ar(f),t.removed=[],typeof q=="string"&&(Pn=!1),Pn){const bt=q.nodeName;if(typeof bt=="string"){const st=Ae(bt);if(!Ie[st]||Xt[st])throw Ha("root node is forbidden and cannot be sanitized in-place")}}else if(q instanceof c)y=ue(""),N=y.ownerDocument.importNode(q,!0),N.nodeType===da.element&&N.nodeName==="BODY"||N.nodeName==="HTML"?y=N:y.appendChild(N);else{if(!Nn&&!Lt&&!Le&&q.indexOf("<")===-1)return A&&Tr?A.createHTML(q):q;if(y=ue(q),!y)return Nn?null:Tr?K:""}y&&On&&m(y.firstChild);const De=Re(Pn?q:y);for(;be=De.nextNode();)Mt(be),za(be),be.content instanceof s&&Fa(be.content);if(Pn)return q;if(Nn){if(Lt){y.normalize();let bt=y.innerHTML;ca([le,me,Je],st=>{bt=Lr(bt,st," ")}),y.innerHTML=bt}if(xr)for(Ze=ye.call(y.ownerDocument);y.firstChild;)Ze.appendChild(y.firstChild);else Ze=y;return(Pe.shadowroot||Pe.shadowrootmode)&&(Ze=_e.call(i,Ze,!0)),Ze}let Qe=Le?y.outerHTML:y.innerHTML;return Le&&Ie["!doctype"]&&y.ownerDocument&&y.ownerDocument.doctype&&y.ownerDocument.doctype.name&&rt(Eo,y.ownerDocument.doctype.name)&&(Qe=" +`+Qe),Lt&&ca([le,me,Je],bt=>{Qe=Lr(Qe,bt," ")}),A&&Tr?A.createHTML(Qe):Qe},t.setConfig=function(){let q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ar(q),jr=!0},t.clearConfig=function(){Un=null,jr=!1},t.isValidAttribute=function(q,f,y){Un||Ar({});const N=Ae(q),be=Ae(f);return Qr(N,be,y)},t.addHook=function(q,f){typeof f=="function"&&ua(de[q],f)},t.removeHook=function(q,f){if(f!==void 0){const y=xf(de[q],f);return y===-1?void 0:Tf(de[q],y,1)[0]}return sl(de[q])},t.removeHooks=function(q){de[q]=[]},t.removeAllHooks=function(){de=gl()},t}var Gf=So();function es(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yr=es();function Ao(e){yr=e}var ur={exec:()=>null};function se(e,t=""){let n=typeof e=="string"?e:e.source,i={replace:(a,s)=>{let l=typeof s=="string"?s:s.source;return l=l.replace(pt.caret,"$1"),n=n.replace(a,l),i},getRegex:()=>new RegExp(n,t)};return i}var Wf=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},jf=/^(?:[ \t]*(?:\n|$))+/,Zf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ia=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ts=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ro=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Co=se(Ro).replace(/bull/g,ts).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vf=se(Ro).replace(/bull/g,ts).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ns=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Kf=/^[^\n]+/,rs=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Jf=se(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rs).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Qf=se(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ts).getRegex(),ai="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",as=/|$))/,ed=se("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",as).replace("tag",ai).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Io=se(ns).replace("hr",Ia).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ai).getRegex(),td=se(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Io).getRegex(),is={blockquote:td,code:Zf,def:Jf,fences:Yf,heading:Xf,hr:Ia,html:ed,lheading:Co,list:Qf,newline:jf,paragraph:Io,table:ur,text:Kf},_l=se("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ia).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ai).getRegex(),nd={...is,lheading:Vf,table:_l,paragraph:se(ns).replace("hr",Ia).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_l).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ai).getRegex()},rd={...is,html:se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",as).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ur,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:se(ns).replace("hr",Ia).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Co).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ad=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,id=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Lo=/^( {2,}|\\)\n(?!\s*$)/,sd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Wf?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Mo=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,fd=se(Mo,"u").replace(/punct/g,Wr).getRegex(),dd=se(Mo,"u").replace(/punct/g,Do).getRegex(),Oo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pd=se(Oo,"gu").replace(/notPunctSpace/g,ss).replace(/punctSpace/g,ii).replace(/punct/g,Wr).getRegex(),hd=se(Oo,"gu").replace(/notPunctSpace/g,cd).replace(/punctSpace/g,od).replace(/punct/g,Do).getRegex(),vd=se("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ss).replace(/punctSpace/g,ii).replace(/punct/g,Wr).getRegex(),gd=se(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Wr).getRegex(),_d="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",md=se(_d,"gu").replace(/notPunctSpace/g,ss).replace(/punctSpace/g,ii).replace(/punct/g,Wr).getRegex(),bd=se(/\\(punct)/,"gu").replace(/punct/g,Wr).getRegex(),kd=se(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),wd=se(as).replace("(?:-->|$)","-->").getRegex(),yd=se("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",wd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xa=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,xd=se(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Xa).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),No=se(/^!?\[(label)\]\[(ref)\]/).replace("label",Xa).replace("ref",rs).getRegex(),Po=se(/^!?\[(ref)\](?:\[\])?/).replace("ref",rs).getRegex(),Td=se("reflink|nolink(?!\\()","g").replace("reflink",No).replace("nolink",Po).getRegex(),ml=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ls={_backpedal:ur,anyPunctuation:bd,autolink:kd,blockSkip:ud,br:Lo,code:id,del:ur,delLDelim:ur,delRDelim:ur,emStrongLDelim:fd,emStrongRDelimAst:pd,emStrongRDelimUnd:vd,escape:ad,link:xd,nolink:Po,punctuation:ld,reflink:No,reflinkSearch:Td,tag:yd,text:sd,url:ur},Ed={...ls,link:se(/^!?\[(label)\]\((.*?)\)/).replace("label",Xa).getRegex(),reflink:se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xa).getRegex()},Hi={...ls,emStrongRDelimAst:hd,emStrongLDelim:dd,delLDelim:gd,delRDelim:md,url:se(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ml).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:se(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},bl=e=>Ad[e];function mn(e,t){if(t){if(pt.escapeTest.test(e))return e.replace(pt.escapeReplace,bl)}else if(pt.escapeTestNoEncode.test(e))return e.replace(pt.escapeReplaceNoEncode,bl);return e}function kl(e){try{e=encodeURI(e).replace(pt.percentDecode,"%")}catch{return null}return e}function wl(e,t){let n=e.replace(pt.findPipe,(s,l,c)=>{let o=!1,u=l;for(;--u>=0&&c[u]==="\\";)o=!o;return o?"|":" |"}),i=n.split(pt.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length0?-2:-1}function Cd(e,t=0){let n=t,i="";for(let a of e)if(a===" "){let s=4-n%4;i+=" ".repeat(s),n+=s}else i+=a,n++;return i}function yl(e,t,n,i,a){let s=t.href,l=t.title||null,c=e[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let o={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:l,text:c,tokens:i.inlineTokens(c)};return i.state.inLink=!1,o}function Id(e,t,n){let i=e.match(n.other.indentCodeCompensation);if(i===null)return t;let a=i[1];return t.split(` +`).map(s=>{let l=s.match(n.other.beginningSpace);if(l===null)return s;let[c]=l;return c.length>=a.length?s.slice(a.length):s}).join(` +`)}var Va=class{options;rules;lexer;constructor(e){this.options=e||yr}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ha(n,` +`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],i=Id(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let i=ha(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ha(t[0],` +`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=ha(t[0],` +`).split(` +`),i="",a="",s=[];for(;n.length>0;){let l=!1,c=[],o;for(o=0;o1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),l=!1;for(;e;){let o=!1,u="",p="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let b=Cd(t[2].split(` +`,1)[0],t[1].length),_=e.split(` +`,1)[0],T=!b.trim(),x=0;if(this.options.pedantic?(x=2,p=b.trimStart()):T?x=t[1].length+1:(x=b.search(this.rules.other.nonSpaceChar),x=x>4?1:x,p=b.slice(x),x+=t[1].length),T&&this.rules.other.blankLine.test(_)&&(u+=_+` +`,e=e.substring(_.length+1),o=!0),!o){let I=this.rules.other.nextBulletRegex(x),E=this.rules.other.hrRegex(x),C=this.rules.other.fencesBeginRegex(x),S=this.rules.other.headingBeginRegex(x),W=this.rules.other.htmlBeginRegex(x),A=this.rules.other.blockquoteBeginRegex(x);for(;e;){let K=e.split(` +`,1)[0],te;if(_=K,this.options.pedantic?(_=_.replace(this.rules.other.listReplaceNesting," "),te=_):te=_.replace(this.rules.other.tabCharGlobal," "),C.test(_)||S.test(_)||W.test(_)||A.test(_)||I.test(_)||E.test(_))break;if(te.search(this.rules.other.nonSpaceChar)>=x||!_.trim())p+=` +`+te.slice(x);else{if(T||b.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(b)||S.test(b)||E.test(b))break;p+=` +`+_}T=!_.trim(),u+=K+` +`,e=e.substring(K.length+1),b=te.slice(x)}}a.loose||(l?a.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(l=!0)),a.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),a.raw+=u}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let o of a.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(o.raw);if(u){let p={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};o.checked=p.checked,a.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=p.raw+o.tokens[0].raw,o.tokens[0].text=p.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(p)):o.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):o.tokens.unshift(p)}}if(!a.loose){let u=o.tokens.filter(b=>b.type==="space"),p=u.length>0&&u.some(b=>this.rules.other.anyLine.test(b.raw));a.loose=p}}if(a.loose)for(let o of a.items){o.loose=!0;for(let u of o.tokens)u.type==="text"&&(u.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:a}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=wl(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(` +`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let l of i)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[o]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===` +`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=ha(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Rd(t[2],"()");if(s===-2)return;if(s>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let i=t[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),yl(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=t[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return yl(n,a,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,l,c=a,o=0,u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+a);(i=u.exec(t))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(l=[...s].length,i[3]||i[4]){c+=l;continue}else if((i[5]||i[6])&&a%3&&!((a+l)%3)){o+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+o);let p=[...i[0]][0].length,b=e.slice(0,a+i.index+p+l);if(Math.min(a,l)%2){let T=b.slice(1,-1);return{type:"em",raw:b,text:T,tokens:this.lexer.inlineTokens(T)}}let _=b.slice(2,-2);return{type:"strong",raw:b,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let i=this.rules.inline.delLDelim.exec(e);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,l,c=a,o=this.rules.inline.delRDelim;for(o.lastIndex=0,t=t.slice(-1*e.length+a);(i=o.exec(t))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s||(l=[...s].length,l!==a))continue;if(i[3]||i[4]){c+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c);let u=[...i[0]][0].length,p=e.slice(0,a+i.index+u+l),b=p.slice(a,-a);return{type:"del",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=t[1],i="mailto:"+n):(n=t[1],i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,i;if(t[2]==="@")n=t[0],i="mailto:"+n;else{let a;do a=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(a!==t[0]);n=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},rn=class $i{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||yr,this.options.tokenizer=this.options.tokenizer||new Va,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:pt,block:qa.normal,inline:pa.normal};this.options.pedantic?(n.block=qa.pedantic,n.inline=pa.pedantic):this.options.gfm&&(n.block=qa.gfm,this.options.breaks?n.inline=pa.breaks:n.inline=pa.gfm),this.tokenizer.rules=n}static get rules(){return{block:qa,inline:pa}}static lex(t,n){return new $i(n).lex(t)}static lexInline(t,n){return new $i(n).inlineTokens(t)}lex(t){t=t.replace(pt.carriageReturn,` +`),this.blockTokens(t,this.tokens);for(let n=0;n(a=l.call({lexer:this},t,n))?(t=t.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);let l=n.at(-1);a.raw.length===1&&l!==void 0?l.raw+=` +`:n.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(` +`)?"":` +`)+a.raw,l.text+=` +`+a.text,this.inlineQueue.at(-1).src=l.text):n.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(` +`)?"":` +`)+a.raw,l.text+=` +`+a.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},n.push(a));continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),n.push(a);continue}let s=t;if(this.options.extensions?.startBlock){let l=1/0,c=t.slice(1),o;this.options.extensions.startBlock.forEach(u=>{o=u.call({lexer:this},c),typeof o=="number"&&o>=0&&(l=Math.min(l,o))}),l<1/0&&l>=0&&(s=t.substring(0,l+1))}if(this.state.top&&(a=this.tokenizer.paragraph(s))){let l=n.at(-1);i&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(` +`)?"":` +`)+a.raw,l.text+=` +`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(a),i=s.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(` +`)?"":` +`)+a.raw,l.text+=` +`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(a);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let i=t,a=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)o.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)s=a[2]?a[2].length:0,i=i.slice(0,a.index+s)+"["+"a".repeat(a[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let l=!1,c="";for(;t;){l||(c=""),l=!1;let o;if(this.options.extensions?.inline?.some(p=>(o=p.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let p=n.at(-1);o.type==="text"&&p?.type==="text"?(p.raw+=o.raw,p.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(t,i,c)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(t,i,c)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),n.push(o);continue}let u=t;if(this.options.extensions?.startInline){let p=1/0,b=t.slice(1),_;this.options.extensions.startInline.forEach(T=>{_=T.call({lexer:this},b),typeof _=="number"&&_>=0&&(p=Math.min(p,_))}),p<1/0&&p>=0&&(u=t.substring(0,p+1))}if(o=this.tokenizer.inlineText(u)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(c=o.raw.slice(-1)),l=!0;let p=n.at(-1);p?.type==="text"?(p.raw+=o.raw,p.text+=o.text):n.push(o);continue}if(t){let p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},Ka=class{options;parser;constructor(e){this.options=e||yr}space(e){return""}code({text:e,lang:t,escaped:n}){let i=(t||"").match(pt.notSpaceStart)?.[0],a=e.replace(pt.endingNewline,"")+` +`;return i?'
    '+(n?a:mn(a,!0))+`
    +`:"
    "+(n?a:mn(a,!0))+`
    +`}blockquote({tokens:e}){return`
    +${this.parser.parse(e)}
    +`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} +`}hr(e){return`
    +`}list(e){let t=e.ordered,n=e.start,i="";for(let l=0;l +`+i+" +`}listitem(e){return`
  • ${this.parser.parse(e.tokens)}
  • +`}checkbox({checked:e}){return" '}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    +`}table(e){let t="",n="";for(let a=0;a${i}`),` + +`+t+` +`+i+`
    +`}tablerow({text:e}){return` +${e} +`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${mn(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let i=this.parser.parseInline(n),a=kl(e);if(a===null)return i;e=a;let s='
    ",s}image({href:e,title:t,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=kl(e);if(a===null)return mn(n);e=a;let s=`${mn(n)}{let l=a[s].flat(1/0);n=n.concat(this.walkTokens(l,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=t.renderers[a.name];s?t.renderers[a.name]=function(...l){let c=a.renderer.apply(this,l);return c===!1&&(c=s.apply(this,l)),c}:t.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[a.level];s?s.unshift(a.tokenizer):t[a.level]=[a.tokenizer],a.start&&(a.level==="block"?t.startBlock?t.startBlock.push(a.start):t.startBlock=[a.start]:a.level==="inline"&&(t.startInline?t.startInline.push(a.start):t.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(t.childTokens[a.name]=a.childTokens)}),i.extensions=t),n.renderer){let a=this.defaults.renderer||new Ka(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let l=s,c=n.renderer[l],o=a[l];a[l]=(...u)=>{let p=c.apply(a,u);return p===!1&&(p=o.apply(a,u)),p||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Va(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let l=s,c=n.tokenizer[l],o=a[l];a[l]=(...u)=>{let p=c.apply(a,u);return p===!1&&(p=o.apply(a,u)),p}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new ba;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let l=s,c=n.hooks[l],o=a[l];ba.passThroughHooks.has(s)?a[l]=u=>{if(this.defaults.async&&ba.passThroughHooksRespectAsync.has(s))return(async()=>{let b=await c.call(a,u);return o.call(a,b)})();let p=c.call(a,u);return o.call(a,p)}:a[l]=(...u)=>{if(this.defaults.async)return(async()=>{let b=await c.apply(a,u);return b===!1&&(b=await o.apply(a,u)),b})();let p=c.apply(a,u);return p===!1&&(p=o.apply(a,u)),p}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(l){let c=[];return c.push(s.call(this,l)),a&&(c=c.concat(a.call(this,l))),c}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return rn.lex(e,t??this.defaults)}parser(e,t){return an.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let l=a.hooks?await a.hooks.preprocess(t):t,c=await(a.hooks?await a.hooks.provideLexer(e):e?rn.lex:rn.lexInline)(l,a),o=a.hooks?await a.hooks.processAllTokens(c):c;a.walkTokens&&await Promise.all(this.walkTokens(o,a.walkTokens));let u=await(a.hooks?await a.hooks.provideParser(e):e?an.parse:an.parseInline)(o,a);return a.hooks?await a.hooks.postprocess(u):u})().catch(s);try{a.hooks&&(t=a.hooks.preprocess(t));let l=(a.hooks?a.hooks.provideLexer(e):e?rn.lex:rn.lexInline)(t,a);a.hooks&&(l=a.hooks.processAllTokens(l)),a.walkTokens&&this.walkTokens(l,a.walkTokens);let c=(a.hooks?a.hooks.provideParser(e):e?an.parse:an.parseInline)(l,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(l){return s(l)}}}onError(e,t){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+mn(n.message+"",!0)+"
    ";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}},br=new Ld;function ke(e,t){return br.parse(e,t)}ke.options=ke.setOptions=function(e){return br.setOptions(e),ke.defaults=br.defaults,Ao(ke.defaults),ke};ke.getDefaults=es;ke.defaults=yr;ke.use=function(...e){return br.use(...e),ke.defaults=br.defaults,Ao(ke.defaults),ke};ke.walkTokens=function(e,t){return br.walkTokens(e,t)};ke.parseInline=br.parseInline;ke.Parser=an;ke.parser=an.parse;ke.Renderer=Ka;ke.TextRenderer=os;ke.Lexer=rn;ke.lexer=rn.lex;ke.Tokenizer=Va;ke.Hooks=ba;ke.parse=ke;ke.options;ke.setOptions;ke.use;ke.walkTokens;ke.parseInline;an.parse;rn.lex;function Dr(e){return Gf.sanitize(ke.parse(e,{async:!1,breaks:!0,gfm:!0}))}function _n(e){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}function jn(e){return`/api/uploads/${encodeURIComponent(e.id)}`}function xl(e){return e.content_type.startsWith("image/")}function Tl(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var Dd=O('
    '),Md=O(''),Od=O(' ',1),Nd=O('
    ',2),Pd=O(' ');function Ti(e,t){Qa(t,!0);let n=rf(t,"onOpenImage",3,()=>{}),i=nn(null),a=nn(!1),s=nn(""),l=Ii(()=>t.upload.content_type?.startsWith("image/")??!1),c=Ii(()=>t.upload.content_type?.startsWith("video/")??!1);function o(){h(a,!0)}function u(){if(!r(i)||!isFinite(r(i).duration))return;const C=Math.floor(r(i).duration),S=Math.floor(C/60),W=C%60;h(s,`${S}:${W.toString().padStart(2,"0")}`)}function p(){r(i)&&(h(a,!0),r(i).play())}function b(C){return C<1024?`${C} B`:C<1024*1024?`${Math.round(C/1024)} KB`:`${(C/(1024*1024)).toFixed(1)} MB`}var _=Qi(),T=Zn(_);{var x=C=>{var S=Dd(),W=d(S),A=d(W),K=v(W,2),te=d(K),fe=d(te),ye=v(te,2);z(()=>{$(W,"aria-label",`Open image ${t.upload.filename}`),$(A,"src",t.url),$(A,"alt",t.upload.filename),M(fe,t.upload.filename),$(ye,"href",t.url),$(ye,"download",t.upload.filename),$(ye,"aria-label",`Download ${t.upload.filename}`)}),G("click",W,()=>n()(t.url,t.upload.filename)),G("click",ye,Me=>Me.stopPropagation()),R(C,S)},I=C=>{var S=Nd();let W;var A=d(S),K=d(A);ja(A,le=>h(i,le),()=>r(i));var te=v(A,2);{var fe=le=>{var me=Od(),Je=Zn(me),Ct=v(Je,2);{var Yt=it=>{var gt=Md(),un=d(gt);z(()=>M(un,r(s))),R(it,gt)};j(Ct,it=>{r(s)&&it(Yt)})}z(()=>$(Je,"aria-label",`Play ${t.upload.filename}`)),G("click",Je,p),R(le,me)};j(te,le=>{r(a)||le(fe)})}var ye=v(te,2),Me=d(ye),_e=d(Me),de=v(Me,2);z(()=>{W=kt(S,1,"media-tile media-tile--video",null,W,{"is-started":r(a)}),A.controls=r(a),$(A,"aria-label",t.upload.filename),$(K,"src",t.url),$(K,"type",t.upload.content_type),M(_e,t.upload.filename),$(de,"href",t.url),$(de,"download",t.upload.filename),$(de,"aria-label",`Download ${t.upload.filename}`)}),Ut("play",A,o),Ut("loadedmetadata",A,u),G("click",de,le=>le.stopPropagation()),R(C,S)},E=C=>{var S=Pd(),W=v(d(S),2),A=d(W),K=d(A),te=v(A,2),fe=d(te);z(ye=>{$(S,"href",t.url),M(K,t.upload.filename),M(fe,ye)},[()=>b(t.upload.byte_size)]),R(C,S)};j(T,C=>{r(l)?C(x):r(c)?C(I,1):C(E,-1)})}R(e,_),ei()}mo(["click"]);var zd=O(''),Fd=O(`
    cc
    ClickClack OpenClaw workspace chat

    Welcome back.

    Workspace chat for the OpenClaw crew. Sign in with the GitHub account that's a member of the org.

    Limited to active members of the OpenClaw org.

    `),Ud=O(''),Bd=O('
    '),Hd=O('
    '),$d=O(''),qd=O(''),Gd=O(''),Wd=O(''),jd=O(''),Zd=O(''),Yd=O(''),Xd=O(''),Vd=O(''),Kd=O(''),Jd=O('

    '),Qd=O('

    '),ep=O('

    ClickClack

    '),tp=O(''),np=O(''),rp=O(''),ap=O('
    '),ip=O('
    Send a message in Markdown — code fences, lists, links all work. Threads open from any message.
    '),sp=O('
    '),lp=O(''),op=O(" "),cp=O(' '),up=O(' '),fp=O(''),dp=O('
    '),pp=O('
    '),hp=O('
    ',1),vp=O(''),gp=O('
    GIFs
    '),_p=O(''),mp=O('
    '),bp=O('
    Replying to
    '),kp=O(''),wp=O(" "),yp=O('
    '),xp=O(''),Tp=O(" "),Ep=O(' '),Sp=O(' '),Ap=O(''),Rp=O('
    '),Cp=O('
    '),Ip=O('
    Replying to
    '),Lp=O('

    Thread

    ',1),Dp=O(''),Mp=O(" "),Op=O(''),Np=O(''),Pp=O(''),zp=O('

    Profile

    Active
    Contact information
    Handle
    User ID
    About

    ',1),Fp=O('
    No thread open Hover any message and tap the bubble to keep side conversations tidy.
    '),Up=O(''),Bp=O("

    "),Hp=O(''),$p=O(''),qp=O('

    ',1);function Gp(e,t){Qa(t,!1);const n=Z(),i=Z(),a=Z(),s=Z(),l=Z(),c=Z(),o=Z();let u=Z(null),p=Z([]),b=Z([]),_=Z([]),T=Z([]),x=Z([]),I=Z(""),E=Z(""),C=Z(""),S=Z(null),W=Z(null),A=Z(null),K=Z(null),te=Z(""),fe=Z(""),ye=Z(""),Me=Z(""),_e=Z(""),de=Z(""),le=Z([]),me=Z(null),Je=Z(!1),Ct=Z(!1),Yt=Z(""),it=Z(""),gt=Z(""),un=Z(""),xn=Z(""),Ie=Z(!1),It=Z("loading"),Pe=Z(!1),fn=null,he=Z(!1),Xt,Vt=Z(null),Tt=Z(!1),Tn=Z(!1),Kt=Z(!1),ce=Z(null),We=Z(null),Lt=Z(null),Jt=Z(null),Le=Z("message");wo(()=>{jr()}),af(()=>{const m=fn;fn=null,h(he,!1),m?.close(),Xt&&window.clearTimeout(Xt)});async function jr(){try{const m=await nt("/api/me");h(u,m.user),await xr(),h(It,"ready")}catch(m){if(m instanceof yo&&(m.status===401||m.status===403)){h(Pe,!0),h(It,"auth");return}h(It,m instanceof Error?m.message:"Could not load ClickClack")}}function On(){r(u)&&(h(it,r(u).display_name),h(gt,r(u).handle?`@${r(u).handle}`:""),h(un,r(u).avatar_url),h(xn,""),h(Ie,!1),h(Ct,!0))}async function Nn(){h(xn,""),h(Ie,!1);try{const m=await nt("/api/me",{method:"PATCH",body:JSON.stringify({display_name:r(it),handle:r(gt),avatar_url:r(un)})});h(u,m.user),h(T,r(T).map(L=>L.author?.id===r(u)?.id?{...L,author:m.user}:L)),h(x,r(x).map(L=>L.author?.id===r(u)?.id?{...L,author:m.user}:L)),r(S)?.author?.id===r(u).id&&h(S,{...r(S),author:m.user}),h(xn,"Saved"),h(Ct,!1)}catch(m){h(xn,m instanceof Error?m.message:"Could not save profile"),h(Ie,!0)}}async function xr(){const m=await nt("/api/workspaces");h(p,m.workspaces),h(I,r(I)||r(p)[0]?.id||""),await tr(),await mt(),r(p).length===0&&h(It,"create a workspace"),Fn()}async function Tr(){if(!r(ye).trim())return;const m=await nt("/api/workspaces",{method:"POST",body:JSON.stringify({name:r(ye)})});h(ye,""),h(Tt,!1),h(p,[...r(p),m.workspace]),h(I,m.workspace.id),await tr(),await mt(),Fn()}async function tr(){if(!r(I))return;const m=await nt(`/api/workspaces/${r(I)}/channels`);h(b,m.channels),h(E,r(b).find(L=>L.id===r(E))?.id||r(b)[0]?.id||""),h(S,null),h(A,null),h(Le,"message"),h(x,[]),await _t()}async function La(){if(!r(I)||!r(Me).trim())return;const m=await nt(`/api/workspaces/${r(I)}/channels`,{method:"POST",body:JSON.stringify({name:r(Me),kind:"public"})});h(Me,""),h(b,[...r(b),m.channel]),h(E,m.channel.id),h(C,""),await _t()}async function _t(){if(r(C)){const L=await nt(`/api/dms/${r(C)}/messages`);h(T,L.messages),await nr();return}if(!r(E)){h(T,[]);return}const m=await nt(`/api/channels/${r(E)}/messages`);h(T,m.messages),await nr()}async function nr(){await Oi(),r(Vt)&&xu(Vt,r(Vt).scrollTop=r(Vt).scrollHeight)}async function Pn(){const m=r(te).trim();if(!m)return;if(!r(E)&&!r(C)){h(It,"pick or create a channel");return}const L=r(C)?"dm":"channel",ue=r(ce)&&r(We)===L?r(ce):null;h(te,"");const Re=r(C)?`/api/dms/${r(C)}/messages`:`/api/channels/${r(E)}/messages`,je={body:m};ue&&(je.quoted_message_id=ue.id);const Dt=await nt(Re,{method:"POST",body:JSON.stringify(je)});let qe=Dt.message;if(ue&&ct(),r(me)){const Mt=r(me);await nt(`/api/messages/${Dt.message.id}/attachments`,{method:"POST",body:JSON.stringify({upload_id:Mt.id})}),h(me,null),qe={...qe,attachments:[...qe.attachments||[],Mt]}}r(T).some(Mt=>Mt.id===qe.id)?h(T,r(T).map(Mt=>Mt.id===qe.id?qe:Mt)):h(T,[...r(T),qe]),await nr()}async function En(m){h(A,null),h(S,m),h(Le,"thread");const L=await nt(`/api/messages/${m.id}/thread`);h(S,L.root),h(x,L.replies),h(W,L.thread_state)}async function Et(){const m=r(fe).trim();if(!m||!r(S))return;const L=r(ce)&&r(We)==="thread"?r(ce):null;h(fe,"");const ue={body:m};L&&(ue.quoted_message_id=L.id);const Re=await nt(`/api/messages/${r(S).id}/thread/replies`,{method:"POST",body:JSON.stringify(ue)});L&&ct(),r(x).some(je=>je.id===Re.message.id)||h(x,[...r(x),Re.message]),h(W,Re.thread_state)}function rr(m,L){h(ce,m),h(We,L),h(Le,L==="thread"?"thread":"message")}function Zr(){return r(K)!==null||r(Ct)}function Da(){return r(Le)==="thread"&&r(S)&&r(Jt)?r(Jt):r(Lt)}function ct(){h(ce,null),h(We,null)}async function Yr(m){const L=m.quoted_message_id;if(!L)return;await Oi();const ue=document.querySelector(`[data-message-id="${CSS.escape(L)}"]`);ue&&(ue.scrollIntoView({behavior:"smooth",block:"center"}),ue.classList.add("highlight"),window.setTimeout(()=>ue.classList.remove("highlight"),1500))}async function Er(){if(!r(I)||!r(de).trim()){h(le,[]);return}const m=await nt(`/api/search?workspace_id=${encodeURIComponent(r(I))}&q=${encodeURIComponent(r(de).trim())}`);h(le,m.results)}async function Sr(m){const L=m.currentTarget,ue=L.files?.[0];if(!ue||!r(I))return;const Re=new FormData;Re.set("workspace_id",r(I)),Re.set("file",ue);const je=await nt("/api/uploads",{method:"POST",body:Re});h(me,je.upload),L.value=""}async function mt(){if(!r(I))return;const m=await nt(`/api/dms?workspace_id=${r(I)}`);h(_,m.conversations)}async function zn(){if(!r(I)||!r(_e).trim())return;const m=await nt("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:r(I),member_ids:[r(_e).trim()]})});h(_e,""),h(_,[...r(_),m.conversation]),h(C,m.conversation.id),h(E,""),h(S,null),h(A,null),h(Le,"message"),await _t()}async function Xr(m){if(!r(I)||!m)return;const L=r(_).find(Re=>Re.members.some(je=>je.id===m));if(L){h(C,L.id),h(E,""),h(S,null),h(A,null),h(Le,"message"),await _t();return}const ue=await nt("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:r(I),member_ids:[m]})});h(_,[...r(_),ue.conversation]),h(C,ue.conversation.id),h(E,""),h(S,null),h(A,null),h(Le,"message"),await _t()}function Fn(){Xt&&window.clearTimeout(Xt);const m=fn;if(fn=null,h(he,!1),m?.close(),!r(I))return;const L=localStorage.getItem(`clickclack:${r(I)}:cursor`)||"",ue=new URL("/api/realtime/ws",window.location.href);ue.protocol=window.location.protocol==="https:"?"wss:":"ws:",ue.searchParams.set("workspace_id",r(I)),L&&ue.searchParams.set("after_cursor",L);const Re=new WebSocket(ue);fn=Re,Re.addEventListener("open",()=>{fn===Re&&h(he,!0)}),Re.addEventListener("message",je=>{const Dt=JSON.parse(String(je.data));Dt.cursor&&localStorage.setItem(`clickclack:${r(I)}:cursor`,Dt.cursor),si(Dt)}),Re.addEventListener("close",()=>{fn===Re&&(h(he,!1),Xt=window.setTimeout(Fn,1200))})}async function si(m){if((m.type==="channel.created"||m.type==="channel.updated")&&m.workspace_id===r(I)){await tr();return}(m.channel_id===r(E)||m.payload.direct_conversation_id===r(C))&&(m.type==="message.created"||m.type==="message.updated"||m.type==="message.deleted")&&await _t();const L=m.payload.root_message_id||m.payload.message_id;r(S)&&L===r(S).id&&await En(r(S))}function ar(m){m&&(h(S,null),h(A,m))}function Vr(m){if(m.key==="Escape"&&r(ce)&&r(We)!=="thread"){m.preventDefault(),ct();return}m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),Pn())}function li(m){if(m.key==="Escape"&&r(ce)&&r(We)==="thread"){m.preventDefault(),ct();return}m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),Et())}function dn(m,L){h(K,{url:m,title:L})}function Ma(m){const L=m.target;L instanceof HTMLImageElement&&L.closest(".markdown")&&(m.preventDefault(),dn(L.currentSrc||L.src,L.alt||"Image"))}function Kr(m){const L=r(te)&&!r(te).endsWith(` +`)?` +`:"";h(te,`${r(te)}${L}${m}`)}function Ae(m,L=m){Kr(`${m}${m==="```"?` +code +`:"text"}${L}`)}function Un(m,L){Kr(`![${L}](${m})`),h(Je,!1),h(Yt,"")}function Jr(){r(We)==="thread"&&ct(),h(S,null),h(A,null),h(Le,"message"),h(x,[])}function Sn(){h(K,null),h(Ct,!1)}vn(()=>(r(p),r(I)),()=>{h(n,r(p).find(m=>m.id===r(I)))}),vn(()=>(r(b),r(E)),()=>{h(i,r(b).find(m=>m.id===r(E)))}),vn(()=>(r(_),r(C)),()=>{h(a,r(_).find(m=>m.id===r(C)))}),vn(()=>(r(S),r(A)),()=>{h(s,r(S)!==null||r(A)!==null)}),vn(()=>r(T),()=>{h(l,uf(r(T)))}),vn(()=>(r(T),r(_),r(u)),()=>{h(c,ff(r(T),r(_),r(u)?.id||""))}),vn(()=>(r(We),r(ce),r(T)),()=>{r(We)==="channel"&&r(ce)&&!r(T).some(m=>m.id===r(ce)?.id)&&ct()}),vn(()=>(r(We),r(ce),r(T)),()=>{r(We)==="dm"&&r(ce)&&!r(T).some(m=>m.id===r(ce)?.id)&&ct()}),vn(()=>(r(We),r(ce),r(S),r(x)),()=>{r(We)==="thread"&&r(ce)&&r(S)&&r(ce).id!==r(S).id&&!r(x).some(m=>m.id===r(ce)?.id)&&ct()}),vn(()=>r(Yt),()=>{h(o,of.filter(m=>{const L=r(Yt).trim().toLowerCase();return!L||m.title.toLowerCase().includes(L)||m.tags.some(ue=>ue.includes(L))}))}),Du(),ko();var Ar=Qi();bo("1oa2eo8",m=>{var L=zd();R(m,L)}),Ut("keydown",Di,m=>{if(m.key==="Escape"){if(Zr())Sn();else if(r(ce)){m.preventDefault(),ct();return}}bf(m,{authRequired:r(Pe),isModalOpen:Zr,messageInput:r(Lt),replyInput:r(Jt),target:Da})});var Oa=Zn(Ar);{var Na=m=>{var L=Fd();R(m,L)},oi=m=>{var L=qp(),ue=Zn(L);let Re;var je=d(ue),Dt=d(je);{var qe=w=>{var k=ft("×");R(w,k)},Mt=w=>{var k=Ud();R(w,k)};j(Dt,w=>{r(Kt)?w(qe):w(Mt,-1)})}var Qr=v(je,2),Pa=v(d(Qr),4),ea=d(Pa);At(ea,1,()=>r(p),w=>w.id,(w,k)=>{var F=Bd();let Y;var ie=d(F),Q=d(ie),ee=d(Q);z(ae=>{Y=kt(F,1,"guild-wrap",null,Y,{active:r(k).id===r(I)}),$(ie,"title",(r(k),g(()=>r(k).name))),M(ee,ae)},[()=>(P(nl),r(k),g(()=>nl(r(k).name)))]),G("click",ie,async()=>{h(I,r(k).id),await tr(),await mt(),Fn()}),R(w,F)});var za=v(ea,2),Fa=v(Pa,2);{var q=w=>{var k=Hd(),F=d(k);Ut("submit",k,Y=>{Y.preventDefault(),Tr()}),gn(F,()=>r(ye),Y=>h(ye,Y)),R(w,k)};j(Fa,w=>{r(Tt)&&w(q)})}var f=v(Qr,2),y=d(f),N=d(y),be=d(N),Ze=d(be),De=v(be,2);let Qe;var bt=d(De),st=v(N,2),ta=d(st),ze=d(ta),na=v(y,2),ra=d(na),cs=v(d(ra),2),us=d(cs);At(us,1,()=>r(b),w=>w.id,(w,k)=>{var F=$d();let Y;var ie=v(d(F),2),Q=d(ie);z(()=>{Y=kt(F,1,"nav-item channel",null,Y,{active:r(k).id===r(E)&&!r(C)}),M(Q,(r(k),g(()=>r(k).name)))}),G("click",F,async()=>{h(E,r(k).id),h(C,""),h(S,null),h(A,null),h(Le,"message"),h(Kt,!1),await _t()}),R(w,F)});var zo=v(us,2);{var Fo=w=>{var k=qd();R(w,k)};j(zo,w=>{r(b),g(()=>r(b).length===0)&&w(Fo)})}var fs=v(cs,2),Uo=d(fs),ds=v(ra,2),ps=v(d(ds),2),hs=d(ps);At(hs,1,()=>r(_),w=>w.id,(w,k)=>{const F=cr(()=>(P(rl),r(k),r(u),g(()=>rl(r(k),r(u)?.id))));var Y=Wd();let ie;var Q=d(Y),ee=d(Q);{var ae=U=>{var V=Gd();z(()=>$(V,"src",(P(r(F)),g(()=>r(F).avatar_url)))),R(U,V)},B=U=>{var V=ft();z(Fe=>M(V,Fe),[()=>(P(Xe),P(r(F)),g(()=>Xe(r(F)?.display_name)))]),R(U,V)};j(ee,U=>{P(r(F)),g(()=>r(F)?.avatar_url)?U(ae):U(B,-1)})}var pe=v(Q,2),xe=d(pe);z((U,V)=>{ie=kt(Y,1,"nav-item dm",null,ie,{active:r(k).id===r(C)}),Ln(Q,`--hue: ${U??""}deg`),M(xe,V)},[()=>(P(Ve),P(r(F)),r(k),g(()=>Ve(r(F)?.id||r(k).id))),()=>(P(Wn),r(k),r(u),g(()=>Wn(r(k),r(u)?.id)))]),G("click",Y,async()=>{h(C,r(k).id),h(E,""),h(S,null),h(A,null),h(Le,"message"),h(Kt,!1),await _t()}),R(w,Y)});var Bo=v(hs,2);{var Ho=w=>{var k=jd();R(w,k)};j(Bo,w=>{r(_),g(()=>r(_).length===0)&&w(Ho)})}var vs=v(ps,2),$o=d(vs),qo=v(ds,2),Go=v(d(qo),2),gs=d(Go);At(gs,1,()=>r(c),w=>w.id,(w,k)=>{const F=cr(()=>(P(al),r(_),r(k),g(()=>al(r(_),r(k).id))));var Y=Yd();let ie;var Q=d(Y),ee=d(Q);{var ae=U=>{var V=Zd();z(()=>$(V,"src",(r(k),g(()=>r(k).avatar_url)))),R(U,V)},B=U=>{var V=ft();z(Fe=>M(V,Fe),[()=>(P(Xe),r(k),g(()=>Xe(r(k).display_name)))]),R(U,V)};j(ee,U=>{r(k),g(()=>r(k).avatar_url)?U(ae):U(B,-1)})}var pe=v(Q,2),xe=d(pe);z(U=>{ie=kt(Y,1,"nav-item dm",null,ie,{active:r(F)?.id===r(C)||r(A)?.id===r(k).id}),Ln(Q,`--hue: ${U??""}deg`),M(xe,(r(k),g(()=>r(k).display_name)))},[()=>(P(Ve),r(k),g(()=>Ve(r(k).id)))]),G("click",Y,async()=>{r(F)?(h(C,r(F).id),h(E,""),h(S,null),h(A,null),h(Le,"message"),h(Kt,!1),await _t()):ar(r(k))}),R(w,Y)});var Wo=v(gs,2);{var jo=w=>{var k=Xd();R(w,k)};j(Wo,w=>{r(c),g(()=>r(c).length===0)&&w(jo)})}var Zo=v(na,2);{var Yo=w=>{var k=Kd(),F=d(k),Y=d(F);{var ie=U=>{var V=Vd();z(()=>$(V,"src",(r(u),g(()=>r(u).avatar_url)))),R(U,V)},Q=U=>{var V=ft();z(Fe=>M(V,Fe),[()=>(P(Xe),r(u),g(()=>Xe(r(u).display_name)))]),R(U,V)};j(Y,U=>{r(u),g(()=>r(u).avatar_url)?U(ie):U(Q,-1)})}var ee=v(F,2),ae=d(ee),B=d(ae),pe=v(ae,2),xe=d(pe);z((U,V,Fe)=>{$(k,"aria-label",U),Ln(F,`--hue: ${V??""}deg`),M(B,(r(u),g(()=>r(u).display_name))),M(xe,Fe)},[()=>(r(u),P(lt),g(()=>`Account settings for ${r(u).display_name} ${lt(r(u).handle)}`)),()=>(P(Ve),r(u),g(()=>Ve(r(u).id))),()=>(r(u),P(lt),r(he),g(()=>r(u).handle?lt(r(u).handle):r(he)?"Active":"Reconnecting…"))]),G("click",k,On),G("contextmenu",k,U=>{U.preventDefault(),On()}),R(w,k)};j(Zo,w=>{r(u)&&w(Yo)})}var _s=v(f,2),ms=d(_s),bs=d(ms),ks=d(bs);{var Xo=w=>{var k=Jd(),F=d(k);z(Y=>M(F,Y),[()=>(P(Wn),r(a),r(u),g(()=>`@${Wn(r(a),r(u)?.id)}`))]),R(w,k)},Vo=w=>{var k=Qd(),F=d(k);z(()=>M(F,(r(i),g(()=>`#${r(i).name}`)))),R(w,k)},Ko=w=>{var k=ep();R(w,k)};j(ks,w=>{r(a)?w(Xo):r(i)?w(Vo,1):w(Ko,-1)})}var Jo=v(ks,4),Qo=d(Jo),ci=v(bs,2),ws=v(d(ci),2),ec=v(ws,2);{var tc=w=>{var k=tp();G("click",k,()=>{h(de,""),h(le,[])}),R(w,k)};j(ec,w=>{r(de)&&w(tc)})}var nc=v(ci,2),aa=d(nc);let ys;var rc=v(aa,2),xs=v(ms,2);{var ac=w=>{var k=ap(),F=d(k),Y=d(F),ie=d(Y),Q=v(Y,2),ee=v(F,2);At(ee,1,()=>r(le),ae=>ae.message.id,(ae,B)=>{var pe=rp(),xe=d(pe),U=d(xe);{var V=Te=>{var Ye=np();z(()=>$(Ye,"src",(r(B),g(()=>r(B).message.author.avatar_url)))),R(Te,Ye)},Fe=Te=>{var Ye=ft();z(pn=>M(Ye,pn),[()=>(P(Xe),r(B),g(()=>Xe(r(B).message.author?.display_name)))]),R(Te,Ye)};j(U,Te=>{r(B),g(()=>r(B).message.author?.avatar_url)?Te(V):Te(Fe,-1)})}var Ot=v(xe,2),Nt=d(Ot),Qt=d(Nt),en=d(Qt),An=v(Qt,2),ve=d(An),H=v(Nt,2),et=d(H);z((Te,Ye)=>{Ln(xe,`--hue: ${Te??""}deg`),M(en,(r(B),g(()=>r(B).message.author?.display_name||"Local User"))),M(ve,Ye),M(et,(r(B),g(()=>r(B).message.body)))},[()=>(P(Ve),r(B),g(()=>Ve(r(B).message.author?.id||r(B).message.author_id||"x"))),()=>(P(_n),r(B),g(()=>_n(r(B).message.created_at)))]),G("click",pe,async()=>{h(le,[]),r(B).message.channel_id&&(h(E,r(B).message.channel_id),h(C,""),await _t()),r(B).message.direct_conversation_id&&(h(C,r(B).message.direct_conversation_id),h(E,""),await _t())}),R(ae,pe)}),z(()=>M(ie,`${r(le),g(()=>r(le).length)??""} ${r(le),g(()=>r(le).length===1?"result":"results")??""}`)),G("click",Q,()=>{h(le,[])}),R(w,k)};j(xs,w=>{r(le),g(()=>r(le).length>0)&&w(ac)})}var ia=v(xs,2),Ts=d(ia);{var ic=w=>{var k=ip(),F=d(k),Y=d(F);{var ie=U=>{var V=ft("@");R(U,V)},Q=U=>{var V=ft("#");R(U,V)};j(Y,U=>{r(a)?U(ie):U(Q,-1)})}var ee=v(F,2),ae=d(ee);{var B=U=>{var V=ft();z(Fe=>M(V,`This is the start of your conversation with ${Fe??""}.`),[()=>(P(Wn),r(a),r(u),g(()=>Wn(r(a),r(u)?.id)))]),R(U,V)},pe=U=>{var V=ft();z(()=>M(V,`Welcome to #${r(i),g(()=>r(i).name)??""}!`)),R(U,V)},xe=U=>{var V=ft("Pick a channel to get started.");R(U,V)};j(ae,U=>{r(a)?U(B):r(i)?U(pe,1):U(xe,-1)})}R(w,k)};j(Ts,w=>{r(T),g(()=>r(T).length===0)&&w(ic)})}var sc=v(Ts,2);At(sc,1,()=>r(l),w=>w.key,(w,k)=>{var F=hp(),Y=Zn(F);{var ie=ve=>{var H=sp(),et=d(H),Te=d(et);z(()=>M(Te,(r(k),g(()=>r(k).dayLabel)))),R(ve,H)};j(Y,ve=>{r(k),g(()=>r(k).dayLabel)&&ve(ie)})}var Q=v(Y,2),ee=d(Q),ae=d(ee);{var B=ve=>{var H=lp();z(()=>$(H,"src",(r(k),g(()=>r(k).authorAvatarURL)))),R(ve,H)},pe=ve=>{var H=ft();z(et=>M(H,et),[()=>(P(Xe),r(k),g(()=>Xe(r(k).authorName)))]),R(ve,H)};j(ae,ve=>{r(k),g(()=>r(k).authorAvatarURL)?ve(B):ve(pe,-1)})}var xe=v(ee,2),U=d(xe),V=d(U),Fe=d(V),Ot=v(V,2);{var Nt=ve=>{var H=op(),et=d(H);z(Te=>M(et,Te),[()=>(P(lt),r(k),g(()=>lt(r(k).authorHandle)))]),R(ve,H)};j(Ot,ve=>{r(k),g(()=>r(k).authorHandle)&&ve(Nt)})}var Qt=v(Ot,2),en=d(Qt),An=v(U,2);At(An,3,()=>(r(k),g(()=>r(k).messages)),ve=>ve.id,(ve,H,et)=>{var Te=pp();let Ye;var pn=d(Te),Bn=d(pn),Rn=v(pn,2),we=d(Rn);{var tt=St=>{var X=fp();let D;var Ce=v(d(X),2),Ge=d(Ce),Cn=d(Ge),ge=v(Ge,2);{var Ee=ut=>{var zt=cp(),la=d(zt);z(Ir=>M(la,Ir),[()=>(P(Ft),r(H),g(()=>Ft(r(H).quoted_body_snapshot)))]),R(ut,zt)},In=ut=>{var zt=up(),la=d(zt);z(Ir=>M(la,`[original deleted] ${Ir??""}`),[()=>(P(Ft),r(H),g(()=>Ft(r(H).quoted_body_snapshot)))]),R(ut,zt)};j(ge,ut=>{r(H),g(()=>r(H).quoted_message_id)?ut(Ee):ut(In,-1)})}z((ut,zt)=>{D=kt(X,1,"quote-block",null,D,{dangling:!r(H).quoted_message_id}),X.disabled=(r(H),g(()=>!r(H).quoted_message_id)),$(X,"aria-label",ut),M(Cn,zt)},[()=>(r(H),P(Gn),g(()=>r(H).quoted_message_id?`Jump to quoted message from ${Gn(r(H))}`:"Original message was deleted")),()=>(P(Gn),r(H),g(()=>Gn(r(H))))]),G("click",X,()=>Yr(r(H))),R(St,X)};j(we,St=>{r(H),g(()=>r(H).quoted_message_id||r(H).quoted_body_snapshot)&&St(tt)})}var Pt=v(we,2);gi(Pt,()=>(P(Dr),r(H),g(()=>Dr(r(H).body))),!0);var Hn=v(Pt,2);{var Rr=St=>{var X=dp();At(X,5,()=>(r(H),g(()=>r(H).attachments)),D=>D.id,(D,Ce)=>{{let Ge=cr(()=>(P(jn),r(Ce),g(()=>jn(r(Ce)))));Ti(D,{get upload(){return r(Ce)},get url(){return r(Ge)},onOpenImage:dn})}}),R(St,X)};j(Hn,St=>{r(H),g(()=>r(H).attachments?.length)&&St(Rr)})}var sa=v(Rn,2),Cr=d(sa),tn=v(Cr,2);z((St,X)=>{Ye=kt(Te,1,"message-row",null,Ye,{selected:r(S)?.id===r(H).id}),$(Te,"data-message-id",(r(H),g(()=>r(H).id))),M(Bn,St),$(tn,"data-tooltip",X)},[()=>(P(r(et)),P(_n),r(H),g(()=>r(et)===0?"":_n(r(H).created_at))),()=>(P(tl),r(H),r(S),g(()=>tl(r(H),r(S)?.id)))]),G("click",Cr,()=>rr(r(H),r(C)?"dm":"channel")),G("click",tn,()=>En(r(H))),R(ve,Te)}),z((ve,H)=>{Ln(ee,`--hue: ${ve??""}deg`),$(ee,"aria-label",(r(k),g(()=>`View profile for ${r(k).authorName}`))),M(Fe,(r(k),g(()=>r(k).authorName))),M(en,H)},[()=>(P(Ve),r(k),g(()=>Ve(r(k).authorID))),()=>(P(_n),r(k),g(()=>_n(r(k).timestamp)))]),G("click",ee,()=>ar(r(k).messages[0]?.author)),G("click",V,()=>ar(r(k).messages[0]?.author)),R(w,F)}),ja(ia,w=>h(Vt,w),()=>r(Vt));var Es=v(ia,2),Ss=d(Es);{var lc=w=>{var k=gp(),F=d(k),Y=v(d(F),2),ie=v(F,2);At(ie,5,()=>r(o),Q=>Q.url,(Q,ee)=>{var ae=vp(),B=d(ae),pe=v(B,2),xe=d(pe);z(()=>{$(B,"src",(r(ee),g(()=>r(ee).url))),$(B,"alt",(r(ee),g(()=>r(ee).title))),M(xe,(r(ee),g(()=>r(ee).title)))}),G("click",ae,()=>Un(r(ee).url,r(ee).title)),R(Q,ae)}),gn(Y,()=>r(Yt),Q=>h(Yt,Q)),R(w,k)};j(Ss,w=>{r(Je)&&w(lc)})}var oc=v(Ss,2),As=d(oc);{var cc=w=>{var k=mp(),F=v(d(k),2);{var Y=B=>{var pe=_p();z(xe=>{$(pe,"src",xe),$(pe,"alt",(r(me),g(()=>r(me).filename)))},[()=>(P(jn),r(me),g(()=>jn(r(me))))]),R(B,pe)},ie=Ii(()=>(P(xl),r(me),g(()=>xl(r(me)))));j(F,B=>{r(ie)&&B(Y)})}var Q=v(F,2),ee=d(Q),ae=v(Q,2);z(B=>M(ee,`${r(me),g(()=>r(me).filename)??""} · ${B??""}`),[()=>(P(Tl),r(me),g(()=>Tl(r(me).byte_size)))]),G("click",ae,()=>h(me,null)),R(w,k)};j(As,w=>{r(me)&&w(cc)})}var Rs=v(As,2);{var uc=w=>{var k=bp(),F=v(d(k),2),Y=d(F),ie=v(d(Y)),Q=d(ie),ee=v(Y,2),ae=d(ee),B=v(F,2);z(pe=>{M(Q,(r(ce),g(()=>r(ce).author?.display_name||"Local User"))),M(ae,pe)},[()=>(P(Ft),r(ce),g(()=>Ft(r(ce).body)))]),G("click",B,ct),R(w,k)};j(Rs,w=>{r(ce)&&r(We)===(r(C)?"dm":"channel")&&w(uc)})}var Cs=v(Rs,2),Is=d(Cs),fc=d(Is),ir=v(Is,2);ja(ir,w=>h(Lt,w),()=>r(Lt)),Ta(()=>gn(ir,()=>r(te),w=>h(te,w))),Xs(ir,(w,k)=>el?.(w),()=>r(te));var dc=v(ir,2),pc=v(Cs,2),Ls=d(pc),Ds=v(Ls,2),ui=v(Ds,2),hc=d(ui);hc.textContent="<>";var fi=v(ui,2),vc=d(fi);vc.textContent="{}";var Ms=v(fi,2),Os=v(Ms,2);let Ns;var di=v(_s,2);let Ps;var gc=d(di);{var _c=w=>{var k=Lp(),F=Zn(k),Y=d(F),ie=v(d(Y),2),Q=d(ie),ee=v(Y,2),ae=v(F,2),B=d(ae),pe=d(B),xe=d(pe);{var U=X=>{var D=kp();z(()=>$(D,"src",(r(S),g(()=>r(S).author.avatar_url)))),R(X,D)},V=X=>{var D=ft();z(Ce=>M(D,Ce),[()=>(P(Xe),r(S),g(()=>Xe(r(S).author?.display_name)))]),R(X,D)};j(xe,X=>{r(S),g(()=>r(S).author?.avatar_url)?X(U):X(V,-1)})}var Fe=v(pe,2),Ot=d(Fe),Nt=d(Ot),Qt=d(Nt),en=v(Nt,2);{var An=X=>{var D=wp(),Ce=d(D);z(Ge=>M(Ce,Ge),[()=>(P(lt),r(S),g(()=>lt(r(S).author.handle)))]),R(X,D)};j(en,X=>{r(S),g(()=>r(S).author?.handle)&&X(An)})}var ve=v(en,2),H=d(ve),et=v(ve,2),Te=v(Ot,2);gi(Te,()=>(P(Dr),r(S),g(()=>Dr(r(S).body))),!0);var Ye=v(Te,2);{var pn=X=>{var D=yp();At(D,5,()=>(r(S),g(()=>r(S).attachments)),Ce=>Ce.id,(Ce,Ge)=>{{let Cn=cr(()=>(P(jn),r(Ge),g(()=>jn(r(Ge)))));Ti(Ce,{get upload(){return r(Ge)},get url(){return r(Cn)},onOpenImage:dn})}}),R(X,D)};j(Ye,X=>{r(S),g(()=>r(S).attachments?.length)&&X(pn)})}var Bn=v(B,2),Rn=d(Bn),we=d(Rn),tt=v(Bn,2);At(tt,5,()=>r(x),X=>X.id,(X,D)=>{var Ce=Cp(),Ge=d(Ce),Cn=d(Ge);{var ge=Ue=>{var Be=xp();z(()=>$(Be,"src",(r(D),g(()=>r(D).author.avatar_url)))),R(Ue,Be)},Ee=Ue=>{var Be=ft();z(hn=>M(Be,hn),[()=>(P(Xe),r(D),g(()=>Xe(r(D).author?.display_name)))]),R(Ue,Be)};j(Cn,Ue=>{r(D),g(()=>r(D).author?.avatar_url)?Ue(ge):Ue(Ee,-1)})}var In=v(Ge,2),ut=d(In),zt=d(ut),la=d(zt),Ir=v(zt,2);{var xc=Ue=>{var Be=Tp(),hn=d(Be);z(sr=>M(hn,sr),[()=>(P(lt),r(D),g(()=>lt(r(D).author.handle)))]),R(Ue,Be)};j(Ir,Ue=>{r(D),g(()=>r(D).author?.handle)&&Ue(xc)})}var Fs=v(Ir,2),Tc=d(Fs),Ec=v(Fs,2),Us=v(ut,2);{var Sc=Ue=>{var Be=Ap();let hn;var sr=v(d(Be),2),Ua=d(sr),Cc=d(Ua),Ic=v(Ua,2);{var Lc=$n=>{var lr=Ep(),pi=d(lr);z(hi=>M(pi,hi),[()=>(P(Ft),r(D),g(()=>Ft(r(D).quoted_body_snapshot)))]),R($n,lr)},Dc=$n=>{var lr=Sp(),pi=d(lr);z(hi=>M(pi,`[original deleted] ${hi??""}`),[()=>(P(Ft),r(D),g(()=>Ft(r(D).quoted_body_snapshot)))]),R($n,lr)};j(Ic,$n=>{r(D),g(()=>r(D).quoted_message_id)?$n(Lc):$n(Dc,-1)})}z(($n,lr)=>{hn=kt(Be,1,"quote-block",null,hn,{dangling:!r(D).quoted_message_id}),Be.disabled=(r(D),g(()=>!r(D).quoted_message_id)),$(Be,"aria-label",$n),M(Cc,lr)},[()=>(r(D),P(Gn),g(()=>r(D).quoted_message_id?`Jump to quoted message from ${Gn(r(D))}`:"Original message was deleted")),()=>(P(Gn),r(D),g(()=>Gn(r(D))))]),G("click",Be,()=>Yr(r(D))),R(Ue,Be)};j(Us,Ue=>{r(D),g(()=>r(D).quoted_message_id||r(D).quoted_body_snapshot)&&Ue(Sc)})}var Bs=v(Us,2);gi(Bs,()=>(P(Dr),r(D),g(()=>Dr(r(D).body))),!0);var Ac=v(Bs,2);{var Rc=Ue=>{var Be=Rp();At(Be,5,()=>(r(D),g(()=>r(D).attachments)),hn=>hn.id,(hn,sr)=>{{let Ua=cr(()=>(P(jn),r(sr),g(()=>jn(r(sr)))));Ti(hn,{get upload(){return r(sr)},get url(){return r(Ua)},onOpenImage:dn})}}),R(Ue,Be)};j(Ac,Ue=>{r(D),g(()=>r(D).attachments?.length)&&Ue(Rc)})}z((Ue,Be)=>{$(Ce,"data-message-id",(r(D),g(()=>r(D).id))),Ln(Ge,`--hue: ${Ue??""}deg`),M(la,(r(D),g(()=>r(D).author?.display_name||"Local User"))),M(Tc,Be)},[()=>(P(Ve),r(D),g(()=>Ve(r(D).author?.id||r(D).author_id||"x"))),()=>(P(_n),r(D),g(()=>_n(r(D).created_at)))]),G("click",Ec,()=>rr(r(D),"thread")),R(X,Ce)});var Pt=v(ae,2),Hn=d(Pt),Rr=d(Hn);{var sa=X=>{var D=Ip(),Ce=v(d(D),2),Ge=d(Ce),Cn=v(d(Ge)),ge=d(Cn),Ee=v(Ge,2),In=d(Ee),ut=v(Ce,2);z(zt=>{M(ge,(r(ce),g(()=>r(ce).author?.display_name||"Local User"))),M(In,zt)},[()=>(P(Ft),r(ce),g(()=>Ft(r(ce).body)))]),G("click",ut,ct),R(X,D)};j(Rr,X=>{r(ce)&&r(We)==="thread"&&X(sa)})}var Cr=v(Rr,2),tn=d(Cr);ja(tn,X=>h(Jt,X),()=>r(Jt)),Ta(()=>gn(tn,()=>r(fe),X=>h(fe,X))),Xs(tn,(X,D)=>el?.(X),()=>r(fe));var St=v(tn,2);z((X,D,Ce)=>{M(Q,`${r(W),r(x),g(()=>r(W)?.reply_count??r(x).length)??""} ${r(W),r(x),g(()=>(r(W)?.reply_count??r(x).length)===1?"reply":"replies")??""}`),$(B,"data-message-id",(r(S),g(()=>r(S).id))),Ln(pe,`--hue: ${X??""}deg`),M(Qt,(r(S),g(()=>r(S).author?.display_name||"Local User"))),M(H,D),M(we,`${r(x),g(()=>r(x).length)??""} ${r(x),g(()=>r(x).length===1?"reply":"replies")??""}`),St.disabled=Ce},[()=>(P(Ve),r(S),g(()=>Ve(r(S).author?.id||r(S).author_id||"x"))),()=>(P(_n),r(S),g(()=>_n(r(S).created_at))),()=>(r(fe),g(()=>!r(fe).trim()))]),G("click",ee,()=>{Jr()}),G("pointerdown",ae,()=>h(Le,"thread")),G("pointerup",ae,Ma),G("click",et,()=>r(S)&&rr(r(S),"thread")),Ut("submit",Pt,X=>{X.preventDefault(),Et()}),Ut("focus",tn,()=>h(Le,"thread")),G("keydown",tn,li),R(w,k)},mc=w=>{var k=zp(),F=Zn(k),Y=d(F),ie=v(d(Y),2),Q=d(ie),ee=v(Y,2),ae=v(F,2),B=d(ae),pe=d(B),xe=d(pe);{var U=ge=>{var Ee=Dp();z(()=>$(Ee,"src",(r(A),g(()=>r(A).avatar_url)))),R(ge,Ee)},V=ge=>{var Ee=ft();z(In=>M(Ee,In),[()=>(P(Xe),r(A),g(()=>Xe(r(A).display_name)))]),R(ge,Ee)};j(xe,ge=>{r(A),g(()=>r(A).avatar_url)?ge(U):ge(V,-1)})}var Fe=v(B,2),Ot=d(Fe),Nt=d(Ot),Qt=d(Nt),en=d(Qt),An=v(Qt,2);{var ve=ge=>{var Ee=Mp(),In=d(Ee);z(ut=>M(In,ut),[()=>(P(lt),r(A),g(()=>lt(r(A).handle)))]),R(ge,Ee)};j(An,ge=>{r(A),g(()=>r(A).handle)&&ge(ve)})}var H=v(Nt,2);{var et=ge=>{var Ee=Op();G("click",Ee,On),R(ge,Ee)};j(H,ge=>{r(u),r(A),g(()=>r(u)?.id===r(A).id)&&ge(et)})}var Te=v(Ot,4),Ye=d(Te);{var pn=ge=>{var Ee=Np();G("click",Ee,()=>Xr(r(A)?.id||"")),R(ge,Ee)};j(Ye,ge=>{r(u),r(A),g(()=>r(u)?.id!==r(A).id)&&ge(pn)})}var Bn=v(Ye,2),Rn=v(Te,2),we=d(Rn),tt=v(d(we),2);{var Pt=ge=>{var Ee=Pp();G("click",Ee,On),R(ge,Ee)};j(tt,ge=>{r(u),r(A),g(()=>r(u)?.id===r(A).id)&&ge(Pt)})}var Hn=v(we,2),Rr=v(d(Hn),2),sa=v(d(Rr),2),Cr=d(sa),tn=v(Hn,2),St=v(d(tn),2),X=v(d(St),2),D=d(X),Ce=v(Rn,2),Ge=v(d(Ce),2),Cn=d(Ge);z((ge,Ee)=>{M(Q,(r(A),g(()=>r(A).display_name))),Ln(B,`--hue: ${ge??""}deg`),M(en,(r(A),g(()=>r(A).display_name))),M(Cr,Ee),M(D,(r(A),g(()=>r(A).id))),M(Cn,`Member of ${r(n),g(()=>r(n)?.name||"this workspace")??""}. Click Message to keep the conversation in your sidebar.`)},[()=>(P(Ve),r(A),g(()=>Ve(r(A).id))),()=>(r(A),P(lt),g(()=>r(A).handle?lt(r(A).handle):"No handle set"))]),G("click",ee,Jr),G("click",Bn,()=>h(It,"status messages are coming soon")),R(w,k)},bc=w=>{var k=Fp();R(w,k)};j(gc,w=>{r(S)?w(_c):r(A)?w(mc,1):w(bc,-1)})}var zs=v(ue,2);{var kc=w=>{var k=Hp(),F=d(k),Y=v(F,2),ie=d(Y),Q=v(d(ie),2),ee=v(ie,2),ae=d(ee),B=d(ae),pe=d(B);{var xe=we=>{var tt=Up();z(()=>$(tt,"src",r(un))),R(we,tt)},U=we=>{var tt=ft();z(Pt=>M(tt,Pt),[()=>(P(Xe),r(it),g(()=>Xe(r(it))))]),R(we,tt)};j(pe,we=>{r(un)?we(xe):we(U,-1)})}var V=v(B,2),Fe=d(V),Ot=d(Fe),Nt=v(Fe,2),Qt=d(Nt),en=v(ae,2),An=v(d(en),2),ve=v(en,2),H=v(d(ve),2),et=v(ve,2),Te=v(d(et),2),Ye=v(et,2);{var pn=we=>{var tt=Bp();let Pt;var Hn=d(tt);z(()=>{Pt=kt(tt,1,"profile-status",null,Pt,{error:r(Ie)}),M(Hn,r(xn))}),R(we,tt)};j(Ye,we=>{r(xn)&&we(pn)})}var Bn=v(Ye,2),Rn=d(Bn);z((we,tt)=>{Ln(B,`--hue: ${we??""}deg`),M(Ot,(r(it),r(u),g(()=>r(it)||r(u).display_name))),M(Qt,tt)},[()=>(P(Ve),r(u),g(()=>Ve(r(u).id))),()=>(r(gt),P(lt),r(u),g(()=>r(gt)||lt(r(u).handle)||"No handle set"))]),G("click",F,Sn),G("click",Q,Sn),Ut("submit",ee,we=>{we.preventDefault(),Nn()}),gn(An,()=>r(it),we=>h(it,we)),gn(H,()=>r(gt),we=>h(gt,we)),gn(Te,()=>r(un),we=>h(un,we)),G("click",Rn,Sn),R(w,k)};j(zs,w=>{r(Ct)&&r(u)&&w(kc)})}var wc=v(zs,2);{var yc=w=>{var k=$p(),F=d(k),Y=v(F,2),ie=d(Y),Q=d(ie),ee=d(Q),ae=v(Q,2),B=d(ae),pe=v(B,2),xe=v(ie,2),U=d(xe);z(()=>{M(ee,(r(K),g(()=>r(K).title))),$(B,"href",(r(K),g(()=>r(K).url))),$(U,"src",(r(K),g(()=>r(K).url))),$(U,"alt",(r(K),g(()=>r(K).title)))}),G("click",F,Sn),G("click",pe,Sn),R(w,k)};j(wc,w=>{r(K)&&w(yc)})}z((w,k)=>{Re=kt(ue,1,"shell",null,Re,{"nav-open":r(Kt),"sidebar-collapsed":r(Tn),"thread-open":r(s)}),M(Ze,(r(n),g(()=>r(n)?.name||"Pick a workspace"))),Qe=kt(De,1,"presence",null,Qe,{online:r(he)}),M(bt,r(he)?"Connected":r(It)),$(st,"aria-label",r(Tn)?"Expand sidebar":"Collapse sidebar"),$(st,"title",r(Tn)?"Expand sidebar":"Collapse sidebar"),$(ze,"d",r(Tn)?"m9 6 6 6-6 6":"m15 6-6 6 6 6"),M(Qo,(r(n),g(()=>r(n)?.name||"no workspace"))),$(aa,"title",r(S)?"Close thread":"Open a message thread"),$(aa,"aria-label",r(S)?"Close thread":"Open a message thread"),ys=kt(aa,1,"",null,ys,{active:r(s)}),$(ir,"placeholder",w),dc.disabled=k,Ns=kt(Os,1,"",null,Ns,{active:r(Je)}),Ps=kt(di,1,"thread",null,Ps,{open:r(s)}),$(di,"aria-label",r(A)?"Profile pane":"Thread pane")},[()=>(r(a),P(Wn),r(u),r(i),g(()=>r(a)?`Message ${Wn(r(a),r(u)?.id)}`:r(i)?`Message #${r(i).name}`:"Pick a channel to start")),()=>(r(te),g(()=>!r(te).trim()))]),G("click",je,()=>h(Kt,!r(Kt))),G("click",za,()=>h(Tt,!r(Tt))),G("click",st,()=>h(Tn,!r(Tn))),Ut("submit",fs,w=>{w.preventDefault(),La()}),gn(Uo,()=>r(Me),w=>h(Me,w)),Ut("submit",vs,w=>{w.preventDefault(),zn()}),gn($o,()=>r(_e),w=>h(_e,w)),Ut("submit",ci,w=>{w.preventDefault(),Er()}),gn(ws,()=>r(de),w=>h(de,w)),G("click",aa,()=>{r(s)?Jr():h(It,"pick a message to open its thread")}),G("click",rc,()=>h(It,"no pinned items")),G("pointerdown",ia,()=>h(Le,"message")),G("pointerup",ia,Ma),Ut("submit",Es,w=>{w.preventDefault(),Pn()}),G("change",fc,Sr),Ut("focus",ir,()=>h(Le,"message")),G("keydown",ir,Vr),G("click",Ls,()=>Ae("**")),G("click",Ds,()=>Ae("_")),G("click",ui,()=>Ae("`")),G("click",fi,()=>Ae("```","\n```")),G("click",Ms,()=>Kr("[label](https://)")),G("click",Os,()=>h(Je,!r(Je))),R(m,L)};j(Oa,m=>{r(Pe)?m(Na):m(oi,-1)})}R(e,Ar),ei()}mo(["click","contextmenu","pointerdown","pointerup","change","keydown"]);var Wp=O(' ',1),jp=O("

    "),Zp=O(`

    Self-hostable chat. Serious tool. Mild brine.

    ClickClack

    A single-binary chat app for teams, communities, bots, and agents: + Slack-style threads, durable realtime, OpenAPI, SQLite, and a CLI that + can drive the whole thing from a shell.

    What it is

    Chat infrastructure that stays boring when the socket drops.

    WebSocket is the pipe. The database is the truth. Every durable message, + thread reply, reaction, and channel update can be recovered over HTTP with + a cursor, so clients and agents can reconnect without drama.

    Agent path

    A friendly CLI, no LLM baked in.

    External agents, CI jobs, and humans use the same public API as the web + app. Tokens and workspace defaults are scoped per server, so switching + hosts does not leak credentials or stale IDs.

     

    Destinations

    Product at the root. Docs and app where people expect them.

    `);function Yp(e,t){Qa(t,!1);const n="https://docs.clickclack.chat",i=["localhost","127.0.0.1","::1"].includes(window.location.hostname)?"/app":"https://app.clickclack.chat",a="https://github.com/openclaw/clickclack",s=[["Single binary","Go server, embedded Svelte app, embedded migrations, local SQLite and uploads."],["Threads that recover","Slack-style one-level threads with durable event replay after reconnects."],["Agent-friendly","A CLI, OpenAPI contract, TypeScript SDK, webhooks, and slash-command shapes."],["Self-host first","SQLite is the default, not the demo. Postgres can arrive behind the store layer."]],l=["clickclack serve --data ./data","clickclack login --magic-token mgt_...",'clickclack send --channel general "deploy started"',"clickclack threads reply msg_... --stdin {var me=Wp();Ta(()=>{Xl.title="ClickClack - Self-hostable chat with claws"}),R(le,me)});var o=d(c),u=v(d(o),2),p=v(d(u),2),b=d(p);$(b,"href",n);var _=v(b,2),T=v(_,2);$(T,"href",a);var x=v(u,2),I=v(d(x),6),E=d(I),C=v(E,2);$(C,"href",n);var S=v(C,2);$(S,"href",a);var W=v(o,4);At(W,5,()=>s,Zu,(le,me)=>{var Je=jp(),Ct=d(Je),Yt=d(Ct),it=v(Ct,2),gt=d(it);z(()=>{M(Yt,r(me)[0]),M(gt,r(me)[1])}),R(le,Je)});var A=v(W,2),K=v(d(A),2),te=d(K),fe=v(A,2),ye=v(d(fe),2),Me=v(d(ye),2);$(Me,"href",n);var _e=v(Me,2),de=v(_e,2);$(de,"href",a),z(le=>{$(_,"href",i),$(E,"href",i),M(te,le),$(_e,"href",i)},[()=>l.join(` +`)]),R(e,c),ei()}function Xp(e){const t=window.location.pathname,i=window.location.hostname.startsWith("app.")||t==="/app"||t.startsWith("/app/");var a=Qi(),s=Zn(a);{var l=o=>{Gp(o,{})},c=o=>{Yp(o,{})};j(s,o=>{i?o(l):o(c,-1)})}R(e,a)}qu(Xp,{target:document.getElementById("app")}); diff --git a/apps/api/internal/webassets/dist/index.html b/apps/api/internal/webassets/dist/index.html index ef8097e..5760b92 100644 --- a/apps/api/internal/webassets/dist/index.html +++ b/apps/api/internal/webassets/dist/index.html @@ -4,7 +4,7 @@ ClickClack - + diff --git a/apps/web/src/ChatApp.svelte b/apps/web/src/ChatApp.svelte index 4f77f3c..092e9b7 100644 --- a/apps/web/src/ChatApp.svelte +++ b/apps/web/src/ChatApp.svelte @@ -1,7 +1,22 @@ + diff --git a/apps/web/src/ChatApp.svelte b/apps/web/src/ChatApp.svelte index 092e9b7..abdbc78 100644 --- a/apps/web/src/ChatApp.svelte +++ b/apps/web/src/ChatApp.svelte @@ -1,7 +1,6 @@ + +
    { + event.preventDefault(); + onSubmit(); + }} +> + {#if showGifPicker} + + {/if} +
    + {#if pendingUpload} +
    + + {#if isImageUpload(pendingUpload)} + {pendingUpload.filename} + {/if} + {pendingUpload.filename} · {formatBytes(pendingUpload.byte_size)} + +
    + {/if} + {#if replyTarget} + + {/if} +
    + {#if showUpload} + + {/if} + + +
    + {#if showToolbar} + + {/if} +
    + diff --git a/apps/web/src/components/composer/ComposerToolbar.svelte b/apps/web/src/components/composer/ComposerToolbar.svelte new file mode 100644 index 0000000..79f7bb9 --- /dev/null +++ b/apps/web/src/components/composer/ComposerToolbar.svelte @@ -0,0 +1,39 @@ + + +
    + + + + + + +
    diff --git a/apps/web/src/components/composer/GifPicker.svelte b/apps/web/src/components/composer/GifPicker.svelte new file mode 100644 index 0000000..15b2c0d --- /dev/null +++ b/apps/web/src/components/composer/GifPicker.svelte @@ -0,0 +1,32 @@ + + +
    +
    + GIFs + onQuery(event.currentTarget.value)} + /> +
    +
    + {#each gifs as gif (gif.url)} + + {/each} +
    +
    diff --git a/apps/web/src/components/composer/ReplyPreview.svelte b/apps/web/src/components/composer/ReplyPreview.svelte new file mode 100644 index 0000000..97119ad --- /dev/null +++ b/apps/web/src/components/composer/ReplyPreview.svelte @@ -0,0 +1,20 @@ + + +
    + + + Replying to {target.author?.display_name || "Local User"} + {quoteSnippet(target.body)} + + +
    From bd432bf7cadbd5bb20ff6992a0444b0d9cacb93a Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 8 May 2026 15:16:00 +0100 Subject: [PATCH 3/7] refactor: extract message components --- .../webassets/dist/assets/index-BXrPY37w.js | 72 +++++++++ .../webassets/dist/assets/index-CgVGSv--.js | 72 --------- apps/api/internal/webassets/dist/index.html | 2 +- apps/web/src/ChatApp.svelte | 139 +++--------------- .../components/messages/MessageGroup.svelte | 69 +++++++++ .../components/messages/MessageList.svelte | 89 +++++++++++ .../src/components/messages/MessageRow.svelte | 75 ++++++++++ .../src/components/messages/QuoteBlock.svelte | 32 ++++ 8 files changed, 355 insertions(+), 195 deletions(-) create mode 100644 apps/api/internal/webassets/dist/assets/index-BXrPY37w.js delete mode 100644 apps/api/internal/webassets/dist/assets/index-CgVGSv--.js create mode 100644 apps/web/src/components/messages/MessageGroup.svelte create mode 100644 apps/web/src/components/messages/MessageList.svelte create mode 100644 apps/web/src/components/messages/MessageRow.svelte create mode 100644 apps/web/src/components/messages/QuoteBlock.svelte diff --git a/apps/api/internal/webassets/dist/assets/index-BXrPY37w.js b/apps/api/internal/webassets/dist/assets/index-BXrPY37w.js new file mode 100644 index 0000000..1521542 --- /dev/null +++ b/apps/api/internal/webassets/dist/assets/index-BXrPY37w.js @@ -0,0 +1,72 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const nc=!1;var al=Array.isArray,rc=Array.prototype.indexOf,Or=Array.prototype.includes,Qa=Array.from,ac=Object.defineProperty,Lr=Object.getOwnPropertyDescriptor,il=Object.getOwnPropertyDescriptors,ic=Object.prototype,sc=Array.prototype,Ui=Object.getPrototypeOf,Ts=Object.isExtensible;const lc=()=>{};function oc(t){return t()}function ki(t){for(var e=0;e{t=a,e=r});return{promise:n,resolve:t,reject:e}}const st=2,Mr=4,ka=8,ll=1<<24,ln=16,Jt=32,Hn=64,wi=128,Ut=512,Me=1024,et=2048,Kt=4096,vt=8192,Dt=16384,fr=32768,yi=1<<25,Pr=65536,xi=1<<17,ol=1<<18,dr=1<<19,cl=1<<20,sn=1<<25,sr=65536,ja=1<<21,ma=1<<22,Bn=1<<23,nr=Symbol("$state"),cc=Symbol("legacy props"),uc=Symbol(""),wn=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},fc=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function ul(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function dc(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function pc(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function hc(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function vc(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function gc(t){throw new Error("https://svelte.dev/e/effect_orphan")}function mc(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function _c(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function bc(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function kc(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function wc(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function yc(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const xc=1,Tc=2,fl=4,Sc=8,Ec=16,Ac=1,Rc=2,Cc=4,Ic=8,Dc=16,Lc=1,Oc=2,qe=Symbol(),dl="http://www.w3.org/1999/xhtml",Mc="http://www.w3.org/2000/svg",Pc="http://www.w3.org/1998/Math/MathML";function Nc(){console.warn("https://svelte.dev/e/derived_inert")}function zc(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function pl(t){return t===this.v}function hl(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function vl(t){return!hl(t,this.v)}let Ur=!1,Fc=!1;function Uc(){Ur=!0}let we=null;function Nr(t){we=t}function Wt(t,e=!1,n){we={p:we,i:!1,c:null,e:null,s:t,x:null,r:J,l:Ur&&!e?{s:null,u:null,$:[]}:null}}function jt(t){var e=we,n=e.e;if(n!==null){e.e=null;for(var a of n)Nl(a)}return e.i=!0,we=e.p,{}}function wa(){return!Ur||we!==null&&we.l===null}let $n=[];function gl(){var t=$n;$n=[],ki(t)}function Gn(t){if($n.length===0&&!va){var e=$n;queueMicrotask(()=>{e===$n&&gl()})}$n.push(t)}function Bc(){for(;$n.length>0;)gl()}function ml(t){var e=J;if(e===null)return re.f|=Bn,t;if((e.f&fr)===0&&(e.f&Mr)===0)throw t;Fn(t,e)}function Fn(t,e){for(;e!==null;){if((e.f&wi)!==0){if((e.f&fr)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const Gc=-7169;function Ae(t,e){t.f=t.f&Gc|e}function Bi(t){(t.f&Ut)!==0||t.deps===null?Ae(t,Me):Ae(t,Kt)}function _l(t){if(t!==null)for(const e of t)(e.f&st)===0||(e.f&sr)===0||(e.f^=sr,_l(e.deps))}function bl(t,e,n){(t.f&et)!==0?e.add(t):(t.f&Kt)!==0&&n.add(t),_l(t.deps),Ae(t,Me)}let Fa=!1;function Hc(t){var e=Fa;try{return Fa=!1,[t(),Fa]}finally{Fa=e}}const Vn=new Set;let K=null,Vt=null,Ti=null,va=!1,di=!1,Rr=null,qa=null;var Ss=0;let qc=1;class qn{id=qc++;current=new Map;previous=new Map;#n=new Set;#o=new Set;#e=new Set;#a=new Map;#r=new Map;#i=null;#t=[];#s=[];#c=new Set;#u=new Set;#l=new Map;#d=new Set;is_fork=!1;#h=!1;#p=new Set;#f(){return this.is_fork||this.#r.size>0}#m(){for(const a of this.#p)for(const r of a.#r.keys()){for(var e=!1,n=r;n.parent!==null;){if(this.#l.has(n)){e=!0;break}n=n.parent}if(!e)return!0}return!1}skip_effect(e){this.#l.has(e)||this.#l.set(e,{d:[],m:[]}),this.#d.delete(e)}unskip_effect(e,n=a=>this.schedule(a)){var a=this.#l.get(e);if(a){this.#l.delete(e);for(var r of a.d)Ae(r,et),n(r);for(r of a.m)Ae(r,Kt),n(r)}this.#d.add(e)}#v(){if(Ss++>1e3&&(Vn.delete(this),jc()),!this.#f()){for(const c of this.#c)this.#u.delete(c),Ae(c,et),this.schedule(c);for(const c of this.#u)Ae(c,Kt),this.schedule(c)}const e=this.#t;this.#t=[],this.apply();var n=Rr=[],a=[],r=qa=[];for(const c of e)try{this.#_(c,n,a)}catch(o){throw yl(c),o}if(K=null,r.length>0){var s=qn.ensure();for(const c of r)s.schedule(c)}if(Rr=null,qa=null,this.#f()||this.#m()){this.#g(a),this.#g(n);for(const[c,o]of this.#l)wl(c,o)}else{this.#a.size===0&&Vn.delete(this),this.#c.clear(),this.#u.clear();for(const c of this.#n)c(this);this.#n.clear(),Es(a),Es(n),this.#i?.resolve()}var l=K;if(this.#t.length>0){const c=l??=this;c.#t.push(...this.#t.filter(o=>!c.#t.includes(o)))}l!==null&&(Vn.add(l),l.#v())}#_(e,n,a){e.f^=Me;for(var r=e.first;r!==null;){var s=r.f,l=(s&(Jt|Hn))!==0,c=l&&(s&Me)!==0,o=c||(s&vt)!==0||this.#l.has(r);if(!o&&r.fn!==null){l?r.f^=Me:(s&Mr)!==0?n.push(r):Gr(r)&&((s&ln)!==0&&this.#u.add(r),cr(r));var u=r.first;if(u!==null){r=u;continue}}for(;r!==null;){var f=r.next;if(f!==null){r=f;break}r=r.parent}}}#g(e){for(var n=0;n!this.current.has(m));if(r.length===0)e&&f.discard();else if(n.length>0){if(e)for(const m of this.#d)f.unskip_effect(m,v=>{(v.f&(ln|ma))!==0?f.schedule(v):f.#g([v])});f.activate();var s=new Set,l=new Map;for(var c of n)kl(c,r,s,l);l=new Map;var o=[...f.current.keys()].filter(m=>this.current.has(m)?this.current.get(m)[0]!==m:!0);for(const m of this.#s)(m.f&(Dt|vt|xi))===0&&Gi(m,o,l)&&((m.f&(ma|ln))!==0?(Ae(m,et),f.schedule(m)):f.#c.add(m));if(f.#t.length>0){f.apply();for(var u of f.#t)f.#_(u,[],[]);f.#t=[]}f.deactivate()}}for(const f of Vn)f.#p.has(this)&&(f.#p.delete(this),f.#p.size===0&&!f.#f()&&(f.activate(),f.#v()))}increment(e,n){let a=this.#a.get(n)??0;if(this.#a.set(n,a+1),e){let r=this.#r.get(n)??0;this.#r.set(n,r+1)}}decrement(e,n,a){let r=this.#a.get(n)??0;if(r===1?this.#a.delete(n):this.#a.set(n,r-1),e){let s=this.#r.get(n)??0;s===1?this.#r.delete(n):this.#r.set(n,s-1)}this.#h||a||(this.#h=!0,Gn(()=>{this.#h=!1,this.flush()}))}transfer_effects(e,n){for(const a of e)this.#c.add(a);for(const a of n)this.#u.add(a);e.clear(),n.clear()}oncommit(e){this.#n.add(e)}ondiscard(e){this.#o.add(e)}on_fork_commit(e){this.#e.add(e)}run_fork_commit_callbacks(){for(const e of this.#e)e(this);this.#e.clear()}settled(){return(this.#i??=sl()).promise}static ensure(){if(K===null){const e=K=new qn;di||(Vn.add(K),va||Gn(()=>{K===e&&e.flush()}))}return K}apply(){{Vt=null;return}}schedule(e){if(Ti=e,e.b?.is_pending&&(e.f&(Mr|ka|ll))!==0&&(e.f&fr)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var a=n.f;if(Rr!==null&&n===J&&(re===null||(re.f&st)===0))return;if((a&(Hn|Jt))!==0){if((a&Me)===0)return;n.f^=Me}}this.#t.push(n)}}function Wc(t){var e=va;va=!0;try{for(var n;;){if(Bc(),K===null)return n;K.flush()}}finally{va=e}}function jc(){try{mc()}catch(t){Fn(t,Ti)}}let kn=null;function Es(t){var e=t.length;if(e!==0){for(var n=0;n0)){rr.clear();for(const r of kn){if((r.f&(Dt|vt))!==0)continue;const s=[r];let l=r.parent;for(;l!==null;)kn.has(l)&&(kn.delete(l),s.push(l)),l=l.parent;for(let c=s.length-1;c>=0;c--){const o=s[c];(o.f&(Dt|vt))===0&&cr(o)}}kn.clear()}}kn=null}}function kl(t,e,n,a){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const r of t.reactions){const s=r.f;(s&st)!==0?kl(r,e,n,a):(s&(ma|ln))!==0&&(s&et)===0&&Gi(r,e,a)&&(Ae(r,et),Hi(r))}}function Gi(t,e,n){const a=n.get(t);if(a!==void 0)return a;if(t.deps!==null)for(const r of t.deps){if(Or.call(e,r))return!0;if((r.f&st)!==0&&Gi(r,e,n))return n.set(r,!0),!0}return n.set(t,!1),!1}function Hi(t){K.schedule(t)}function wl(t,e){if(!((t.f&Jt)!==0&&(t.f&Me)!==0)){(t.f&et)!==0?e.d.push(t):(t.f&Kt)!==0&&e.m.push(t),Ae(t,Me);for(var n=t.first;n!==null;)wl(n,e),n=n.next}}function yl(t){Ae(t,Me);for(var e=t.first;e!==null;)yl(e),e=e.next}function Zc(t){let e=0,n=or(0),a;return()=>{Wi()&&(i(n),Br(()=>(e===0&&(a=T(()=>t(()=>ga(n)))),e+=1,()=>{Gn(()=>{e-=1,e===0&&(a?.(),a=void 0,ga(n))})})))}}var Yc=Pr|dr;function Xc(t,e,n,a){new Vc(t,e,n,a)}class Vc{parent;is_pending=!1;transform_error;#n;#o=null;#e;#a;#r;#i=null;#t=null;#s=null;#c=null;#u=0;#l=0;#d=!1;#h=new Set;#p=new Set;#f=null;#m=Zc(()=>(this.#f=or(this.#u),()=>{this.#f=null}));constructor(e,n,a,r){this.#n=e,this.#e=n,this.#a=s=>{var l=J;l.b=this,l.f|=wi,a(s)},this.parent=J.b,this.transform_error=r??this.parent?.transform_error??(s=>s),this.#r=Ka(()=>{this.#b()},Yc)}#v(){try{this.#i=Ft(()=>this.#a(this.#n))}catch(e){this.error(e)}}#_(e){const n=this.#e.failed;n&&(this.#s=Ft(()=>{n(this.#n,()=>e,()=>()=>{})}))}#g(){const e=this.#e.pending;e&&(this.is_pending=!0,this.#t=Ft(()=>e(this.#n)),Gn(()=>{var n=this.#c=document.createDocumentFragment(),a=on();n.append(a),this.#i=this.#w(()=>Ft(()=>this.#a(a))),this.#l===0&&(this.#n.before(n),this.#c=null,ar(this.#t,()=>{this.#t=null}),this.#k(K))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#u=0,this.#i=Ft(()=>{this.#a(this.#n)}),this.#l>0){var e=this.#c=document.createDocumentFragment();Xi(this.#i,e);const n=this.#e.pending;this.#t=Ft(()=>n(this.#n))}else this.#k(K)}catch(n){this.error(n)}}#k(e){this.is_pending=!1,e.transfer_effects(this.#h,this.#p)}defer_effect(e){bl(e,this.#h,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#e.pending}#w(e){var n=J,a=re,r=we;Ht(this.#r),Gt(this.#r),Nr(this.#r.ctx);try{return qn.ensure(),e()}catch(s){return ml(s),null}finally{Ht(n),Gt(a),Nr(r)}}#y(e,n){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(e,n);return}this.#l+=e,this.#l===0&&(this.#k(n),this.#t&&ar(this.#t,()=>{this.#t=null}),this.#c&&(this.#n.before(this.#c),this.#c=null))}update_pending_count(e,n){this.#y(e,n),this.#u+=e,!(!this.#f||this.#d)&&(this.#d=!0,Gn(()=>{this.#d=!1,this.#f&&zr(this.#f,this.#u)}))}get_effect_pending(){return this.#m(),i(this.#f)}error(e){if(!this.#e.onerror&&!this.#e.failed)throw e;K?.is_fork?(this.#i&&K.skip_effect(this.#i),this.#t&&K.skip_effect(this.#t),this.#s&&K.skip_effect(this.#s),K.on_fork_commit(()=>{this.#x(e)})):this.#x(e)}#x(e){this.#i&&(yt(this.#i),this.#i=null),this.#t&&(yt(this.#t),this.#t=null),this.#s&&(yt(this.#s),this.#s=null);var n=this.#e.onerror;let a=this.#e.failed;var r=!1,s=!1;const l=()=>{if(r){zc();return}r=!0,s&&yc(),this.#s!==null&&ar(this.#s,()=>{this.#s=null}),this.#w(()=>{this.#b()})},c=o=>{try{s=!0,n?.(o,l),s=!1}catch(u){Fn(u,this.#r&&this.#r.parent)}a&&(this.#s=this.#w(()=>{try{return Ft(()=>{var u=J;u.b=this,u.f|=wi,a(this.#n,()=>o,()=>l)})}catch(u){return Fn(u,this.#r.parent),null}}))};Gn(()=>{var o;try{o=this.transform_error(e)}catch(u){Fn(u,this.#r&&this.#r.parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(c,u=>Fn(u,this.#r&&this.#r.parent)):c(o)})}}function Qc(t,e,n,a){const r=wa()?ya:Nt;var s=t.filter(v=>!v.settled);if(n.length===0&&s.length===0){a(e.map(r));return}var l=J,c=Jc(),o=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(v=>v.promise)):null;function u(v){c();try{a(v)}catch(x){(l.f&Dt)===0&&Fn(x,l)}Za()}if(n.length===0){o.then(()=>u(e.map(r)));return}var f=xl();function m(){Promise.all(n.map(v=>Kc(v))).then(v=>u([...e.map(r),...v])).catch(v=>Fn(v,l)).finally(()=>f())}o?o.then(()=>{c(),m(),Za()}):m()}function Jc(){var t=J,e=re,n=we,a=K;return function(s=!0){Ht(t),Gt(e),Nr(n),s&&(t.f&Dt)===0&&(a?.activate(),a?.apply())}}function Za(t=!0){Ht(null),Gt(null),Nr(null),t&&K?.deactivate()}function xl(){var t=J,e=t.b,n=K,a=e.is_rendered();return e.update_pending_count(1,n),n.increment(a,t),(r=!1)=>{e.update_pending_count(-1,n),n.decrement(a,t,r)}}function ya(t){var e=st|et;return J!==null&&(J.f|=dr),{ctx:we,deps:null,effects:null,equals:pl,f:e,fn:t,reactions:null,rv:0,v:qe,wv:0,parent:J,ac:null}}function Kc(t,e,n){let a=J;a===null&&dc();var r=void 0,s=or(qe),l=!re,c=new Map;return fu(()=>{var o=J,u=sl();r=u.promise;try{Promise.resolve(t()).then(u.resolve,u.reject).finally(Za)}catch(x){u.reject(x),Za()}var f=K;if(l){if((o.f&fr)!==0)var m=xl();if(a.b.is_rendered())c.get(f)?.reject(wn),c.delete(f);else{for(const x of c.values())x.reject(wn);c.clear()}c.set(f,u)}const v=(x,b=void 0)=>{if(m){var E=b===wn;m(E)}if(!(b===wn||(o.f&Dt)!==0)){if(f.activate(),b)s.f|=Bn,zr(s,b);else{(s.f&Bn)!==0&&(s.f^=Bn),zr(s,x);for(const[k,_]of c){if(c.delete(k),k===f)break;_.reject(wn)}}f.deactivate()}};u.promise.then(v,x=>v(null,x||"unknown"))}),Pl(()=>{for(const o of c.values())o.reject(wn)}),new Promise(o=>{function u(f){function m(){f===r?o(s):u(r)}f.then(m,m)}u(r)})}function lr(t){const e=ya(t);return Hl(e),e}function Nt(t){const e=ya(t);return e.equals=vl,e}function $c(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;ni(t))),e}function h(t,e,n=!1){re!==null&&(!Qt||(re.f&xi)!==0)&&wa()&&(re.f&(st|ln|ma|xi))!==0&&(Bt===null||!Or.call(Bt,t))&&wc();let a=n?Cr(e):e;return zr(t,a,qa)}function zr(t,e,n=null){if(!t.equals(e)){rr.set(t,xn?e:t.v);var a=qn.ensure();if(a.capture(t,e),(t.f&st)!==0){const r=t;(t.f&et)!==0&&qi(r),Vt===null&&Bi(r)}t.wv=Wl(),Al(t,et,n),wa()&&J!==null&&(J.f&Me)!==0&&(J.f&(Jt|Hn))===0&&(zt===null?pu([t]):zt.push(t)),!a.is_fork&&Si.size>0&&!El&&nu()}return e}function nu(){El=!1;for(const t of Si)(t.f&Me)!==0&&Ae(t,Kt),Gr(t)&&cr(t);Si.clear()}function ga(t){h(t,t.v+1)}function Al(t,e,n){var a=t.reactions;if(a!==null)for(var r=wa(),s=a.length,l=0;l{if(ir===s)return c();var o=re,u=ir;Gt(null),Cs(s);var f=c();return Gt(o),Cs(u),f};return a&&n.set("length",Ct(t.length)),new Proxy(t,{defineProperty(c,o,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&bc();var f=n.get(o);return f===void 0?l(()=>{var m=Ct(u.value);return n.set(o,m),m}):h(f,u.value,!0),!0},deleteProperty(c,o){var u=n.get(o);if(u===void 0){if(o in c){const f=l(()=>Ct(qe));n.set(o,f),ga(r)}}else h(u,qe),ga(r);return!0},get(c,o,u){if(o===nr)return t;var f=n.get(o),m=o in c;if(f===void 0&&(!m||Lr(c,o)?.writable)&&(f=l(()=>{var x=Cr(m?c[o]:qe),b=Ct(x);return b}),n.set(o,f)),f!==void 0){var v=i(f);return v===qe?void 0:v}return Reflect.get(c,o,u)},getOwnPropertyDescriptor(c,o){var u=Reflect.getOwnPropertyDescriptor(c,o);if(u&&"value"in u){var f=n.get(o);f&&(u.value=i(f))}else if(u===void 0){var m=n.get(o),v=m?.v;if(m!==void 0&&v!==qe)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return u},has(c,o){if(o===nr)return!0;var u=n.get(o),f=u!==void 0&&u.v!==qe||Reflect.has(c,o);if(u!==void 0||J!==null&&(!f||Lr(c,o)?.writable)){u===void 0&&(u=l(()=>{var v=f?Cr(c[o]):qe,x=Ct(v);return x}),n.set(o,u));var m=i(u);if(m===qe)return!1}return f},set(c,o,u,f){var m=n.get(o),v=o in c;if(a&&o==="length")for(var x=u;xCt(qe)),n.set(x+"",b))}if(m===void 0)(!v||Lr(c,o)?.writable)&&(m=l(()=>Ct(void 0)),h(m,Cr(u)),n.set(o,m));else{v=m.v!==qe;var E=l(()=>Cr(u));h(m,E)}var k=Reflect.getOwnPropertyDescriptor(c,o);if(k?.set&&k.set.call(f,u),!v){if(a&&typeof o=="string"){var _=n.get("length"),z=Number(o);Number.isInteger(z)&&z>=_.v&&h(_,z+1)}ga(r)}return!0},ownKeys(c){i(r);var o=Reflect.ownKeys(c).filter(m=>{var v=n.get(m);return v===void 0||v.v!==qe});for(var[u,f]of n)f.v!==qe&&!(u in c)&&o.push(u);return o},setPrototypeOf(){kc()}})}var Ei,Rl,Cl,Il,Dl;function ru(){if(Ei===void 0){Ei=window,Rl=document,Cl=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Il=Lr(e,"firstChild").get,Dl=Lr(e,"nextSibling").get,Ts(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Ts(n)&&(n.__t=void 0)}}function on(t=""){return document.createTextNode(t)}function Un(t){return Il.call(t)}function xa(t){return Dl.call(t)}function p(t,e){return Un(t)}function yn(t,e=!1){{var n=Un(t);return n instanceof Comment&&n.data===""?xa(n):n}}function g(t,e=1,n=!1){let a=t;for(;e--;)a=xa(a);return a}function au(t){t.textContent=""}function Ll(){return!1}function Ol(t,e,n){return document.createElementNS(e??dl,t,void 0)}let As=!1;function iu(){As||(As=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{if(!t.defaultPrevented)for(const e of t.target.elements)e.__on_r?.()})},{capture:!0}))}function Ja(t){var e=re,n=J;Gt(null),Ht(null);try{return t()}finally{Gt(e),Ht(n)}}function su(t,e,n,a=n){t.addEventListener(e,()=>Ja(n));const r=t.__on_r;r?t.__on_r=()=>{r(),a(!0)}:t.__on_r=()=>a(!0),iu()}function Ml(t){J===null&&(re===null&&gc(),vc()),xn&&hc()}function lu(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function cn(t,e){var n=J;n!==null&&(n.f&vt)!==0&&(t|=vt);var a={ctx:we,deps:null,nodes:null,f:t|et|Ut,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};K?.register_created_effect(a);var r=a;if((t&Mr)!==0)Rr!==null?Rr.push(a):qn.ensure().schedule(a);else if(e!==null){try{cr(a)}catch(l){throw yt(a),l}r.deps===null&&r.teardown===null&&r.nodes===null&&r.first===r.last&&(r.f&dr)===0&&(r=r.first,(t&ln)!==0&&(t&Pr)!==0&&r!==null&&(r.f|=Pr))}if(r!==null&&(r.parent=n,n!==null&&lu(r,n),re!==null&&(re.f&st)!==0&&(t&Hn)===0)){var s=re;(s.effects??=[]).push(r)}return a}function Wi(){return re!==null&&!Qt}function Pl(t){const e=cn(ka,null);return Ae(e,Me),e.teardown=t,e}function _a(t){Ml();var e=J.f,n=!re&&(e&Jt)!==0&&(e&fr)===0;if(n){var a=we;(a.e??=[]).push(t)}else return Nl(t)}function Nl(t){return cn(Mr|cl,t)}function ou(t){return Ml(),cn(ka|cl,t)}function cu(t){qn.ensure();const e=cn(Hn|dr,t);return(n={})=>new Promise(a=>{n.outro?ar(e,()=>{yt(e),a(void 0)}):(yt(e),a(void 0))})}function ji(t){return cn(Mr,t)}function _n(t,e){var n=we,a={effect:null,ran:!1,deps:t};n.l.$.push(a),a.effect=Br(()=>{if(t(),!a.ran){a.ran=!0;var r=J;try{Ht(r.parent),T(e)}finally{Ht(r)}}})}function uu(){var t=we;Br(()=>{for(var e of t.l.$){e.deps();var n=e.effect;(n.f&Me)!==0&&n.deps!==null&&Ae(n,Kt),Gr(n)&&cr(n),e.ran=!1}})}function fu(t){return cn(ma|dr,t)}function Br(t,e=0){return cn(ka|e,t)}function N(t,e=[],n=[],a=[]){Qc(a,e,n,r=>{cn(ka,()=>t(...r.map(i)))})}function Ka(t,e=0){var n=cn(ln|e,t);return n}function Ft(t){return cn(Jt|dr,t)}function zl(t){var e=t.teardown;if(e!==null){const n=xn,a=re;Rs(!0),Gt(null);try{e.call(null)}finally{Rs(n),Gt(a)}}}function Zi(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const r=n.ac;r!==null&&Ja(()=>{r.abort(wn)});var a=n.next;(n.f&Hn)!==0?n.parent=null:yt(n,e),n=a}}function du(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Jt)===0&&yt(e),e=n}}function yt(t,e=!0){var n=!1;(e||(t.f&ol)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(Fl(t.nodes.start,t.nodes.end),n=!0),Ae(t,yi),Zi(t,e&&!n),ba(t,0);var a=t.nodes&&t.nodes.t;if(a!==null)for(const s of a)s.stop();zl(t),t.f^=yi,t.f|=Dt;var r=t.parent;r!==null&&r.first!==null&&Ul(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function Fl(t,e){for(;t!==null;){var n=t===e?null:xa(t);t.remove(),t=n}}function Ul(t){var e=t.parent,n=t.prev,a=t.next;n!==null&&(n.next=a),a!==null&&(a.prev=n),e!==null&&(e.first===t&&(e.first=a),e.last===t&&(e.last=n))}function ar(t,e,n=!0){var a=[];Bl(t,a,!0);var r=()=>{n&&yt(t),e&&e()},s=a.length;if(s>0){var l=()=>--s||r();for(var c of a)c.out(l)}else r()}function Bl(t,e,n){if((t.f&vt)===0){t.f^=vt;var a=t.nodes&&t.nodes.t;if(a!==null)for(const c of a)(c.is_global||n)&&e.push(c);for(var r=t.first;r!==null;){var s=r.next;if((r.f&Hn)===0){var l=(r.f&Pr)!==0||(r.f&Jt)!==0&&(t.f&ln)!==0;Bl(r,e,l?n:!1)}r=s}}}function Yi(t){Gl(t,!0)}function Gl(t,e){if((t.f&vt)!==0){t.f^=vt,(t.f&Me)===0&&(Ae(t,et),qn.ensure().schedule(t));for(var n=t.first;n!==null;){var a=n.next,r=(n.f&Pr)!==0||(n.f&Jt)!==0;Gl(n,r?e:!1),n=a}var s=t.nodes&&t.nodes.t;if(s!==null)for(const l of s)(l.is_global||e)&&l.in()}}function Xi(t,e){if(t.nodes)for(var n=t.nodes.start,a=t.nodes.end;n!==null;){var r=n===a?null:xa(n);e.append(n),n=r}}let Wa=!1,xn=!1;function Rs(t){xn=t}let re=null,Qt=!1;function Gt(t){re=t}let J=null;function Ht(t){J=t}let Bt=null;function Hl(t){re!==null&&(Bt===null?Bt=[t]:Bt.push(t))}let wt=null,Rt=0,zt=null;function pu(t){zt=t}let ql=1,er=0,ir=er;function Cs(t){ir=t}function Wl(){return++ql}function Gr(t){var e=t.f;if((e&et)!==0)return!0;if(e&st&&(t.f&=~sr),(e&Kt)!==0){for(var n=t.deps,a=n.length,r=0;rt.wv)return!0}(e&Ut)!==0&&Vt===null&&Ae(t,Me)}return!1}function jl(t,e,n=!0){var a=t.reactions;if(a!==null&&!(Bt!==null&&Or.call(Bt,t)))for(var r=0;r{t.ac.abort(wn)}),t.ac=null);try{t.f|=ja;var f=t.fn,m=f();t.f|=fr;var v=t.deps,x=K?.is_fork;if(wt!==null){var b;if(x||ba(t,Rt),v!==null&&Rt>0)for(v.length=Rt+wt.length,b=0;bn?.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Gn(()=>{e.addEventListener(t,r,a)}):e.addEventListener(t,r,a),r}function an(t,e,n,a,r){var s={capture:a,passive:r},l=mu(t,e,n,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Pl(()=>{e.removeEventListener(t,l,s)})}function H(t,e,n){(e[ua]??={})[t]=n}function un(t){for(var e=0;e{throw k});throw v}}finally{t[ua]=e,delete t.currentTarget,Gt(f),Ht(m)}}}const _u=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function bu(t){return _u?.createHTML(t)??t}function ku(t){var e=Ol("template");return e.innerHTML=bu(t.replaceAll("","")),e.content}function Fr(t,e){var n=J;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function L(t,e){var n=(e&Lc)!==0,a=(e&Oc)!==0,r,s=!t.startsWith("");return()=>{r===void 0&&(r=ku(s?t:""+t),n||(r=Un(r)));var l=a||Cl?document.importNode(r,!0):r.cloneNode(!0);if(n){var c=Un(l),o=l.lastChild;Fr(c,o)}else Fr(l,l);return l}}function pt(t=""){{var e=on(t+"");return Fr(e,e),e}}function $a(){var t=document.createDocumentFragment(),e=document.createComment(""),n=on();return t.append(e,n),Fr(e,n),t}function R(t,e){t!==null&&t.before(e)}function O(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t.__t??=t.nodeValue)&&(t.__t=n,t.nodeValue=`${n}`)}function wu(t,e){return yu(t,e)}const Ua=new Map;function yu(t,{target:e,anchor:n,props:a={},events:r,context:s,intro:l=!0,transformError:c}){ru();var o=void 0,u=cu(()=>{var f=n??e.appendChild(on());Xc(f,{pending:()=>{}},x=>{Wt({});var b=we;s&&(b.c=s),r&&(a.$$events=r),o=t(x,a)||{},jt()},c);var m=new Set,v=x=>{for(var b=0;b{for(var x of m)for(const k of[e,document]){var b=Ua.get(k),E=b.get(x);--E==0?(k.removeEventListener(x,Ii),b.delete(x),b.size===0&&Ua.delete(k)):b.set(x,E)}Ci.delete(v),f!==n&&f.parentNode?.removeChild(f)}});return xu.set(o,u),o}let xu=new WeakMap;class Tu{anchor;#n=new Map;#o=new Map;#e=new Map;#a=new Set;#r=!0;constructor(e,n=!0){this.anchor=e,this.#r=n}#i=e=>{if(this.#n.has(e)){var n=this.#n.get(e),a=this.#o.get(n);if(a)Yi(a),this.#a.delete(n);else{var r=this.#e.get(n);r&&(this.#o.set(n,r.effect),this.#e.delete(n),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),a=r.effect)}for(const[s,l]of this.#n){if(this.#n.delete(s),s===e)break;const c=this.#e.get(l);c&&(yt(c.effect),this.#e.delete(l))}for(const[s,l]of this.#o){if(s===n||this.#a.has(s))continue;const c=()=>{if(Array.from(this.#n.values()).includes(s)){var u=document.createDocumentFragment();Xi(l,u),u.append(on()),this.#e.set(s,{effect:l,fragment:u})}else yt(l);this.#a.delete(s),this.#o.delete(s)};this.#r||!a?(this.#a.add(s),ar(l,c,!1)):c()}}};#t=e=>{this.#n.delete(e);const n=Array.from(this.#n.values());for(const[a,r]of this.#e)n.includes(a)||(yt(r.effect),this.#e.delete(a))};ensure(e,n){var a=K,r=Ll();if(n&&!this.#o.has(e)&&!this.#e.has(e))if(r){var s=document.createDocumentFragment(),l=on();s.append(l),this.#e.set(e,{effect:Ft(()=>n(l)),fragment:s})}else this.#o.set(e,Ft(()=>n(this.anchor)));if(this.#n.set(a,e),r){for(const[c,o]of this.#o)c===e?a.unskip_effect(o):a.skip_effect(o);for(const[c,o]of this.#e)c===e?a.unskip_effect(o.effect):a.skip_effect(o.effect);a.oncommit(this.#i),a.ondiscard(this.#t)}else this.#i(a)}}function q(t,e,n=!1){var a=new Tu(t),r=n?Pr:0;function s(l,c){a.ensure(l,c)}Ka(()=>{var l=!1;e((c,o=0)=>{l=!0,s(o,c)}),l||s(-1,null)},r)}function Su(t,e){return e}function Eu(t,e,n){for(var a=[],r=e.length,s,l=e.length,c=0;c{if(s){if(s.pending.delete(m),s.done.add(m),s.pending.size===0){var v=t.outrogroups;Di(t,Qa(s.done)),v.delete(s),v.size===0&&(t.outrogroups=null)}}else l-=1},!1)}if(l===0){var o=a.length===0&&n!==null;if(o){var u=n,f=u.parentNode;au(f),f.append(u),t.items.clear()}Di(t,e,!o)}else s={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(s)}function Di(t,e,n=!0){var a;if(t.pending.size>0){a=new Set;for(const l of t.pending.values())for(const c of l)a.add(t.items.get(c).e)}for(var r=0;r{var y=n();return al(y)?y:y==null?[]:Qa(y)}),v,x=new Map,b=!0;function E(y){(z.effect.f&Dt)===0&&(z.pending.delete(y),z.fallback=f,Au(z,v,l,e,a),f!==null&&(v.length===0?(f.f&sn)===0?Yi(f):(f.f^=sn,fa(f,null,l)):ar(f,()=>{f=null})))}function k(y){z.pending.delete(y)}var _=Ka(()=>{v=i(m);for(var y=v.length,I=new Set,G=K,te=Ll(),ae=0;aes(l)):(f=Ft(()=>s(Ds??=on())),f.f|=sn)),y>I.size&&pc(),!b)if(x.set(G,I),te){for(const[X,le]of c)I.has(X)||G.skip_effect(le.e);G.oncommit(E),G.ondiscard(k)}else E(G);i(m)}),z={effect:_,items:c,pending:x,outrogroups:null,fallback:f};b=!1}function ra(t){for(;t!==null&&(t.f&Jt)===0;)t=t.next;return t}function Au(t,e,n,a,r){var s=(a&Sc)!==0,l=e.length,c=t.items,o=ra(t.effect.first),u,f=null,m,v=[],x=[],b,E,k,_;if(s)for(_=0;_0){var _e=(a&fl)!==0&&l===0?n:null;if(s){for(_=0;_{if(m!==void 0)for(k of m)k.nodes?.a?.apply()})}function Ru(t,e,n,a,r,s,l,c){var o=(l&xc)!==0?(l&Ec)===0?j(n,!1,!1):or(n):null,u=(l&Tc)!==0?or(r):null;return{v:o,i:u,e:Ft(()=>(s(e,o??n,u??r,c),()=>{t.delete(a)}))}}function fa(t,e,n){if(t.nodes)for(var a=t.nodes.start,r=t.nodes.end,s=e&&(e.f&sn)===0?e.nodes.start:n;a!==null;){var l=xa(a);if(s.before(a),a===r)return;a=l}}function Nn(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function Li(t,e,n=!1,a=!1,r=!1,s=!1){var l=t,c="";if(n)var o=t;N(()=>{var u=J;if(c!==(c=e()??"")){if(n){u.nodes=null,o.innerHTML=c,c!==""&&Fr(Un(o),o.lastChild);return}if(u.nodes!==null&&(Fl(u.nodes.start,u.nodes.end),u.nodes=null),c!==""){var f=a?Mc:r?Pc:void 0,m=Ol(a?"svg":r?"math":"template",f);m.innerHTML=c;var v=a||r?m:m.content;if(Fr(Un(v),v.lastChild),a||r)for(;Un(v);)l.before(Un(v));else l.before(v)}}})}function Ql(t,e){var n;n=document.head.appendChild(on()),Ka(()=>e(n),ol|dr)}function Cu(t,e,n){ji(()=>{var a=T(()=>e(t,n?.())||{});if(n&&a?.update){var r=!1,s={};Br(()=>{var l=n();Z(l),r&&hl(s,l)&&(s=l,a.update(l))}),r=!0}if(a?.destroy)return()=>a.destroy()})}function Jl(t){var e,n,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e=0;){var c=l+s;(l===0||Ls.includes(a[l-1]))&&(c===a.length||Ls.includes(a[c]))?a=(l===0?"":a.substring(0,l))+a.substring(c+1):l=c}}return a===""?null:a}function Ou(t,e){return t==null?null:String(t)}function dt(t,e,n,a,r,s){var l=t.__className;if(l!==n||l===void 0){var c=Lu(n,a,s);c==null?t.removeAttribute("class"):t.className=c,t.__className=n}else if(s&&r!==s)for(var o in s){var u=!!s[o];(r==null||u!==!!r[o])&&t.classList.toggle(o,u)}return s}function bn(t,e,n,a){var r=t.__style;if(r!==e){var s=Ou(e);s==null?t.removeAttribute("style"):t.style.cssText=s,t.__style=e}return a}const Mu=Symbol("is custom element"),Pu=Symbol("is html"),Nu=fc?"progress":"PROGRESS";function Kl(t,e){var n=$l(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==Nu)||(t.value=e??"")}function F(t,e,n,a){var r=$l(t);r[e]!==(r[e]=n)&&(e==="loading"&&(t[uc]=n),n==null?t.removeAttribute(e):typeof n!="string"&&zu(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function $l(t){return t.__attributes??={[Mu]:t.nodeName.includes("-"),[Pu]:t.namespaceURI===dl}}var Os=new Map;function zu(t){var e=t.getAttribute("is")||t.nodeName,n=Os.get(e);if(n)return n;Os.set(e,n=[]);for(var a,r=t,s=Element.prototype;s!==r;){a=il(r);for(var l in a)a[l].set&&n.push(l);r=Ui(r)}return n}function Qn(t,e,n=e){var a=new WeakSet;su(t,"input",async r=>{var s=r?t.defaultValue:t.value;if(s=pi(t)?hi(s):s,n(s),K!==null&&a.add(K),await Ai(),s!==(s=e())){var l=t.selectionStart,c=t.selectionEnd,o=t.value.length;if(t.value=s??"",c!==null){var u=t.value.length;l===c&&c===o&&u>o?(t.selectionStart=u,t.selectionEnd=u):(t.selectionStart=l,t.selectionEnd=Math.min(c,u))}}}),T(e)==null&&t.value&&(n(pi(t)?hi(t.value):t.value),K!==null&&a.add(K)),Br(()=>{var r=e();if(t===document.activeElement){var s=K;if(a.has(s))return}pi(t)&&r===hi(t.value)||t.type==="date"&&!r&&!t.value||r!==t.value&&(t.value=r??"")})}function pi(t){var e=t.type;return e==="number"||e==="range"}function hi(t){return t===""?null:+t}function Ms(t,e){return t===e||t?.[nr]===e}function Vi(t={},e,n,a){var r=we.r,s=J;return ji(()=>{var l,c;return Br(()=>{l=c,c=[],T(()=>{t!==n(...c)&&(e(t,...c),l&&Ms(n(...l),t)&&e(null,...l))})}),()=>{let o=s;for(;o!==r&&o.parent!==null&&o.parent.f&yi;)o=o.parent;const u=()=>{c&&Ms(n(...c),t)&&e(null,...c)},f=o.teardown;o.teardown=()=>{u(),f?.()}}}),t}function eo(t=!1){const e=we,n=e.l.u;if(!n)return;let a=()=>Z(e.s);if(t){let r=0,s={};const l=ya(()=>{let c=!1;const o=e.s;for(const u in o)o[u]!==s[u]&&(s[u]=o[u],c=!0);return c&&r++,r});a=()=>i(l)}n.b.length&&ou(()=>{Ps(e,a),ki(n.b)}),_a(()=>{const r=T(()=>n.m.map(oc));return()=>{for(const s of r)typeof s=="function"&&s()}}),n.a.length&&_a(()=>{Ps(e,a),ki(n.a)})}function Ps(t,e){if(t.l.s)for(const n of t.l.s)i(n);e()}function Qe(t,e,n,a){var r=!Ur||(n&Rc)!==0,s=(n&Ic)!==0,l=(n&Dc)!==0,c=a,o=!0,u=()=>(o&&(o=!1,c=l?T(a):a),c);let f;if(s){var m=nr in t||cc in t;f=Lr(t,e)?.set??(m&&e in t?y=>t[e]=y:void 0)}var v,x=!1;s?[v,x]=Hc(()=>t[e]):v=t[e],v===void 0&&a!==void 0&&(v=u(),f&&(r&&_c(),f(v)));var b;if(r?b=()=>{var y=t[e];return y===void 0?u():(o=!0,y)}:b=()=>{var y=t[e];return y!==void 0&&(c=void 0),y===void 0?c:y},r&&(n&Cc)===0)return b;if(f){var E=t.$$legacy;return(function(y,I){return arguments.length>0?((!r||!I||E||x)&&f(I?b():y),y):b()})}var k=!1,_=((n&Ac)!==0?ya:Nt)(()=>(k=!1,b()));s&&i(_);var z=J;return(function(y,I){if(arguments.length>0){const G=I?i(_):r&&s?Cr(y):y;return h(_,G),k=!0,c!==void 0&&(c=G),y}return xn&&k||(z.f&Dt)!==0?_.v:i(_)})}function to(t){we===null&&ul(),Ur&&we.l!==null?Uu(we).m.push(t):_a(()=>{const e=T(t);if(typeof e=="function")return e})}function Fu(t){we===null&&ul(),to(()=>()=>T(t))}function Uu(t){var e=t.l;return e.u??={a:[],b:[],m:[]}}const Bu="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Bu);Uc();class no extends Error{constructor(e,n){super(n),this.status=e}status}async function Ve(t,e={}){const n=new Headers(e.headers);n.set("Accept","application/json"),e.body&&!(e.body instanceof FormData)&&n.set("Content-Type","application/json");const a=await fetch(t,{...e,headers:n});if(!a.ok)throw new no(a.status,await a.text());return a.json()}const Gu=[{title:"Ship it",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYjJ1bm1meHE4N2x3bnN0djJkMWtjNGc5bXYzZDFiOHBsbG16M3F0ZSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/l0HlHFRbmaZtBRhXG/giphy.gif",tags:["ship","launch","done"]},{title:"Approved",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExazBpbzJ6ODZ3bXQ3OHBvNGJidWZoajc0cHV6YnVub3MzZ3c1a2Z2dSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/111ebonMs90YLu/giphy.gif",tags:["yes","approved","nice"]},{title:"Deploy dance",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExY3NkaTVmZW9ydWNnZnl0ZWQ5aHQyeGNrd2k3NG4wZWNqYzNmd3k1ZCZlcD12MV9naWZzX3NlYXJjaCZjdD1n/GeimqsH0TLDt4tScGw/giphy.gif",tags:["deploy","dance","celebrate"]},{title:"Looking",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYWZ3emE0dm5mN2h0bGVsY2w0OXBodGd2cGJlNDRiZXo1YWNtdWRmZyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/26n6WywJyh39n1pBu/giphy.gif",tags:["search","looking","debug"]},{title:"Typing faster",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExOWFlbnJnbnIzbHYxcDIzdXZ3NGF3N2FocHNvMmR5enU3bHpycHBlZSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/13HgwGsXF0aiGY/giphy.gif",tags:["typing","code","work"]},{title:"Tiny victory",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdjJ2b2tqNmF4dG16NjE0eXhuc3h5bTlvamgwNTR0Zmd6ZjhtM2JuaSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/3o7abKhOpu0NwenH3O/giphy.gif",tags:["win","victory","celebrate"]}];function tr(t,e=120){if(!t)return"";const n=t.replace(/\s+/g," ").trim();return n.length>e?n.slice(0,e-1)+"...":n}function Ir(t){return t.quoted_author?.display_name||"Unknown"}function Hu(t,e){return e===t.id?"Open":"Thread"}function qu(t){const e=new Date(t),n=new Date,a=new Date;a.setDate(n.getDate()-1);const r=(s,l)=>s.getFullYear()===l.getFullYear()&&s.getMonth()===l.getMonth()&&s.getDate()===l.getDate();return r(e,n)?"Today":r(e,a)?"Yesterday":new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric"}).format(e)}function Wu(t){const e=[];let n="",a="",r=0;for(const s of t){const l=new Date(s.created_at),c=l.toDateString(),o=s.author?.id||s.author_id||"local",u=c!==n,f=o!==a,m=l.getTime()-r>300*1e3;u||f||m||e.length===0?e.push({key:s.id,dayLabel:u?qu(s.created_at):null,messages:[s],authorName:s.author?.display_name||"Local User",authorHandle:s.author?.handle||"",authorAvatarURL:s.author?.avatar_url||"",authorID:o,timestamp:s.created_at}):e[e.length-1].messages.push(s),n=c,a=o,r=l.getTime()}return e}function Ns(t){const e=t.trim();if(!e)return"?";const n=e.split(/\s+/);return n.length>=2?(n[0][0]+n[1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function Je(t){if(!t)return"?";const e=t.trim();return e?e[0].toUpperCase():"?"}function ut(t){return t?`@${t}`:""}function Ke(t){let e=0;for(let n=0;n>>0;return e%360}function zs(t,e){return t.members.find(n=>n.id!==e)||t.members[0]}function Jn(t,e){const n=t.members.filter(r=>r.id!==e);return(n.length>0?n:t.members).map(r=>r.display_name).join(", ")}function ju(t,e,n){const a=new Map;for(const r of e)for(const s of r.members)s.id&&s.id!==n&&a.set(s.id,s);for(const r of[...t].reverse()){const s=r.author;s?.id&&s.id!==n&&a.set(s.id,s)}return[...a.values()].slice(0,12)}function Fs(t,e){return t.find(n=>n.members.some(a=>a.id===e))}const Zu=new Set(["button","checkbox","combobox","link","listbox","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","option","radio","radiogroup","slider","spinbutton","switch","tab","tablist","textbox","tree","treeitem"]),Yu=new Set(["INPUT","TEXTAREA","SELECT","BUTTON","A","DETAILS","SUMMARY","VIDEO","AUDIO"]);function Xu(t){if(!t)return!1;if(t.isContentEditable)return!0;if(t instanceof HTMLInputElement){const e=(t.type||"text").toLowerCase();return e!=="checkbox"&&e!=="radio"&&e!=="button"&&e!=="submit"&&e!=="reset"&&e!=="file"}return t instanceof HTMLTextAreaElement}function Vu(t){if(!t||Qu(t))return!1;if(Yu.has(t.tagName))return!0;const e=t.getAttribute("role");if(e&&Zu.has(e))return!0;const n=t.getAttribute("tabindex");return!!(n!==null&&n!=="-1"&&t.hasAttribute("aria-keyshortcuts"))}function Qu(t){if(!t.closest(".messages, .thread"))return!1;if(t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement)return!0;const e=t.getAttribute("role");return e==="button"||e==="link"}function Ju(){const t=typeof window<"u"?window.getSelection():null;if(!t||t.isCollapsed||t.rangeCount===0)return!1;const e=t.getRangeAt(0).commonAncestorContainer;return e?!!(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(".messages, .thread, .markdown"):!1}function Ku(t,e){if(e.authRequired||e.isModalOpen()||t.defaultPrevented||t.isComposing||t.keyCode===229||t.ctrlKey||t.metaKey||t.altKey||t.key.length!==1||Ju())return!1;const n=document.activeElement;return!(n===e.messageInput||n===e.replyInput||Xu(n)||Vu(n))}function $u(t,e){if(!Ku(t,e))return;const n=e.target();if(!n||n.disabled||n.readOnly)return;t.key===" "&&t.preventDefault(),n.focus({preventScroll:!0});const a=n.value.length;if(n.setSelectionRange(a,a),t.key===" "){const r=n.selectionStart??a,s=n.selectionEnd??a;n.setRangeText(" ",r,s,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))}}const{entries:ro,setPrototypeOf:Us,isFrozen:ef,getPrototypeOf:tf,getOwnPropertyDescriptor:nf}=Object;let{freeze:gt,seal:qt,create:Er}=Object,{apply:Oi,construct:Mi}=typeof Reflect<"u"&&Reflect;gt||(gt=function(e){return e});qt||(qt=function(e){return e});Oi||(Oi=function(e,n){for(var a=arguments.length,r=new Array(a>2?a-2:0),s=2;s1?n-1:0),r=1;r"u"?null:Pe(BigInt.prototype.toString),Ws=typeof Symbol>"u"?null:Pe(Symbol.prototype.toString),Ee=Pe(Object.prototype.hasOwnProperty),sa=Pe(Object.prototype.toString),$e=Pe(RegExp.prototype.test),Ba=cf(TypeError);function Pe(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:da;if(Us&&Us(t,null),!ft(e))return t;let a=e.length;for(;a--;){let r=e[a];if(typeof r=="string"){const s=n(r);s!==r&&(ef(e)||(e[a]=s),r=s)}t[r]=!0}return t}function uf(t){for(let e=0;e/gm),mf=qt(/\$\{[\w\W]*/gm),_f=qt(/^data-[\-\w.\u00B7-\uFFFF]+$/),bf=qt(/^aria-[\-\w]+$/),ao=qt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kf=qt(/^(?:\w+script|data):/i),wf=qt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),io=qt(/^html$/i),yf=qt(/^[a-z][.\w]*(-[.\w]+)+$/i);var Vs=Object.freeze({__proto__:null,ARIA_ATTR:bf,ATTR_WHITESPACE:wf,CUSTOM_ELEMENT:yf,DATA_ATTR:_f,DOCTYPE_NAME:io,ERB_EXPR:gf,IS_ALLOWED_URI:ao,IS_SCRIPT_OR_DATA:kf,MUSTACHE_EXPR:vf,TMPLIT_EXPR:mf});const la={element:1,text:3,progressingInstruction:7,comment:8,document:9},xf=function(){return typeof window>"u"?null:window},Tf=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let a=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(a=n.getAttribute(r));const s="dompurify"+(a?"#"+a:"");try{return e.createPolicy(s,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Qs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function so(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xf();const e=B=>so(B);if(e.version="3.4.2",e.removed=[],!t||!t.document||t.document.nodeType!==la.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const a=n,r=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:c,Element:o,NodeFilter:u,NamedNodeMap:f=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:m,DOMParser:v,trustedTypes:x}=t,b=o.prototype,E=Ar(b,"cloneNode"),k=Ar(b,"remove"),_=Ar(b,"nextSibling"),z=Ar(b,"childNodes"),y=Ar(b,"parentNode");if(typeof l=="function"){const B=n.createElement("template");B.content&&B.content.ownerDocument&&(n=B.content.ownerDocument)}let I,G="";const{implementation:te,createNodeIterator:ae,createDocumentFragment:fe,getElementsByTagName:_e}=n,{importNode:ie}=a;let X=Qs();e.isSupported=typeof ro=="function"&&typeof y=="function"&&te&&te.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:le,ERB_EXPR:Ne,TMPLIT_EXPR:he,DATA_ATTR:lt,ARIA_ATTR:tt,IS_SCRIPT_OR_DATA:nt,ATTR_WHITESPACE:W,CUSTOM_ELEMENT:We}=Vs;let{IS_ALLOWED_URI:Lt}=Vs,se=null;const Tn=Y({},[...js,...gi,...mi,..._i,...Zs]);let de=null;const xt=Y({},[...Ys,...bi,...Xs,...Ga]);let oe=Object.seal(Er(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ze=null,Tt=null;const je=Object.seal(Er(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let $t=!0,ve=!0,Ge=!1,hr=!0,Ot=!1,Re=!0,fn=!1,Sn=!1,qr=!1,En=!1,vr=!1,dn=!1,Sa=!0,mt=!1;const gr="user-content-";let mr=!0,An=!1,pn={},_t=null;const _r=Y({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ea=null;const bt=Y({},["audio","video","img","source","image","track"]);let br=null;const Aa=Y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kr="http://www.w3.org/1998/Math/MathML",Rn="http://www.w3.org/2000/svg",Mt="http://www.w3.org/1999/xhtml";let Cn=Mt,In=!1,Wr=null;const Ra=Y({},[kr,Rn,Mt],vi);let jr=Y({},["mi","mo","mn","ms","mtext"]),Zr=Y({},["annotation-xml"]);const wr=Y({},["title","style","font","a","script"]);let Dn=null;const Yr=["application/xhtml+xml","text/html"],ni="text/html";let Ce=null,en=null;const Ln=n.createElement("form"),Xr=function(d){return d instanceof RegExp||d instanceof Function},Vr=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(en&&en===d)return;(!d||typeof d!="object")&&(d={}),d=kt(d),Dn=Yr.indexOf(d.PARSER_MEDIA_TYPE)===-1?ni:d.PARSER_MEDIA_TYPE,Ce=Dn==="application/xhtml+xml"?vi:da,se=Ee(d,"ALLOWED_TAGS")&&ft(d.ALLOWED_TAGS)?Y({},d.ALLOWED_TAGS,Ce):Tn,de=Ee(d,"ALLOWED_ATTR")&&ft(d.ALLOWED_ATTR)?Y({},d.ALLOWED_ATTR,Ce):xt,Wr=Ee(d,"ALLOWED_NAMESPACES")&&ft(d.ALLOWED_NAMESPACES)?Y({},d.ALLOWED_NAMESPACES,vi):Ra,br=Ee(d,"ADD_URI_SAFE_ATTR")&&ft(d.ADD_URI_SAFE_ATTR)?Y(kt(Aa),d.ADD_URI_SAFE_ATTR,Ce):Aa,Ea=Ee(d,"ADD_DATA_URI_TAGS")&&ft(d.ADD_DATA_URI_TAGS)?Y(kt(bt),d.ADD_DATA_URI_TAGS,Ce):bt,_t=Ee(d,"FORBID_CONTENTS")&&ft(d.FORBID_CONTENTS)?Y({},d.FORBID_CONTENTS,Ce):_r,ze=Ee(d,"FORBID_TAGS")&&ft(d.FORBID_TAGS)?Y({},d.FORBID_TAGS,Ce):kt({}),Tt=Ee(d,"FORBID_ATTR")&&ft(d.FORBID_ATTR)?Y({},d.FORBID_ATTR,Ce):kt({}),pn=Ee(d,"USE_PROFILES")?d.USE_PROFILES&&typeof d.USE_PROFILES=="object"?kt(d.USE_PROFILES):d.USE_PROFILES:!1,$t=d.ALLOW_ARIA_ATTR!==!1,ve=d.ALLOW_DATA_ATTR!==!1,Ge=d.ALLOW_UNKNOWN_PROTOCOLS||!1,hr=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ot=d.SAFE_FOR_TEMPLATES||!1,Re=d.SAFE_FOR_XML!==!1,fn=d.WHOLE_DOCUMENT||!1,En=d.RETURN_DOM||!1,vr=d.RETURN_DOM_FRAGMENT||!1,dn=d.RETURN_TRUSTED_TYPE||!1,qr=d.FORCE_BODY||!1,Sa=d.SANITIZE_DOM!==!1,mt=d.SANITIZE_NAMED_PROPS||!1,mr=d.KEEP_CONTENT!==!1,An=d.IN_PLACE||!1,Lt=df(d.ALLOWED_URI_REGEXP)?d.ALLOWED_URI_REGEXP:ao,Cn=typeof d.NAMESPACE=="string"?d.NAMESPACE:Mt,jr=Ee(d,"MATHML_TEXT_INTEGRATION_POINTS")&&d.MATHML_TEXT_INTEGRATION_POINTS&&typeof d.MATHML_TEXT_INTEGRATION_POINTS=="object"?kt(d.MATHML_TEXT_INTEGRATION_POINTS):Y({},["mi","mo","mn","ms","mtext"]),Zr=Ee(d,"HTML_INTEGRATION_POINTS")&&d.HTML_INTEGRATION_POINTS&&typeof d.HTML_INTEGRATION_POINTS=="object"?kt(d.HTML_INTEGRATION_POINTS):Y({},["annotation-xml"]);const S=Ee(d,"CUSTOM_ELEMENT_HANDLING")&&d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING=="object"?kt(d.CUSTOM_ELEMENT_HANDLING):Er(null);if(oe=Er(null),Ee(S,"tagNameCheck")&&Xr(S.tagNameCheck)&&(oe.tagNameCheck=S.tagNameCheck),Ee(S,"attributeNameCheck")&&Xr(S.attributeNameCheck)&&(oe.attributeNameCheck=S.attributeNameCheck),Ee(S,"allowCustomizedBuiltInElements")&&typeof S.allowCustomizedBuiltInElements=="boolean"&&(oe.allowCustomizedBuiltInElements=S.allowCustomizedBuiltInElements),Ot&&(ve=!1),vr&&(En=!0),pn&&(se=Y({},Zs),de=Er(null),pn.html===!0&&(Y(se,js),Y(de,Ys)),pn.svg===!0&&(Y(se,gi),Y(de,bi),Y(de,Ga)),pn.svgFilters===!0&&(Y(se,mi),Y(de,bi),Y(de,Ga)),pn.mathMl===!0&&(Y(se,_i),Y(de,Xs),Y(de,Ga))),je.tagCheck=null,je.attributeCheck=null,Ee(d,"ADD_TAGS")&&(typeof d.ADD_TAGS=="function"?je.tagCheck=d.ADD_TAGS:ft(d.ADD_TAGS)&&(se===Tn&&(se=kt(se)),Y(se,d.ADD_TAGS,Ce))),Ee(d,"ADD_ATTR")&&(typeof d.ADD_ATTR=="function"?je.attributeCheck=d.ADD_ATTR:ft(d.ADD_ATTR)&&(de===xt&&(de=kt(de)),Y(de,d.ADD_ATTR,Ce))),Ee(d,"ADD_URI_SAFE_ATTR")&&ft(d.ADD_URI_SAFE_ATTR)&&Y(br,d.ADD_URI_SAFE_ATTR,Ce),Ee(d,"FORBID_CONTENTS")&&ft(d.FORBID_CONTENTS)&&(_t===_r&&(_t=kt(_t)),Y(_t,d.FORBID_CONTENTS,Ce)),Ee(d,"ADD_FORBID_CONTENTS")&&ft(d.ADD_FORBID_CONTENTS)&&(_t===_r&&(_t=kt(_t)),Y(_t,d.ADD_FORBID_CONTENTS,Ce)),mr&&(se["#text"]=!0),fn&&Y(se,["html","head","body"]),se.table&&(Y(se,["tbody"]),delete ze.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ba('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ba('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=d.TRUSTED_TYPES_POLICY,G=I.createHTML("")}else I===void 0&&(I=Tf(x,r)),I!==null&&typeof G=="string"&&(G=I.createHTML(""));gt&>(d),en=d},Ca=Y({},[...gi,...mi,...pf]),Ia=Y({},[..._i,...hf]),w=function(d){let S=y(d);(!S||!S.tagName)&&(S={namespaceURI:Cn,tagName:"template"});const M=da(d.tagName),pe=da(S.tagName);return Wr[d.namespaceURI]?d.namespaceURI===Rn?S.namespaceURI===Mt?M==="svg":S.namespaceURI===kr?M==="svg"&&(pe==="annotation-xml"||jr[pe]):!!Ca[M]:d.namespaceURI===kr?S.namespaceURI===Mt?M==="math":S.namespaceURI===Rn?M==="math"&&Zr[pe]:!!Ia[M]:d.namespaceURI===Mt?S.namespaceURI===Rn&&!Zr[pe]||S.namespaceURI===kr&&!jr[pe]?!1:!Ia[M]&&(wr[M]||!Ca[M]):!!(Dn==="application/xhtml+xml"&&Wr[d.namespaceURI]):!1},D=function(d){ia(e.removed,{element:d});try{y(d).removeChild(d)}catch{k(d)}},$=function(d,S){try{ia(e.removed,{attribute:S.getAttributeNode(d),from:S})}catch{ia(e.removed,{attribute:null,from:S})}if(S.removeAttribute(d),d==="is")if(En||vr)try{D(S)}catch{}else try{S.setAttribute(d,"")}catch{}},ye=function(d){let S=null,M=null;if(qr)d=""+d;else{const Se=Gs(d,/^[\r\n\t ]+/);M=Se&&Se[0]}Dn==="application/xhtml+xml"&&Cn===Mt&&(d=''+d+"");const pe=I?I.createHTML(d):d;if(Cn===Mt)try{S=new v().parseFromString(pe,Dn)}catch{}if(!S||!S.documentElement){S=te.createDocument(Cn,"template",null);try{S.documentElement.innerHTML=In?G:pe}catch{}}const Ue=S.body||S.documentElement;return d&&M&&Ue.insertBefore(n.createTextNode(M),Ue.childNodes[0]||null),Cn===Mt?_e.call(S,fn?"html":"body")[0]:fn?S.documentElement:Ue},Ze=function(d){return ae.call(d.ownerDocument||d,d,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Pt=function(d){return d instanceof m&&(typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||!(d.attributes instanceof f)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function")},St=function(d){return typeof c=="function"&&d instanceof c};function Fe(B,d,S){aa(B,M=>{M.call(e,d,S,en)})}const Qr=function(d){let S=null;if(Fe(X.beforeSanitizeElements,d,null),Pt(d))return D(d),!0;const M=Ce(d.nodeName);if(Fe(X.uponSanitizeElement,d,{tagName:M,allowedTags:se}),Re&&d.hasChildNodes()&&!St(d.firstElementChild)&&$e(/<[/\w!]/g,d.innerHTML)&&$e(/<[/\w!]/g,d.textContent)||Re&&d.namespaceURI===Mt&&M==="style"&&St(d.firstElementChild)||d.nodeType===la.progressingInstruction||Re&&d.nodeType===la.comment&&$e(/<[/\w]/g,d.data))return D(d),!0;if(ze[M]||!(je.tagCheck instanceof Function&&je.tagCheck(M))&&!se[M]){if(!ze[M]&&La(M)&&(oe.tagNameCheck instanceof RegExp&&$e(oe.tagNameCheck,M)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(M)))return!1;if(mr&&!_t[M]){const pe=y(d)||d.parentNode,Ue=z(d)||d.childNodes;if(Ue&&pe){const Se=Ue.length;for(let rt=Se-1;rt>=0;--rt){const Ye=E(Ue[rt],!0);pe.insertBefore(Ye,_(d))}}}return D(d),!0}return d instanceof o&&!w(d)||(M==="noscript"||M==="noembed"||M==="noframes")&&$e(/<\/no(script|embed|frames)/i,d.innerHTML)?(D(d),!0):(Ot&&d.nodeType===la.text&&(S=d.textContent,aa([le,Ne,he],pe=>{S=Sr(S,pe," ")}),d.textContent!==S&&(ia(e.removed,{element:d.cloneNode()}),d.textContent=S)),Fe(X.afterSanitizeElements,d,null),!1)},Jr=function(d,S,M){if(Tt[S]||Sa&&(S==="id"||S==="name")&&(M in n||M in Ln))return!1;const pe=de[S]||je.attributeCheck instanceof Function&&je.attributeCheck(S,d);if(!(ve&&!Tt[S]&&$e(lt,S))){if(!($t&&$e(tt,S))){if(!pe||Tt[S]){if(!(La(d)&&(oe.tagNameCheck instanceof RegExp&&$e(oe.tagNameCheck,d)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(d))&&(oe.attributeNameCheck instanceof RegExp&&$e(oe.attributeNameCheck,S)||oe.attributeNameCheck instanceof Function&&oe.attributeNameCheck(S,d))||S==="is"&&oe.allowCustomizedBuiltInElements&&(oe.tagNameCheck instanceof RegExp&&$e(oe.tagNameCheck,M)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(M))))return!1}else if(!br[S]){if(!$e(Lt,Sr(M,W,""))){if(!((S==="src"||S==="xlink:href"||S==="href")&&d!=="script"&&Hs(M,"data:")===0&&Ea[d])){if(!(Ge&&!$e(nt,Sr(M,W,"")))){if(M)return!1}}}}}}return!0},Da=Y({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),La=function(d){return!Da[da(d)]&&$e(We,d)},Oa=function(d){Fe(X.beforeSanitizeAttributes,d,null);const{attributes:S}=d;if(!S||Pt(d))return;const M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:de,forceKeepAttr:void 0};let pe=S.length;for(;pe--;){const Ue=S[pe],{name:Se,namespaceURI:rt,value:Ye}=Ue,Et=Ce(Se),Kr=Ye;let Ie=Se==="value"?Kr:sf(Kr);if(M.attrName=Et,M.attrValue=Ie,M.keepAttr=!0,M.forceKeepAttr=void 0,Fe(X.uponSanitizeAttribute,d,M),Ie=M.attrValue,mt&&(Et==="id"||Et==="name")&&Hs(Ie,gr)!==0&&($(Se,d),Ie=gr+Ie),Re&&$e(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ie)){$(Se,d);continue}if(Et==="attributename"&&Gs(Ie,"href")){$(Se,d);continue}if(M.forceKeepAttr)continue;if(!M.keepAttr){$(Se,d);continue}if(!hr&&$e(/\/>/i,Ie)){$(Se,d);continue}Ot&&aa([le,Ne,he],ea=>{Ie=Sr(Ie,ea," ")});const $r=Ce(d.nodeName);if(!Jr($r,Et,Ie)){$(Se,d);continue}if(I&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!rt)switch(x.getAttributeType($r,Et)){case"TrustedHTML":{Ie=I.createHTML(Ie);break}case"TrustedScriptURL":{Ie=I.createScriptURL(Ie);break}}if(Ie!==Kr)try{rt?d.setAttributeNS(rt,Se,Ie):d.setAttribute(Se,Ie),Pt(d)?D(d):Bs(e.removed)}catch{$(Se,d)}}Fe(X.afterSanitizeAttributes,d,null)},Ma=function(d){let S=null;const M=Ze(d);for(Fe(X.beforeSanitizeShadowDOM,d,null);S=M.nextNode();)Fe(X.uponSanitizeShadowNode,S,null),Qr(S),Oa(S),S.content instanceof s&&Ma(S.content);Fe(X.afterSanitizeShadowDOM,d,null)};return e.sanitize=function(B){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,M=null,pe=null,Ue=null;if(In=!B,In&&(B=""),typeof B!="string"&&!St(B)&&(B=ff(B),typeof B!="string"))throw Ba("dirty is not a string, aborting");if(!e.isSupported)return B;if(Sn||Vr(d),e.removed=[],typeof B=="string"&&(An=!1),An){const Ye=B.nodeName;if(typeof Ye=="string"){const Et=Ce(Ye);if(!se[Et]||ze[Et])throw Ba("root node is forbidden and cannot be sanitized in-place")}}else if(B instanceof c)S=ye(""),M=S.ownerDocument.importNode(B,!0),M.nodeType===la.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?S=M:S.appendChild(M);else{if(!En&&!Ot&&!fn&&B.indexOf("<")===-1)return I&&dn?I.createHTML(B):B;if(S=ye(B),!S)return En?null:dn?G:""}S&&qr&&D(S.firstChild);const Se=Ze(An?B:S);for(;pe=Se.nextNode();)Qr(pe),Oa(pe),pe.content instanceof s&&Ma(pe.content);if(An)return B;if(En){if(Ot){S.normalize();let Ye=S.innerHTML;aa([le,Ne,he],Et=>{Ye=Sr(Ye,Et," ")}),S.innerHTML=Ye}if(vr)for(Ue=fe.call(S.ownerDocument);S.firstChild;)Ue.appendChild(S.firstChild);else Ue=S;return(de.shadowroot||de.shadowrootmode)&&(Ue=ie.call(a,Ue,!0)),Ue}let rt=fn?S.outerHTML:S.innerHTML;return fn&&se["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&$e(io,S.ownerDocument.doctype.name)&&(rt=" +`+rt),Ot&&aa([le,Ne,he],Ye=>{rt=Sr(rt,Ye," ")}),I&&dn?I.createHTML(rt):rt},e.setConfig=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vr(B),Sn=!0},e.clearConfig=function(){en=null,Sn=!1},e.isValidAttribute=function(B,d,S){en||Vr({});const M=Ce(B),pe=Ce(d);return Jr(M,pe,S)},e.addHook=function(B,d){typeof d=="function"&&ia(X[B],d)},e.removeHook=function(B,d){if(d!==void 0){const S=rf(X[B],d);return S===-1?void 0:af(X[B],S,1)[0]}return Bs(X[B])},e.removeHooks=function(B){X[B]=[]},e.removeAllHooks=function(){X=Qs()},e}var Sf=so();function Qi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var pr=Qi();function lo(t){pr=t}var Kn={exec:()=>null};function ne(t,e=""){let n=typeof t=="string"?t:t.source,a={replace:(r,s)=>{let l=typeof s=="string"?s:s.source;return l=l.replace(ht.caret,"$1"),n=n.replace(r,l),a},getRegex:()=>new RegExp(n,e)};return a}var Ef=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Af=/^(?:[ \t]*(?:\n|$))+/,Rf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Cf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ta=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,If=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ji=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,oo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,co=ne(oo).replace(/bull/g,Ji).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Df=ne(oo).replace(/bull/g,Ji).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ki=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Lf=/^[^\n]+/,$i=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Of=ne(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$i).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Mf=ne(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ji).getRegex(),ei="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",es=/|$))/,Pf=ne("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",es).replace("tag",ei).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),uo=ne(Ki).replace("hr",Ta).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ei).getRegex(),Nf=ne(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",uo).getRegex(),ts={blockquote:Nf,code:Rf,def:Of,fences:Cf,heading:If,hr:Ta,html:Pf,lheading:co,list:Mf,newline:Af,paragraph:uo,table:Kn,text:Lf},Js=ne("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ta).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ei).getRegex(),zf={...ts,lheading:Df,table:Js,paragraph:ne(Ki).replace("hr",Ta).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Js).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ei).getRegex()},Ff={...ts,html:ne(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",es).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Kn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ne(Ki).replace("hr",Ta).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",co).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Uf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Bf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,fo=/^( {2,}|\\)\n(?!\s*$)/,Gf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ef?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ho=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Zf=ne(ho,"u").replace(/punct/g,Hr).getRegex(),Yf=ne(ho,"u").replace(/punct/g,po).getRegex(),vo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Xf=ne(vo,"gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,ti).replace(/punct/g,Hr).getRegex(),Vf=ne(vo,"gu").replace(/notPunctSpace/g,Wf).replace(/punctSpace/g,qf).replace(/punct/g,po).getRegex(),Qf=ne("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,ti).replace(/punct/g,Hr).getRegex(),Jf=ne(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Hr).getRegex(),Kf="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",$f=ne(Kf,"gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,ti).replace(/punct/g,Hr).getRegex(),ed=ne(/\\(punct)/,"gu").replace(/punct/g,Hr).getRegex(),td=ne(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),nd=ne(es).replace("(?:-->|$)","-->").getRegex(),rd=ne("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",nd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ya=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ad=ne(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ya).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),go=ne(/^!?\[(label)\]\[(ref)\]/).replace("label",Ya).replace("ref",$i).getRegex(),mo=ne(/^!?\[(ref)\](?:\[\])?/).replace("ref",$i).getRegex(),id=ne("reflink|nolink(?!\\()","g").replace("reflink",go).replace("nolink",mo).getRegex(),Ks=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,rs={_backpedal:Kn,anyPunctuation:ed,autolink:td,blockSkip:jf,br:fo,code:Bf,del:Kn,delLDelim:Kn,delRDelim:Kn,emStrongLDelim:Zf,emStrongRDelimAst:Xf,emStrongRDelimUnd:Qf,escape:Uf,link:ad,nolink:mo,punctuation:Hf,reflink:go,reflinkSearch:id,tag:rd,text:Gf,url:Kn},sd={...rs,link:ne(/^!?\[(label)\]\((.*?)\)/).replace("label",Ya).getRegex(),reflink:ne(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ya).getRegex()},Pi={...rs,emStrongRDelimAst:Vf,emStrongLDelim:Yf,delLDelim:Jf,delRDelim:$f,url:ne(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ks).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ne(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},$s=t=>od[t];function rn(t,e){if(e){if(ht.escapeTest.test(t))return t.replace(ht.escapeReplace,$s)}else if(ht.escapeTestNoEncode.test(t))return t.replace(ht.escapeReplaceNoEncode,$s);return t}function el(t){try{t=encodeURI(t).replace(ht.percentDecode,"%")}catch{return null}return t}function tl(t,e){let n=t.replace(ht.findPipe,(s,l,c)=>{let o=!1,u=l;for(;--u>=0&&c[u]==="\\";)o=!o;return o?"|":" |"}),a=n.split(ht.splitPipe),r=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length0?-2:-1}function ud(t,e=0){let n=e,a="";for(let r of t)if(r===" "){let s=4-n%4;a+=" ".repeat(s),n+=s}else a+=r,n++;return a}function nl(t,e,n,a,r){let s=e.href,l=e.title||null,c=t[1].replace(r.other.outputLinkReplace,"$1");a.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:l,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,o}function fd(t,e,n){let a=t.match(n.other.indentCodeCompensation);if(a===null)return e;let r=a[1];return e.split(` +`).map(s=>{let l=s.match(n.other.beginningSpace);if(l===null)return s;let[c]=l;return c.length>=r.length?s.slice(r.length):s}).join(` +`)}var Xa=class{options;rules;lexer;constructor(t){this.options=t||pr}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ca(n,` +`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],a=fd(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:a}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let a=ca(n,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(n=a.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:ca(e[0],` +`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=ca(e[0],` +`).split(` +`),a="",r="",s=[];for(;n.length>0;){let l=!1,c=[],o;for(o=0;o1,r={type:"list",raw:"",ordered:a,start:a?+n.slice(0,-1):"",loose:!1,items:[]};n=a?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=a?n:"[*+-]");let s=this.rules.other.listItemRegex(n),l=!1;for(;t;){let o=!1,u="",f="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;u=e[0],t=t.substring(u.length);let m=ud(e[2].split(` +`,1)[0],e[1].length),v=t.split(` +`,1)[0],x=!m.trim(),b=0;if(this.options.pedantic?(b=2,f=m.trimStart()):x?b=e[1].length+1:(b=m.search(this.rules.other.nonSpaceChar),b=b>4?1:b,f=m.slice(b),b+=e[1].length),x&&this.rules.other.blankLine.test(v)&&(u+=v+` +`,t=t.substring(v.length+1),o=!0),!o){let E=this.rules.other.nextBulletRegex(b),k=this.rules.other.hrRegex(b),_=this.rules.other.fencesBeginRegex(b),z=this.rules.other.headingBeginRegex(b),y=this.rules.other.htmlBeginRegex(b),I=this.rules.other.blockquoteBeginRegex(b);for(;t;){let G=t.split(` +`,1)[0],te;if(v=G,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),te=v):te=v.replace(this.rules.other.tabCharGlobal," "),_.test(v)||z.test(v)||y.test(v)||I.test(v)||E.test(v)||k.test(v))break;if(te.search(this.rules.other.nonSpaceChar)>=b||!v.trim())f+=` +`+te.slice(b);else{if(x||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(m)||z.test(m)||k.test(m))break;f+=` +`+v}x=!v.trim(),u+=G+` +`,t=t.substring(G.length+1),m=te.slice(b)}}r.loose||(l?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(l=!0)),r.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),r.raw+=u}let c=r.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let o of r.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(o.raw);if(u){let f={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};o.checked=f.checked,r.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=f.raw+o.tokens[0].raw,o.tokens[0].text=f.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(f)):o.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):o.tokens.unshift(f)}}if(!r.loose){let u=o.tokens.filter(m=>m.type==="space"),f=u.length>0&&u.some(m=>this.rules.other.anyLine.test(m.raw));r.loose=f}}if(r.loose)for(let o of r.items){o.loose=!0;for(let u of o.tokens)u.type==="text"&&(u.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:a,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=tl(e[1]),a=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(` +`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===a.length){for(let l of a)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[o]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===` +`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=ca(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=cd(e[2],"()");if(s===-2)return;if(s>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let a=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(a);s&&(a=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?a=a.slice(1):a=a.slice(1,-1)),nl(e,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let a=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[a.toLowerCase()];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return nl(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!(!a||!a[1]&&!a[2]&&!a[3]&&!a[4]||a[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...a[0]].length-1,s,l,c=r,o=0,u=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+r);(a=u.exec(e))!==null;){if(s=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!s)continue;if(l=[...s].length,a[3]||a[4]){c+=l;continue}else if((a[5]||a[6])&&r%3&&!((r+l)%3)){o+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+o);let f=[...a[0]][0].length,m=t.slice(0,r+a.index+f+l);if(Math.min(r,l)%2){let x=m.slice(1,-1);return{type:"em",raw:m,text:x,tokens:this.lexer.inlineTokens(x)}}let v=m.slice(2,-2);return{type:"strong",raw:m,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return a&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let a=this.rules.inline.delLDelim.exec(t);if(a&&(!a[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...a[0]].length-1,s,l,c=r,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*t.length+r);(a=o.exec(e))!==null;){if(s=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!s||(l=[...s].length,l!==r))continue;if(a[3]||a[4]){c+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c);let u=[...a[0]][0].length,f=t.slice(0,r+a.index+u+l),m=f.slice(r,-r);return{type:"del",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,a;return e[2]==="@"?(n=e[1],a="mailto:"+n):(n=e[1],a=n),{type:"link",raw:e[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,a;if(e[2]==="@")n=e[0],a="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?a="http://"+e[0]:a=e[0]}return{type:"link",raw:e[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Yt=class Ni{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||pr,this.options.tokenizer=this.options.tokenizer||new Xa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:ht,block:Ha.normal,inline:oa.normal};this.options.pedantic?(n.block=Ha.pedantic,n.inline=oa.pedantic):this.options.gfm&&(n.block=Ha.gfm,this.options.breaks?n.inline=oa.breaks:n.inline=oa.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ha,inline:oa}}static lex(e,n){return new Ni(n).lex(e)}static lexInline(e,n){return new Ni(n).inlineTokens(e)}lex(e){e=e.replace(ht.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let n=0;n(r=l.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let l=n.at(-1);r.raw.length===1&&l!==void 0?l.raw+=` +`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(` +`)?"":` +`)+r.raw,l.text+=` +`+r.text,this.inlineQueue.at(-1).src=l.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(` +`)?"":` +`)+r.raw,l.text+=` +`+r.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},n.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let l=1/0,c=e.slice(1),o;this.options.extensions.startBlock.forEach(u=>{o=u.call({lexer:this},c),typeof o=="number"&&o>=0&&(l=Math.min(l,o))}),l<1/0&&l>=0&&(s=e.substring(0,l+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let l=n.at(-1);a&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(` +`)?"":` +`)+r.raw,l.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(r),a=s.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(` +`)?"":` +`)+r.raw,l.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(r);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let a=e,r=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(a))!==null;)o.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(a))!==null;)a=a.slice(0,r.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(a))!==null;)s=r[2]?r[2].length:0,a=a.slice(0,r.index+s)+"["+"a".repeat(r[0].length-s-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let l=!1,c="";for(;e;){l||(c=""),l=!1;let o;if(this.options.extensions?.inline?.some(f=>(o=f.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let f=n.at(-1);o.type==="text"&&f?.type==="text"?(f.raw+=o.raw,f.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(e,a,c)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e,a,c)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let u=e;if(this.options.extensions?.startInline){let f=1/0,m=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},m),typeof v=="number"&&v>=0&&(f=Math.min(f,v))}),f<1/0&&f>=0&&(u=e.substring(0,f+1))}if(o=this.tokenizer.inlineText(u)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(c=o.raw.slice(-1)),l=!0;let f=n.at(-1);f?.type==="text"?(f.raw+=o.raw,f.text+=o.text):n.push(o);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return n}},Va=class{options;parser;constructor(t){this.options=t||pr}space(t){return""}code({text:t,lang:e,escaped:n}){let a=(e||"").match(ht.notSpaceStart)?.[0],r=t.replace(ht.endingNewline,"")+` +`;return a?'
    '+(n?r:rn(r,!0))+`
    +`:"
    "+(n?r:rn(r,!0))+`
    +`}blockquote({tokens:t}){return`
    +${this.parser.parse(t)}
    +`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`${this.parser.parseInline(t)} +`}hr(t){return`
    +`}list(t){let e=t.ordered,n=t.start,a="";for(let l=0;l +`+a+" +`}listitem(t){return`
  • ${this.parser.parse(t.tokens)}
  • +`}checkbox({checked:t}){return" '}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    +`}table(t){let e="",n="";for(let r=0;r${a}`),` + +`+e+` +`+a+`
    +`}tablerow({text:t}){return` +${t} +`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+` +`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${rn(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:e,tokens:n}){let a=this.parser.parseInline(n),r=el(t);if(r===null)return a;t=r;let s='
    ",s}image({href:t,title:e,text:n,tokens:a}){a&&(n=this.parser.parseInline(a,this.parser.textRenderer));let r=el(t);if(r===null)return rn(n);t=r;let s=`${rn(n)}{let l=r[s].flat(1/0);n=n.concat(this.walkTokens(l,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let a={...n};if(a.async=this.defaults.async||a.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let s=e.renderers[r.name];s?e.renderers[r.name]=function(...l){let c=r.renderer.apply(this,l);return c===!1&&(c=s.apply(this,l)),c}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[r.level];s?s.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),a.extensions=e),n.renderer){let r=this.defaults.renderer||new Va(this.defaults);for(let s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let l=s,c=n.renderer[l],o=r[l];r[l]=(...u)=>{let f=c.apply(r,u);return f===!1&&(f=o.apply(r,u)),f||""}}a.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Xa(this.defaults);for(let s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let l=s,c=n.tokenizer[l],o=r[l];r[l]=(...u)=>{let f=c.apply(r,u);return f===!1&&(f=o.apply(r,u)),f}}a.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new pa;for(let s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let l=s,c=n.hooks[l],o=r[l];pa.passThroughHooks.has(s)?r[l]=u=>{if(this.defaults.async&&pa.passThroughHooksRespectAsync.has(s))return(async()=>{let m=await c.call(r,u);return o.call(r,m)})();let f=c.call(r,u);return o.call(r,f)}:r[l]=(...u)=>{if(this.defaults.async)return(async()=>{let m=await c.apply(r,u);return m===!1&&(m=await o.apply(r,u)),m})();let f=c.apply(r,u);return f===!1&&(f=o.apply(r,u)),f}}a.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,s=n.walkTokens;a.walkTokens=function(l){let c=[];return c.push(s.call(this,l)),r&&(c=c.concat(r.call(this,l))),c}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Yt.lex(t,e??this.defaults)}parser(t,e){return Xt.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let a={...n},r={...this.defaults,...a},s=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&a.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let l=r.hooks?await r.hooks.preprocess(e):e,c=await(r.hooks?await r.hooks.provideLexer(t):t?Yt.lex:Yt.lexInline)(l,r),o=r.hooks?await r.hooks.processAllTokens(c):c;r.walkTokens&&await Promise.all(this.walkTokens(o,r.walkTokens));let u=await(r.hooks?await r.hooks.provideParser(t):t?Xt.parse:Xt.parseInline)(o,r);return r.hooks?await r.hooks.postprocess(u):u})().catch(s);try{r.hooks&&(e=r.hooks.preprocess(e));let l=(r.hooks?r.hooks.provideLexer(t):t?Yt.lex:Yt.lexInline)(e,r);r.hooks&&(l=r.hooks.processAllTokens(l)),r.walkTokens&&this.walkTokens(l,r.walkTokens);let c=(r.hooks?r.hooks.provideParser(t):t?Xt.parse:Xt.parseInline)(l,r);return r.hooks&&(c=r.hooks.postprocess(c)),c}catch(l){return s(l)}}}onError(t,e){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,t){let a="

    An error occurred:

    "+rn(n.message+"",!0)+"
    ";return e?Promise.resolve(a):a}if(e)return Promise.reject(n);throw n}}},ur=new dd;function ue(t,e){return ur.parse(t,e)}ue.options=ue.setOptions=function(t){return ur.setOptions(t),ue.defaults=ur.defaults,lo(ue.defaults),ue};ue.getDefaults=Qi;ue.defaults=pr;ue.use=function(...t){return ur.use(...t),ue.defaults=ur.defaults,lo(ue.defaults),ue};ue.walkTokens=function(t,e){return ur.walkTokens(t,e)};ue.parseInline=ur.parseInline;ue.Parser=Xt;ue.parser=Xt.parse;ue.Renderer=Va;ue.TextRenderer=as;ue.Lexer=Yt;ue.lexer=Yt.lex;ue.Tokenizer=Xa;ue.Hooks=pa;ue.parse=ue;ue.options;ue.setOptions;ue.use;ue.walkTokens;ue.parseInline;Xt.parse;Yt.lex;function ha(t){return Sf.sanitize(ue.parse(t,{async:!1,breaks:!0,gfm:!0}))}function zn(t){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(t))}function Dr(t){return`/api/uploads/${encodeURIComponent(t.id)}`}function pd(t){return t.content_type.startsWith("image/")}function hd(t){return t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function vd(t,e){const n=()=>{const s=t.style.height;t.style.height="auto";const l=`${t.scrollHeight}px`;s!==l?t.style.height=l:t.style.height=s},a=()=>n(),r=()=>n();return requestAnimationFrame(n),t.addEventListener("input",a),window.addEventListener("resize",r),{update(){requestAnimationFrame(n)},destroy(){t.removeEventListener("input",a),window.removeEventListener("resize",r)}}}var gd=L('
    ');function md(t,e){Wt(e,!0);var n=gd(),a=p(n),r=g(a,2),s=g(r,2),l=p(s);l.textContent="<>";var c=g(s,2),o=p(c);o.textContent="{}";var u=g(c,2),f=g(u,2);let m;N(()=>m=dt(f,1,"",null,m,{active:e.showGifPicker})),H("click",a,()=>e.onWrap("**")),H("click",r,()=>e.onWrap("_")),H("click",s,()=>e.onWrap("`")),H("click",c,()=>e.onWrap("```","\n```")),H("click",u,()=>e.onAppend("[label](https://)")),H("click",f,function(...v){e.onToggleGif?.apply(this,v)}),R(t,n),jt()}un(["click"]);var _d=L(''),bd=L('
    GIFs
    ');function kd(t,e){Wt(e,!0);var n=bd(),a=p(n),r=g(p(a),2),s=g(a,2);It(s,21,()=>e.gifs,l=>l.url,(l,c)=>{var o=_d(),u=p(o),f=g(u,2),m=p(f);N(()=>{F(u,"src",i(c).url),F(u,"alt",i(c).title),O(m,i(c).title)}),H("click",o,()=>e.onPick(i(c).url,i(c).title)),R(l,o)}),N(()=>Kl(r,e.query)),H("input",r,l=>e.onQuery(l.currentTarget.value)),R(t,n),jt()}un(["input","click"]);var wd=L('
    Replying to
    ');function yd(t,e){Wt(e,!0);var n=wd(),a=g(p(n),2),r=p(a),s=g(p(r)),l=p(s),c=g(r,2),o=p(c),u=g(a,2);N(f=>{O(l,e.target.author?.display_name||"Local User"),O(o,f)},[()=>tr(e.target.body)]),H("click",u,function(...f){e.onClear?.apply(this,f)}),R(t,n),jt()}un(["click"]);var xd=L(''),Td=L('
    '),Sd=L(''),Ed=L('
    ');function rl(t,e){Wt(e,!0);let n=Qe(e,"formClass",3,"composer"),a=Qe(e,"pendingUpload",3,null),r=Qe(e,"replyTarget",3,null),s=Qe(e,"showUpload",3,!1),l=Qe(e,"showToolbar",3,!1),c=Qe(e,"showGifPicker",3,!1),o=Qe(e,"gifQuery",3,""),u=Qe(e,"filteredGifs",19,()=>[]),f=Qe(e,"onUploadFile",3,()=>{}),m=Qe(e,"onRemoveUpload",3,()=>{}),v=Qe(e,"onClearReply",3,()=>{}),x=Qe(e,"onApplyMarkdownWrap",3,()=>{}),b=Qe(e,"onAppendToComposer",3,()=>{}),E=Qe(e,"onToggleGif",3,()=>{}),k=Qe(e,"onGifQuery",3,()=>{}),_=Qe(e,"onPickGif",3,()=>{}),z=Ct(null);_a(()=>(e.onInputRef(i(z)),()=>e.onInputRef(null)));var y=Ed(),I=p(y);{var G=W=>{kd(W,{get gifs(){return u()},get query(){return o()},get onQuery(){return k()},get onPick(){return _()}})};q(I,W=>{c()&&W(G)})}var te=g(I,2),ae=p(te);{var fe=W=>{var We=Td(),Lt=g(p(We),2);{var se=ze=>{var Tt=xd();N(je=>{F(Tt,"src",je),F(Tt,"alt",a().filename)},[()=>Dr(a())]),R(ze,Tt)},Tn=lr(()=>pd(a()));q(Lt,ze=>{i(Tn)&&ze(se)})}var de=g(Lt,2),xt=p(de),oe=g(de,2);N(ze=>O(xt,`${a().filename??""} · ${ze??""}`),[()=>hd(a().byte_size)]),H("click",oe,function(...ze){m()?.apply(this,ze)}),R(W,We)};q(ae,W=>{a()&&W(fe)})}var _e=g(ae,2);{var ie=W=>{yd(W,{get target(){return r()},get onClear(){return v()}})};q(_e,W=>{r()&&W(ie)})}var X=g(_e,2),le=p(X);{var Ne=W=>{var We=Sd(),Lt=p(We);H("change",Lt,function(...se){f()?.apply(this,se)}),R(W,We)};q(le,W=>{s()&&W(Ne)})}var he=g(le,2);Vi(he,W=>h(z,W),()=>i(z)),Cu(he,(W,We)=>vd?.(W),()=>e.value);var lt=g(he,2),tt=g(X,2);{var nt=W=>{md(W,{get showGifPicker(){return c()},get onWrap(){return x()},get onAppend(){return b()},get onToggleGif(){return E()}})};q(tt,W=>{l()&&W(nt)})}N(W=>{dt(y,1,Du(n())),Kl(he,e.value),F(he,"placeholder",e.placeholder),F(he,"aria-label",e.ariaLabel),F(lt,"aria-label",e.submitLabel),lt.disabled=W},[()=>!e.value.trim()]),an("submit",y,W=>{W.preventDefault(),e.onSubmit()}),H("input",he,W=>e.onValue(W.currentTarget.value)),an("focus",he,function(...W){e.onFocus?.apply(this,W)}),H("keydown",he,function(...W){e.onKeydown?.apply(this,W)}),R(t,y),jt()}un(["click","change","input","keydown"]);var Ad=L('
    '),Rd=L(''),Cd=L(' ',1),Id=L('
    ',2),Dd=L(' ');function Fi(t,e){Wt(e,!0);let n=Qe(e,"onOpenImage",3,()=>{}),a=Ct(null),r=Ct(!1),s=Ct(""),l=lr(()=>e.upload.content_type?.startsWith("image/")??!1),c=lr(()=>e.upload.content_type?.startsWith("video/")??!1);function o(){h(r,!0)}function u(){if(!i(a)||!isFinite(i(a).duration))return;const _=Math.floor(i(a).duration),z=Math.floor(_/60),y=_%60;h(s,`${z}:${y.toString().padStart(2,"0")}`)}function f(){i(a)&&(h(r,!0),i(a).play())}function m(_){return _<1024?`${_} B`:_<1024*1024?`${Math.round(_/1024)} KB`:`${(_/(1024*1024)).toFixed(1)} MB`}var v=$a(),x=yn(v);{var b=_=>{var z=Ad(),y=p(z),I=p(y),G=g(y,2),te=p(G),ae=p(te),fe=g(te,2);N(()=>{F(y,"aria-label",`Open image ${e.upload.filename}`),F(I,"src",e.url),F(I,"alt",e.upload.filename),O(ae,e.upload.filename),F(fe,"href",e.url),F(fe,"download",e.upload.filename),F(fe,"aria-label",`Download ${e.upload.filename}`)}),H("click",y,()=>n()(e.url,e.upload.filename)),H("click",fe,_e=>_e.stopPropagation()),R(_,z)},E=_=>{var z=Id();let y;var I=p(z),G=p(I);Vi(I,le=>h(a,le),()=>i(a));var te=g(I,2);{var ae=le=>{var Ne=Cd(),he=yn(Ne),lt=g(he,2);{var tt=nt=>{var W=Rd(),We=p(W);N(()=>O(We,i(s))),R(nt,W)};q(lt,nt=>{i(s)&&nt(tt)})}N(()=>F(he,"aria-label",`Play ${e.upload.filename}`)),H("click",he,f),R(le,Ne)};q(te,le=>{i(r)||le(ae)})}var fe=g(te,2),_e=p(fe),ie=p(_e),X=g(_e,2);N(()=>{y=dt(z,1,"media-tile media-tile--video",null,y,{"is-started":i(r)}),I.controls=i(r),F(I,"aria-label",e.upload.filename),F(G,"src",e.url),F(G,"type",e.upload.content_type),O(ie,e.upload.filename),F(X,"href",e.url),F(X,"download",e.upload.filename),F(X,"aria-label",`Download ${e.upload.filename}`)}),an("play",I,o),an("loadedmetadata",I,u),H("click",X,le=>le.stopPropagation()),R(_,z)},k=_=>{var z=Dd(),y=g(p(z),2),I=p(y),G=p(I),te=g(I,2),ae=p(te);N(fe=>{F(z,"href",e.url),O(G,e.upload.filename),O(ae,fe)},[()=>m(e.upload.byte_size)]),R(_,z)};q(x,_=>{i(l)?_(b):i(c)?_(E,1):_(k,-1)})}R(t,v),jt()}un(["click"]);var Ld=L(' '),Od=L(' '),Md=L('');function Pd(t,e){Wt(e,!0);var n=$a(),a=yn(n);{var r=s=>{var l=Md();let c;var o=g(p(l),2),u=p(o),f=p(u),m=g(u,2);{var v=b=>{var E=Ld(),k=p(E);N(_=>O(k,_),[()=>tr(e.message.quoted_body_snapshot)]),R(b,E)},x=b=>{var E=Od(),k=p(E);N(_=>O(k,`[original deleted] ${_??""}`),[()=>tr(e.message.quoted_body_snapshot)]),R(b,E)};q(m,b=>{e.message.quoted_message_id?b(v):b(x,-1)})}N((b,E)=>{c=dt(l,1,"quote-block",null,c,{dangling:!e.message.quoted_message_id}),l.disabled=!e.message.quoted_message_id,F(l,"aria-label",b),O(f,E)},[()=>e.message.quoted_message_id?`Jump to quoted message from ${Ir(e.message)}`:"Original message was deleted",()=>Ir(e.message)]),H("click",l,()=>e.onJump(e.message)),R(s,l)};q(a,s=>{(e.message.quoted_message_id||e.message.quoted_body_snapshot)&&s(r)})}R(t,n),jt()}un(["click"]);var Nd=L('
    '),zd=L('
    ');function Fd(t,e){Wt(e,!0);var n=zd();let a;var r=p(n),s=p(r),l=g(r,2),c=p(l);Pd(c,{get message(){return e.message},get onJump(){return e.onJumpToQuote}});var o=g(c,2);Li(o,()=>ha(e.message.body),!0);var u=g(o,2);{var f=b=>{var E=Nd();It(E,21,()=>e.message.attachments,k=>k.id,(k,_)=>{{let z=lr(()=>Dr(i(_)));Fi(k,{get upload(){return i(_)},get url(){return i(z)},get onOpenImage(){return e.onOpenImage}})}}),R(b,E)};q(u,b=>{e.message.attachments?.length&&b(f)})}var m=g(l,2),v=p(m),x=g(v,2);N((b,E)=>{a=dt(n,1,"message-row",null,a,{selected:e.selected}),F(n,"data-message-id",e.message.id),O(s,b),F(x,"data-tooltip",E)},[()=>e.index===0?"":zn(e.message.created_at),()=>Hu(e.message,e.selectedThreadID)]),H("click",v,()=>e.onReply(e.message,e.replyContext)),H("click",x,()=>e.onOpenThread(e.message)),R(t,n),jt()}un(["click"]);var Ud=L(''),Bd=L(" "),Gd=L('
    ');function Hd(t,e){Wt(e,!0);var n=Gd(),a=p(n),r=p(a);{var s=k=>{var _=Ud();N(()=>F(_,"src",e.group.authorAvatarURL)),R(k,_)},l=k=>{var _=pt();N(z=>O(_,z),[()=>Je(e.group.authorName)]),R(k,_)};q(r,k=>{e.group.authorAvatarURL?k(s):k(l,-1)})}var c=g(a,2),o=p(c),u=p(o),f=p(u),m=g(u,2);{var v=k=>{var _=Bd(),z=p(_);N(y=>O(z,y),[()=>ut(e.group.authorHandle)]),R(k,_)};q(m,k=>{e.group.authorHandle&&k(v)})}var x=g(m,2),b=p(x),E=g(o,2);It(E,19,()=>e.group.messages,k=>k.id,(k,_,z)=>{{let y=lr(()=>e.selectedThreadID===i(_).id);Fd(k,{get message(){return i(_)},get index(){return i(z)},get selected(){return i(y)},get replyContext(){return e.replyContext},get selectedThreadID(){return e.selectedThreadID},get onReply(){return e.onReply},get onOpenThread(){return e.onOpenThread},get onJumpToQuote(){return e.onJumpToQuote},get onOpenImage(){return e.onOpenImage}})}}),N((k,_)=>{bn(a,`--hue: ${k??""}deg`),F(a,"aria-label",`View profile for ${e.group.authorName}`),O(f,e.group.authorName),O(b,_)},[()=>Ke(e.group.authorID),()=>zn(e.group.timestamp)]),H("click",a,()=>e.onOpenProfile(e.group.messages[0]?.author)),H("click",u,()=>e.onOpenProfile(e.group.messages[0]?.author)),R(t,n),jt()}un(["click"]);var qd=L('
    Send a message in Markdown — code fences, lists, links all work. Threads open from any message.
    '),Wd=L('
    '),jd=L(" ",1),Zd=L('
    ');function Yd(t,e){Wt(e,!0);let n=Ct(null),a=lr(()=>Wu(e.messages)),r=lr(()=>e.selectedDirect?"dm":"channel");_a(()=>(e.onListRef(i(n)),()=>e.onListRef(null)));var s=Zd(),l=p(s);{var c=u=>{var f=qd(),m=p(f),v=p(m);{var x=I=>{var G=pt("@");R(I,G)},b=I=>{var G=pt("#");R(I,G)};q(v,I=>{e.selectedDirect?I(x):I(b,-1)})}var E=g(m,2),k=p(E);{var _=I=>{var G=pt();N(te=>O(G,`This is the start of your conversation with ${te??""}.`),[()=>Jn(e.selectedDirect,e.currentUserID)]),R(I,G)},z=I=>{var G=pt();N(()=>O(G,`Welcome to #${e.selectedChannel.name??""}!`)),R(I,G)},y=I=>{var G=pt("Pick a channel to get started.");R(I,G)};q(k,I=>{e.selectedDirect?I(_):e.selectedChannel?I(z,1):I(y,-1)})}R(u,f)};q(l,u=>{e.messages.length===0&&u(c)})}var o=g(l,2);It(o,17,()=>i(a),u=>u.key,(u,f)=>{var m=jd(),v=yn(m);{var x=E=>{var k=Wd(),_=p(k),z=p(_);N(()=>O(z,i(f).dayLabel)),R(E,k)};q(v,E=>{i(f).dayLabel&&E(x)})}var b=g(v,2);Hd(b,{get group(){return i(f)},get selectedThreadID(){return e.selectedThreadID},get replyContext(){return i(r)},get onOpenProfile(){return e.onOpenProfile},get onReply(){return e.onReply},get onOpenThread(){return e.onOpenThread},get onJumpToQuote(){return e.onJumpToQuote},get onOpenImage(){return e.onOpenImage}}),R(u,m)}),Vi(s,u=>h(n,u),()=>i(n)),H("pointerdown",s,function(...u){e.onActivateMessageComposer?.apply(this,u)}),H("pointerup",s,function(...u){e.onInlineImagePointerUp?.apply(this,u)}),R(t,s),jt()}un(["pointerdown","pointerup"]);var Xd=L(''),Vd=L(`
    cc
    ClickClack OpenClaw workspace chat

    Welcome back.

    Workspace chat for the OpenClaw crew. Sign in with the GitHub account that's a member of the org.

    Limited to active members of the OpenClaw org.

    `),Qd=L(''),Jd=L('
    '),Kd=L('
    '),$d=L(''),ep=L(''),tp=L(''),np=L(''),rp=L(''),ap=L(''),ip=L(''),sp=L(''),lp=L(''),op=L(''),cp=L('

    '),up=L('

    '),fp=L('

    ClickClack

    '),dp=L(''),pp=L(''),hp=L(''),vp=L('
    '),gp=L(''),mp=L(" "),_p=L('
    '),bp=L(''),kp=L(" "),wp=L(' '),yp=L(' '),xp=L(''),Tp=L('
    '),Sp=L('
    '),Ep=L('

    Thread

    ',1),Ap=L(''),Rp=L(" "),Cp=L(''),Ip=L(''),Dp=L(''),Lp=L('

    Profile

    Active
    Contact information
    Handle
    User ID
    About

    ',1),Op=L('
    No thread open Hover any message and tap the bubble to keep side conversations tidy.
    '),Mp=L(''),Pp=L("

    "),Np=L(''),zp=L(''),Fp=L('

    ',1);function Up(t,e){Wt(e,!1);const n=j(),a=j(),r=j(),s=j(),l=j(),c=j();let o=j(null),u=j([]),f=j([]),m=j([]),v=j([]),x=j([]),b=j(""),E=j(""),k=j(""),_=j(null),z=j(null),y=j(null),I=j(null),G=j(""),te=j(""),ae=j(""),fe=j(""),_e=j(""),ie=j(""),X=j([]),le=j(null),Ne=j(!1),he=j(!1),lt=j(""),tt=j(""),nt=j(""),W=j(""),We=j(""),Lt=j(!1),se=j("loading"),Tn=j(!1),de=null,xt=j(!1),oe,ze=j(null),Tt=j(!1),je=j(!1),$t=j(!1),ve=j(null),Ge=j(null),hr=j(null),Ot=j(null),Re=j("message");to(()=>{fn()}),Fu(()=>{const w=de;de=null,h(xt,!1),w?.close(),oe&&window.clearTimeout(oe)});async function fn(){try{const w=await Ve("/api/me");h(o,w.user),await En(),h(se,"ready")}catch(w){if(w instanceof no&&(w.status===401||w.status===403)){h(Tn,!0),h(se,"auth");return}h(se,w instanceof Error?w.message:"Could not load ClickClack")}}function Sn(){i(o)&&(h(tt,i(o).display_name),h(nt,i(o).handle?`@${i(o).handle}`:""),h(W,i(o).avatar_url),h(We,""),h(Lt,!1),h(he,!0))}async function qr(){h(We,""),h(Lt,!1);try{const w=await Ve("/api/me",{method:"PATCH",body:JSON.stringify({display_name:i(tt),handle:i(nt),avatar_url:i(W)})});h(o,w.user),h(v,i(v).map(D=>D.author?.id===i(o)?.id?{...D,author:w.user}:D)),h(x,i(x).map(D=>D.author?.id===i(o)?.id?{...D,author:w.user}:D)),i(_)?.author?.id===i(o).id&&h(_,{...i(_),author:w.user}),h(We,"Saved"),h(he,!1)}catch(w){h(We,w instanceof Error?w.message:"Could not save profile"),h(Lt,!0)}}async function En(){const w=await Ve("/api/workspaces");h(u,w.workspaces),h(b,i(b)||i(u)[0]?.id||""),await dn(),await Rn(),i(u).length===0&&h(se,"create a workspace"),In()}async function vr(){if(!i(ae).trim())return;const w=await Ve("/api/workspaces",{method:"POST",body:JSON.stringify({name:i(ae)})});h(ae,""),h(Tt,!1),h(u,[...i(u),w.workspace]),h(b,w.workspace.id),await dn(),await Rn(),In()}async function dn(){if(!i(b))return;const w=await Ve(`/api/workspaces/${i(b)}/channels`);h(f,w.channels),h(E,i(f).find(D=>D.id===i(E))?.id||i(f)[0]?.id||""),h(_,null),h(y,null),h(Re,"message"),h(x,[]),await mt()}async function Sa(){if(!i(b)||!i(fe).trim())return;const w=await Ve(`/api/workspaces/${i(b)}/channels`,{method:"POST",body:JSON.stringify({name:i(fe),kind:"public"})});h(fe,""),h(f,[...i(f),w.channel]),h(E,w.channel.id),h(k,""),await mt()}async function mt(){if(i(k)){const D=await Ve(`/api/dms/${i(k)}/messages`);h(v,D.messages),await gr();return}if(!i(E)){h(v,[]);return}const w=await Ve(`/api/channels/${i(E)}/messages`);h(v,w.messages),await gr()}async function gr(){await Ai(),i(ze)&&tu(ze,i(ze).scrollTop=i(ze).scrollHeight)}async function mr(){const w=i(G).trim();if(!w)return;if(!i(E)&&!i(k)){h(se,"pick or create a channel");return}const D=i(k)?"dm":"channel",$=i(ve)&&i(Ge)===D?i(ve):null;h(G,"");const ye=i(k)?`/api/dms/${i(k)}/messages`:`/api/channels/${i(E)}/messages`,Ze={body:w};$&&(Ze.quoted_message_id=$.id);const Pt=await Ve(ye,{method:"POST",body:JSON.stringify(Ze)});let St=Pt.message;if($&&bt(),i(le)){const Fe=i(le);await Ve(`/api/messages/${Pt.message.id}/attachments`,{method:"POST",body:JSON.stringify({upload_id:Fe.id})}),h(le,null),St={...St,attachments:[...St.attachments||[],Fe]}}i(v).some(Fe=>Fe.id===St.id)?h(v,i(v).map(Fe=>Fe.id===St.id?St:Fe)):h(v,[...i(v),St]),await gr()}async function An(w){h(y,null),h(_,w),h(Re,"thread");const D=await Ve(`/api/messages/${w.id}/thread`);h(_,D.root),h(x,D.replies),h(z,D.thread_state)}async function pn(){const w=i(te).trim();if(!w||!i(_))return;const D=i(ve)&&i(Ge)==="thread"?i(ve):null;h(te,"");const $={body:w};D&&($.quoted_message_id=D.id);const ye=await Ve(`/api/messages/${i(_).id}/thread/replies`,{method:"POST",body:JSON.stringify($)});D&&bt(),i(x).some(Ze=>Ze.id===ye.message.id)||h(x,[...i(x),ye.message]),h(z,ye.thread_state)}function _t(w,D){h(ve,w),h(Ge,D),h(Re,D==="thread"?"thread":"message")}function _r(){return i(I)!==null||i(he)}function Ea(){return i(Re)==="thread"&&i(_)&&i(Ot)?i(Ot):i(hr)}function bt(){h(ve,null),h(Ge,null)}async function br(w){const D=w.quoted_message_id;if(!D)return;await Ai();const $=document.querySelector(`[data-message-id="${CSS.escape(D)}"]`);$&&($.scrollIntoView({behavior:"smooth",block:"center"}),$.classList.add("highlight"),window.setTimeout(()=>$.classList.remove("highlight"),1500))}async function Aa(){if(!i(b)||!i(ie).trim()){h(X,[]);return}const w=await Ve(`/api/search?workspace_id=${encodeURIComponent(i(b))}&q=${encodeURIComponent(i(ie).trim())}`);h(X,w.results)}async function kr(w){const D=w.currentTarget,$=D.files?.[0];if(!$||!i(b))return;const ye=new FormData;ye.set("workspace_id",i(b)),ye.set("file",$);const Ze=await Ve("/api/uploads",{method:"POST",body:ye});h(le,Ze.upload),D.value=""}async function Rn(){if(!i(b))return;const w=await Ve(`/api/dms?workspace_id=${i(b)}`);h(m,w.conversations)}async function Mt(){if(!i(b)||!i(_e).trim())return;const w=await Ve("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:i(b),member_ids:[i(_e).trim()]})});h(_e,""),h(m,[...i(m),w.conversation]),h(k,w.conversation.id),h(E,""),h(_,null),h(y,null),h(Re,"message"),await mt()}async function Cn(w){if(!i(b)||!w)return;const D=i(m).find(ye=>ye.members.some(Ze=>Ze.id===w));if(D){h(k,D.id),h(E,""),h(_,null),h(y,null),h(Re,"message"),await mt();return}const $=await Ve("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:i(b),member_ids:[w]})});h(m,[...i(m),$.conversation]),h(k,$.conversation.id),h(E,""),h(_,null),h(y,null),h(Re,"message"),await mt()}function In(){oe&&window.clearTimeout(oe);const w=de;if(de=null,h(xt,!1),w?.close(),!i(b))return;const D=localStorage.getItem(`clickclack:${i(b)}:cursor`)||"",$=new URL("/api/realtime/ws",window.location.href);$.protocol=window.location.protocol==="https:"?"wss:":"ws:",$.searchParams.set("workspace_id",i(b)),D&&$.searchParams.set("after_cursor",D);const ye=new WebSocket($);de=ye,ye.addEventListener("open",()=>{de===ye&&h(xt,!0)}),ye.addEventListener("message",Ze=>{const Pt=JSON.parse(String(Ze.data));Pt.cursor&&localStorage.setItem(`clickclack:${i(b)}:cursor`,Pt.cursor),Wr(Pt)}),ye.addEventListener("close",()=>{de===ye&&(h(xt,!1),oe=window.setTimeout(In,1200))})}async function Wr(w){if((w.type==="channel.created"||w.type==="channel.updated")&&w.workspace_id===i(b)){await dn();return}(w.channel_id===i(E)||w.payload.direct_conversation_id===i(k))&&(w.type==="message.created"||w.type==="message.updated"||w.type==="message.deleted")&&await mt();const D=w.payload.root_message_id||w.payload.message_id;i(_)&&D===i(_).id&&await An(i(_))}function Ra(w){w&&(h(_,null),h(y,w))}function jr(w){if(w.key==="Escape"&&i(ve)&&i(Ge)!=="thread"){w.preventDefault(),bt();return}w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),mr())}function Zr(w){if(w.key==="Escape"&&i(ve)&&i(Ge)==="thread"){w.preventDefault(),bt();return}w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),pn())}function wr(w,D){h(I,{url:w,title:D})}function Dn(w){const D=w.target;D instanceof HTMLImageElement&&D.closest(".markdown")&&(w.preventDefault(),wr(D.currentSrc||D.src,D.alt||"Image"))}function Yr(w){const D=i(G)&&!i(G).endsWith(` +`)?` +`:"";h(G,`${i(G)}${D}${w}`)}function ni(w,D=w){Yr(`${w}${w==="```"?` +code +`:"text"}${D}`)}function Ce(w,D){Yr(`![${D}](${w})`),h(Ne,!1),h(lt,"")}function en(){i(Ge)==="thread"&&bt(),h(_,null),h(y,null),h(Re,"message"),h(x,[])}function Ln(){h(I,null),h(he,!1)}_n(()=>(i(u),i(b)),()=>{h(n,i(u).find(w=>w.id===i(b)))}),_n(()=>(i(f),i(E)),()=>{h(a,i(f).find(w=>w.id===i(E)))}),_n(()=>(i(m),i(k)),()=>{h(r,i(m).find(w=>w.id===i(k)))}),_n(()=>(i(_),i(y)),()=>{h(s,i(_)!==null||i(y)!==null)}),_n(()=>(i(v),i(m),i(o)),()=>{h(l,ju(i(v),i(m),i(o)?.id||""))}),_n(()=>(i(Ge),i(ve),i(v)),()=>{i(Ge)==="channel"&&i(ve)&&!i(v).some(w=>w.id===i(ve)?.id)&&bt()}),_n(()=>(i(Ge),i(ve),i(v)),()=>{i(Ge)==="dm"&&i(ve)&&!i(v).some(w=>w.id===i(ve)?.id)&&bt()}),_n(()=>(i(Ge),i(ve),i(_),i(x)),()=>{i(Ge)==="thread"&&i(ve)&&i(_)&&i(ve).id!==i(_).id&&!i(x).some(w=>w.id===i(ve)?.id)&&bt()}),_n(()=>i(lt),()=>{h(c,Gu.filter(w=>{const D=i(lt).trim().toLowerCase();return!D||w.title.toLowerCase().includes(D)||w.tags.some($=>$.includes(D))}))}),uu(),eo();var Xr=$a();Ql("1oa2eo8",w=>{var D=Xd();R(w,D)}),an("keydown",Ei,w=>{if(w.key==="Escape"){if(_r())Ln();else if(i(ve)){w.preventDefault(),bt();return}}$u(w,{authRequired:i(Tn),isModalOpen:_r,messageInput:i(hr),replyInput:i(Ot),target:Ea})});var Vr=yn(Xr);{var Ca=w=>{var D=Vd();R(w,D)},Ia=w=>{var D=Fp(),$=yn(D);let ye;var Ze=p($),Pt=p(Ze);{var St=A=>{var C=pt("×");R(A,C)},Fe=A=>{var C=Qd();R(A,C)};q(Pt,A=>{i($t)?A(St):A(Fe,-1)})}var Qr=g(Ze,2),Jr=g(p(Qr),4),Da=p(Jr);It(Da,1,()=>i(u),A=>A.id,(A,C)=>{var U=Jd();let ee;var be=p(U),xe=p(be),He=p(xe);N(Te=>{ee=dt(U,1,"guild-wrap",null,ee,{active:i(C).id===i(b)}),F(be,"title",(i(C),T(()=>i(C).name))),O(He,Te)},[()=>(Z(Ns),i(C),T(()=>Ns(i(C).name)))]),H("click",be,async()=>{h(b,i(C).id),await dn(),await Rn(),In()}),R(A,U)});var La=g(Da,2),Oa=g(Jr,2);{var Ma=A=>{var C=Kd(),U=p(C);an("submit",C,ee=>{ee.preventDefault(),vr()}),Qn(U,()=>i(ae),ee=>h(ae,ee)),R(A,C)};q(Oa,A=>{i(Tt)&&A(Ma)})}var B=g(Qr,2),d=p(B),S=p(d),M=p(S),pe=p(M),Ue=g(M,2);let Se;var rt=p(Ue),Ye=g(S,2),Et=p(Ye),Kr=p(Et),Ie=g(d,2),$r=p(Ie),ea=g(p($r),2),is=p(ea);It(is,1,()=>i(f),A=>A.id,(A,C)=>{var U=$d();let ee;var be=g(p(U),2),xe=p(be);N(()=>{ee=dt(U,1,"nav-item channel",null,ee,{active:i(C).id===i(E)&&!i(k)}),O(xe,(i(C),T(()=>i(C).name)))}),H("click",U,async()=>{h(E,i(C).id),h(k,""),h(_,null),h(y,null),h(Re,"message"),h($t,!1),await mt()}),R(A,U)});var _o=g(is,2);{var bo=A=>{var C=ep();R(A,C)};q(_o,A=>{i(f),T(()=>i(f).length===0)&&A(bo)})}var ss=g(ea,2),ko=p(ss),ls=g($r,2),os=g(p(ls),2),cs=p(os);It(cs,1,()=>i(m),A=>A.id,(A,C)=>{const U=Nt(()=>(Z(zs),i(C),i(o),T(()=>zs(i(C),i(o)?.id))));var ee=np();let be;var xe=p(ee),He=p(xe);{var Te=Q=>{var ce=tp();N(()=>F(ce,"src",(Z(i(U)),T(()=>i(U).avatar_url)))),R(Q,ce)},V=Q=>{var ce=pt();N(at=>O(ce,at),[()=>(Z(Je),Z(i(U)),T(()=>Je(i(U)?.display_name)))]),R(Q,ce)};q(He,Q=>{Z(i(U)),T(()=>i(U)?.avatar_url)?Q(Te):Q(V,-1)})}var Be=g(xe,2),Xe=p(Be);N((Q,ce)=>{be=dt(ee,1,"nav-item dm",null,be,{active:i(C).id===i(k)}),bn(xe,`--hue: ${Q??""}deg`),O(Xe,ce)},[()=>(Z(Ke),Z(i(U)),i(C),T(()=>Ke(i(U)?.id||i(C).id))),()=>(Z(Jn),i(C),i(o),T(()=>Jn(i(C),i(o)?.id)))]),H("click",ee,async()=>{h(k,i(C).id),h(E,""),h(_,null),h(y,null),h(Re,"message"),h($t,!1),await mt()}),R(A,ee)});var wo=g(cs,2);{var yo=A=>{var C=rp();R(A,C)};q(wo,A=>{i(m),T(()=>i(m).length===0)&&A(yo)})}var us=g(os,2),xo=p(us),To=g(ls,2),So=g(p(To),2),fs=p(So);It(fs,1,()=>i(l),A=>A.id,(A,C)=>{const U=Nt(()=>(Z(Fs),i(m),i(C),T(()=>Fs(i(m),i(C).id))));var ee=ip();let be;var xe=p(ee),He=p(xe);{var Te=Q=>{var ce=ap();N(()=>F(ce,"src",(i(C),T(()=>i(C).avatar_url)))),R(Q,ce)},V=Q=>{var ce=pt();N(at=>O(ce,at),[()=>(Z(Je),i(C),T(()=>Je(i(C).display_name)))]),R(Q,ce)};q(He,Q=>{i(C),T(()=>i(C).avatar_url)?Q(Te):Q(V,-1)})}var Be=g(xe,2),Xe=p(Be);N(Q=>{be=dt(ee,1,"nav-item dm",null,be,{active:i(U)?.id===i(k)||i(y)?.id===i(C).id}),bn(xe,`--hue: ${Q??""}deg`),O(Xe,(i(C),T(()=>i(C).display_name)))},[()=>(Z(Ke),i(C),T(()=>Ke(i(C).id)))]),H("click",ee,async()=>{i(U)?(h(k,i(U).id),h(E,""),h(_,null),h(y,null),h(Re,"message"),h($t,!1),await mt()):Ra(i(C))}),R(A,ee)});var Eo=g(fs,2);{var Ao=A=>{var C=sp();R(A,C)};q(Eo,A=>{i(l),T(()=>i(l).length===0)&&A(Ao)})}var Ro=g(Ie,2);{var Co=A=>{var C=op(),U=p(C),ee=p(U);{var be=Q=>{var ce=lp();N(()=>F(ce,"src",(i(o),T(()=>i(o).avatar_url)))),R(Q,ce)},xe=Q=>{var ce=pt();N(at=>O(ce,at),[()=>(Z(Je),i(o),T(()=>Je(i(o).display_name)))]),R(Q,ce)};q(ee,Q=>{i(o),T(()=>i(o).avatar_url)?Q(be):Q(xe,-1)})}var He=g(U,2),Te=p(He),V=p(Te),Be=g(Te,2),Xe=p(Be);N((Q,ce,at)=>{F(C,"aria-label",Q),bn(U,`--hue: ${ce??""}deg`),O(V,(i(o),T(()=>i(o).display_name))),O(Xe,at)},[()=>(i(o),Z(ut),T(()=>`Account settings for ${i(o).display_name} ${ut(i(o).handle)}`)),()=>(Z(Ke),i(o),T(()=>Ke(i(o).id))),()=>(i(o),Z(ut),i(xt),T(()=>i(o).handle?ut(i(o).handle):i(xt)?"Active":"Reconnecting…"))]),H("click",C,Sn),H("contextmenu",C,Q=>{Q.preventDefault(),Sn()}),R(A,C)};q(Ro,A=>{i(o)&&A(Co)})}var ds=g(B,2),ps=p(ds),hs=p(ps),vs=p(hs);{var Io=A=>{var C=cp(),U=p(C);N(ee=>O(U,ee),[()=>(Z(Jn),i(r),i(o),T(()=>`@${Jn(i(r),i(o)?.id)}`))]),R(A,C)},Do=A=>{var C=up(),U=p(C);N(()=>O(U,(i(a),T(()=>`#${i(a).name}`)))),R(A,C)},Lo=A=>{var C=fp();R(A,C)};q(vs,A=>{i(r)?A(Io):i(a)?A(Do,1):A(Lo,-1)})}var Oo=g(vs,4),Mo=p(Oo),ri=g(hs,2),gs=g(p(ri),2),Po=g(gs,2);{var No=A=>{var C=dp();H("click",C,()=>{h(ie,""),h(X,[])}),R(A,C)};q(Po,A=>{i(ie)&&A(No)})}var zo=g(ri,2),ta=p(zo);let ms;var Fo=g(ta,2),_s=g(ps,2);{var Uo=A=>{var C=vp(),U=p(C),ee=p(U),be=p(ee),xe=g(ee,2),He=g(U,2);It(He,1,()=>i(X),Te=>Te.message.id,(Te,V)=>{var Be=hp(),Xe=p(Be),Q=p(Xe);{var ce=it=>{var ot=pp();N(()=>F(ot,"src",(i(V),T(()=>i(V).message.author.avatar_url)))),R(it,ot)},at=it=>{var ot=pt();N(Zn=>O(ot,Zn),[()=>(Z(Je),i(V),T(()=>Je(i(V).message.author?.display_name)))]),R(it,ot)};q(Q,it=>{i(V),T(()=>i(V).message.author?.avatar_url)?it(ce):it(at,-1)})}var hn=g(Xe,2),tn=p(hn),vn=p(tn),gn=p(vn),Wn=g(vn,2),mn=p(Wn),jn=g(tn,2),On=p(jn);N((it,ot)=>{bn(Xe,`--hue: ${it??""}deg`),O(gn,(i(V),T(()=>i(V).message.author?.display_name||"Local User"))),O(mn,ot),O(On,(i(V),T(()=>i(V).message.body)))},[()=>(Z(Ke),i(V),T(()=>Ke(i(V).message.author?.id||i(V).message.author_id||"x"))),()=>(Z(zn),i(V),T(()=>zn(i(V).message.created_at)))]),H("click",Be,async()=>{h(X,[]),i(V).message.channel_id&&(h(E,i(V).message.channel_id),h(k,""),await mt()),i(V).message.direct_conversation_id&&(h(k,i(V).message.direct_conversation_id),h(E,""),await mt())}),R(Te,Be)}),N(()=>O(be,`${i(X),T(()=>i(X).length)??""} ${i(X),T(()=>i(X).length===1?"result":"results")??""}`)),H("click",xe,()=>{h(X,[])}),R(A,C)};q(_s,A=>{i(X),T(()=>i(X).length>0)&&A(Uo)})}var bs=g(_s,2);{let A=Nt(()=>(i(_),T(()=>i(_)?.id))),C=Nt(()=>(i(o),T(()=>i(o)?.id)));Yd(bs,{get messages(){return i(v)},get selectedDirect(){return i(r)},get selectedChannel(){return i(a)},get selectedThreadID(){return i(A)},get currentUserID(){return i(C)},onListRef:U=>h(ze,U),onActivateMessageComposer:()=>h(Re,"message"),onInlineImagePointerUp:Dn,onOpenProfile:Ra,onReply:_t,onOpenThread:An,onJumpToQuote:U=>{br(U)},onOpenImage:wr})}var Bo=g(bs,2);{let A=Nt(()=>(i(r),Z(Jn),i(o),i(a),T(()=>i(r)?`Message ${Jn(i(r),i(o)?.id)}`:i(a)?`Message #${i(a).name}`:"Pick a channel to start"))),C=Nt(()=>i(ve)&&i(Ge)===(i(k)?"dm":"channel")?i(ve):null);rl(Bo,{get value(){return i(G)},get placeholder(){return i(A)},ariaLabel:"Message body",submitLabel:"Send",get pendingUpload(){return i(le)},get replyTarget(){return i(C)},showUpload:!0,showToolbar:!0,get showGifPicker(){return i(Ne)},get gifQuery(){return i(lt)},get filteredGifs(){return i(c)},onValue:U=>h(G,U),onSubmit:()=>{mr()},onKeydown:jr,onFocus:()=>h(Re,"message"),onInputRef:U=>h(hr,U),onUploadFile:kr,onRemoveUpload:()=>h(le,null),onClearReply:bt,onApplyMarkdownWrap:ni,onAppendToComposer:Yr,onToggleGif:()=>h(Ne,!i(Ne)),onGifQuery:U=>h(lt,U),onPickGif:Ce})}var ai=g(ds,2);let ks;var Go=p(ai);{var Ho=A=>{var C=Ep(),U=yn(C),ee=p(U),be=g(p(ee),2),xe=p(be),He=g(ee,2),Te=g(U,2),V=p(Te),Be=p(V),Xe=p(Be);{var Q=ge=>{var P=gp();N(()=>F(P,"src",(i(_),T(()=>i(_).author.avatar_url)))),R(ge,P)},ce=ge=>{var P=pt();N(At=>O(P,At),[()=>(Z(Je),i(_),T(()=>Je(i(_).author?.display_name)))]),R(ge,P)};q(Xe,ge=>{i(_),T(()=>i(_).author?.avatar_url)?ge(Q):ge(ce,-1)})}var at=g(Be,2),hn=p(at),tn=p(hn),vn=p(tn),gn=g(tn,2);{var Wn=ge=>{var P=mp(),At=p(P);N(Zt=>O(At,Zt),[()=>(Z(ut),i(_),T(()=>ut(i(_).author.handle)))]),R(ge,P)};q(gn,ge=>{i(_),T(()=>i(_).author?.handle)&&ge(Wn)})}var mn=g(gn,2),jn=p(mn),On=g(mn,2),it=g(hn,2);Li(it,()=>(Z(ha),i(_),T(()=>ha(i(_).body))),!0);var ot=g(it,2);{var Zn=ge=>{var P=_p();It(P,5,()=>(i(_),T(()=>i(_).attachments)),At=>At.id,(At,Zt)=>{{let na=Nt(()=>(Z(Dr),i(Zt),T(()=>Dr(i(Zt)))));Fi(At,{get upload(){return i(Zt)},get url(){return i(na)},onOpenImage:wr})}}),R(ge,P)};q(ot,ge=>{i(_),T(()=>i(_).attachments?.length)&&ge(Zn)})}var yr=g(V,2),xr=p(yr),ke=p(xr),ct=g(yr,2);It(ct,5,()=>i(x),ge=>ge.id,(ge,P)=>{var At=Sp(),Zt=p(At),na=p(Zt);{var ii=Le=>{var Oe=bp();N(()=>F(Oe,"src",(i(P),T(()=>i(P).author.avatar_url)))),R(Le,Oe)},si=Le=>{var Oe=pt();N(nn=>O(Oe,nn),[()=>(Z(Je),i(P),T(()=>Je(i(P).author?.display_name)))]),R(Le,Oe)};q(na,Le=>{i(P),T(()=>i(P).author?.avatar_url)?Le(ii):Le(si,-1)})}var li=g(Zt,2),Pa=p(li),Na=p(Pa),oi=p(Na),me=g(Na,2);{var De=Le=>{var Oe=kp(),nn=p(Oe);N(Yn=>O(nn,Yn),[()=>(Z(ut),i(P),T(()=>ut(i(P).author.handle)))]),R(Le,Oe)};q(me,Le=>{i(P),T(()=>i(P).author?.handle)&&Le(De)})}var Tr=g(me,2),ci=p(Tr),Xo=g(Tr,2),ys=g(Pa,2);{var Vo=Le=>{var Oe=xp();let nn;var Yn=g(p(Oe),2),za=p(Yn),Ko=p(za),$o=g(za,2);{var ec=Pn=>{var Xn=wp(),ui=p(Xn);N(fi=>O(ui,fi),[()=>(Z(tr),i(P),T(()=>tr(i(P).quoted_body_snapshot)))]),R(Pn,Xn)},tc=Pn=>{var Xn=yp(),ui=p(Xn);N(fi=>O(ui,`[original deleted] ${fi??""}`),[()=>(Z(tr),i(P),T(()=>tr(i(P).quoted_body_snapshot)))]),R(Pn,Xn)};q($o,Pn=>{i(P),T(()=>i(P).quoted_message_id)?Pn(ec):Pn(tc,-1)})}N((Pn,Xn)=>{nn=dt(Oe,1,"quote-block",null,nn,{dangling:!i(P).quoted_message_id}),Oe.disabled=(i(P),T(()=>!i(P).quoted_message_id)),F(Oe,"aria-label",Pn),O(Ko,Xn)},[()=>(i(P),Z(Ir),T(()=>i(P).quoted_message_id?`Jump to quoted message from ${Ir(i(P))}`:"Original message was deleted")),()=>(Z(Ir),i(P),T(()=>Ir(i(P))))]),H("click",Oe,()=>br(i(P))),R(Le,Oe)};q(ys,Le=>{i(P),T(()=>i(P).quoted_message_id||i(P).quoted_body_snapshot)&&Le(Vo)})}var xs=g(ys,2);Li(xs,()=>(Z(ha),i(P),T(()=>ha(i(P).body))),!0);var Qo=g(xs,2);{var Jo=Le=>{var Oe=Tp();It(Oe,5,()=>(i(P),T(()=>i(P).attachments)),nn=>nn.id,(nn,Yn)=>{{let za=Nt(()=>(Z(Dr),i(Yn),T(()=>Dr(i(Yn)))));Fi(nn,{get upload(){return i(Yn)},get url(){return i(za)},onOpenImage:wr})}}),R(Le,Oe)};q(Qo,Le=>{i(P),T(()=>i(P).attachments?.length)&&Le(Jo)})}N((Le,Oe)=>{F(At,"data-message-id",(i(P),T(()=>i(P).id))),bn(Zt,`--hue: ${Le??""}deg`),O(oi,(i(P),T(()=>i(P).author?.display_name||"Local User"))),O(ci,Oe)},[()=>(Z(Ke),i(P),T(()=>Ke(i(P).author?.id||i(P).author_id||"x"))),()=>(Z(zn),i(P),T(()=>zn(i(P).created_at)))]),H("click",Xo,()=>_t(i(P),"thread")),R(ge,At)});var Mn=g(Te,2);{let ge=Nt(()=>i(ve)&&i(Ge)==="thread"?i(ve):null);rl(Mn,{get value(){return i(te)},placeholder:"Reply in thread",ariaLabel:"Reply body",submitLabel:"Reply",formClass:"composer reply-composer",get replyTarget(){return i(ge)},onValue:P=>h(te,P),onSubmit:()=>{pn()},onKeydown:Zr,onFocus:()=>h(Re,"thread"),onInputRef:P=>h(Ot,P),onClearReply:bt})}N((ge,P)=>{O(xe,`${i(z),i(x),T(()=>i(z)?.reply_count??i(x).length)??""} ${i(z),i(x),T(()=>(i(z)?.reply_count??i(x).length)===1?"reply":"replies")??""}`),F(V,"data-message-id",(i(_),T(()=>i(_).id))),bn(Be,`--hue: ${ge??""}deg`),O(vn,(i(_),T(()=>i(_).author?.display_name||"Local User"))),O(jn,P),O(ke,`${i(x),T(()=>i(x).length)??""} ${i(x),T(()=>i(x).length===1?"reply":"replies")??""}`)},[()=>(Z(Ke),i(_),T(()=>Ke(i(_).author?.id||i(_).author_id||"x"))),()=>(Z(zn),i(_),T(()=>zn(i(_).created_at)))]),H("click",He,()=>{en()}),H("pointerdown",Te,()=>h(Re,"thread")),H("pointerup",Te,Dn),H("click",On,()=>i(_)&&_t(i(_),"thread")),R(A,C)},qo=A=>{var C=Lp(),U=yn(C),ee=p(U),be=g(p(ee),2),xe=p(be),He=g(ee,2),Te=g(U,2),V=p(Te),Be=p(V),Xe=p(Be);{var Q=me=>{var De=Ap();N(()=>F(De,"src",(i(y),T(()=>i(y).avatar_url)))),R(me,De)},ce=me=>{var De=pt();N(Tr=>O(De,Tr),[()=>(Z(Je),i(y),T(()=>Je(i(y).display_name)))]),R(me,De)};q(Xe,me=>{i(y),T(()=>i(y).avatar_url)?me(Q):me(ce,-1)})}var at=g(V,2),hn=p(at),tn=p(hn),vn=p(tn),gn=p(vn),Wn=g(vn,2);{var mn=me=>{var De=Rp(),Tr=p(De);N(ci=>O(Tr,ci),[()=>(Z(ut),i(y),T(()=>ut(i(y).handle)))]),R(me,De)};q(Wn,me=>{i(y),T(()=>i(y).handle)&&me(mn)})}var jn=g(tn,2);{var On=me=>{var De=Cp();H("click",De,Sn),R(me,De)};q(jn,me=>{i(o),i(y),T(()=>i(o)?.id===i(y).id)&&me(On)})}var it=g(hn,4),ot=p(it);{var Zn=me=>{var De=Ip();H("click",De,()=>Cn(i(y)?.id||"")),R(me,De)};q(ot,me=>{i(o),i(y),T(()=>i(o)?.id!==i(y).id)&&me(Zn)})}var yr=g(ot,2),xr=g(it,2),ke=p(xr),ct=g(p(ke),2);{var Mn=me=>{var De=Dp();H("click",De,Sn),R(me,De)};q(ct,me=>{i(o),i(y),T(()=>i(o)?.id===i(y).id)&&me(Mn)})}var ge=g(ke,2),P=g(p(ge),2),At=g(p(P),2),Zt=p(At),na=g(ge,2),ii=g(p(na),2),si=g(p(ii),2),li=p(si),Pa=g(xr,2),Na=g(p(Pa),2),oi=p(Na);N((me,De)=>{O(xe,(i(y),T(()=>i(y).display_name))),bn(V,`--hue: ${me??""}deg`),O(gn,(i(y),T(()=>i(y).display_name))),O(Zt,De),O(li,(i(y),T(()=>i(y).id))),O(oi,`Member of ${i(n),T(()=>i(n)?.name||"this workspace")??""}. Click Message to keep the conversation in your sidebar.`)},[()=>(Z(Ke),i(y),T(()=>Ke(i(y).id))),()=>(i(y),Z(ut),T(()=>i(y).handle?ut(i(y).handle):"No handle set"))]),H("click",He,en),H("click",yr,()=>h(se,"status messages are coming soon")),R(A,C)},Wo=A=>{var C=Op();R(A,C)};q(Go,A=>{i(_)?A(Ho):i(y)?A(qo,1):A(Wo,-1)})}var ws=g($,2);{var jo=A=>{var C=Np(),U=p(C),ee=g(U,2),be=p(ee),xe=g(p(be),2),He=g(be,2),Te=p(He),V=p(Te),Be=p(V);{var Xe=ke=>{var ct=Mp();N(()=>F(ct,"src",i(W))),R(ke,ct)},Q=ke=>{var ct=pt();N(Mn=>O(ct,Mn),[()=>(Z(Je),i(tt),T(()=>Je(i(tt))))]),R(ke,ct)};q(Be,ke=>{i(W)?ke(Xe):ke(Q,-1)})}var ce=g(V,2),at=p(ce),hn=p(at),tn=g(at,2),vn=p(tn),gn=g(Te,2),Wn=g(p(gn),2),mn=g(gn,2),jn=g(p(mn),2),On=g(mn,2),it=g(p(On),2),ot=g(On,2);{var Zn=ke=>{var ct=Pp();let Mn;var ge=p(ct);N(()=>{Mn=dt(ct,1,"profile-status",null,Mn,{error:i(Lt)}),O(ge,i(We))}),R(ke,ct)};q(ot,ke=>{i(We)&&ke(Zn)})}var yr=g(ot,2),xr=p(yr);N((ke,ct)=>{bn(V,`--hue: ${ke??""}deg`),O(hn,(i(tt),i(o),T(()=>i(tt)||i(o).display_name))),O(vn,ct)},[()=>(Z(Ke),i(o),T(()=>Ke(i(o).id))),()=>(i(nt),Z(ut),i(o),T(()=>i(nt)||ut(i(o).handle)||"No handle set"))]),H("click",U,Ln),H("click",xe,Ln),an("submit",He,ke=>{ke.preventDefault(),qr()}),Qn(Wn,()=>i(tt),ke=>h(tt,ke)),Qn(jn,()=>i(nt),ke=>h(nt,ke)),Qn(it,()=>i(W),ke=>h(W,ke)),H("click",xr,Ln),R(A,C)};q(ws,A=>{i(he)&&i(o)&&A(jo)})}var Zo=g(ws,2);{var Yo=A=>{var C=zp(),U=p(C),ee=g(U,2),be=p(ee),xe=p(be),He=p(xe),Te=g(xe,2),V=p(Te),Be=g(V,2),Xe=g(be,2),Q=p(Xe);N(()=>{O(He,(i(I),T(()=>i(I).title))),F(V,"href",(i(I),T(()=>i(I).url))),F(Q,"src",(i(I),T(()=>i(I).url))),F(Q,"alt",(i(I),T(()=>i(I).title)))}),H("click",U,Ln),H("click",Be,Ln),R(A,C)};q(Zo,A=>{i(I)&&A(Yo)})}N(()=>{ye=dt($,1,"shell",null,ye,{"nav-open":i($t),"sidebar-collapsed":i(je),"thread-open":i(s)}),O(pe,(i(n),T(()=>i(n)?.name||"Pick a workspace"))),Se=dt(Ue,1,"presence",null,Se,{online:i(xt)}),O(rt,i(xt)?"Connected":i(se)),F(Ye,"aria-label",i(je)?"Expand sidebar":"Collapse sidebar"),F(Ye,"title",i(je)?"Expand sidebar":"Collapse sidebar"),F(Kr,"d",i(je)?"m9 6 6 6-6 6":"m15 6-6 6 6 6"),O(Mo,(i(n),T(()=>i(n)?.name||"no workspace"))),F(ta,"title",i(_)?"Close thread":"Open a message thread"),F(ta,"aria-label",i(_)?"Close thread":"Open a message thread"),ms=dt(ta,1,"",null,ms,{active:i(s)}),ks=dt(ai,1,"thread",null,ks,{open:i(s)}),F(ai,"aria-label",i(y)?"Profile pane":"Thread pane")}),H("click",Ze,()=>h($t,!i($t))),H("click",La,()=>h(Tt,!i(Tt))),H("click",Ye,()=>h(je,!i(je))),an("submit",ss,A=>{A.preventDefault(),Sa()}),Qn(ko,()=>i(fe),A=>h(fe,A)),an("submit",us,A=>{A.preventDefault(),Mt()}),Qn(xo,()=>i(_e),A=>h(_e,A)),an("submit",ri,A=>{A.preventDefault(),Aa()}),Qn(gs,()=>i(ie),A=>h(ie,A)),H("click",ta,()=>{i(s)?en():h(se,"pick a message to open its thread")}),H("click",Fo,()=>h(se,"no pinned items")),R(w,D)};q(Vr,w=>{i(Tn)?w(Ca):w(Ia,-1)})}R(t,Xr),jt()}un(["click","contextmenu","pointerdown","pointerup"]);var Bp=L(' ',1),Gp=L("

    "),Hp=L(`

    Self-hostable chat. Serious tool. Mild brine.

    ClickClack

    A single-binary chat app for teams, communities, bots, and agents: + Slack-style threads, durable realtime, OpenAPI, SQLite, and a CLI that + can drive the whole thing from a shell.

    What it is

    Chat infrastructure that stays boring when the socket drops.

    WebSocket is the pipe. The database is the truth. Every durable message, + thread reply, reaction, and channel update can be recovered over HTTP with + a cursor, so clients and agents can reconnect without drama.

    Agent path

    A friendly CLI, no LLM baked in.

    External agents, CI jobs, and humans use the same public API as the web + app. Tokens and workspace defaults are scoped per server, so switching + hosts does not leak credentials or stale IDs.

     

    Destinations

    Product at the root. Docs and app where people expect them.

    `);function qp(t,e){Wt(e,!1);const n="https://docs.clickclack.chat",a=["localhost","127.0.0.1","::1"].includes(window.location.hostname)?"/app":"https://app.clickclack.chat",r="https://github.com/openclaw/clickclack",s=[["Single binary","Go server, embedded Svelte app, embedded migrations, local SQLite and uploads."],["Threads that recover","Slack-style one-level threads with durable event replay after reconnects."],["Agent-friendly","A CLI, OpenAPI contract, TypeScript SDK, webhooks, and slash-command shapes."],["Self-host first","SQLite is the default, not the demo. Postgres can arrive behind the store layer."]],l=["clickclack serve --data ./data","clickclack login --magic-token mgt_...",'clickclack send --channel general "deploy started"',"clickclack threads reply msg_... --stdin {var Ne=Bp();ji(()=>{Rl.title="ClickClack - Self-hostable chat with claws"}),R(le,Ne)});var o=p(c),u=g(p(o),2),f=g(p(u),2),m=p(f);F(m,"href",n);var v=g(m,2),x=g(v,2);F(x,"href",r);var b=g(u,2),E=g(p(b),6),k=p(E),_=g(k,2);F(_,"href",n);var z=g(_,2);F(z,"href",r);var y=g(o,4);It(y,5,()=>s,Su,(le,Ne)=>{var he=Gp(),lt=p(he),tt=p(lt),nt=g(lt,2),W=p(nt);N(()=>{O(tt,i(Ne)[0]),O(W,i(Ne)[1])}),R(le,he)});var I=g(y,2),G=g(p(I),2),te=p(G),ae=g(I,2),fe=g(p(ae),2),_e=g(p(fe),2);F(_e,"href",n);var ie=g(_e,2),X=g(ie,2);F(X,"href",r),N(le=>{F(v,"href",a),F(k,"href",a),O(te,le),F(ie,"href",a)},[()=>l.join(` +`)]),R(t,c),jt()}function Wp(t){const e=window.location.pathname,a=window.location.hostname.startsWith("app.")||e==="/app"||e.startsWith("/app/");var r=$a(),s=yn(r);{var l=o=>{Up(o,{})},c=o=>{qp(o,{})};q(s,o=>{a?o(l):o(c,-1)})}R(t,r)}wu(Wp,{target:document.getElementById("app")}); diff --git a/apps/api/internal/webassets/dist/assets/index-CgVGSv--.js b/apps/api/internal/webassets/dist/assets/index-CgVGSv--.js deleted file mode 100644 index b14e5f0..0000000 --- a/apps/api/internal/webassets/dist/assets/index-CgVGSv--.js +++ /dev/null @@ -1,72 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const lc=!1;var cl=Array.isArray,oc=Array.prototype.indexOf,Hr=Array.prototype.includes,ni=Array.from,cc=Object.defineProperty,Br=Object.getOwnPropertyDescriptor,ul=Object.getOwnPropertyDescriptors,uc=Object.prototype,fc=Array.prototype,Gi=Object.getPrototypeOf,Rs=Object.isExtensible;const dc=()=>{};function pc(e){return e()}function Ti(e){for(var t=0;t{e=a,t=r});return{promise:n,resolve:e,reject:t}}const ut=2,Gr=4,Ca=8,dl=1<<24,yn=16,cn=32,tr=64,Si=128,Yt=512,Ge=1024,lt=2048,un=4096,wt=8192,zt=16384,Sr=32768,Ei=1<<25,qr=65536,Ai=1<<17,pl=1<<18,Er=1<<19,hl=1<<20,wn=1<<25,wr=65536,Va=1<<21,Aa=1<<22,Jn=1<<23,mr=Symbol("$state"),hc=Symbol("legacy props"),vc=Symbol(""),Nn=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},gc=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function vl(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function mc(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function _c(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function bc(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function kc(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function wc(e){throw new Error("https://svelte.dev/e/effect_orphan")}function yc(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function xc(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Tc(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Sc(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ec(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ac(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Rc=1,Cc=2,gl=4,Ic=8,Lc=16,Dc=1,Oc=2,Mc=4,Nc=8,Pc=16,zc=1,Fc=2,Je=Symbol(),ml="http://www.w3.org/1999/xhtml",Uc="http://www.w3.org/2000/svg",Bc="http://www.w3.org/1998/Math/MathML";function Hc(){console.warn("https://svelte.dev/e/derived_inert")}function Gc(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function _l(e){return e===this.v}function bl(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function kl(e){return!bl(e,this.v)}let Yr=!1,qc=!1;function Wc(){Yr=!0}let Ee=null;function Wr(e){Ee=e}function rr(e,t=!1,n){Ee={p:Ee,i:!1,c:null,e:null,s:e,x:null,r:J,l:Yr&&!t?{s:null,u:null,$:[]}:null}}function ar(e){var t=Ee,n=t.e;if(n!==null){t.e=null;for(var a of n)Hl(a)}return t.i=!0,Ee=t.p,{}}function Ia(){return!Yr||Ee!==null&&Ee.l===null}let vr=[];function wl(){var e=vr;vr=[],Ti(e)}function er(e){if(vr.length===0&&!Sa){var t=vr;queueMicrotask(()=>{t===vr&&wl()})}vr.push(e)}function jc(){for(;vr.length>0;)wl()}function yl(e){var t=J;if(t===null)return ie.f|=Jn,e;if((t.f&Sr)===0&&(t.f&Gr)===0)throw e;Kn(e,t)}function Kn(e,t){for(;t!==null;){if((t.f&Si)!==0){if((t.f&Sr)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Zc=-7169;function Me(e,t){e.f=e.f&Zc|t}function qi(e){(e.f&Yt)!==0||e.deps===null?Me(e,Ge):Me(e,un)}function xl(e){if(e!==null)for(const t of e)(t.f&ut)===0||(t.f&wr)===0||(t.f^=wr,xl(t.deps))}function Tl(e,t,n){(e.f<)!==0?t.add(e):(e.f&un)!==0&&n.add(e),xl(e.deps),Me(e,Ge)}let qa=!1;function Yc(e){var t=qa;try{return qa=!1,[e(),qa]}finally{qa=t}}const fr=new Set;let ee=null,ln=null,Ri=null,Sa=!1,hi=!1,Fr=null,$a=null;var Cs=0;let $c=1;class nr{id=$c++;current=new Map;previous=new Map;#n=new Set;#o=new Set;#e=new Set;#a=new Map;#r=new Map;#i=null;#t=[];#s=[];#c=new Set;#u=new Set;#l=new Map;#d=new Set;is_fork=!1;#h=!1;#p=new Set;#f(){return this.is_fork||this.#r.size>0}#m(){for(const a of this.#p)for(const r of a.#r.keys()){for(var t=!1,n=r;n.parent!==null;){if(this.#l.has(n)){t=!0;break}n=n.parent}if(!t)return!0}return!1}skip_effect(t){this.#l.has(t)||this.#l.set(t,{d:[],m:[]}),this.#d.delete(t)}unskip_effect(t,n=a=>this.schedule(a)){var a=this.#l.get(t);if(a){this.#l.delete(t);for(var r of a.d)Me(r,lt),n(r);for(r of a.m)Me(r,un),n(r)}this.#d.add(t)}#v(){if(Cs++>1e3&&(fr.delete(this),Vc()),!this.#f()){for(const c of this.#c)this.#u.delete(c),Me(c,lt),this.schedule(c);for(const c of this.#u)Me(c,un),this.schedule(c)}const t=this.#t;this.#t=[],this.apply();var n=Fr=[],a=[],r=$a=[];for(const c of t)try{this.#_(c,n,a)}catch(o){throw Al(c),o}if(ee=null,r.length>0){var s=nr.ensure();for(const c of r)s.schedule(c)}if(Fr=null,$a=null,this.#f()||this.#m()){this.#g(a),this.#g(n);for(const[c,o]of this.#l)El(c,o)}else{this.#a.size===0&&fr.delete(this),this.#c.clear(),this.#u.clear();for(const c of this.#n)c(this);this.#n.clear(),Is(a),Is(n),this.#i?.resolve()}var l=ee;if(this.#t.length>0){const c=l??=this;c.#t.push(...this.#t.filter(o=>!c.#t.includes(o)))}l!==null&&(fr.add(l),l.#v())}#_(t,n,a){t.f^=Ge;for(var r=t.first;r!==null;){var s=r.f,l=(s&(cn|tr))!==0,c=l&&(s&Ge)!==0,o=c||(s&wt)!==0||this.#l.has(r);if(!o&&r.fn!==null){l?r.f^=Ge:(s&Gr)!==0?n.push(r):Xr(r)&&((s&yn)!==0&&this.#u.add(r),xr(r));var u=r.first;if(u!==null){r=u;continue}}for(;r!==null;){var d=r.next;if(d!==null){r=d;break}r=r.parent}}}#g(t){for(var n=0;n!this.current.has(m));if(r.length===0)t&&d.discard();else if(n.length>0){if(t)for(const m of this.#d)d.unskip_effect(m,g=>{(g.f&(yn|Aa))!==0?d.schedule(g):d.#g([g])});d.activate();var s=new Set,l=new Map;for(var c of n)Sl(c,r,s,l);l=new Map;var o=[...d.current.keys()].filter(m=>this.current.has(m)?this.current.get(m)[0]!==m:!0);for(const m of this.#s)(m.f&(zt|wt|Ai))===0&&Wi(m,o,l)&&((m.f&(Aa|yn))!==0?(Me(m,lt),d.schedule(m)):d.#c.add(m));if(d.#t.length>0){d.apply();for(var u of d.#t)d.#_(u,[],[]);d.#t=[]}d.deactivate()}}for(const d of fr)d.#p.has(this)&&(d.#p.delete(this),d.#p.size===0&&!d.#f()&&(d.activate(),d.#v()))}increment(t,n){let a=this.#a.get(n)??0;if(this.#a.set(n,a+1),t){let r=this.#r.get(n)??0;this.#r.set(n,r+1)}}decrement(t,n,a){let r=this.#a.get(n)??0;if(r===1?this.#a.delete(n):this.#a.set(n,r-1),t){let s=this.#r.get(n)??0;s===1?this.#r.delete(n):this.#r.set(n,s-1)}this.#h||a||(this.#h=!0,er(()=>{this.#h=!1,this.flush()}))}transfer_effects(t,n){for(const a of t)this.#c.add(a);for(const a of n)this.#u.add(a);t.clear(),n.clear()}oncommit(t){this.#n.add(t)}ondiscard(t){this.#o.add(t)}on_fork_commit(t){this.#e.add(t)}run_fork_commit_callbacks(){for(const t of this.#e)t(this);this.#e.clear()}settled(){return(this.#i??=fl()).promise}static ensure(){if(ee===null){const t=ee=new nr;hi||(fr.add(ee),Sa||er(()=>{ee===t&&t.flush()}))}return ee}apply(){{ln=null;return}}schedule(t){if(Ri=t,t.b?.is_pending&&(t.f&(Gr|Ca|dl))!==0&&(t.f&Sr)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var a=n.f;if(Fr!==null&&n===J&&(ie===null||(ie.f&ut)===0))return;if((a&(tr|cn))!==0){if((a&Ge)===0)return;n.f^=Ge}}this.#t.push(n)}}function Xc(e){var t=Sa;Sa=!0;try{for(var n;;){if(jc(),ee===null)return n;ee.flush()}}finally{Sa=t}}function Vc(){try{yc()}catch(e){Kn(e,Ri)}}let Mn=null;function Is(e){var t=e.length;if(t!==0){for(var n=0;n0)){_r.clear();for(const r of Mn){if((r.f&(zt|wt))!==0)continue;const s=[r];let l=r.parent;for(;l!==null;)Mn.has(l)&&(Mn.delete(l),s.push(l)),l=l.parent;for(let c=s.length-1;c>=0;c--){const o=s[c];(o.f&(zt|wt))===0&&xr(o)}}Mn.clear()}}Mn=null}}function Sl(e,t,n,a){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const r of e.reactions){const s=r.f;(s&ut)!==0?Sl(r,t,n,a):(s&(Aa|yn))!==0&&(s<)===0&&Wi(r,t,a)&&(Me(r,lt),ji(r))}}function Wi(e,t,n){const a=n.get(e);if(a!==void 0)return a;if(e.deps!==null)for(const r of e.deps){if(Hr.call(t,r))return!0;if((r.f&ut)!==0&&Wi(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function ji(e){ee.schedule(e)}function El(e,t){if(!((e.f&cn)!==0&&(e.f&Ge)!==0)){(e.f<)!==0?t.d.push(e):(e.f&un)!==0&&t.m.push(e),Me(e,Ge);for(var n=e.first;n!==null;)El(n,t),n=n.next}}function Al(e){Me(e,Ge);for(var t=e.first;t!==null;)Al(t),t=t.next}function Kc(e){let t=0,n=yr(0),a;return()=>{Yi()&&(i(n),$r(()=>(t===0&&(a=_(()=>e(()=>Ea(n)))),t+=1,()=>{er(()=>{t-=1,t===0&&(a?.(),a=void 0,Ea(n))})})))}}var Qc=qr|Er;function Jc(e,t,n,a){new eu(e,t,n,a)}class eu{parent;is_pending=!1;transform_error;#n;#o=null;#e;#a;#r;#i=null;#t=null;#s=null;#c=null;#u=0;#l=0;#d=!1;#h=new Set;#p=new Set;#f=null;#m=Kc(()=>(this.#f=yr(this.#u),()=>{this.#f=null}));constructor(t,n,a,r){this.#n=t,this.#e=n,this.#a=s=>{var l=J;l.b=this,l.f|=Si,a(s)},this.parent=J.b,this.transform_error=r??this.parent?.transform_error??(s=>s),this.#r=ai(()=>{this.#b()},Qc)}#v(){try{this.#i=Zt(()=>this.#a(this.#n))}catch(t){this.error(t)}}#_(t){const n=this.#e.failed;n&&(this.#s=Zt(()=>{n(this.#n,()=>t,()=>()=>{})}))}#g(){const t=this.#e.pending;t&&(this.is_pending=!0,this.#t=Zt(()=>t(this.#n)),er(()=>{var n=this.#c=document.createDocumentFragment(),a=xn();n.append(a),this.#i=this.#w(()=>Zt(()=>this.#a(a))),this.#l===0&&(this.#n.before(n),this.#c=null,br(this.#t,()=>{this.#t=null}),this.#k(ee))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#u=0,this.#i=Zt(()=>{this.#a(this.#n)}),this.#l>0){var t=this.#c=document.createDocumentFragment();Ki(this.#i,t);const n=this.#e.pending;this.#t=Zt(()=>n(this.#n))}else this.#k(ee)}catch(n){this.error(n)}}#k(t){this.is_pending=!1,t.transfer_effects(this.#h,this.#p)}defer_effect(t){Tl(t,this.#h,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#e.pending}#w(t){var n=J,a=ie,r=Ee;Vt(this.#r),Xt(this.#r),Wr(this.#r.ctx);try{return nr.ensure(),t()}catch(s){return yl(s),null}finally{Vt(n),Xt(a),Wr(r)}}#y(t,n){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(t,n);return}this.#l+=t,this.#l===0&&(this.#k(n),this.#t&&br(this.#t,()=>{this.#t=null}),this.#c&&(this.#n.before(this.#c),this.#c=null))}update_pending_count(t,n){this.#y(t,n),this.#u+=t,!(!this.#f||this.#d)&&(this.#d=!0,er(()=>{this.#d=!1,this.#f&&jr(this.#f,this.#u)}))}get_effect_pending(){return this.#m(),i(this.#f)}error(t){if(!this.#e.onerror&&!this.#e.failed)throw t;ee?.is_fork?(this.#i&&ee.skip_effect(this.#i),this.#t&&ee.skip_effect(this.#t),this.#s&&ee.skip_effect(this.#s),ee.on_fork_commit(()=>{this.#x(t)})):this.#x(t)}#x(t){this.#i&&(Lt(this.#i),this.#i=null),this.#t&&(Lt(this.#t),this.#t=null),this.#s&&(Lt(this.#s),this.#s=null);var n=this.#e.onerror;let a=this.#e.failed;var r=!1,s=!1;const l=()=>{if(r){Gc();return}r=!0,s&&Ac(),this.#s!==null&&br(this.#s,()=>{this.#s=null}),this.#w(()=>{this.#b()})},c=o=>{try{s=!0,n?.(o,l),s=!1}catch(u){Kn(u,this.#r&&this.#r.parent)}a&&(this.#s=this.#w(()=>{try{return Zt(()=>{var u=J;u.b=this,u.f|=Si,a(this.#n,()=>o,()=>l)})}catch(u){return Kn(u,this.#r.parent),null}}))};er(()=>{var o;try{o=this.transform_error(t)}catch(u){Kn(u,this.#r&&this.#r.parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(c,u=>Kn(u,this.#r&&this.#r.parent)):c(o)})}}function tu(e,t,n,a){const r=Ia()?La:rn;var s=e.filter(g=>!g.settled);if(n.length===0&&s.length===0){a(t.map(r));return}var l=J,c=nu(),o=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(g=>g.promise)):null;function u(g){c();try{a(g)}catch(T){(l.f&zt)===0&&Kn(T,l)}Ka()}if(n.length===0){o.then(()=>u(t.map(r)));return}var d=Rl();function m(){Promise.all(n.map(g=>ru(g))).then(g=>u([...t.map(r),...g])).catch(g=>Kn(g,l)).finally(()=>d())}o?o.then(()=>{c(),m(),Ka()}):m()}function nu(){var e=J,t=ie,n=Ee,a=ee;return function(s=!0){Vt(e),Xt(t),Wr(n),s&&(e.f&zt)===0&&(a?.activate(),a?.apply())}}function Ka(e=!0){Vt(null),Xt(null),Wr(null),e&&ee?.deactivate()}function Rl(){var e=J,t=e.b,n=ee,a=t.is_rendered();return t.update_pending_count(1,n),n.increment(a,e),(r=!1)=>{t.update_pending_count(-1,n),n.decrement(a,e,r)}}function La(e){var t=ut|lt;return J!==null&&(J.f|=Er),{ctx:Ee,deps:null,effects:null,equals:_l,f:t,fn:e,reactions:null,rv:0,v:Je,wv:0,parent:J,ac:null}}function ru(e,t,n){let a=J;a===null&&mc();var r=void 0,s=yr(Je),l=!ie,c=new Map;return gu(()=>{var o=J,u=fl();r=u.promise;try{Promise.resolve(e()).then(u.resolve,u.reject).finally(Ka)}catch(T){u.reject(T),Ka()}var d=ee;if(l){if((o.f&Sr)!==0)var m=Rl();if(a.b.is_rendered())c.get(d)?.reject(Nn),c.delete(d);else{for(const T of c.values())T.reject(Nn);c.clear()}c.set(d,u)}const g=(T,w=void 0)=>{if(m){var I=w===Nn;m(I)}if(!(w===Nn||(o.f&zt)!==0)){if(d.activate(),w)s.f|=Jn,jr(s,w);else{(s.f&Jn)!==0&&(s.f^=Jn),jr(s,T);for(const[S,R]of c){if(c.delete(S),S===d)break;R.reject(Nn)}}d.deactivate()}};u.promise.then(g,T=>g(null,T||"unknown"))}),Bl(()=>{for(const o of c.values())o.reject(Nn)}),new Promise(o=>{function u(d){function m(){d===r?o(s):u(r)}d.then(m,m)}u(r)})}function Ci(e){const t=La(e);return Yl(t),t}function rn(e){const t=La(e);return t.equals=kl,t}function au(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;ni(e))),t}function h(e,t,n=!1){ie!==null&&(!on||(ie.f&Ai)!==0)&&Ia()&&(ie.f&(ut|yn|Aa|Ai))!==0&&($t===null||!Hr.call($t,e))&&Ec();let a=n?Ur(t):t;return jr(e,a,$a)}function jr(e,t,n=null){if(!e.equals(t)){_r.set(e,Pn?t:e.v);var a=nr.ensure();if(a.capture(e,t),(e.f&ut)!==0){const r=e;(e.f<)!==0&&Zi(r),ln===null&&qi(r)}e.wv=Xl(),Dl(e,lt,n),Ia()&&J!==null&&(J.f&Ge)!==0&&(J.f&(cn|tr))===0&&(Wt===null?_u([e]):Wt.push(e)),!a.is_fork&&Ii.size>0&&!Ll&&lu()}return t}function lu(){Ll=!1;for(const e of Ii)(e.f&Ge)!==0&&Me(e,un),Xr(e)&&xr(e);Ii.clear()}function Ea(e){h(e,e.v+1)}function Dl(e,t,n){var a=e.reactions;if(a!==null)for(var r=Ia(),s=a.length,l=0;l{if(kr===s)return c();var o=ie,u=kr;Xt(null),Os(s);var d=c();return Xt(o),Os(u),d};return a&&n.set("length",jt(e.length)),new Proxy(e,{defineProperty(c,o,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Tc();var d=n.get(o);return d===void 0?l(()=>{var m=jt(u.value);return n.set(o,m),m}):h(d,u.value,!0),!0},deleteProperty(c,o){var u=n.get(o);if(u===void 0){if(o in c){const d=l(()=>jt(Je));n.set(o,d),Ea(r)}}else h(u,Je),Ea(r);return!0},get(c,o,u){if(o===mr)return e;var d=n.get(o),m=o in c;if(d===void 0&&(!m||Br(c,o)?.writable)&&(d=l(()=>{var T=Ur(m?c[o]:Je),w=jt(T);return w}),n.set(o,d)),d!==void 0){var g=i(d);return g===Je?void 0:g}return Reflect.get(c,o,u)},getOwnPropertyDescriptor(c,o){var u=Reflect.getOwnPropertyDescriptor(c,o);if(u&&"value"in u){var d=n.get(o);d&&(u.value=i(d))}else if(u===void 0){var m=n.get(o),g=m?.v;if(m!==void 0&&g!==Je)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return u},has(c,o){if(o===mr)return!0;var u=n.get(o),d=u!==void 0&&u.v!==Je||Reflect.has(c,o);if(u!==void 0||J!==null&&(!d||Br(c,o)?.writable)){u===void 0&&(u=l(()=>{var g=d?Ur(c[o]):Je,T=jt(g);return T}),n.set(o,u));var m=i(u);if(m===Je)return!1}return d},set(c,o,u,d){var m=n.get(o),g=o in c;if(a&&o==="length")for(var T=u;Tjt(Je)),n.set(T+"",w))}if(m===void 0)(!g||Br(c,o)?.writable)&&(m=l(()=>jt(void 0)),h(m,Ur(u)),n.set(o,m));else{g=m.v!==Je;var I=l(()=>Ur(u));h(m,I)}var S=Reflect.getOwnPropertyDescriptor(c,o);if(S?.set&&S.set.call(d,u),!g){if(a&&typeof o=="string"){var R=n.get("length"),E=Number(o);Number.isInteger(E)&&E>=R.v&&h(R,E+1)}Ea(r)}return!0},ownKeys(c){i(r);var o=Reflect.ownKeys(c).filter(m=>{var g=n.get(m);return g===void 0||g.v!==Je});for(var[u,d]of n)d.v!==Je&&!(u in c)&&o.push(u);return o},setPrototypeOf(){Sc()}})}var Li,Ol,Ml,Nl,Pl;function ou(){if(Li===void 0){Li=window,Ol=document,Ml=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Nl=Br(t,"firstChild").get,Pl=Br(t,"nextSibling").get,Rs(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Rs(n)&&(n.__t=void 0)}}function xn(e=""){return document.createTextNode(e)}function Qn(e){return Nl.call(e)}function Da(e){return Pl.call(e)}function p(e,t){return Qn(e)}function Vn(e,t=!1){{var n=Qn(e);return n instanceof Comment&&n.data===""?Da(n):n}}function v(e,t=1,n=!1){let a=e;for(;t--;)a=Da(a);return a}function cu(e){e.textContent=""}function zl(){return!1}function Fl(e,t,n){return document.createElementNS(t??ml,e,void 0)}let Ls=!1;function uu(){Ls||(Ls=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function ri(e){var t=ie,n=J;Xt(null),Vt(null);try{return e()}finally{Xt(t),Vt(n)}}function fu(e,t,n,a=n){e.addEventListener(t,()=>ri(n));const r=e.__on_r;r?e.__on_r=()=>{r(),a(!0)}:e.__on_r=()=>a(!0),uu()}function Ul(e){J===null&&(ie===null&&wc(),kc()),Pn&&bc()}function du(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Tn(e,t){var n=J;n!==null&&(n.f&wt)!==0&&(e|=wt);var a={ctx:Ee,deps:null,nodes:null,f:e|lt|Yt,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};ee?.register_created_effect(a);var r=a;if((e&Gr)!==0)Fr!==null?Fr.push(a):nr.ensure().schedule(a);else if(t!==null){try{xr(a)}catch(l){throw Lt(a),l}r.deps===null&&r.teardown===null&&r.nodes===null&&r.first===r.last&&(r.f&Er)===0&&(r=r.first,(e&yn)!==0&&(e&qr)!==0&&r!==null&&(r.f|=qr))}if(r!==null&&(r.parent=n,n!==null&&du(r,n),ie!==null&&(ie.f&ut)!==0&&(e&tr)===0)){var s=ie;(s.effects??=[]).push(r)}return a}function Yi(){return ie!==null&&!on}function Bl(e){const t=Tn(Ca,null);return Me(t,Ge),t.teardown=e,t}function Qa(e){Ul();var t=J.f,n=!ie&&(t&cn)!==0&&(t&Sr)===0;if(n){var a=Ee;(a.e??=[]).push(e)}else return Hl(e)}function Hl(e){return Tn(Gr|hl,e)}function pu(e){return Ul(),Tn(Ca|hl,e)}function hu(e){nr.ensure();const t=Tn(tr|Er,e);return(n={})=>new Promise(a=>{n.outro?br(t,()=>{Lt(t),a(void 0)}):(Lt(t),a(void 0))})}function $i(e){return Tn(Gr,e)}function mn(e,t){var n=Ee,a={effect:null,ran:!1,deps:e};n.l.$.push(a),a.effect=$r(()=>{if(e(),!a.ran){a.ran=!0;var r=J;try{Vt(r.parent),_(t)}finally{Vt(r)}}})}function vu(){var e=Ee;$r(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&Ge)!==0&&n.deps!==null&&Me(n,un),Xr(n)&&xr(n),t.ran=!1}})}function gu(e){return Tn(Aa|Er,e)}function $r(e,t=0){return Tn(Ca|t,e)}function z(e,t=[],n=[],a=[]){tu(a,t,n,r=>{Tn(Ca,()=>e(...r.map(i)))})}function ai(e,t=0){var n=Tn(yn|t,e);return n}function Zt(e){return Tn(cn|Er,e)}function Gl(e){var t=e.teardown;if(t!==null){const n=Pn,a=ie;Ds(!0),Xt(null);try{t.call(null)}finally{Ds(n),Xt(a)}}}function Xi(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const r=n.ac;r!==null&&ri(()=>{r.abort(Nn)});var a=n.next;(n.f&tr)!==0?n.parent=null:Lt(n,t),n=a}}function mu(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&cn)===0&&Lt(t),t=n}}function Lt(e,t=!0){var n=!1;(t||(e.f&pl)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(ql(e.nodes.start,e.nodes.end),n=!0),Me(e,Ei),Xi(e,t&&!n),Ra(e,0);var a=e.nodes&&e.nodes.t;if(a!==null)for(const s of a)s.stop();Gl(e),e.f^=Ei,e.f|=zt;var r=e.parent;r!==null&&r.first!==null&&Wl(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function ql(e,t){for(;e!==null;){var n=e===t?null:Da(e);e.remove(),e=n}}function Wl(e){var t=e.parent,n=e.prev,a=e.next;n!==null&&(n.next=a),a!==null&&(a.prev=n),t!==null&&(t.first===e&&(t.first=a),t.last===e&&(t.last=n))}function br(e,t,n=!0){var a=[];jl(e,a,!0);var r=()=>{n&&Lt(e),t&&t()},s=a.length;if(s>0){var l=()=>--s||r();for(var c of a)c.out(l)}else r()}function jl(e,t,n){if((e.f&wt)===0){e.f^=wt;var a=e.nodes&&e.nodes.t;if(a!==null)for(const c of a)(c.is_global||n)&&t.push(c);for(var r=e.first;r!==null;){var s=r.next;if((r.f&tr)===0){var l=(r.f&qr)!==0||(r.f&cn)!==0&&(e.f&yn)!==0;jl(r,t,l?n:!1)}r=s}}}function Vi(e){Zl(e,!0)}function Zl(e,t){if((e.f&wt)!==0){e.f^=wt,(e.f&Ge)===0&&(Me(e,lt),nr.ensure().schedule(e));for(var n=e.first;n!==null;){var a=n.next,r=(n.f&qr)!==0||(n.f&cn)!==0;Zl(n,r?t:!1),n=a}var s=e.nodes&&e.nodes.t;if(s!==null)for(const l of s)(l.is_global||t)&&l.in()}}function Ki(e,t){if(e.nodes)for(var n=e.nodes.start,a=e.nodes.end;n!==null;){var r=n===a?null:Da(n);t.append(n),n=r}}let Xa=!1,Pn=!1;function Ds(e){Pn=e}let ie=null,on=!1;function Xt(e){ie=e}let J=null;function Vt(e){J=e}let $t=null;function Yl(e){ie!==null&&($t===null?$t=[e]:$t.push(e))}let It=null,Nt=0,Wt=null;function _u(e){Wt=e}let $l=1,gr=0,kr=gr;function Os(e){kr=e}function Xl(){return++$l}function Xr(e){var t=e.f;if((t<)!==0)return!0;if(t&ut&&(e.f&=~wr),(t&un)!==0){for(var n=e.deps,a=n.length,r=0;re.wv)return!0}(t&Yt)!==0&&ln===null&&Me(e,Ge)}return!1}function Vl(e,t,n=!0){var a=e.reactions;if(a!==null&&!($t!==null&&Hr.call($t,e)))for(var r=0;r{e.ac.abort(Nn)}),e.ac=null);try{e.f|=Va;var d=e.fn,m=d();e.f|=Sr;var g=e.deps,T=ee?.is_fork;if(It!==null){var w;if(T||Ra(e,Nt),g!==null&&Nt>0)for(g.length=Nt+It.length,w=0;wn?.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?er(()=>{t.addEventListener(e,r,a)}):t.addEventListener(e,r,a),r}function kn(e,t,n,a,r){var s={capture:a,passive:r},l=yu(e,t,n,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Bl(()=>{t.removeEventListener(e,l,s)})}function W(e,t,n){(t[wa]??={})[e]=n}function Vr(e){for(var t=0;t{throw S});throw g}}finally{e[wa]=t,delete e.currentTarget,Xt(d),Vt(m)}}}const xu=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Tu(e){return xu?.createHTML(e)??e}function Su(e){var t=Fl("template");return t.innerHTML=Tu(e.replaceAll("","")),t.content}function Zr(e,t){var n=J;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function O(e,t){var n=(t&zc)!==0,a=(t&Fc)!==0,r,s=!e.startsWith("");return()=>{r===void 0&&(r=Su(s?e:""+e),n||(r=Qn(r)));var l=a||Ml?document.importNode(r,!0):r.cloneNode(!0);if(n){var c=Qn(l),o=l.lastChild;Zr(c,o)}else Zr(l,l);return l}}function mt(e=""){{var t=xn(e+"");return Zr(t,t),t}}function Qi(){var e=document.createDocumentFragment(),t=document.createComment(""),n=xn();return e.append(t,n),Zr(t,n),e}function C(e,t){e!==null&&e.before(t)}function M(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function Eu(e,t){return Au(e,t)}const Wa=new Map;function Au(e,{target:t,anchor:n,props:a={},events:r,context:s,intro:l=!0,transformError:c}){ou();var o=void 0,u=hu(()=>{var d=n??t.appendChild(xn());Jc(d,{pending:()=>{}},T=>{rr({});var w=Ee;s&&(w.c=s),r&&(a.$$events=r),o=e(T,a)||{},ar()},c);var m=new Set,g=T=>{for(var w=0;w{for(var T of m)for(const S of[t,document]){var w=Wa.get(S),I=w.get(T);--I==0?(S.removeEventListener(T,Ni),w.delete(T),w.size===0&&Wa.delete(S)):w.set(T,I)}Mi.delete(g),d!==n&&d.parentNode?.removeChild(d)}});return Ru.set(o,u),o}let Ru=new WeakMap;class Cu{anchor;#n=new Map;#o=new Map;#e=new Map;#a=new Set;#r=!0;constructor(t,n=!0){this.anchor=t,this.#r=n}#i=t=>{if(this.#n.has(t)){var n=this.#n.get(t),a=this.#o.get(n);if(a)Vi(a),this.#a.delete(n);else{var r=this.#e.get(n);r&&(this.#o.set(n,r.effect),this.#e.delete(n),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),a=r.effect)}for(const[s,l]of this.#n){if(this.#n.delete(s),s===t)break;const c=this.#e.get(l);c&&(Lt(c.effect),this.#e.delete(l))}for(const[s,l]of this.#o){if(s===n||this.#a.has(s))continue;const c=()=>{if(Array.from(this.#n.values()).includes(s)){var u=document.createDocumentFragment();Ki(l,u),u.append(xn()),this.#e.set(s,{effect:l,fragment:u})}else Lt(l);this.#a.delete(s),this.#o.delete(s)};this.#r||!a?(this.#a.add(s),br(l,c,!1)):c()}}};#t=t=>{this.#n.delete(t);const n=Array.from(this.#n.values());for(const[a,r]of this.#e)n.includes(a)||(Lt(r.effect),this.#e.delete(a))};ensure(t,n){var a=ee,r=zl();if(n&&!this.#o.has(t)&&!this.#e.has(t))if(r){var s=document.createDocumentFragment(),l=xn();s.append(l),this.#e.set(t,{effect:Zt(()=>n(l)),fragment:s})}else this.#o.set(t,Zt(()=>n(this.anchor)));if(this.#n.set(a,t),r){for(const[c,o]of this.#o)c===t?a.unskip_effect(o):a.skip_effect(o);for(const[c,o]of this.#e)c===t?a.unskip_effect(o.effect):a.skip_effect(o.effect);a.oncommit(this.#i),a.ondiscard(this.#t)}else this.#i(a)}}function j(e,t,n=!1){var a=new Cu(e),r=n?qr:0;function s(l,c){a.ensure(l,c)}ai(()=>{var l=!1;t((c,o=0)=>{l=!0,s(o,c)}),l||s(-1,null)},r)}function Iu(e,t){return t}function Lu(e,t,n){for(var a=[],r=t.length,s,l=t.length,c=0;c{if(s){if(s.pending.delete(m),s.done.add(m),s.pending.size===0){var g=e.outrogroups;Pi(e,ni(s.done)),g.delete(s),g.size===0&&(e.outrogroups=null)}}else l-=1},!1)}if(l===0){var o=a.length===0&&n!==null;if(o){var u=n,d=u.parentNode;cu(d),d.append(u),e.items.clear()}Pi(e,t,!o)}else s={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(s)}function Pi(e,t,n=!0){var a;if(e.pending.size>0){a=new Set;for(const l of e.pending.values())for(const c of l)a.add(e.items.get(c).e)}for(var r=0;r{var L=n();return cl(L)?L:L==null?[]:ni(L)}),g,T=new Map,w=!0;function I(L){(E.effect.f&zt)===0&&(E.pending.delete(L),E.fallback=d,Du(E,g,l,t,a),d!==null&&(g.length===0?(d.f&wn)===0?Vi(d):(d.f^=wn,ya(d,null,l)):br(d,()=>{d=null})))}function S(L){E.pending.delete(L)}var R=ai(()=>{g=i(m);for(var L=g.length,A=new Set,$=ee,te=zl(),oe=0;oes(l)):(d=Zt(()=>s(Ns??=xn())),d.f|=wn)),L>A.size&&_c(),!w)if(T.set($,A),te){for(const[re,ne]of c)A.has(re)||$.skip_effect(ne.e);$.oncommit(I),$.ondiscard(S)}else I($);i(m)}),E={effect:R,items:c,pending:T,outrogroups:null,fallback:d};w=!1}function ha(e){for(;e!==null&&(e.f&cn)===0;)e=e.next;return e}function Du(e,t,n,a,r){var s=(a&Ic)!==0,l=t.length,c=e.items,o=ha(e.effect.first),u,d=null,m,g=[],T=[],w,I,S,R;if(s)for(R=0;R0){var Te=(a&gl)!==0&&l===0?n:null;if(s){for(R=0;R{if(m!==void 0)for(S of m)S.nodes?.a?.apply()})}function Ou(e,t,n,a,r,s,l,c){var o=(l&Rc)!==0?(l&Lc)===0?Z(n,!1,!1):yr(n):null,u=(l&Cc)!==0?yr(r):null;return{v:o,i:u,e:Zt(()=>(s(t,o??n,u??r,c),()=>{e.delete(a)}))}}function ya(e,t,n){if(e.nodes)for(var a=e.nodes.start,r=e.nodes.end,s=t&&(t.f&wn)===0?t.nodes.start:n;a!==null;){var l=Da(a);if(s.before(a),a===r)return;a=l}}function Yn(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function vi(e,t,n=!1,a=!1,r=!1,s=!1){var l=e,c="";if(n)var o=e;z(()=>{var u=J;if(c!==(c=t()??"")){if(n){u.nodes=null,o.innerHTML=c,c!==""&&Zr(Qn(o),o.lastChild);return}if(u.nodes!==null&&(ql(u.nodes.start,u.nodes.end),u.nodes=null),c!==""){var d=a?Uc:r?Bc:void 0,m=Fl(a?"svg":r?"math":"template",d);m.innerHTML=c;var g=a||r?m:m.content;if(Zr(Qn(g),g.lastChild),a||r)for(;Qn(g);)l.before(Qn(g));else l.before(g)}}})}function to(e,t){var n;n=document.head.appendChild(xn()),ai(()=>t(n),pl|Er)}function Mu(e,t,n){$i(()=>{var a=_(()=>t(e,n?.())||{});if(n&&a?.update){var r=!1,s={};$r(()=>{var l=n();F(l),r&&bl(s,l)&&(s=l,a.update(l))}),r=!0}if(a?.destroy)return()=>a.destroy()})}function no(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t=0;){var c=l+s;(l===0||Ps.includes(a[l-1]))&&(c===a.length||Ps.includes(a[c]))?a=(l===0?"":a.substring(0,l))+a.substring(c+1):l=c}}return a===""?null:a}function Fu(e,t){return e==null?null:String(e)}function bt(e,t,n,a,r,s){var l=e.__className;if(l!==n||l===void 0){var c=zu(n,a,s);c==null?e.removeAttribute("class"):e.className=c,e.__className=n}else if(s&&r!==s)for(var o in s){var u=!!s[o];(r==null||u!==!!r[o])&&e.classList.toggle(o,u)}return s}function Dn(e,t,n,a){var r=e.__style;if(r!==t){var s=Fu(t);s==null?e.removeAttribute("style"):e.style.cssText=s,e.__style=t}return a}const Uu=Symbol("is custom element"),Bu=Symbol("is html"),Hu=gc?"progress":"PROGRESS";function ro(e,t){var n=ao(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==Hu)||(e.value=t??"")}function H(e,t,n,a){var r=ao(e);r[t]!==(r[t]=n)&&(t==="loading"&&(e[vc]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Gu(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ao(e){return e.__attributes??={[Uu]:e.nodeName.includes("-"),[Bu]:e.namespaceURI===ml}}var zs=new Map;function Gu(e){var t=e.getAttribute("is")||e.nodeName,n=zs.get(t);if(n)return n;zs.set(t,n=[]);for(var a,r=e,s=Element.prototype;s!==r;){a=ul(r);for(var l in a)a[l].set&&n.push(l);r=Gi(r)}return n}function dr(e,t,n=t){var a=new WeakSet;fu(e,"input",async r=>{var s=r?e.defaultValue:e.value;if(s=gi(e)?mi(s):s,n(s),ee!==null&&a.add(ee),await Di(),s!==(s=t())){var l=e.selectionStart,c=e.selectionEnd,o=e.value.length;if(e.value=s??"",c!==null){var u=e.value.length;l===c&&c===o&&u>o?(e.selectionStart=u,e.selectionEnd=u):(e.selectionStart=l,e.selectionEnd=Math.min(c,u))}}}),_(t)==null&&e.value&&(n(gi(e)?mi(e.value):e.value),ee!==null&&a.add(ee)),$r(()=>{var r=t();if(e===document.activeElement){var s=ee;if(a.has(s))return}gi(e)&&r===mi(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function gi(e){var t=e.type;return t==="number"||t==="range"}function mi(e){return e===""?null:+e}function Fs(e,t){return e===t||e?.[mr]===t}function Ji(e={},t,n,a){var r=Ee.r,s=J;return $i(()=>{var l,c;return $r(()=>{l=c,c=[],_(()=>{e!==n(...c)&&(t(e,...c),l&&Fs(n(...l),e)&&t(null,...l))})}),()=>{let o=s;for(;o!==r&&o.parent!==null&&o.parent.f&Ei;)o=o.parent;const u=()=>{c&&Fs(n(...c),e)&&t(null,...c)},d=o.teardown;o.teardown=()=>{u(),d?.()}}}),e}function io(e=!1){const t=Ee,n=t.l.u;if(!n)return;let a=()=>F(t.s);if(e){let r=0,s={};const l=La(()=>{let c=!1;const o=t.s;for(const u in o)o[u]!==s[u]&&(s[u]=o[u],c=!0);return c&&r++,r});a=()=>i(l)}n.b.length&&pu(()=>{Us(t,a),Ti(n.b)}),Qa(()=>{const r=_(()=>n.m.map(pc));return()=>{for(const s of r)typeof s=="function"&&s()}}),n.a.length&&Qa(()=>{Us(t,a),Ti(n.a)})}function Us(e,t){if(e.l.s)for(const n of e.l.s)i(n);t()}function it(e,t,n,a){var r=!Yr||(n&Oc)!==0,s=(n&Nc)!==0,l=(n&Pc)!==0,c=a,o=!0,u=()=>(o&&(o=!1,c=l?_(a):a),c);let d;if(s){var m=mr in e||hc in e;d=Br(e,t)?.set??(m&&t in e?L=>e[t]=L:void 0)}var g,T=!1;s?[g,T]=Yc(()=>e[t]):g=e[t],g===void 0&&a!==void 0&&(g=u(),d&&(r&&xc(),d(g)));var w;if(r?w=()=>{var L=e[t];return L===void 0?u():(o=!0,L)}:w=()=>{var L=e[t];return L!==void 0&&(c=void 0),L===void 0?c:L},r&&(n&Mc)===0)return w;if(d){var I=e.$$legacy;return(function(L,A){return arguments.length>0?((!r||!A||I||T)&&d(A?w():L),L):w()})}var S=!1,R=((n&Dc)!==0?La:rn)(()=>(S=!1,w()));s&&i(R);var E=J;return(function(L,A){if(arguments.length>0){const $=A?i(R):r&&s?Ur(L):L;return h(R,$),S=!0,c!==void 0&&(c=$),L}return Pn&&S||(E.f&zt)!==0?R.v:i(R)})}function so(e){Ee===null&&vl(),Yr&&Ee.l!==null?Wu(Ee).m.push(e):Qa(()=>{const t=_(e);if(typeof t=="function")return t})}function qu(e){Ee===null&&vl(),so(()=>()=>_(e))}function Wu(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}const ju="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(ju);Wc();class lo extends Error{constructor(t,n){super(n),this.status=t}status}async function at(e,t={}){const n=new Headers(t.headers);n.set("Accept","application/json"),t.body&&!(t.body instanceof FormData)&&n.set("Content-Type","application/json");const a=await fetch(e,{...t,headers:n});if(!a.ok)throw new lo(a.status,await a.text());return a.json()}const Zu=[{title:"Ship it",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYjJ1bm1meHE4N2x3bnN0djJkMWtjNGc5bXYzZDFiOHBsbG16M3F0ZSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/l0HlHFRbmaZtBRhXG/giphy.gif",tags:["ship","launch","done"]},{title:"Approved",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExazBpbzJ6ODZ3bXQ3OHBvNGJidWZoajc0cHV6YnVub3MzZ3c1a2Z2dSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/111ebonMs90YLu/giphy.gif",tags:["yes","approved","nice"]},{title:"Deploy dance",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExY3NkaTVmZW9ydWNnZnl0ZWQ5aHQyeGNrd2k3NG4wZWNqYzNmd3k1ZCZlcD12MV9naWZzX3NlYXJjaCZjdD1n/GeimqsH0TLDt4tScGw/giphy.gif",tags:["deploy","dance","celebrate"]},{title:"Looking",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYWZ3emE0dm5mN2h0bGVsY2w0OXBodGd2cGJlNDRiZXo1YWNtdWRmZyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/26n6WywJyh39n1pBu/giphy.gif",tags:["search","looking","debug"]},{title:"Typing faster",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExOWFlbnJnbnIzbHYxcDIzdXZ3NGF3N2FocHNvMmR5enU3bHpycHBlZSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/13HgwGsXF0aiGY/giphy.gif",tags:["typing","code","work"]},{title:"Tiny victory",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdjJ2b2tqNmF4dG16NjE0eXhuc3h5bTlvamgwNTR0Zmd6ZjhtM2JuaSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/3o7abKhOpu0NwenH3O/giphy.gif",tags:["win","victory","celebrate"]}];function On(e,t=120){if(!e)return"";const n=e.replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t-1)+"...":n}function $n(e){return e.quoted_author?.display_name||"Unknown"}function Bs(e,t){return t===e.id?"Open":"Thread"}function Yu(e){const t=new Date(e),n=new Date,a=new Date;a.setDate(n.getDate()-1);const r=(s,l)=>s.getFullYear()===l.getFullYear()&&s.getMonth()===l.getMonth()&&s.getDate()===l.getDate();return r(t,n)?"Today":r(t,a)?"Yesterday":new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric"}).format(t)}function $u(e){const t=[];let n="",a="",r=0;for(const s of e){const l=new Date(s.created_at),c=l.toDateString(),o=s.author?.id||s.author_id||"local",u=c!==n,d=o!==a,m=l.getTime()-r>300*1e3;u||d||m||t.length===0?t.push({key:s.id,dayLabel:u?Yu(s.created_at):null,messages:[s],authorName:s.author?.display_name||"Local User",authorHandle:s.author?.handle||"",authorAvatarURL:s.author?.avatar_url||"",authorID:o,timestamp:s.created_at}):t[t.length-1].messages.push(s),n=c,a=o,r=l.getTime()}return t}function Hs(e){const t=e.trim();if(!t)return"?";const n=t.split(/\s+/);return n.length>=2?(n[0][0]+n[1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function Ke(e){if(!e)return"?";const t=e.trim();return t?t[0].toUpperCase():"?"}function ct(e){return e?`@${e}`:""}function Qe(e){let t=0;for(let n=0;n>>0;return t%360}function Gs(e,t){return e.members.find(n=>n.id!==t)||e.members[0]}function Xn(e,t){const n=e.members.filter(r=>r.id!==t);return(n.length>0?n:e.members).map(r=>r.display_name).join(", ")}function Xu(e,t,n){const a=new Map;for(const r of t)for(const s of r.members)s.id&&s.id!==n&&a.set(s.id,s);for(const r of[...e].reverse()){const s=r.author;s?.id&&s.id!==n&&a.set(s.id,s)}return[...a.values()].slice(0,12)}function qs(e,t){return e.find(n=>n.members.some(a=>a.id===t))}const Vu=new Set(["button","checkbox","combobox","link","listbox","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","option","radio","radiogroup","slider","spinbutton","switch","tab","tablist","textbox","tree","treeitem"]),Ku=new Set(["INPUT","TEXTAREA","SELECT","BUTTON","A","DETAILS","SUMMARY","VIDEO","AUDIO"]);function Qu(e){if(!e)return!1;if(e.isContentEditable)return!0;if(e instanceof HTMLInputElement){const t=(e.type||"text").toLowerCase();return t!=="checkbox"&&t!=="radio"&&t!=="button"&&t!=="submit"&&t!=="reset"&&t!=="file"}return e instanceof HTMLTextAreaElement}function Ju(e){if(!e||ef(e))return!1;if(Ku.has(e.tagName))return!0;const t=e.getAttribute("role");if(t&&Vu.has(t))return!0;const n=e.getAttribute("tabindex");return!!(n!==null&&n!=="-1"&&e.hasAttribute("aria-keyshortcuts"))}function ef(e){if(!e.closest(".messages, .thread"))return!1;if(e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement)return!0;const t=e.getAttribute("role");return t==="button"||t==="link"}function tf(){const e=typeof window<"u"?window.getSelection():null;if(!e||e.isCollapsed||e.rangeCount===0)return!1;const t=e.getRangeAt(0).commonAncestorContainer;return t?!!(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest(".messages, .thread, .markdown"):!1}function nf(e,t){if(t.authRequired||t.isModalOpen()||e.defaultPrevented||e.isComposing||e.keyCode===229||e.ctrlKey||e.metaKey||e.altKey||e.key.length!==1||tf())return!1;const n=document.activeElement;return!(n===t.messageInput||n===t.replyInput||Qu(n)||Ju(n))}function rf(e,t){if(!nf(e,t))return;const n=t.target();if(!n||n.disabled||n.readOnly)return;e.key===" "&&e.preventDefault(),n.focus({preventScroll:!0});const a=n.value.length;if(n.setSelectionRange(a,a),e.key===" "){const r=n.selectionStart??a,s=n.selectionEnd??a;n.setRangeText(" ",r,s,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))}}const{entries:oo,setPrototypeOf:Ws,isFrozen:af,getPrototypeOf:sf,getOwnPropertyDescriptor:lf}=Object;let{freeze:yt,seal:Kt,create:Pr}=Object,{apply:zi,construct:Fi}=typeof Reflect<"u"&&Reflect;yt||(yt=function(t){return t});Kt||(Kt=function(t){return t});zi||(zi=function(t,n){for(var a=arguments.length,r=new Array(a>2?a-2:0),s=2;s1?n-1:0),r=1;r"u"?null:qe(BigInt.prototype.toString),Xs=typeof Symbol>"u"?null:qe(Symbol.prototype.toString),Oe=qe(Object.prototype.hasOwnProperty),ma=qe(Object.prototype.toString),st=qe(RegExp.prototype.test),ja=pf(TypeError);function qe(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:xa;if(Ws&&Ws(e,null),!_t(t))return e;let a=t.length;for(;a--;){let r=t[a];if(typeof r=="string"){const s=n(r);s!==r&&(af(t)||(t[a]=s),r=s)}e[r]=!0}return e}function hf(e){for(let t=0;t/gm),wf=Kt(/\$\{[\w\W]*/gm),yf=Kt(/^data-[\-\w.\u00B7-\uFFFF]+$/),xf=Kt(/^aria-[\-\w]+$/),co=Kt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Tf=Kt(/^(?:\w+script|data):/i),Sf=Kt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),uo=Kt(/^html$/i),Ef=Kt(/^[a-z][.\w]*(-[.\w]+)+$/i);var el=Object.freeze({__proto__:null,ARIA_ATTR:xf,ATTR_WHITESPACE:Sf,CUSTOM_ELEMENT:Ef,DATA_ATTR:yf,DOCTYPE_NAME:uo,ERB_EXPR:kf,IS_ALLOWED_URI:co,IS_SCRIPT_OR_DATA:Tf,MUSTACHE_EXPR:bf,TMPLIT_EXPR:wf});const _a={element:1,text:3,progressingInstruction:7,comment:8,document:9},Af=function(){return typeof window>"u"?null:window},Rf=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let a=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(a=n.getAttribute(r));const s="dompurify"+(a?"#"+a:"");try{return t.createPolicy(s,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},tl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function fo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Af();const t=q=>fo(q);if(t.version="3.4.2",t.removed=[],!e||!e.document||e.document.nodeType!==_a.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const a=n,r=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:c,Element:o,NodeFilter:u,NamedNodeMap:d=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:m,DOMParser:g,trustedTypes:T}=e,w=o.prototype,I=zr(w,"cloneNode"),S=zr(w,"remove"),R=zr(w,"nextSibling"),E=zr(w,"childNodes"),L=zr(w,"parentNode");if(typeof l=="function"){const q=n.createElement("template");q.content&&q.content.ownerDocument&&(n=q.content.ownerDocument)}let A,$="";const{implementation:te,createNodeIterator:oe,createDocumentFragment:ge,getElementsByTagName:Te}=n,{importNode:ce}=a;let re=tl();t.isSupported=typeof oo=="function"&&typeof L=="function"&&te&&te.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ne,ERB_EXPR:Ne,TMPLIT_EXPR:we,DATA_ATTR:ft,ARIA_ATTR:Dt,IS_SCRIPT_OR_DATA:Ze,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:et}=el;let{IS_ALLOWED_URI:xt}=el,ke=null;const Tt=Q({},[...Vs,...bi,...ki,...wi,...Ks]);let Ae=null;const Ft=Q({},[...Qs,...yi,...Js,...Za]);let se=Object.seal(Pr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),We=null,dt=null;const pt=Object.seal(Pr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Sn=!0,Qt=!0,ye=!1,Ye=!0,Jt=!1,fn=!0,Ce=!1,Qr=!1,zn=!1,Fn=!1,Rr=!1,Cr=!1,ir=!0,Ma=!1;const St="user-content-";let sr=!0,Un=!1,En={},Ot=null;const lr=Q({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Jr=null;const Na=Q({},["audio","video","img","source","image","track"]);let ht=null;const ea=Q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ir="http://www.w3.org/1998/Math/MathML",Lr="http://www.w3.org/2000/svg",Et="http://www.w3.org/1999/xhtml";let Bn=Et,ta=!1,Hn=null;const li=Q({},[Ir,Lr,Et],_i);let or=Q({},["mi","mo","mn","ms","mtext"]),na=Q({},["annotation-xml"]);const oi=Q({},["title","style","font","a","script"]);let dn=null;const Pa=["application/xhtml+xml","text/html"],ra="text/html";let Pe=null,Gn=null;const aa=n.createElement("form"),An=function(f){return f instanceof RegExp||f instanceof Function},Dr=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Gn&&Gn===f)return;(!f||typeof f!="object")&&(f={}),f=Ct(f),dn=Pa.indexOf(f.PARSER_MEDIA_TYPE)===-1?ra:f.PARSER_MEDIA_TYPE,Pe=dn==="application/xhtml+xml"?_i:xa,ke=Oe(f,"ALLOWED_TAGS")&&_t(f.ALLOWED_TAGS)?Q({},f.ALLOWED_TAGS,Pe):Tt,Ae=Oe(f,"ALLOWED_ATTR")&&_t(f.ALLOWED_ATTR)?Q({},f.ALLOWED_ATTR,Pe):Ft,Hn=Oe(f,"ALLOWED_NAMESPACES")&&_t(f.ALLOWED_NAMESPACES)?Q({},f.ALLOWED_NAMESPACES,_i):li,ht=Oe(f,"ADD_URI_SAFE_ATTR")&&_t(f.ADD_URI_SAFE_ATTR)?Q(Ct(ea),f.ADD_URI_SAFE_ATTR,Pe):ea,Jr=Oe(f,"ADD_DATA_URI_TAGS")&&_t(f.ADD_DATA_URI_TAGS)?Q(Ct(Na),f.ADD_DATA_URI_TAGS,Pe):Na,Ot=Oe(f,"FORBID_CONTENTS")&&_t(f.FORBID_CONTENTS)?Q({},f.FORBID_CONTENTS,Pe):lr,We=Oe(f,"FORBID_TAGS")&&_t(f.FORBID_TAGS)?Q({},f.FORBID_TAGS,Pe):Ct({}),dt=Oe(f,"FORBID_ATTR")&&_t(f.FORBID_ATTR)?Q({},f.FORBID_ATTR,Pe):Ct({}),En=Oe(f,"USE_PROFILES")?f.USE_PROFILES&&typeof f.USE_PROFILES=="object"?Ct(f.USE_PROFILES):f.USE_PROFILES:!1,Sn=f.ALLOW_ARIA_ATTR!==!1,Qt=f.ALLOW_DATA_ATTR!==!1,ye=f.ALLOW_UNKNOWN_PROTOCOLS||!1,Ye=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Jt=f.SAFE_FOR_TEMPLATES||!1,fn=f.SAFE_FOR_XML!==!1,Ce=f.WHOLE_DOCUMENT||!1,Fn=f.RETURN_DOM||!1,Rr=f.RETURN_DOM_FRAGMENT||!1,Cr=f.RETURN_TRUSTED_TYPE||!1,zn=f.FORCE_BODY||!1,ir=f.SANITIZE_DOM!==!1,Ma=f.SANITIZE_NAMED_PROPS||!1,sr=f.KEEP_CONTENT!==!1,Un=f.IN_PLACE||!1,xt=gf(f.ALLOWED_URI_REGEXP)?f.ALLOWED_URI_REGEXP:co,Bn=typeof f.NAMESPACE=="string"?f.NAMESPACE:Et,or=Oe(f,"MATHML_TEXT_INTEGRATION_POINTS")&&f.MATHML_TEXT_INTEGRATION_POINTS&&typeof f.MATHML_TEXT_INTEGRATION_POINTS=="object"?Ct(f.MATHML_TEXT_INTEGRATION_POINTS):Q({},["mi","mo","mn","ms","mtext"]),na=Oe(f,"HTML_INTEGRATION_POINTS")&&f.HTML_INTEGRATION_POINTS&&typeof f.HTML_INTEGRATION_POINTS=="object"?Ct(f.HTML_INTEGRATION_POINTS):Q({},["annotation-xml"]);const y=Oe(f,"CUSTOM_ELEMENT_HANDLING")&&f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING=="object"?Ct(f.CUSTOM_ELEMENT_HANDLING):Pr(null);if(se=Pr(null),Oe(y,"tagNameCheck")&&An(y.tagNameCheck)&&(se.tagNameCheck=y.tagNameCheck),Oe(y,"attributeNameCheck")&&An(y.attributeNameCheck)&&(se.attributeNameCheck=y.attributeNameCheck),Oe(y,"allowCustomizedBuiltInElements")&&typeof y.allowCustomizedBuiltInElements=="boolean"&&(se.allowCustomizedBuiltInElements=y.allowCustomizedBuiltInElements),Jt&&(Qt=!1),Rr&&(Fn=!0),En&&(ke=Q({},Ks),Ae=Pr(null),En.html===!0&&(Q(ke,Vs),Q(Ae,Qs)),En.svg===!0&&(Q(ke,bi),Q(Ae,yi),Q(Ae,Za)),En.svgFilters===!0&&(Q(ke,ki),Q(Ae,yi),Q(Ae,Za)),En.mathMl===!0&&(Q(ke,wi),Q(Ae,Js),Q(Ae,Za))),pt.tagCheck=null,pt.attributeCheck=null,Oe(f,"ADD_TAGS")&&(typeof f.ADD_TAGS=="function"?pt.tagCheck=f.ADD_TAGS:_t(f.ADD_TAGS)&&(ke===Tt&&(ke=Ct(ke)),Q(ke,f.ADD_TAGS,Pe))),Oe(f,"ADD_ATTR")&&(typeof f.ADD_ATTR=="function"?pt.attributeCheck=f.ADD_ATTR:_t(f.ADD_ATTR)&&(Ae===Ft&&(Ae=Ct(Ae)),Q(Ae,f.ADD_ATTR,Pe))),Oe(f,"ADD_URI_SAFE_ATTR")&&_t(f.ADD_URI_SAFE_ATTR)&&Q(ht,f.ADD_URI_SAFE_ATTR,Pe),Oe(f,"FORBID_CONTENTS")&&_t(f.FORBID_CONTENTS)&&(Ot===lr&&(Ot=Ct(Ot)),Q(Ot,f.FORBID_CONTENTS,Pe)),Oe(f,"ADD_FORBID_CONTENTS")&&_t(f.ADD_FORBID_CONTENTS)&&(Ot===lr&&(Ot=Ct(Ot)),Q(Ot,f.ADD_FORBID_CONTENTS,Pe)),sr&&(ke["#text"]=!0),Ce&&Q(ke,["html","head","body"]),ke.table&&(Q(ke,["tbody"]),delete We.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw ja('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ja('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=f.TRUSTED_TYPES_POLICY,$=A.createHTML("")}else A===void 0&&(A=Rf(T,r)),A!==null&&typeof $=="string"&&($=A.createHTML(""));yt&&yt(f),Gn=f},za=Q({},[...bi,...ki,...mf]),Fa=Q({},[...wi,..._f]),ci=function(f){let y=L(f);(!y||!y.tagName)&&(y={namespaceURI:Bn,tagName:"template"});const P=xa(f.tagName),fe=xa(y.tagName);return Hn[f.namespaceURI]?f.namespaceURI===Lr?y.namespaceURI===Et?P==="svg":y.namespaceURI===Ir?P==="svg"&&(fe==="annotation-xml"||or[fe]):!!za[P]:f.namespaceURI===Ir?y.namespaceURI===Et?P==="math":y.namespaceURI===Lr?P==="math"&&na[fe]:!!Fa[P]:f.namespaceURI===Et?y.namespaceURI===Lr&&!na[fe]||y.namespaceURI===Ir&&!or[fe]?!1:!Fa[P]&&(oi[P]||!za[P]):!!(dn==="application/xhtml+xml"&&Hn[f.namespaceURI]):!1},b=function(f){ga(t.removed,{element:f});try{L(f).removeChild(f)}catch{S(f)}},D=function(f,y){try{ga(t.removed,{attribute:y.getAttributeNode(f),from:y})}catch{ga(t.removed,{attribute:null,from:y})}if(y.removeAttribute(f),f==="is")if(Fn||Rr)try{b(y)}catch{}else try{y.setAttribute(f,"")}catch{}},le=function(f){let y=null,P=null;if(zn)f=""+f;else{const Ie=Zs(f,/^[\r\n\t ]+/);P=Ie&&Ie[0]}dn==="application/xhtml+xml"&&Bn===Et&&(f=''+f+"");const fe=A?A.createHTML(f):f;if(Bn===Et)try{y=new g().parseFromString(fe,dn)}catch{}if(!y||!y.documentElement){y=te.createDocument(Bn,"template",null);try{y.documentElement.innerHTML=ta?$:fe}catch{}}const Xe=y.body||y.documentElement;return f&&P&&Xe.insertBefore(n.createTextNode(P),Xe.childNodes[0]||null),Bn===Et?Te.call(y,Ce?"html":"body")[0]:Ce?y.documentElement:Xe},Re=function(f){return oe.call(f.ownerDocument||f,f,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},$e=function(f){return f instanceof m&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof d)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Ut=function(f){return typeof c=="function"&&f instanceof c};function je(q,f,y){va(q,P=>{P.call(t,f,y,Gn)})}const Bt=function(f){let y=null;if(je(re.beforeSanitizeElements,f,null),$e(f))return b(f),!0;const P=Pe(f.nodeName);if(je(re.uponSanitizeElement,f,{tagName:P,allowedTags:ke}),fn&&f.hasChildNodes()&&!Ut(f.firstElementChild)&&st(/<[/\w!]/g,f.innerHTML)&&st(/<[/\w!]/g,f.textContent)||fn&&f.namespaceURI===Et&&P==="style"&&Ut(f.firstElementChild)||f.nodeType===_a.progressingInstruction||fn&&f.nodeType===_a.comment&&st(/<[/\w]/g,f.data))return b(f),!0;if(We[P]||!(pt.tagCheck instanceof Function&&pt.tagCheck(P))&&!ke[P]){if(!We[P]&&sa(P)&&(se.tagNameCheck instanceof RegExp&&st(se.tagNameCheck,P)||se.tagNameCheck instanceof Function&&se.tagNameCheck(P)))return!1;if(sr&&!Ot[P]){const fe=L(f)||f.parentNode,Xe=E(f)||f.childNodes;if(Xe&&fe){const Ie=Xe.length;for(let tt=Ie-1;tt>=0;--tt){const At=I(Xe[tt],!0);fe.insertBefore(At,R(f))}}}return b(f),!0}return f instanceof o&&!ci(f)||(P==="noscript"||P==="noembed"||P==="noframes")&&st(/<\/no(script|embed|frames)/i,f.innerHTML)?(b(f),!0):(Jt&&f.nodeType===_a.text&&(y=f.textContent,va([ne,Ne,we],fe=>{y=Mr(y,fe," ")}),f.textContent!==y&&(ga(t.removed,{element:f.cloneNode()}),f.textContent=y)),je(re.afterSanitizeElements,f,null),!1)},ia=function(f,y,P){if(dt[y]||ir&&(y==="id"||y==="name")&&(P in n||P in aa))return!1;const fe=Ae[y]||pt.attributeCheck instanceof Function&&pt.attributeCheck(y,f);if(!(Qt&&!dt[y]&&st(ft,y))){if(!(Sn&&st(Dt,y))){if(!fe||dt[y]){if(!(sa(f)&&(se.tagNameCheck instanceof RegExp&&st(se.tagNameCheck,f)||se.tagNameCheck instanceof Function&&se.tagNameCheck(f))&&(se.attributeNameCheck instanceof RegExp&&st(se.attributeNameCheck,y)||se.attributeNameCheck instanceof Function&&se.attributeNameCheck(y,f))||y==="is"&&se.allowCustomizedBuiltInElements&&(se.tagNameCheck instanceof RegExp&&st(se.tagNameCheck,P)||se.tagNameCheck instanceof Function&&se.tagNameCheck(P))))return!1}else if(!ht[y]){if(!st(xt,Mr(P,Y,""))){if(!((y==="src"||y==="xlink:href"||y==="href")&&f!=="script"&&Ys(P,"data:")===0&&Jr[f])){if(!(ye&&!st(Ze,Mr(P,Y,"")))){if(P)return!1}}}}}}return!0},Ua=Q({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),sa=function(f){return!Ua[xa(f)]&&st(et,f)},Ba=function(f){je(re.beforeSanitizeAttributes,f,null);const{attributes:y}=f;if(!y||$e(f))return;const P={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ae,forceKeepAttr:void 0};let fe=y.length;for(;fe--;){const Xe=y[fe],{name:Ie,namespaceURI:tt,value:At}=Xe,ot=Pe(Ie),la=At;let Fe=Ie==="value"?la:uf(la);if(P.attrName=ot,P.attrValue=Fe,P.keepAttr=!0,P.forceKeepAttr=void 0,je(re.uponSanitizeAttribute,f,P),Fe=P.attrValue,Ma&&(ot==="id"||ot==="name")&&Ys(Fe,St)!==0&&(D(Ie,f),Fe=St+Fe),fn&&st(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Fe)){D(Ie,f);continue}if(ot==="attributename"&&Zs(Fe,"href")){D(Ie,f);continue}if(P.forceKeepAttr)continue;if(!P.keepAttr){D(Ie,f);continue}if(!Ye&&st(/\/>/i,Fe)){D(Ie,f);continue}Jt&&va([ne,Ne,we],ca=>{Fe=Mr(Fe,ca," ")});const oa=Pe(f.nodeName);if(!ia(oa,ot,Fe)){D(Ie,f);continue}if(A&&typeof T=="object"&&typeof T.getAttributeType=="function"&&!tt)switch(T.getAttributeType(oa,ot)){case"TrustedHTML":{Fe=A.createHTML(Fe);break}case"TrustedScriptURL":{Fe=A.createScriptURL(Fe);break}}if(Fe!==la)try{tt?f.setAttributeNS(tt,Ie,Fe):f.setAttribute(Ie,Fe),$e(f)?b(f):js(t.removed)}catch{D(Ie,f)}}je(re.afterSanitizeAttributes,f,null)},Ha=function(f){let y=null;const P=Re(f);for(je(re.beforeSanitizeShadowDOM,f,null);y=P.nextNode();)je(re.uponSanitizeShadowNode,y,null),Bt(y),Ba(y),y.content instanceof s&&Ha(y.content);je(re.afterSanitizeShadowDOM,f,null)};return t.sanitize=function(q){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=null,P=null,fe=null,Xe=null;if(ta=!q,ta&&(q=""),typeof q!="string"&&!Ut(q)&&(q=vf(q),typeof q!="string"))throw ja("dirty is not a string, aborting");if(!t.isSupported)return q;if(Qr||Dr(f),t.removed=[],typeof q=="string"&&(Un=!1),Un){const At=q.nodeName;if(typeof At=="string"){const ot=Pe(At);if(!ke[ot]||We[ot])throw ja("root node is forbidden and cannot be sanitized in-place")}}else if(q instanceof c)y=le(""),P=y.ownerDocument.importNode(q,!0),P.nodeType===_a.element&&P.nodeName==="BODY"||P.nodeName==="HTML"?y=P:y.appendChild(P);else{if(!Fn&&!Jt&&!Ce&&q.indexOf("<")===-1)return A&&Cr?A.createHTML(q):q;if(y=le(q),!y)return Fn?null:Cr?$:""}y&&zn&&b(y.firstChild);const Ie=Re(Un?q:y);for(;fe=Ie.nextNode();)Bt(fe),Ba(fe),fe.content instanceof s&&Ha(fe.content);if(Un)return q;if(Fn){if(Jt){y.normalize();let At=y.innerHTML;va([ne,Ne,we],ot=>{At=Mr(At,ot," ")}),y.innerHTML=At}if(Rr)for(Xe=ge.call(y.ownerDocument);y.firstChild;)Xe.appendChild(y.firstChild);else Xe=y;return(Ae.shadowroot||Ae.shadowrootmode)&&(Xe=ce.call(a,Xe,!0)),Xe}let tt=Ce?y.outerHTML:y.innerHTML;return Ce&&ke["!doctype"]&&y.ownerDocument&&y.ownerDocument.doctype&&y.ownerDocument.doctype.name&&st(uo,y.ownerDocument.doctype.name)&&(tt=" -`+tt),Jt&&va([ne,Ne,we],At=>{tt=Mr(tt,At," ")}),A&&Cr?A.createHTML(tt):tt},t.setConfig=function(){let q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dr(q),Qr=!0},t.clearConfig=function(){Gn=null,Qr=!1},t.isValidAttribute=function(q,f,y){Gn||Dr({});const P=Pe(q),fe=Pe(f);return ia(P,fe,y)},t.addHook=function(q,f){typeof f=="function"&&ga(re[q],f)},t.removeHook=function(q,f){if(f!==void 0){const y=of(re[q],f);return y===-1?void 0:cf(re[q],y,1)[0]}return js(re[q])},t.removeHooks=function(q){re[q]=[]},t.removeAllHooks=function(){re=tl()},t}var Cf=fo();function es(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ar=es();function po(e){Ar=e}var hr={exec:()=>null};function ae(e,t=""){let n=typeof e=="string"?e:e.source,a={replace:(r,s)=>{let l=typeof s=="string"?s:s.source;return l=l.replace(kt.caret,"$1"),n=n.replace(r,l),a},getRegex:()=>new RegExp(n,t)};return a}var If=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Lf=/^(?:[ \t]*(?:\n|$))+/,Df=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Of=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Oa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ts=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ho=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,vo=ae(ho).replace(/bull/g,ts).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Nf=ae(ho).replace(/bull/g,ts).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ns=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Pf=/^[^\n]+/,rs=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,zf=ae(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rs).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ff=ae(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ts).getRegex(),ii="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",as=/|$))/,Uf=ae("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",as).replace("tag",ii).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),go=ae(ns).replace("hr",Oa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ii).getRegex(),Bf=ae(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",go).getRegex(),is={blockquote:Bf,code:Df,def:zf,fences:Of,heading:Mf,hr:Oa,html:Uf,lheading:vo,list:Ff,newline:Lf,paragraph:go,table:hr,text:Pf},nl=ae("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Oa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ii).getRegex(),Hf={...is,lheading:Nf,table:nl,paragraph:ae(ns).replace("hr",Oa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",nl).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ii).getRegex()},Gf={...is,html:ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",as).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:hr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ae(ns).replace("hr",Oa).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",vo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},qf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Wf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,mo=/^( {2,}|\\)\n(?!\s*$)/,jf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",If?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),bo=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Vf=ae(bo,"u").replace(/punct/g,Kr).getRegex(),Kf=ae(bo,"u").replace(/punct/g,_o).getRegex(),ko="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Qf=ae(ko,"gu").replace(/notPunctSpace/g,ss).replace(/punctSpace/g,si).replace(/punct/g,Kr).getRegex(),Jf=ae(ko,"gu").replace(/notPunctSpace/g,$f).replace(/punctSpace/g,Yf).replace(/punct/g,_o).getRegex(),ed=ae("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ss).replace(/punctSpace/g,si).replace(/punct/g,Kr).getRegex(),td=ae(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Kr).getRegex(),nd="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",rd=ae(nd,"gu").replace(/notPunctSpace/g,ss).replace(/punctSpace/g,si).replace(/punct/g,Kr).getRegex(),ad=ae(/\\(punct)/,"gu").replace(/punct/g,Kr).getRegex(),id=ae(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),sd=ae(as).replace("(?:-->|$)","-->").getRegex(),ld=ae("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",sd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ja=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,od=ae(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ja).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wo=ae(/^!?\[(label)\]\[(ref)\]/).replace("label",Ja).replace("ref",rs).getRegex(),yo=ae(/^!?\[(ref)\](?:\[\])?/).replace("ref",rs).getRegex(),cd=ae("reflink|nolink(?!\\()","g").replace("reflink",wo).replace("nolink",yo).getRegex(),rl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ls={_backpedal:hr,anyPunctuation:ad,autolink:id,blockSkip:Xf,br:mo,code:Wf,del:hr,delLDelim:hr,delRDelim:hr,emStrongLDelim:Vf,emStrongRDelimAst:Qf,emStrongRDelimUnd:ed,escape:qf,link:od,nolink:yo,punctuation:Zf,reflink:wo,reflinkSearch:cd,tag:ld,text:jf,url:hr},ud={...ls,link:ae(/^!?\[(label)\]\((.*?)\)/).replace("label",Ja).getRegex(),reflink:ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ja).getRegex()},Ui={...ls,emStrongRDelimAst:Jf,emStrongLDelim:Kf,delLDelim:td,delRDelim:rd,url:ae(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",rl).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ae(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},al=e=>dd[e];function bn(e,t){if(t){if(kt.escapeTest.test(e))return e.replace(kt.escapeReplace,al)}else if(kt.escapeTestNoEncode.test(e))return e.replace(kt.escapeReplaceNoEncode,al);return e}function il(e){try{e=encodeURI(e).replace(kt.percentDecode,"%")}catch{return null}return e}function sl(e,t){let n=e.replace(kt.findPipe,(s,l,c)=>{let o=!1,u=l;for(;--u>=0&&c[u]==="\\";)o=!o;return o?"|":" |"}),a=n.split(kt.splitPipe),r=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),t)if(a.length>t)a.splice(t);else for(;a.length0?-2:-1}function hd(e,t=0){let n=t,a="";for(let r of e)if(r===" "){let s=4-n%4;a+=" ".repeat(s),n+=s}else a+=r,n++;return a}function ll(e,t,n,a,r){let s=t.href,l=t.title||null,c=e[1].replace(r.other.outputLinkReplace,"$1");a.state.inLink=!0;let o={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:l,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,o}function vd(e,t,n){let a=e.match(n.other.indentCodeCompensation);if(a===null)return t;let r=a[1];return t.split(` -`).map(s=>{let l=s.match(n.other.beginningSpace);if(l===null)return s;let[c]=l;return c.length>=r.length?s.slice(r.length):s}).join(` -`)}var ei=class{options;rules;lexer;constructor(e){this.options=e||Ar}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ka(n,` -`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],a=vd(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:a}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let a=ka(n,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(n=a.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ka(t[0],` -`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=ka(t[0],` -`).split(` -`),a="",r="",s=[];for(;n.length>0;){let l=!1,c=[],o;for(o=0;o1,r={type:"list",raw:"",ordered:a,start:a?+n.slice(0,-1):"",loose:!1,items:[]};n=a?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=a?n:"[*+-]");let s=this.rules.other.listItemRegex(n),l=!1;for(;e;){let o=!1,u="",d="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let m=hd(t[2].split(` -`,1)[0],t[1].length),g=e.split(` -`,1)[0],T=!m.trim(),w=0;if(this.options.pedantic?(w=2,d=m.trimStart()):T?w=t[1].length+1:(w=m.search(this.rules.other.nonSpaceChar),w=w>4?1:w,d=m.slice(w),w+=t[1].length),T&&this.rules.other.blankLine.test(g)&&(u+=g+` -`,e=e.substring(g.length+1),o=!0),!o){let I=this.rules.other.nextBulletRegex(w),S=this.rules.other.hrRegex(w),R=this.rules.other.fencesBeginRegex(w),E=this.rules.other.headingBeginRegex(w),L=this.rules.other.htmlBeginRegex(w),A=this.rules.other.blockquoteBeginRegex(w);for(;e;){let $=e.split(` -`,1)[0],te;if(g=$,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),te=g):te=g.replace(this.rules.other.tabCharGlobal," "),R.test(g)||E.test(g)||L.test(g)||A.test(g)||I.test(g)||S.test(g))break;if(te.search(this.rules.other.nonSpaceChar)>=w||!g.trim())d+=` -`+te.slice(w);else{if(T||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||R.test(m)||E.test(m)||S.test(m))break;d+=` -`+g}T=!g.trim(),u+=$+` -`,e=e.substring($.length+1),m=te.slice(w)}}r.loose||(l?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(l=!0)),r.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),r.raw+=u}let c=r.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let o of r.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(o.raw);if(u){let d={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};o.checked=d.checked,r.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=d.raw+o.tokens[0].raw,o.tokens[0].text=d.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(d)):o.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):o.tokens.unshift(d)}}if(!r.loose){let u=o.tokens.filter(m=>m.type==="space"),d=u.length>0&&u.some(m=>this.rules.other.anyLine.test(m.raw));r.loose=d}}if(r.loose)for(let o of r.items){o.loose=!0;for(let u of o.tokens)u.type==="text"&&(u.type="paragraph")}return r}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:a,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=sl(t[1]),a=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(` -`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===a.length){for(let l of a)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[o]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===` -`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=ka(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=pd(t[2],"()");if(s===-2)return;if(s>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let a=t[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(a);s&&(a=s[1],r=s[3])}else r=t[3]?t[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?a=a.slice(1):a=a.slice(1,-1)),ll(t,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let a=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[a.toLowerCase()];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return ll(n,r,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let a=this.rules.inline.emStrongLDelim.exec(e);if(!(!a||!a[1]&&!a[2]&&!a[3]&&!a[4]||a[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...a[0]].length-1,s,l,c=r,o=0,u=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+r);(a=u.exec(t))!==null;){if(s=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!s)continue;if(l=[...s].length,a[3]||a[4]){c+=l;continue}else if((a[5]||a[6])&&r%3&&!((r+l)%3)){o+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+o);let d=[...a[0]][0].length,m=e.slice(0,r+a.index+d+l);if(Math.min(r,l)%2){let T=m.slice(1,-1);return{type:"em",raw:m,text:T,tokens:this.lexer.inlineTokens(T)}}let g=m.slice(2,-2);return{type:"strong",raw:m,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return a&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let a=this.rules.inline.delLDelim.exec(e);if(a&&(!a[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...a[0]].length-1,s,l,c=r,o=this.rules.inline.delRDelim;for(o.lastIndex=0,t=t.slice(-1*e.length+r);(a=o.exec(t))!==null;){if(s=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!s||(l=[...s].length,l!==r))continue;if(a[3]||a[4]){c+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c);let u=[...a[0]][0].length,d=e.slice(0,r+a.index+u+l),m=d.slice(r,-r);return{type:"del",raw:d,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,a;return t[2]==="@"?(n=t[1],a="mailto:"+n):(n=t[1],a=n),{type:"link",raw:t[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,a;if(t[2]==="@")n=t[0],a="mailto:"+n;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(r!==t[0]);n=t[0],t[1]==="www."?a="http://"+t[0]:a=t[0]}return{type:"link",raw:t[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},an=class Bi{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ar,this.options.tokenizer=this.options.tokenizer||new ei,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:kt,block:Ya.normal,inline:ba.normal};this.options.pedantic?(n.block=Ya.pedantic,n.inline=ba.pedantic):this.options.gfm&&(n.block=Ya.gfm,this.options.breaks?n.inline=ba.breaks:n.inline=ba.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ya,inline:ba}}static lex(t,n){return new Bi(n).lex(t)}static lexInline(t,n){return new Bi(n).inlineTokens(t)}lex(t){t=t.replace(kt.carriageReturn,` -`),this.blockTokens(t,this.tokens);for(let n=0;n(r=l.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length);let l=n.at(-1);r.raw.length===1&&l!==void 0?l.raw+=` -`:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(` -`)?"":` -`)+r.raw,l.text+=` -`+r.text,this.inlineQueue.at(-1).src=l.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(` -`)?"":` -`)+r.raw,l.text+=` -`+r.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},n.push(r));continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}let s=t;if(this.options.extensions?.startBlock){let l=1/0,c=t.slice(1),o;this.options.extensions.startBlock.forEach(u=>{o=u.call({lexer:this},c),typeof o=="number"&&o>=0&&(l=Math.min(l,o))}),l<1/0&&l>=0&&(s=t.substring(0,l+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let l=n.at(-1);a&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(` -`)?"":` -`)+r.raw,l.text+=` -`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(r),a=s.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(` -`)?"":` -`)+r.raw,l.text+=` -`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(r);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let a=t,r=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(a))!==null;)o.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(a))!==null;)a=a.slice(0,r.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(a))!==null;)s=r[2]?r[2].length:0,a=a.slice(0,r.index+s)+"["+"a".repeat(r[0].length-s-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let l=!1,c="";for(;t;){l||(c=""),l=!1;let o;if(this.options.extensions?.inline?.some(d=>(o=d.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let d=n.at(-1);o.type==="text"&&d?.type==="text"?(d.raw+=o.raw,d.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(t,a,c)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(t,a,c)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),n.push(o);continue}let u=t;if(this.options.extensions?.startInline){let d=1/0,m=t.slice(1),g;this.options.extensions.startInline.forEach(T=>{g=T.call({lexer:this},m),typeof g=="number"&&g>=0&&(d=Math.min(d,g))}),d<1/0&&d>=0&&(u=t.substring(0,d+1))}if(o=this.tokenizer.inlineText(u)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(c=o.raw.slice(-1)),l=!0;let d=n.at(-1);d?.type==="text"?(d.raw+=o.raw,d.text+=o.text):n.push(o);continue}if(t){let d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return n}},ti=class{options;parser;constructor(e){this.options=e||Ar}space(e){return""}code({text:e,lang:t,escaped:n}){let a=(t||"").match(kt.notSpaceStart)?.[0],r=e.replace(kt.endingNewline,"")+` -`;return a?'
    '+(n?r:bn(r,!0))+`
    -`:"
    "+(n?r:bn(r,!0))+`
    -`}blockquote({tokens:e}){return`
    -${this.parser.parse(e)}
    -`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} -`}hr(e){return`
    -`}list(e){let t=e.ordered,n=e.start,a="";for(let l=0;l -`+a+" -`}listitem(e){return`
  • ${this.parser.parse(e.tokens)}
  • -`}checkbox({checked:e}){return" '}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    -`}table(e){let t="",n="";for(let r=0;r${a}`),` - -`+t+` -`+a+`
    -`}tablerow({text:e}){return` -${e} -`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${bn(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let a=this.parser.parseInline(n),r=il(e);if(r===null)return a;e=r;let s='
    ",s}image({href:e,title:t,text:n,tokens:a}){a&&(n=this.parser.parseInline(a,this.parser.textRenderer));let r=il(e);if(r===null)return bn(n);e=r;let s=`${bn(n)}{let l=r[s].flat(1/0);n=n.concat(this.walkTokens(l,t))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let a={...n};if(a.async=this.defaults.async||a.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let s=t.renderers[r.name];s?t.renderers[r.name]=function(...l){let c=r.renderer.apply(this,l);return c===!1&&(c=s.apply(this,l)),c}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[r.level];s?s.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),a.extensions=t),n.renderer){let r=this.defaults.renderer||new ti(this.defaults);for(let s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let l=s,c=n.renderer[l],o=r[l];r[l]=(...u)=>{let d=c.apply(r,u);return d===!1&&(d=o.apply(r,u)),d||""}}a.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new ei(this.defaults);for(let s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let l=s,c=n.tokenizer[l],o=r[l];r[l]=(...u)=>{let d=c.apply(r,u);return d===!1&&(d=o.apply(r,u)),d}}a.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new Ta;for(let s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let l=s,c=n.hooks[l],o=r[l];Ta.passThroughHooks.has(s)?r[l]=u=>{if(this.defaults.async&&Ta.passThroughHooksRespectAsync.has(s))return(async()=>{let m=await c.call(r,u);return o.call(r,m)})();let d=c.call(r,u);return o.call(r,d)}:r[l]=(...u)=>{if(this.defaults.async)return(async()=>{let m=await c.apply(r,u);return m===!1&&(m=await o.apply(r,u)),m})();let d=c.apply(r,u);return d===!1&&(d=o.apply(r,u)),d}}a.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,s=n.walkTokens;a.walkTokens=function(l){let c=[];return c.push(s.call(this,l)),r&&(c=c.concat(r.call(this,l))),c}}this.defaults={...this.defaults,...a}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return an.lex(e,t??this.defaults)}parser(e,t){return sn.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let a={...n},r={...this.defaults,...a},s=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&a.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=e),r.async)return(async()=>{let l=r.hooks?await r.hooks.preprocess(t):t,c=await(r.hooks?await r.hooks.provideLexer(e):e?an.lex:an.lexInline)(l,r),o=r.hooks?await r.hooks.processAllTokens(c):c;r.walkTokens&&await Promise.all(this.walkTokens(o,r.walkTokens));let u=await(r.hooks?await r.hooks.provideParser(e):e?sn.parse:sn.parseInline)(o,r);return r.hooks?await r.hooks.postprocess(u):u})().catch(s);try{r.hooks&&(t=r.hooks.preprocess(t));let l=(r.hooks?r.hooks.provideLexer(e):e?an.lex:an.lexInline)(t,r);r.hooks&&(l=r.hooks.processAllTokens(l)),r.walkTokens&&this.walkTokens(l,r.walkTokens);let c=(r.hooks?r.hooks.provideParser(e):e?sn.parse:sn.parseInline)(l,r);return r.hooks&&(c=r.hooks.postprocess(c)),c}catch(l){return s(l)}}}onError(e,t){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let a="

    An error occurred:

    "+bn(n.message+"",!0)+"
    ";return t?Promise.resolve(a):a}if(t)return Promise.reject(n);throw n}}},Tr=new gd;function ve(e,t){return Tr.parse(e,t)}ve.options=ve.setOptions=function(e){return Tr.setOptions(e),ve.defaults=Tr.defaults,po(ve.defaults),ve};ve.getDefaults=es;ve.defaults=Ar;ve.use=function(...e){return Tr.use(...e),ve.defaults=Tr.defaults,po(ve.defaults),ve};ve.walkTokens=function(e,t){return Tr.walkTokens(e,t)};ve.parseInline=Tr.parseInline;ve.Parser=sn;ve.parser=sn.parse;ve.Renderer=ti;ve.TextRenderer=os;ve.Lexer=an;ve.lexer=an.lex;ve.Tokenizer=ei;ve.Hooks=Ta;ve.parse=ve;ve.options;ve.setOptions;ve.use;ve.walkTokens;ve.parseInline;sn.parse;an.lex;function Nr(e){return Cf.sanitize(ve.parse(e,{async:!1,breaks:!0,gfm:!0}))}function _n(e){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}function pr(e){return`/api/uploads/${encodeURIComponent(e.id)}`}function md(e){return e.content_type.startsWith("image/")}function _d(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function bd(e,t){const n=()=>{const s=e.style.height;e.style.height="auto";const l=`${e.scrollHeight}px`;s!==l?e.style.height=l:e.style.height=s},a=()=>n(),r=()=>n();return requestAnimationFrame(n),e.addEventListener("input",a),window.addEventListener("resize",r),{update(){requestAnimationFrame(n)},destroy(){e.removeEventListener("input",a),window.removeEventListener("resize",r)}}}var kd=O('
    ');function wd(e,t){rr(t,!0);var n=kd(),a=p(n),r=v(a,2),s=v(r,2),l=p(s);l.textContent="<>";var c=v(s,2),o=p(c);o.textContent="{}";var u=v(c,2),d=v(u,2);let m;z(()=>m=bt(d,1,"",null,m,{active:t.showGifPicker})),W("click",a,()=>t.onWrap("**")),W("click",r,()=>t.onWrap("_")),W("click",s,()=>t.onWrap("`")),W("click",c,()=>t.onWrap("```","\n```")),W("click",u,()=>t.onAppend("[label](https://)")),W("click",d,function(...g){t.onToggleGif?.apply(this,g)}),C(e,n),ar()}Vr(["click"]);var yd=O(''),xd=O('
    GIFs
    ');function Td(e,t){rr(t,!0);var n=xd(),a=p(n),r=v(p(a),2),s=v(a,2);Pt(s,21,()=>t.gifs,l=>l.url,(l,c)=>{var o=yd(),u=p(o),d=v(u,2),m=p(d);z(()=>{H(u,"src",i(c).url),H(u,"alt",i(c).title),M(m,i(c).title)}),W("click",o,()=>t.onPick(i(c).url,i(c).title)),C(l,o)}),z(()=>ro(r,t.query)),W("input",r,l=>t.onQuery(l.currentTarget.value)),C(e,n),ar()}Vr(["input","click"]);var Sd=O('
    Replying to
    ');function Ed(e,t){rr(t,!0);var n=Sd(),a=v(p(n),2),r=p(a),s=v(p(r)),l=p(s),c=v(r,2),o=p(c),u=v(a,2);z(d=>{M(l,t.target.author?.display_name||"Local User"),M(o,d)},[()=>On(t.target.body)]),W("click",u,function(...d){t.onClear?.apply(this,d)}),C(e,n),ar()}Vr(["click"]);var Ad=O(''),Rd=O('
    '),Cd=O(''),Id=O('
    ');function ol(e,t){rr(t,!0);let n=it(t,"formClass",3,"composer"),a=it(t,"pendingUpload",3,null),r=it(t,"replyTarget",3,null),s=it(t,"showUpload",3,!1),l=it(t,"showToolbar",3,!1),c=it(t,"showGifPicker",3,!1),o=it(t,"gifQuery",3,""),u=it(t,"filteredGifs",19,()=>[]),d=it(t,"onUploadFile",3,()=>{}),m=it(t,"onRemoveUpload",3,()=>{}),g=it(t,"onClearReply",3,()=>{}),T=it(t,"onApplyMarkdownWrap",3,()=>{}),w=it(t,"onAppendToComposer",3,()=>{}),I=it(t,"onToggleGif",3,()=>{}),S=it(t,"onGifQuery",3,()=>{}),R=it(t,"onPickGif",3,()=>{}),E=jt(null);Qa(()=>(t.onInputRef(i(E)),()=>t.onInputRef(null)));var L=Id(),A=p(L);{var $=Y=>{Td(Y,{get gifs(){return u()},get query(){return o()},get onQuery(){return S()},get onPick(){return R()}})};j(A,Y=>{c()&&Y($)})}var te=v(A,2),oe=p(te);{var ge=Y=>{var et=Rd(),xt=v(p(et),2);{var ke=We=>{var dt=Ad();z(pt=>{H(dt,"src",pt),H(dt,"alt",a().filename)},[()=>pr(a())]),C(We,dt)},Tt=Ci(()=>md(a()));j(xt,We=>{i(Tt)&&We(ke)})}var Ae=v(xt,2),Ft=p(Ae),se=v(Ae,2);z(We=>M(Ft,`${a().filename??""} · ${We??""}`),[()=>_d(a().byte_size)]),W("click",se,function(...We){m()?.apply(this,We)}),C(Y,et)};j(oe,Y=>{a()&&Y(ge)})}var Te=v(oe,2);{var ce=Y=>{Ed(Y,{get target(){return r()},get onClear(){return g()}})};j(Te,Y=>{r()&&Y(ce)})}var re=v(Te,2),ne=p(re);{var Ne=Y=>{var et=Cd(),xt=p(et);W("change",xt,function(...ke){d()?.apply(this,ke)}),C(Y,et)};j(ne,Y=>{s()&&Y(Ne)})}var we=v(ne,2);Ji(we,Y=>h(E,Y),()=>i(E)),Mu(we,(Y,et)=>bd?.(Y),()=>t.value);var ft=v(we,2),Dt=v(re,2);{var Ze=Y=>{wd(Y,{get showGifPicker(){return c()},get onWrap(){return T()},get onAppend(){return w()},get onToggleGif(){return I()}})};j(Dt,Y=>{l()&&Y(Ze)})}z(Y=>{bt(L,1,Pu(n())),ro(we,t.value),H(we,"placeholder",t.placeholder),H(we,"aria-label",t.ariaLabel),H(ft,"aria-label",t.submitLabel),ft.disabled=Y},[()=>!t.value.trim()]),kn("submit",L,Y=>{Y.preventDefault(),t.onSubmit()}),W("input",we,Y=>t.onValue(Y.currentTarget.value)),kn("focus",we,function(...Y){t.onFocus?.apply(this,Y)}),W("keydown",we,function(...Y){t.onKeydown?.apply(this,Y)}),C(e,L),ar()}Vr(["click","change","input","keydown"]);var Ld=O('
    '),Dd=O(''),Od=O(' ',1),Md=O('
    ',2),Nd=O(' ');function xi(e,t){rr(t,!0);let n=it(t,"onOpenImage",3,()=>{}),a=jt(null),r=jt(!1),s=jt(""),l=Ci(()=>t.upload.content_type?.startsWith("image/")??!1),c=Ci(()=>t.upload.content_type?.startsWith("video/")??!1);function o(){h(r,!0)}function u(){if(!i(a)||!isFinite(i(a).duration))return;const R=Math.floor(i(a).duration),E=Math.floor(R/60),L=R%60;h(s,`${E}:${L.toString().padStart(2,"0")}`)}function d(){i(a)&&(h(r,!0),i(a).play())}function m(R){return R<1024?`${R} B`:R<1024*1024?`${Math.round(R/1024)} KB`:`${(R/(1024*1024)).toFixed(1)} MB`}var g=Qi(),T=Vn(g);{var w=R=>{var E=Ld(),L=p(E),A=p(L),$=v(L,2),te=p($),oe=p(te),ge=v(te,2);z(()=>{H(L,"aria-label",`Open image ${t.upload.filename}`),H(A,"src",t.url),H(A,"alt",t.upload.filename),M(oe,t.upload.filename),H(ge,"href",t.url),H(ge,"download",t.upload.filename),H(ge,"aria-label",`Download ${t.upload.filename}`)}),W("click",L,()=>n()(t.url,t.upload.filename)),W("click",ge,Te=>Te.stopPropagation()),C(R,E)},I=R=>{var E=Md();let L;var A=p(E),$=p(A);Ji(A,ne=>h(a,ne),()=>i(a));var te=v(A,2);{var oe=ne=>{var Ne=Od(),we=Vn(Ne),ft=v(we,2);{var Dt=Ze=>{var Y=Dd(),et=p(Y);z(()=>M(et,i(s))),C(Ze,Y)};j(ft,Ze=>{i(s)&&Ze(Dt)})}z(()=>H(we,"aria-label",`Play ${t.upload.filename}`)),W("click",we,d),C(ne,Ne)};j(te,ne=>{i(r)||ne(oe)})}var ge=v(te,2),Te=p(ge),ce=p(Te),re=v(Te,2);z(()=>{L=bt(E,1,"media-tile media-tile--video",null,L,{"is-started":i(r)}),A.controls=i(r),H(A,"aria-label",t.upload.filename),H($,"src",t.url),H($,"type",t.upload.content_type),M(ce,t.upload.filename),H(re,"href",t.url),H(re,"download",t.upload.filename),H(re,"aria-label",`Download ${t.upload.filename}`)}),kn("play",A,o),kn("loadedmetadata",A,u),W("click",re,ne=>ne.stopPropagation()),C(R,E)},S=R=>{var E=Nd(),L=v(p(E),2),A=p(L),$=p(A),te=v(A,2),oe=p(te);z(ge=>{H(E,"href",t.url),M($,t.upload.filename),M(oe,ge)},[()=>m(t.upload.byte_size)]),C(R,E)};j(T,R=>{i(l)?R(w):i(c)?R(I,1):R(S,-1)})}C(e,g),ar()}Vr(["click"]);var Pd=O(''),zd=O(`
    cc
    ClickClack OpenClaw workspace chat

    Welcome back.

    Workspace chat for the OpenClaw crew. Sign in with the GitHub account that's a member of the org.

    Limited to active members of the OpenClaw org.

    `),Fd=O(''),Ud=O('
    '),Bd=O('
    '),Hd=O(''),Gd=O(''),qd=O(''),Wd=O(''),jd=O(''),Zd=O(''),Yd=O(''),$d=O(''),Xd=O(''),Vd=O(''),Kd=O('

    '),Qd=O('

    '),Jd=O('

    ClickClack

    '),ep=O(''),tp=O(''),np=O(''),rp=O('
    '),ap=O('
    Send a message in Markdown — code fences, lists, links all work. Threads open from any message.
    '),ip=O('
    '),sp=O(''),lp=O(" "),op=O(' '),cp=O(' '),up=O(''),fp=O('
    '),dp=O('
    '),pp=O('
    ',1),hp=O(''),vp=O(" "),gp=O('
    '),mp=O(''),_p=O(" "),bp=O(' '),kp=O(' '),wp=O(''),yp=O('
    '),xp=O('
    '),Tp=O('

    Thread

    ',1),Sp=O(''),Ep=O(" "),Ap=O(''),Rp=O(''),Cp=O(''),Ip=O('

    Profile

    Active
    Contact information
    Handle
    User ID
    About

    ',1),Lp=O('
    No thread open Hover any message and tap the bubble to keep side conversations tidy.
    '),Dp=O(''),Op=O("

    "),Mp=O(''),Np=O(''),Pp=O('

    ',1);function zp(e,t){rr(t,!1);const n=Z(),a=Z(),r=Z(),s=Z(),l=Z(),c=Z(),o=Z();let u=Z(null),d=Z([]),m=Z([]),g=Z([]),T=Z([]),w=Z([]),I=Z(""),S=Z(""),R=Z(""),E=Z(null),L=Z(null),A=Z(null),$=Z(null),te=Z(""),oe=Z(""),ge=Z(""),Te=Z(""),ce=Z(""),re=Z(""),ne=Z([]),Ne=Z(null),we=Z(!1),ft=Z(!1),Dt=Z(""),Ze=Z(""),Y=Z(""),et=Z(""),xt=Z(""),ke=Z(!1),Tt=Z("loading"),Ae=Z(!1),Ft=null,se=Z(!1),We,dt=Z(null),pt=Z(!1),Sn=Z(!1),Qt=Z(!1),ye=Z(null),Ye=Z(null),Jt=Z(null),fn=Z(null),Ce=Z("message");so(()=>{Qr()}),qu(()=>{const b=Ft;Ft=null,h(se,!1),b?.close(),We&&window.clearTimeout(We)});async function Qr(){try{const b=await at("/api/me");h(u,b.user),await Rr(),h(Tt,"ready")}catch(b){if(b instanceof lo&&(b.status===401||b.status===403)){h(Ae,!0),h(Tt,"auth");return}h(Tt,b instanceof Error?b.message:"Could not load ClickClack")}}function zn(){i(u)&&(h(Ze,i(u).display_name),h(Y,i(u).handle?`@${i(u).handle}`:""),h(et,i(u).avatar_url),h(xt,""),h(ke,!1),h(ft,!0))}async function Fn(){h(xt,""),h(ke,!1);try{const b=await at("/api/me",{method:"PATCH",body:JSON.stringify({display_name:i(Ze),handle:i(Y),avatar_url:i(et)})});h(u,b.user),h(T,i(T).map(D=>D.author?.id===i(u)?.id?{...D,author:b.user}:D)),h(w,i(w).map(D=>D.author?.id===i(u)?.id?{...D,author:b.user}:D)),i(E)?.author?.id===i(u).id&&h(E,{...i(E),author:b.user}),h(xt,"Saved"),h(ft,!1)}catch(b){h(xt,b instanceof Error?b.message:"Could not save profile"),h(ke,!0)}}async function Rr(){const b=await at("/api/workspaces");h(d,b.workspaces),h(I,i(I)||i(d)[0]?.id||""),await ir(),await Et(),i(d).length===0&&h(Tt,"create a workspace"),Hn()}async function Cr(){if(!i(ge).trim())return;const b=await at("/api/workspaces",{method:"POST",body:JSON.stringify({name:i(ge)})});h(ge,""),h(pt,!1),h(d,[...i(d),b.workspace]),h(I,b.workspace.id),await ir(),await Et(),Hn()}async function ir(){if(!i(I))return;const b=await at(`/api/workspaces/${i(I)}/channels`);h(m,b.channels),h(S,i(m).find(D=>D.id===i(S))?.id||i(m)[0]?.id||""),h(E,null),h(A,null),h(Ce,"message"),h(w,[]),await St()}async function Ma(){if(!i(I)||!i(Te).trim())return;const b=await at(`/api/workspaces/${i(I)}/channels`,{method:"POST",body:JSON.stringify({name:i(Te),kind:"public"})});h(Te,""),h(m,[...i(m),b.channel]),h(S,b.channel.id),h(R,""),await St()}async function St(){if(i(R)){const D=await at(`/api/dms/${i(R)}/messages`);h(T,D.messages),await sr();return}if(!i(S)){h(T,[]);return}const b=await at(`/api/channels/${i(S)}/messages`);h(T,b.messages),await sr()}async function sr(){await Di(),i(dt)&&su(dt,i(dt).scrollTop=i(dt).scrollHeight)}async function Un(){const b=i(te).trim();if(!b)return;if(!i(S)&&!i(R)){h(Tt,"pick or create a channel");return}const D=i(R)?"dm":"channel",le=i(ye)&&i(Ye)===D?i(ye):null;h(te,"");const Re=i(R)?`/api/dms/${i(R)}/messages`:`/api/channels/${i(S)}/messages`,$e={body:b};le&&($e.quoted_message_id=le.id);const Ut=await at(Re,{method:"POST",body:JSON.stringify($e)});let je=Ut.message;if(le&&ht(),i(Ne)){const Bt=i(Ne);await at(`/api/messages/${Ut.message.id}/attachments`,{method:"POST",body:JSON.stringify({upload_id:Bt.id})}),h(Ne,null),je={...je,attachments:[...je.attachments||[],Bt]}}i(T).some(Bt=>Bt.id===je.id)?h(T,i(T).map(Bt=>Bt.id===je.id?je:Bt)):h(T,[...i(T),je]),await sr()}async function En(b){h(A,null),h(E,b),h(Ce,"thread");const D=await at(`/api/messages/${b.id}/thread`);h(E,D.root),h(w,D.replies),h(L,D.thread_state)}async function Ot(){const b=i(oe).trim();if(!b||!i(E))return;const D=i(ye)&&i(Ye)==="thread"?i(ye):null;h(oe,"");const le={body:b};D&&(le.quoted_message_id=D.id);const Re=await at(`/api/messages/${i(E).id}/thread/replies`,{method:"POST",body:JSON.stringify(le)});D&&ht(),i(w).some($e=>$e.id===Re.message.id)||h(w,[...i(w),Re.message]),h(L,Re.thread_state)}function lr(b,D){h(ye,b),h(Ye,D),h(Ce,D==="thread"?"thread":"message")}function Jr(){return i($)!==null||i(ft)}function Na(){return i(Ce)==="thread"&&i(E)&&i(fn)?i(fn):i(Jt)}function ht(){h(ye,null),h(Ye,null)}async function ea(b){const D=b.quoted_message_id;if(!D)return;await Di();const le=document.querySelector(`[data-message-id="${CSS.escape(D)}"]`);le&&(le.scrollIntoView({behavior:"smooth",block:"center"}),le.classList.add("highlight"),window.setTimeout(()=>le.classList.remove("highlight"),1500))}async function Ir(){if(!i(I)||!i(re).trim()){h(ne,[]);return}const b=await at(`/api/search?workspace_id=${encodeURIComponent(i(I))}&q=${encodeURIComponent(i(re).trim())}`);h(ne,b.results)}async function Lr(b){const D=b.currentTarget,le=D.files?.[0];if(!le||!i(I))return;const Re=new FormData;Re.set("workspace_id",i(I)),Re.set("file",le);const $e=await at("/api/uploads",{method:"POST",body:Re});h(Ne,$e.upload),D.value=""}async function Et(){if(!i(I))return;const b=await at(`/api/dms?workspace_id=${i(I)}`);h(g,b.conversations)}async function Bn(){if(!i(I)||!i(ce).trim())return;const b=await at("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:i(I),member_ids:[i(ce).trim()]})});h(ce,""),h(g,[...i(g),b.conversation]),h(R,b.conversation.id),h(S,""),h(E,null),h(A,null),h(Ce,"message"),await St()}async function ta(b){if(!i(I)||!b)return;const D=i(g).find(Re=>Re.members.some($e=>$e.id===b));if(D){h(R,D.id),h(S,""),h(E,null),h(A,null),h(Ce,"message"),await St();return}const le=await at("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:i(I),member_ids:[b]})});h(g,[...i(g),le.conversation]),h(R,le.conversation.id),h(S,""),h(E,null),h(A,null),h(Ce,"message"),await St()}function Hn(){We&&window.clearTimeout(We);const b=Ft;if(Ft=null,h(se,!1),b?.close(),!i(I))return;const D=localStorage.getItem(`clickclack:${i(I)}:cursor`)||"",le=new URL("/api/realtime/ws",window.location.href);le.protocol=window.location.protocol==="https:"?"wss:":"ws:",le.searchParams.set("workspace_id",i(I)),D&&le.searchParams.set("after_cursor",D);const Re=new WebSocket(le);Ft=Re,Re.addEventListener("open",()=>{Ft===Re&&h(se,!0)}),Re.addEventListener("message",$e=>{const Ut=JSON.parse(String($e.data));Ut.cursor&&localStorage.setItem(`clickclack:${i(I)}:cursor`,Ut.cursor),li(Ut)}),Re.addEventListener("close",()=>{Ft===Re&&(h(se,!1),We=window.setTimeout(Hn,1200))})}async function li(b){if((b.type==="channel.created"||b.type==="channel.updated")&&b.workspace_id===i(I)){await ir();return}(b.channel_id===i(S)||b.payload.direct_conversation_id===i(R))&&(b.type==="message.created"||b.type==="message.updated"||b.type==="message.deleted")&&await St();const D=b.payload.root_message_id||b.payload.message_id;i(E)&&D===i(E).id&&await En(i(E))}function or(b){b&&(h(E,null),h(A,b))}function na(b){if(b.key==="Escape"&&i(ye)&&i(Ye)!=="thread"){b.preventDefault(),ht();return}b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),Un())}function oi(b){if(b.key==="Escape"&&i(ye)&&i(Ye)==="thread"){b.preventDefault(),ht();return}b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),Ot())}function dn(b,D){h($,{url:b,title:D})}function Pa(b){const D=b.target;D instanceof HTMLImageElement&&D.closest(".markdown")&&(b.preventDefault(),dn(D.currentSrc||D.src,D.alt||"Image"))}function ra(b){const D=i(te)&&!i(te).endsWith(` -`)?` -`:"";h(te,`${i(te)}${D}${b}`)}function Pe(b,D=b){ra(`${b}${b==="```"?` -code -`:"text"}${D}`)}function Gn(b,D){ra(`![${D}](${b})`),h(we,!1),h(Dt,"")}function aa(){i(Ye)==="thread"&&ht(),h(E,null),h(A,null),h(Ce,"message"),h(w,[])}function An(){h($,null),h(ft,!1)}mn(()=>(i(d),i(I)),()=>{h(n,i(d).find(b=>b.id===i(I)))}),mn(()=>(i(m),i(S)),()=>{h(a,i(m).find(b=>b.id===i(S)))}),mn(()=>(i(g),i(R)),()=>{h(r,i(g).find(b=>b.id===i(R)))}),mn(()=>(i(E),i(A)),()=>{h(s,i(E)!==null||i(A)!==null)}),mn(()=>i(T),()=>{h(l,$u(i(T)))}),mn(()=>(i(T),i(g),i(u)),()=>{h(c,Xu(i(T),i(g),i(u)?.id||""))}),mn(()=>(i(Ye),i(ye),i(T)),()=>{i(Ye)==="channel"&&i(ye)&&!i(T).some(b=>b.id===i(ye)?.id)&&ht()}),mn(()=>(i(Ye),i(ye),i(T)),()=>{i(Ye)==="dm"&&i(ye)&&!i(T).some(b=>b.id===i(ye)?.id)&&ht()}),mn(()=>(i(Ye),i(ye),i(E),i(w)),()=>{i(Ye)==="thread"&&i(ye)&&i(E)&&i(ye).id!==i(E).id&&!i(w).some(b=>b.id===i(ye)?.id)&&ht()}),mn(()=>i(Dt),()=>{h(o,Zu.filter(b=>{const D=i(Dt).trim().toLowerCase();return!D||b.title.toLowerCase().includes(D)||b.tags.some(le=>le.includes(D))}))}),vu(),io();var Dr=Qi();to("1oa2eo8",b=>{var D=Pd();C(b,D)}),kn("keydown",Li,b=>{if(b.key==="Escape"){if(Jr())An();else if(i(ye)){b.preventDefault(),ht();return}}rf(b,{authRequired:i(Ae),isModalOpen:Jr,messageInput:i(Jt),replyInput:i(fn),target:Na})});var za=Vn(Dr);{var Fa=b=>{var D=zd();C(b,D)},ci=b=>{var D=Pp(),le=Vn(D);let Re;var $e=p(le),Ut=p($e);{var je=x=>{var k=mt("×");C(x,k)},Bt=x=>{var k=Fd();C(x,k)};j(Ut,x=>{i(Qt)?x(je):x(Bt,-1)})}var ia=v($e,2),Ua=v(p(ia),4),sa=p(Ua);Pt(sa,1,()=>i(d),x=>x.id,(x,k)=>{var B=Ud();let K;var de=p(B),me=p(de),xe=p(me);z(_e=>{K=bt(B,1,"guild-wrap",null,K,{active:i(k).id===i(I)}),H(de,"title",(i(k),_(()=>i(k).name))),M(xe,_e)},[()=>(F(Hs),i(k),_(()=>Hs(i(k).name)))]),W("click",de,async()=>{h(I,i(k).id),await ir(),await Et(),Hn()}),C(x,B)});var Ba=v(sa,2),Ha=v(Ua,2);{var q=x=>{var k=Bd(),B=p(k);kn("submit",k,K=>{K.preventDefault(),Cr()}),dr(B,()=>i(ge),K=>h(ge,K)),C(x,k)};j(Ha,x=>{i(pt)&&x(q)})}var f=v(ia,2),y=p(f),P=p(y),fe=p(P),Xe=p(fe),Ie=v(fe,2);let tt;var At=p(Ie),ot=v(P,2),la=p(ot),Fe=p(la),oa=v(y,2),ca=p(oa),cs=v(p(ca),2),us=p(cs);Pt(us,1,()=>i(m),x=>x.id,(x,k)=>{var B=Hd();let K;var de=v(p(B),2),me=p(de);z(()=>{K=bt(B,1,"nav-item channel",null,K,{active:i(k).id===i(S)&&!i(R)}),M(me,(i(k),_(()=>i(k).name)))}),W("click",B,async()=>{h(S,i(k).id),h(R,""),h(E,null),h(A,null),h(Ce,"message"),h(Qt,!1),await St()}),C(x,B)});var xo=v(us,2);{var To=x=>{var k=Gd();C(x,k)};j(xo,x=>{i(m),_(()=>i(m).length===0)&&x(To)})}var fs=v(cs,2),So=p(fs),ds=v(ca,2),ps=v(p(ds),2),hs=p(ps);Pt(hs,1,()=>i(g),x=>x.id,(x,k)=>{const B=rn(()=>(F(Gs),i(k),i(u),_(()=>Gs(i(k),i(u)?.id))));var K=Wd();let de;var me=p(K),xe=p(me);{var _e=U=>{var X=qd();z(()=>H(X,"src",(F(i(B)),_(()=>i(B).avatar_url)))),C(U,X)},V=U=>{var X=mt();z(Ue=>M(X,Ue),[()=>(F(Ke),F(i(B)),_(()=>Ke(i(B)?.display_name)))]),C(U,X)};j(xe,U=>{F(i(B)),_(()=>i(B)?.avatar_url)?U(_e):U(V,-1)})}var Le=v(me,2),ze=p(Le);z((U,X)=>{de=bt(K,1,"nav-item dm",null,de,{active:i(k).id===i(R)}),Dn(me,`--hue: ${U??""}deg`),M(ze,X)},[()=>(F(Qe),F(i(B)),i(k),_(()=>Qe(i(B)?.id||i(k).id))),()=>(F(Xn),i(k),i(u),_(()=>Xn(i(k),i(u)?.id)))]),W("click",K,async()=>{h(R,i(k).id),h(S,""),h(E,null),h(A,null),h(Ce,"message"),h(Qt,!1),await St()}),C(x,K)});var Eo=v(hs,2);{var Ao=x=>{var k=jd();C(x,k)};j(Eo,x=>{i(g),_(()=>i(g).length===0)&&x(Ao)})}var vs=v(ps,2),Ro=p(vs),Co=v(ds,2),Io=v(p(Co),2),gs=p(Io);Pt(gs,1,()=>i(c),x=>x.id,(x,k)=>{const B=rn(()=>(F(qs),i(g),i(k),_(()=>qs(i(g),i(k).id))));var K=Yd();let de;var me=p(K),xe=p(me);{var _e=U=>{var X=Zd();z(()=>H(X,"src",(i(k),_(()=>i(k).avatar_url)))),C(U,X)},V=U=>{var X=mt();z(Ue=>M(X,Ue),[()=>(F(Ke),i(k),_(()=>Ke(i(k).display_name)))]),C(U,X)};j(xe,U=>{i(k),_(()=>i(k).avatar_url)?U(_e):U(V,-1)})}var Le=v(me,2),ze=p(Le);z(U=>{de=bt(K,1,"nav-item dm",null,de,{active:i(B)?.id===i(R)||i(A)?.id===i(k).id}),Dn(me,`--hue: ${U??""}deg`),M(ze,(i(k),_(()=>i(k).display_name)))},[()=>(F(Qe),i(k),_(()=>Qe(i(k).id)))]),W("click",K,async()=>{i(B)?(h(R,i(B).id),h(S,""),h(E,null),h(A,null),h(Ce,"message"),h(Qt,!1),await St()):or(i(k))}),C(x,K)});var Lo=v(gs,2);{var Do=x=>{var k=$d();C(x,k)};j(Lo,x=>{i(c),_(()=>i(c).length===0)&&x(Do)})}var Oo=v(oa,2);{var Mo=x=>{var k=Vd(),B=p(k),K=p(B);{var de=U=>{var X=Xd();z(()=>H(X,"src",(i(u),_(()=>i(u).avatar_url)))),C(U,X)},me=U=>{var X=mt();z(Ue=>M(X,Ue),[()=>(F(Ke),i(u),_(()=>Ke(i(u).display_name)))]),C(U,X)};j(K,U=>{i(u),_(()=>i(u).avatar_url)?U(de):U(me,-1)})}var xe=v(B,2),_e=p(xe),V=p(_e),Le=v(_e,2),ze=p(Le);z((U,X,Ue)=>{H(k,"aria-label",U),Dn(B,`--hue: ${X??""}deg`),M(V,(i(u),_(()=>i(u).display_name))),M(ze,Ue)},[()=>(i(u),F(ct),_(()=>`Account settings for ${i(u).display_name} ${ct(i(u).handle)}`)),()=>(F(Qe),i(u),_(()=>Qe(i(u).id))),()=>(i(u),F(ct),i(se),_(()=>i(u).handle?ct(i(u).handle):i(se)?"Active":"Reconnecting…"))]),W("click",k,zn),W("contextmenu",k,U=>{U.preventDefault(),zn()}),C(x,k)};j(Oo,x=>{i(u)&&x(Mo)})}var ms=v(f,2),_s=p(ms),bs=p(_s),ks=p(bs);{var No=x=>{var k=Kd(),B=p(k);z(K=>M(B,K),[()=>(F(Xn),i(r),i(u),_(()=>`@${Xn(i(r),i(u)?.id)}`))]),C(x,k)},Po=x=>{var k=Qd(),B=p(k);z(()=>M(B,(i(a),_(()=>`#${i(a).name}`)))),C(x,k)},zo=x=>{var k=Jd();C(x,k)};j(ks,x=>{i(r)?x(No):i(a)?x(Po,1):x(zo,-1)})}var Fo=v(ks,4),Uo=p(Fo),ui=v(bs,2),ws=v(p(ui),2),Bo=v(ws,2);{var Ho=x=>{var k=ep();W("click",k,()=>{h(re,""),h(ne,[])}),C(x,k)};j(Bo,x=>{i(re)&&x(Ho)})}var Go=v(ui,2),ua=p(Go);let ys;var qo=v(ua,2),xs=v(_s,2);{var Wo=x=>{var k=rp(),B=p(k),K=p(B),de=p(K),me=v(K,2),xe=v(B,2);Pt(xe,1,()=>i(ne),_e=>_e.message.id,(_e,V)=>{var Le=np(),ze=p(Le),U=p(ze);{var X=Se=>{var Ve=tp();z(()=>H(Ve,"src",(i(V),_(()=>i(V).message.author.avatar_url)))),C(Se,Ve)},Ue=Se=>{var Ve=mt();z(pn=>M(Ve,pn),[()=>(F(Ke),i(V),_(()=>Ke(i(V).message.author?.display_name)))]),C(Se,Ve)};j(U,Se=>{i(V),_(()=>i(V).message.author?.avatar_url)?Se(X):Se(Ue,-1)})}var Ht=v(ze,2),Gt=p(Ht),en=p(Gt),tn=p(en),Rn=v(en,2),ue=p(Rn),G=v(Gt,2),nt=p(G);z((Se,Ve)=>{Dn(ze,`--hue: ${Se??""}deg`),M(tn,(i(V),_(()=>i(V).message.author?.display_name||"Local User"))),M(ue,Ve),M(nt,(i(V),_(()=>i(V).message.body)))},[()=>(F(Qe),i(V),_(()=>Qe(i(V).message.author?.id||i(V).message.author_id||"x"))),()=>(F(_n),i(V),_(()=>_n(i(V).message.created_at)))]),W("click",Le,async()=>{h(ne,[]),i(V).message.channel_id&&(h(S,i(V).message.channel_id),h(R,""),await St()),i(V).message.direct_conversation_id&&(h(R,i(V).message.direct_conversation_id),h(S,""),await St())}),C(_e,Le)}),z(()=>M(de,`${i(ne),_(()=>i(ne).length)??""} ${i(ne),_(()=>i(ne).length===1?"result":"results")??""}`)),W("click",me,()=>{h(ne,[])}),C(x,k)};j(xs,x=>{i(ne),_(()=>i(ne).length>0)&&x(Wo)})}var fa=v(xs,2),Ts=p(fa);{var jo=x=>{var k=ap(),B=p(k),K=p(B);{var de=U=>{var X=mt("@");C(U,X)},me=U=>{var X=mt("#");C(U,X)};j(K,U=>{i(r)?U(de):U(me,-1)})}var xe=v(B,2),_e=p(xe);{var V=U=>{var X=mt();z(Ue=>M(X,`This is the start of your conversation with ${Ue??""}.`),[()=>(F(Xn),i(r),i(u),_(()=>Xn(i(r),i(u)?.id)))]),C(U,X)},Le=U=>{var X=mt();z(()=>M(X,`Welcome to #${i(a),_(()=>i(a).name)??""}!`)),C(U,X)},ze=U=>{var X=mt("Pick a channel to get started.");C(U,X)};j(_e,U=>{i(r)?U(V):i(a)?U(Le,1):U(ze,-1)})}C(x,k)};j(Ts,x=>{i(T),_(()=>i(T).length===0)&&x(jo)})}var Zo=v(Ts,2);Pt(Zo,1,()=>i(l),x=>x.key,(x,k)=>{var B=pp(),K=Vn(B);{var de=ue=>{var G=ip(),nt=p(G),Se=p(nt);z(()=>M(Se,(i(k),_(()=>i(k).dayLabel)))),C(ue,G)};j(K,ue=>{i(k),_(()=>i(k).dayLabel)&&ue(de)})}var me=v(K,2),xe=p(me),_e=p(xe);{var V=ue=>{var G=sp();z(()=>H(G,"src",(i(k),_(()=>i(k).authorAvatarURL)))),C(ue,G)},Le=ue=>{var G=mt();z(nt=>M(G,nt),[()=>(F(Ke),i(k),_(()=>Ke(i(k).authorName)))]),C(ue,G)};j(_e,ue=>{i(k),_(()=>i(k).authorAvatarURL)?ue(V):ue(Le,-1)})}var ze=v(xe,2),U=p(ze),X=p(U),Ue=p(X),Ht=v(X,2);{var Gt=ue=>{var G=lp(),nt=p(G);z(Se=>M(nt,Se),[()=>(F(ct),i(k),_(()=>ct(i(k).authorHandle)))]),C(ue,G)};j(Ht,ue=>{i(k),_(()=>i(k).authorHandle)&&ue(Gt)})}var en=v(Ht,2),tn=p(en),Rn=v(U,2);Pt(Rn,3,()=>(i(k),_(()=>i(k).messages)),ue=>ue.id,(ue,G,nt)=>{var Se=dp();let Ve;var pn=p(Se),qn=p(pn),Cn=v(pn,2),be=p(Cn);{var rt=Mt=>{var gt=up();let hn;var vn=v(p(gt),2),In=p(vn),da=p(In),he=v(In,2);{var De=qt=>{var Ln=op(),Or=p(Ln);z(pa=>M(Or,pa),[()=>(F(On),i(G),_(()=>On(i(G).quoted_body_snapshot)))]),C(qt,Ln)},jn=qt=>{var Ln=cp(),Or=p(Ln);z(pa=>M(Or,`[original deleted] ${pa??""}`),[()=>(F(On),i(G),_(()=>On(i(G).quoted_body_snapshot)))]),C(qt,Ln)};j(he,qt=>{i(G),_(()=>i(G).quoted_message_id)?qt(De):qt(jn,-1)})}z((qt,Ln)=>{hn=bt(gt,1,"quote-block",null,hn,{dangling:!i(G).quoted_message_id}),gt.disabled=(i(G),_(()=>!i(G).quoted_message_id)),H(gt,"aria-label",qt),M(da,Ln)},[()=>(i(G),F($n),_(()=>i(G).quoted_message_id?`Jump to quoted message from ${$n(i(G))}`:"Original message was deleted")),()=>(F($n),i(G),_(()=>$n(i(G))))]),W("click",gt,()=>ea(i(G))),C(Mt,gt)};j(be,Mt=>{i(G),_(()=>i(G).quoted_message_id||i(G).quoted_body_snapshot)&&Mt(rt)})}var nn=v(be,2);vi(nn,()=>(F(Nr),i(G),_(()=>Nr(i(G).body))),!0);var pe=v(nn,2);{var N=Mt=>{var gt=fp();Pt(gt,5,()=>(i(G),_(()=>i(G).attachments)),hn=>hn.id,(hn,vn)=>{{let In=rn(()=>(F(pr),i(vn),_(()=>pr(i(vn)))));xi(hn,{get upload(){return i(vn)},get url(){return i(In)},onOpenImage:dn})}}),C(Mt,gt)};j(pe,Mt=>{i(G),_(()=>i(G).attachments?.length)&&Mt(N)})}var vt=v(Cn,2),Rt=p(vt),Wn=v(Rt,2);z((Mt,gt)=>{Ve=bt(Se,1,"message-row",null,Ve,{selected:i(E)?.id===i(G).id}),H(Se,"data-message-id",(i(G),_(()=>i(G).id))),M(qn,Mt),H(Wn,"data-tooltip",gt)},[()=>(F(i(nt)),F(_n),i(G),_(()=>i(nt)===0?"":_n(i(G).created_at))),()=>(F(Bs),i(G),i(E),_(()=>Bs(i(G),i(E)?.id)))]),W("click",Rt,()=>lr(i(G),i(R)?"dm":"channel")),W("click",Wn,()=>En(i(G))),C(ue,Se)}),z((ue,G)=>{Dn(xe,`--hue: ${ue??""}deg`),H(xe,"aria-label",(i(k),_(()=>`View profile for ${i(k).authorName}`))),M(Ue,(i(k),_(()=>i(k).authorName))),M(tn,G)},[()=>(F(Qe),i(k),_(()=>Qe(i(k).authorID))),()=>(F(_n),i(k),_(()=>_n(i(k).timestamp)))]),W("click",xe,()=>or(i(k).messages[0]?.author)),W("click",X,()=>or(i(k).messages[0]?.author)),C(x,B)}),Ji(fa,x=>h(dt,x),()=>i(dt));var Yo=v(fa,2);{let x=rn(()=>(i(r),F(Xn),i(u),i(a),_(()=>i(r)?`Message ${Xn(i(r),i(u)?.id)}`:i(a)?`Message #${i(a).name}`:"Pick a channel to start"))),k=rn(()=>i(ye)&&i(Ye)===(i(R)?"dm":"channel")?i(ye):null);ol(Yo,{get value(){return i(te)},get placeholder(){return i(x)},ariaLabel:"Message body",submitLabel:"Send",get pendingUpload(){return i(Ne)},get replyTarget(){return i(k)},showUpload:!0,showToolbar:!0,get showGifPicker(){return i(we)},get gifQuery(){return i(Dt)},get filteredGifs(){return i(o)},onValue:B=>h(te,B),onSubmit:()=>{Un()},onKeydown:na,onFocus:()=>h(Ce,"message"),onInputRef:B=>h(Jt,B),onUploadFile:Lr,onRemoveUpload:()=>h(Ne,null),onClearReply:ht,onApplyMarkdownWrap:Pe,onAppendToComposer:ra,onToggleGif:()=>h(we,!i(we)),onGifQuery:B=>h(Dt,B),onPickGif:Gn})}var fi=v(ms,2);let Ss;var $o=p(fi);{var Xo=x=>{var k=Tp(),B=Vn(k),K=p(B),de=v(p(K),2),me=p(de),xe=v(K,2),_e=v(B,2),V=p(_e),Le=p(V),ze=p(Le);{var U=pe=>{var N=hp();z(()=>H(N,"src",(i(E),_(()=>i(E).author.avatar_url)))),C(pe,N)},X=pe=>{var N=mt();z(vt=>M(N,vt),[()=>(F(Ke),i(E),_(()=>Ke(i(E).author?.display_name)))]),C(pe,N)};j(ze,pe=>{i(E),_(()=>i(E).author?.avatar_url)?pe(U):pe(X,-1)})}var Ue=v(Le,2),Ht=p(Ue),Gt=p(Ht),en=p(Gt),tn=v(Gt,2);{var Rn=pe=>{var N=vp(),vt=p(N);z(Rt=>M(vt,Rt),[()=>(F(ct),i(E),_(()=>ct(i(E).author.handle)))]),C(pe,N)};j(tn,pe=>{i(E),_(()=>i(E).author?.handle)&&pe(Rn)})}var ue=v(tn,2),G=p(ue),nt=v(ue,2),Se=v(Ht,2);vi(Se,()=>(F(Nr),i(E),_(()=>Nr(i(E).body))),!0);var Ve=v(Se,2);{var pn=pe=>{var N=gp();Pt(N,5,()=>(i(E),_(()=>i(E).attachments)),vt=>vt.id,(vt,Rt)=>{{let Wn=rn(()=>(F(pr),i(Rt),_(()=>pr(i(Rt)))));xi(vt,{get upload(){return i(Rt)},get url(){return i(Wn)},onOpenImage:dn})}}),C(pe,N)};j(Ve,pe=>{i(E),_(()=>i(E).attachments?.length)&&pe(pn)})}var qn=v(V,2),Cn=p(qn),be=p(Cn),rt=v(qn,2);Pt(rt,5,()=>i(w),pe=>pe.id,(pe,N)=>{var vt=xp(),Rt=p(vt),Wn=p(Rt);{var Mt=Be=>{var He=mp();z(()=>H(He,"src",(i(N),_(()=>i(N).author.avatar_url)))),C(Be,He)},gt=Be=>{var He=mt();z(gn=>M(He,gn),[()=>(F(Ke),i(N),_(()=>Ke(i(N).author?.display_name)))]),C(Be,He)};j(Wn,Be=>{i(N),_(()=>i(N).author?.avatar_url)?Be(Mt):Be(gt,-1)})}var hn=v(Rt,2),vn=p(hn),In=p(vn),da=p(In),he=v(In,2);{var De=Be=>{var He=_p(),gn=p(He);z(cr=>M(gn,cr),[()=>(F(ct),i(N),_(()=>ct(i(N).author.handle)))]),C(Be,He)};j(he,Be=>{i(N),_(()=>i(N).author?.handle)&&Be(De)})}var jn=v(he,2),qt=p(jn),Ln=v(jn,2),Or=v(vn,2);{var pa=Be=>{var He=wp();let gn;var cr=v(p(He),2),Ga=p(cr),rc=p(Ga),ac=v(Ga,2);{var ic=Zn=>{var ur=bp(),di=p(ur);z(pi=>M(di,pi),[()=>(F(On),i(N),_(()=>On(i(N).quoted_body_snapshot)))]),C(Zn,ur)},sc=Zn=>{var ur=kp(),di=p(ur);z(pi=>M(di,`[original deleted] ${pi??""}`),[()=>(F(On),i(N),_(()=>On(i(N).quoted_body_snapshot)))]),C(Zn,ur)};j(ac,Zn=>{i(N),_(()=>i(N).quoted_message_id)?Zn(ic):Zn(sc,-1)})}z((Zn,ur)=>{gn=bt(He,1,"quote-block",null,gn,{dangling:!i(N).quoted_message_id}),He.disabled=(i(N),_(()=>!i(N).quoted_message_id)),H(He,"aria-label",Zn),M(rc,ur)},[()=>(i(N),F($n),_(()=>i(N).quoted_message_id?`Jump to quoted message from ${$n(i(N))}`:"Original message was deleted")),()=>(F($n),i(N),_(()=>$n(i(N))))]),W("click",He,()=>ea(i(N))),C(Be,He)};j(Or,Be=>{i(N),_(()=>i(N).quoted_message_id||i(N).quoted_body_snapshot)&&Be(pa)})}var As=v(Or,2);vi(As,()=>(F(Nr),i(N),_(()=>Nr(i(N).body))),!0);var tc=v(As,2);{var nc=Be=>{var He=yp();Pt(He,5,()=>(i(N),_(()=>i(N).attachments)),gn=>gn.id,(gn,cr)=>{{let Ga=rn(()=>(F(pr),i(cr),_(()=>pr(i(cr)))));xi(gn,{get upload(){return i(cr)},get url(){return i(Ga)},onOpenImage:dn})}}),C(Be,He)};j(tc,Be=>{i(N),_(()=>i(N).attachments?.length)&&Be(nc)})}z((Be,He)=>{H(vt,"data-message-id",(i(N),_(()=>i(N).id))),Dn(Rt,`--hue: ${Be??""}deg`),M(da,(i(N),_(()=>i(N).author?.display_name||"Local User"))),M(qt,He)},[()=>(F(Qe),i(N),_(()=>Qe(i(N).author?.id||i(N).author_id||"x"))),()=>(F(_n),i(N),_(()=>_n(i(N).created_at)))]),W("click",Ln,()=>lr(i(N),"thread")),C(pe,vt)});var nn=v(_e,2);{let pe=rn(()=>i(ye)&&i(Ye)==="thread"?i(ye):null);ol(nn,{get value(){return i(oe)},placeholder:"Reply in thread",ariaLabel:"Reply body",submitLabel:"Reply",formClass:"composer reply-composer",get replyTarget(){return i(pe)},onValue:N=>h(oe,N),onSubmit:()=>{Ot()},onKeydown:oi,onFocus:()=>h(Ce,"thread"),onInputRef:N=>h(fn,N),onClearReply:ht})}z((pe,N)=>{M(me,`${i(L),i(w),_(()=>i(L)?.reply_count??i(w).length)??""} ${i(L),i(w),_(()=>(i(L)?.reply_count??i(w).length)===1?"reply":"replies")??""}`),H(V,"data-message-id",(i(E),_(()=>i(E).id))),Dn(Le,`--hue: ${pe??""}deg`),M(en,(i(E),_(()=>i(E).author?.display_name||"Local User"))),M(G,N),M(be,`${i(w),_(()=>i(w).length)??""} ${i(w),_(()=>i(w).length===1?"reply":"replies")??""}`)},[()=>(F(Qe),i(E),_(()=>Qe(i(E).author?.id||i(E).author_id||"x"))),()=>(F(_n),i(E),_(()=>_n(i(E).created_at)))]),W("click",xe,()=>{aa()}),W("pointerdown",_e,()=>h(Ce,"thread")),W("pointerup",_e,Pa),W("click",nt,()=>i(E)&&lr(i(E),"thread")),C(x,k)},Vo=x=>{var k=Ip(),B=Vn(k),K=p(B),de=v(p(K),2),me=p(de),xe=v(K,2),_e=v(B,2),V=p(_e),Le=p(V),ze=p(Le);{var U=he=>{var De=Sp();z(()=>H(De,"src",(i(A),_(()=>i(A).avatar_url)))),C(he,De)},X=he=>{var De=mt();z(jn=>M(De,jn),[()=>(F(Ke),i(A),_(()=>Ke(i(A).display_name)))]),C(he,De)};j(ze,he=>{i(A),_(()=>i(A).avatar_url)?he(U):he(X,-1)})}var Ue=v(V,2),Ht=p(Ue),Gt=p(Ht),en=p(Gt),tn=p(en),Rn=v(en,2);{var ue=he=>{var De=Ep(),jn=p(De);z(qt=>M(jn,qt),[()=>(F(ct),i(A),_(()=>ct(i(A).handle)))]),C(he,De)};j(Rn,he=>{i(A),_(()=>i(A).handle)&&he(ue)})}var G=v(Gt,2);{var nt=he=>{var De=Ap();W("click",De,zn),C(he,De)};j(G,he=>{i(u),i(A),_(()=>i(u)?.id===i(A).id)&&he(nt)})}var Se=v(Ht,4),Ve=p(Se);{var pn=he=>{var De=Rp();W("click",De,()=>ta(i(A)?.id||"")),C(he,De)};j(Ve,he=>{i(u),i(A),_(()=>i(u)?.id!==i(A).id)&&he(pn)})}var qn=v(Ve,2),Cn=v(Se,2),be=p(Cn),rt=v(p(be),2);{var nn=he=>{var De=Cp();W("click",De,zn),C(he,De)};j(rt,he=>{i(u),i(A),_(()=>i(u)?.id===i(A).id)&&he(nn)})}var pe=v(be,2),N=v(p(pe),2),vt=v(p(N),2),Rt=p(vt),Wn=v(pe,2),Mt=v(p(Wn),2),gt=v(p(Mt),2),hn=p(gt),vn=v(Cn,2),In=v(p(vn),2),da=p(In);z((he,De)=>{M(me,(i(A),_(()=>i(A).display_name))),Dn(V,`--hue: ${he??""}deg`),M(tn,(i(A),_(()=>i(A).display_name))),M(Rt,De),M(hn,(i(A),_(()=>i(A).id))),M(da,`Member of ${i(n),_(()=>i(n)?.name||"this workspace")??""}. Click Message to keep the conversation in your sidebar.`)},[()=>(F(Qe),i(A),_(()=>Qe(i(A).id))),()=>(i(A),F(ct),_(()=>i(A).handle?ct(i(A).handle):"No handle set"))]),W("click",xe,aa),W("click",qn,()=>h(Tt,"status messages are coming soon")),C(x,k)},Ko=x=>{var k=Lp();C(x,k)};j($o,x=>{i(E)?x(Xo):i(A)?x(Vo,1):x(Ko,-1)})}var Es=v(le,2);{var Qo=x=>{var k=Mp(),B=p(k),K=v(B,2),de=p(K),me=v(p(de),2),xe=v(de,2),_e=p(xe),V=p(_e),Le=p(V);{var ze=be=>{var rt=Dp();z(()=>H(rt,"src",i(et))),C(be,rt)},U=be=>{var rt=mt();z(nn=>M(rt,nn),[()=>(F(Ke),i(Ze),_(()=>Ke(i(Ze))))]),C(be,rt)};j(Le,be=>{i(et)?be(ze):be(U,-1)})}var X=v(V,2),Ue=p(X),Ht=p(Ue),Gt=v(Ue,2),en=p(Gt),tn=v(_e,2),Rn=v(p(tn),2),ue=v(tn,2),G=v(p(ue),2),nt=v(ue,2),Se=v(p(nt),2),Ve=v(nt,2);{var pn=be=>{var rt=Op();let nn;var pe=p(rt);z(()=>{nn=bt(rt,1,"profile-status",null,nn,{error:i(ke)}),M(pe,i(xt))}),C(be,rt)};j(Ve,be=>{i(xt)&&be(pn)})}var qn=v(Ve,2),Cn=p(qn);z((be,rt)=>{Dn(V,`--hue: ${be??""}deg`),M(Ht,(i(Ze),i(u),_(()=>i(Ze)||i(u).display_name))),M(en,rt)},[()=>(F(Qe),i(u),_(()=>Qe(i(u).id))),()=>(i(Y),F(ct),i(u),_(()=>i(Y)||ct(i(u).handle)||"No handle set"))]),W("click",B,An),W("click",me,An),kn("submit",xe,be=>{be.preventDefault(),Fn()}),dr(Rn,()=>i(Ze),be=>h(Ze,be)),dr(G,()=>i(Y),be=>h(Y,be)),dr(Se,()=>i(et),be=>h(et,be)),W("click",Cn,An),C(x,k)};j(Es,x=>{i(ft)&&i(u)&&x(Qo)})}var Jo=v(Es,2);{var ec=x=>{var k=Np(),B=p(k),K=v(B,2),de=p(K),me=p(de),xe=p(me),_e=v(me,2),V=p(_e),Le=v(V,2),ze=v(de,2),U=p(ze);z(()=>{M(xe,(i($),_(()=>i($).title))),H(V,"href",(i($),_(()=>i($).url))),H(U,"src",(i($),_(()=>i($).url))),H(U,"alt",(i($),_(()=>i($).title)))}),W("click",B,An),W("click",Le,An),C(x,k)};j(Jo,x=>{i($)&&x(ec)})}z(()=>{Re=bt(le,1,"shell",null,Re,{"nav-open":i(Qt),"sidebar-collapsed":i(Sn),"thread-open":i(s)}),M(Xe,(i(n),_(()=>i(n)?.name||"Pick a workspace"))),tt=bt(Ie,1,"presence",null,tt,{online:i(se)}),M(At,i(se)?"Connected":i(Tt)),H(ot,"aria-label",i(Sn)?"Expand sidebar":"Collapse sidebar"),H(ot,"title",i(Sn)?"Expand sidebar":"Collapse sidebar"),H(Fe,"d",i(Sn)?"m9 6 6 6-6 6":"m15 6-6 6 6 6"),M(Uo,(i(n),_(()=>i(n)?.name||"no workspace"))),H(ua,"title",i(E)?"Close thread":"Open a message thread"),H(ua,"aria-label",i(E)?"Close thread":"Open a message thread"),ys=bt(ua,1,"",null,ys,{active:i(s)}),Ss=bt(fi,1,"thread",null,Ss,{open:i(s)}),H(fi,"aria-label",i(A)?"Profile pane":"Thread pane")}),W("click",$e,()=>h(Qt,!i(Qt))),W("click",Ba,()=>h(pt,!i(pt))),W("click",ot,()=>h(Sn,!i(Sn))),kn("submit",fs,x=>{x.preventDefault(),Ma()}),dr(So,()=>i(Te),x=>h(Te,x)),kn("submit",vs,x=>{x.preventDefault(),Bn()}),dr(Ro,()=>i(ce),x=>h(ce,x)),kn("submit",ui,x=>{x.preventDefault(),Ir()}),dr(ws,()=>i(re),x=>h(re,x)),W("click",ua,()=>{i(s)?aa():h(Tt,"pick a message to open its thread")}),W("click",qo,()=>h(Tt,"no pinned items")),W("pointerdown",fa,()=>h(Ce,"message")),W("pointerup",fa,Pa),C(b,D)};j(za,b=>{i(Ae)?b(Fa):b(ci,-1)})}C(e,Dr),ar()}Vr(["click","contextmenu","pointerdown","pointerup"]);var Fp=O(' ',1),Up=O("

    "),Bp=O(`

    Self-hostable chat. Serious tool. Mild brine.

    ClickClack

    A single-binary chat app for teams, communities, bots, and agents: - Slack-style threads, durable realtime, OpenAPI, SQLite, and a CLI that - can drive the whole thing from a shell.

    What it is

    Chat infrastructure that stays boring when the socket drops.

    WebSocket is the pipe. The database is the truth. Every durable message, - thread reply, reaction, and channel update can be recovered over HTTP with - a cursor, so clients and agents can reconnect without drama.

    Agent path

    A friendly CLI, no LLM baked in.

    External agents, CI jobs, and humans use the same public API as the web - app. Tokens and workspace defaults are scoped per server, so switching - hosts does not leak credentials or stale IDs.

     

    Destinations

    Product at the root. Docs and app where people expect them.

    `);function Hp(e,t){rr(t,!1);const n="https://docs.clickclack.chat",a=["localhost","127.0.0.1","::1"].includes(window.location.hostname)?"/app":"https://app.clickclack.chat",r="https://github.com/openclaw/clickclack",s=[["Single binary","Go server, embedded Svelte app, embedded migrations, local SQLite and uploads."],["Threads that recover","Slack-style one-level threads with durable event replay after reconnects."],["Agent-friendly","A CLI, OpenAPI contract, TypeScript SDK, webhooks, and slash-command shapes."],["Self-host first","SQLite is the default, not the demo. Postgres can arrive behind the store layer."]],l=["clickclack serve --data ./data","clickclack login --magic-token mgt_...",'clickclack send --channel general "deploy started"',"clickclack threads reply msg_... --stdin {var Ne=Fp();$i(()=>{Ol.title="ClickClack - Self-hostable chat with claws"}),C(ne,Ne)});var o=p(c),u=v(p(o),2),d=v(p(u),2),m=p(d);H(m,"href",n);var g=v(m,2),T=v(g,2);H(T,"href",r);var w=v(u,2),I=v(p(w),6),S=p(I),R=v(S,2);H(R,"href",n);var E=v(R,2);H(E,"href",r);var L=v(o,4);Pt(L,5,()=>s,Iu,(ne,Ne)=>{var we=Up(),ft=p(we),Dt=p(ft),Ze=v(ft,2),Y=p(Ze);z(()=>{M(Dt,i(Ne)[0]),M(Y,i(Ne)[1])}),C(ne,we)});var A=v(L,2),$=v(p(A),2),te=p($),oe=v(A,2),ge=v(p(oe),2),Te=v(p(ge),2);H(Te,"href",n);var ce=v(Te,2),re=v(ce,2);H(re,"href",r),z(ne=>{H(g,"href",a),H(S,"href",a),M(te,ne),H(ce,"href",a)},[()=>l.join(` -`)]),C(e,c),ar()}function Gp(e){const t=window.location.pathname,a=window.location.hostname.startsWith("app.")||t==="/app"||t.startsWith("/app/");var r=Qi(),s=Vn(r);{var l=o=>{zp(o,{})},c=o=>{Hp(o,{})};j(s,o=>{a?o(l):o(c,-1)})}C(e,r)}Eu(Gp,{target:document.getElementById("app")}); diff --git a/apps/api/internal/webassets/dist/index.html b/apps/api/internal/webassets/dist/index.html index 085d599..1e83b0f 100644 --- a/apps/api/internal/webassets/dist/index.html +++ b/apps/api/internal/webassets/dist/index.html @@ -4,7 +4,7 @@ ClickClack - + diff --git a/apps/web/src/ChatApp.svelte b/apps/web/src/ChatApp.svelte index abdbc78..1eb9fbf 100644 --- a/apps/web/src/ChatApp.svelte +++ b/apps/web/src/ChatApp.svelte @@ -2,7 +2,7 @@ import { onDestroy, onMount, tick } from "svelte"; import { APIError, api } from "./lib/api"; import { gifLibrary } from "./lib/gifs"; - import { groupMessages, quoteSnippet, quotedAuthorName, threadSummary } from "./lib/chat/messages"; + import { quoteSnippet, quotedAuthorName } from "./lib/chat/messages"; import { avatarHue, avatarInitial, @@ -18,6 +18,7 @@ import { uploadURL } from "./lib/uploads"; import ChatComposer from "./components/composer/ChatComposer.svelte"; import MediaAttachment from "./components/MediaAttachment.svelte"; + import MessageList from "./components/messages/MessageList.svelte"; import type { Channel, DirectConversation, Message, RealtimeEvent, SearchResult, ThreadState, Upload, User, Workspace } from "./lib/types"; let user: User | null = null; @@ -68,7 +69,6 @@ $: selectedChannel = channels.find((channel) => channel.id === selectedChannelID); $: selectedDirect = directConversations.find((conversation) => conversation.id === selectedDirectID); $: sidePanelOpen = selectedThread !== null || selectedProfile !== null; - $: groupedMessages = groupMessages(messages); $: recentPeople = collectRecentPeople(messages, directConversations, user?.id || ""); $: if (replyContext === "channel" && replyTarget && !messages.some((m) => m.id === replyTarget?.id)) clearReplyTarget(); $: if (replyContext === "dm" && replyTarget && !messages.some((m) => m.id === replyTarget?.id)) clearReplyTarget(); @@ -898,126 +898,21 @@ {/if} -
    (activeComposerContext = "message")} - onpointerup={handleInlineImagePointerUp} - > - {#if messages.length === 0} -
    -
    - {#if selectedDirect}@{:else}#{/if} -
    - - {#if selectedDirect} - This is the start of your conversation with {dmTitle(selectedDirect, user?.id)}. - {:else if selectedChannel} - Welcome to #{selectedChannel.name}! - {:else} - Pick a channel to get started. - {/if} - - Send a message in Markdown — code fences, lists, links all work. Threads open from any message. -
    - {/if} - {#each groupedMessages as group (group.key)} - {#if group.dayLabel} -
    {group.dayLabel}
    - {/if} -
    - -
    -
    - - {#if group.authorHandle}{handleLabel(group.authorHandle)}{/if} - -
    - {#each group.messages as message, index (message.id)} -
    - -
    - {#if message.quoted_message_id || message.quoted_body_snapshot} - - {/if} -
    {@html markdown(message.body)}
    - {#if message.attachments?.length} -
    - {#each message.attachments as attachment (attachment.id)} - - {/each} -
    - {/if} -
    -
    - - -
    -
    - {/each} -
    -
    - {/each} -
    + (messageList = node)} + onActivateMessageComposer={() => (activeComposerContext = "message")} + onInlineImagePointerUp={handleInlineImagePointerUp} + onOpenProfile={openUserProfile} + onReply={setReplyTarget} + onOpenThread={openThread} + onJumpToQuote={(message) => void jumpToQuotedMessage(message)} + onOpenImage={openImageViewer} + /> + import { avatarHue, avatarInitial, handleLabel } from "../../lib/chat/people"; + import { time } from "../../lib/format"; + import type { Message } from "../../lib/types"; + import type { MessageGroup as MessageGroupType } from "../../lib/chat/messages"; + import MessageRow from "./MessageRow.svelte"; + + type Props = { + group: MessageGroupType; + selectedThreadID?: string; + replyContext: "channel" | "dm"; + onOpenProfile: (profile?: Message["author"]) => void; + onReply: (message: Message, context: "channel" | "dm") => void; + onOpenThread: (message: Message) => void; + onJumpToQuote: (message: Message) => void; + onOpenImage: (url: string, title: string) => void; + }; + + let { + group, + selectedThreadID, + replyContext, + onOpenProfile, + onReply, + onOpenThread, + onJumpToQuote, + onOpenImage, + }: Props = $props(); + + +
    + +
    +
    + + {#if group.authorHandle}{handleLabel(group.authorHandle)}{/if} + +
    + {#each group.messages as message, index (message.id)} + + {/each} +
    +
    diff --git a/apps/web/src/components/messages/MessageList.svelte b/apps/web/src/components/messages/MessageList.svelte new file mode 100644 index 0000000..5e11b8a --- /dev/null +++ b/apps/web/src/components/messages/MessageList.svelte @@ -0,0 +1,89 @@ + + +
    + {#if messages.length === 0} +
    +
    + {#if selectedDirect}@{:else}#{/if} +
    + + {#if selectedDirect} + This is the start of your conversation with {dmTitle(selectedDirect, currentUserID)}. + {:else if selectedChannel} + Welcome to #{selectedChannel.name}! + {:else} + Pick a channel to get started. + {/if} + + Send a message in Markdown — code fences, lists, links all work. Threads open from any message. +
    + {/if} + {#each groupedMessages as group (group.key)} + {#if group.dayLabel} +
    {group.dayLabel}
    + {/if} + + {/each} +
    diff --git a/apps/web/src/components/messages/MessageRow.svelte b/apps/web/src/components/messages/MessageRow.svelte new file mode 100644 index 0000000..4e76081 --- /dev/null +++ b/apps/web/src/components/messages/MessageRow.svelte @@ -0,0 +1,75 @@ + + +
    + +
    + +
    {@html markdown(message.body)}
    + {#if message.attachments?.length} +
    + {#each message.attachments as attachment (attachment.id)} + + {/each} +
    + {/if} +
    +
    + + +
    +
    diff --git a/apps/web/src/components/messages/QuoteBlock.svelte b/apps/web/src/components/messages/QuoteBlock.svelte new file mode 100644 index 0000000..3f0c3b4 --- /dev/null +++ b/apps/web/src/components/messages/QuoteBlock.svelte @@ -0,0 +1,32 @@ + + +{#if message.quoted_message_id || message.quoted_body_snapshot} + +{/if} From 218981e0d088514ce6964953c50c697e03621c71 Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 8 May 2026 15:23:10 +0100 Subject: [PATCH 4/7] refactor: extract thread and modal components --- apps/web/src/ChatApp.svelte | 311 +++--------------- .../src/components/media/ImageViewer.svelte | 25 ++ .../src/components/profile/ProfilePane.svelte | 88 +++++ .../profile/ProfileSettingsModal.svelte | 101 ++++++ .../src/components/thread/ThreadPanel.svelte | 159 +++++++++ 5 files changed, 417 insertions(+), 267 deletions(-) create mode 100644 apps/web/src/components/media/ImageViewer.svelte create mode 100644 apps/web/src/components/profile/ProfilePane.svelte create mode 100644 apps/web/src/components/profile/ProfileSettingsModal.svelte create mode 100644 apps/web/src/components/thread/ThreadPanel.svelte diff --git a/apps/web/src/ChatApp.svelte b/apps/web/src/ChatApp.svelte index 1eb9fbf..e00cf65 100644 --- a/apps/web/src/ChatApp.svelte +++ b/apps/web/src/ChatApp.svelte @@ -2,7 +2,6 @@ import { onDestroy, onMount, tick } from "svelte"; import { APIError, api } from "./lib/api"; import { gifLibrary } from "./lib/gifs"; - import { quoteSnippet, quotedAuthorName } from "./lib/chat/messages"; import { avatarHue, avatarInitial, @@ -14,11 +13,13 @@ workspaceInitial, } from "./lib/chat/people"; import { redirectTypingToComposer } from "./lib/chat/typeToFocus"; - import { markdown, time } from "./lib/format"; - import { uploadURL } from "./lib/uploads"; import ChatComposer from "./components/composer/ChatComposer.svelte"; - import MediaAttachment from "./components/MediaAttachment.svelte"; + import ImageViewer from "./components/media/ImageViewer.svelte"; import MessageList from "./components/messages/MessageList.svelte"; + import ProfilePane from "./components/profile/ProfilePane.svelte"; + import ProfileSettingsModal from "./components/profile/ProfileSettingsModal.svelte"; + import ThreadPanel from "./components/thread/ThreadPanel.svelte"; + import { time } from "./lib/format"; import type { Channel, DirectConversation, Message, RealtimeEvent, SearchResult, ThreadState, Upload, User, Workspace } from "./lib/types"; let user: User | null = null; @@ -944,208 +945,35 @@ {#if showProfileSettings && user} - + (profileDisplayName = value)} + onHandle={(value) => (profileHandle = value)} + onAvatarURL={(value) => (profileAvatarURL = value)} + onClose={closeModal} + onSave={() => void saveProfile()} + /> {/if} {#if selectedImage} - + {/if} {/if} diff --git a/apps/web/src/components/media/ImageViewer.svelte b/apps/web/src/components/media/ImageViewer.svelte new file mode 100644 index 0000000..c56ebca --- /dev/null +++ b/apps/web/src/components/media/ImageViewer.svelte @@ -0,0 +1,25 @@ + + + diff --git a/apps/web/src/components/profile/ProfilePane.svelte b/apps/web/src/components/profile/ProfilePane.svelte new file mode 100644 index 0000000..b74b2c2 --- /dev/null +++ b/apps/web/src/components/profile/ProfilePane.svelte @@ -0,0 +1,88 @@ + + +
    +
    +

    Profile

    + {profile.display_name} +
    + +
    +
    +
    + + {#if profile.avatar_url} + + {:else} + {avatarInitial(profile.display_name)} + {/if} + +
    +
    +
    +
    +

    {profile.display_name}

    + {#if profile.handle}{handleLabel(profile.handle)}{/if} +
    + {#if currentUser?.id === profile.id} + + {/if} +
    +
    + + Active +
    +
    + {#if currentUser?.id !== profile.id} + + {/if} + +
    +
    +
    + Contact information + {#if currentUser?.id === profile.id} + + {/if} +
    +
    + +
    + Handle + {profile.handle ? handleLabel(profile.handle) : "No handle set"} +
    +
    +
    + +
    + User ID + {profile.id} +
    +
    +
    +
    +
    + About +
    +

    Member of {workspaceName || "this workspace"}. Click Message to keep the conversation in your sidebar.

    +
    +
    +
    diff --git a/apps/web/src/components/profile/ProfileSettingsModal.svelte b/apps/web/src/components/profile/ProfileSettingsModal.svelte new file mode 100644 index 0000000..857c7c0 --- /dev/null +++ b/apps/web/src/components/profile/ProfileSettingsModal.svelte @@ -0,0 +1,101 @@ + + + diff --git a/apps/web/src/components/thread/ThreadPanel.svelte b/apps/web/src/components/thread/ThreadPanel.svelte new file mode 100644 index 0000000..bced9ba --- /dev/null +++ b/apps/web/src/components/thread/ThreadPanel.svelte @@ -0,0 +1,159 @@ + + +
    +
    +

    Thread

    + {threadState?.reply_count ?? replies.length} {(threadState?.reply_count ?? replies.length) === 1 ? "reply" : "replies"} +
    + +
    +
    +
    +
    + {#if root.author?.avatar_url} + + {:else} + {avatarInitial(root.author?.display_name)} + {/if} +
    +
    +
    + {root.author?.display_name || "Local User"} + {#if root.author?.handle}{handleLabel(root.author.handle)}{/if} + + +
    +
    {@html markdown(root.body)}
    + {#if root.attachments?.length} +
    + {#each root.attachments as attachment (attachment.id)} + + {/each} +
    + {/if} +
    +
    +
    {replies.length} {replies.length === 1 ? "reply" : "replies"}
    +
    + {#each replies as reply (reply.id)} +
    +
    + {#if reply.author?.avatar_url} + + {:else} + {avatarInitial(reply.author?.display_name)} + {/if} +
    +
    +
    + {reply.author?.display_name || "Local User"} + {#if reply.author?.handle}{handleLabel(reply.author.handle)}{/if} + + +
    + +
    {@html markdown(reply.body)}
    + {#if reply.attachments?.length} +
    + {#each reply.attachments as attachment (attachment.id)} + + {/each} +
    + {/if} +
    +
    + {/each} +
    +
    + From f830966b7728dcbb63598991f1c556fa61a8db12 Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 8 May 2026 15:25:36 +0100 Subject: [PATCH 5/7] refactor: extract navigation components --- apps/web/src/ChatApp.svelte | 451 +++++------------- .../components/navigation/ChannelList.svelte | 59 +++ .../navigation/DirectMessageList.svelte | 69 +++ .../components/navigation/GuildRail.svelte | 64 +++ .../src/components/navigation/Sidebar.svelte | 169 +++++++ .../components/search/SearchResults.svelte | 40 ++ apps/web/src/components/topbar/Topbar.svelte | 88 ++++ 7 files changed, 599 insertions(+), 341 deletions(-) create mode 100644 apps/web/src/components/navigation/ChannelList.svelte create mode 100644 apps/web/src/components/navigation/DirectMessageList.svelte create mode 100644 apps/web/src/components/navigation/GuildRail.svelte create mode 100644 apps/web/src/components/navigation/Sidebar.svelte create mode 100644 apps/web/src/components/search/SearchResults.svelte create mode 100644 apps/web/src/components/topbar/Topbar.svelte diff --git a/apps/web/src/ChatApp.svelte b/apps/web/src/ChatApp.svelte index e00cf65..4145d7f 100644 --- a/apps/web/src/ChatApp.svelte +++ b/apps/web/src/ChatApp.svelte @@ -2,24 +2,18 @@ import { onDestroy, onMount, tick } from "svelte"; import { APIError, api } from "./lib/api"; import { gifLibrary } from "./lib/gifs"; - import { - avatarHue, - avatarInitial, - collectRecentPeople, - directConversationForUser, - dmAvatarUser, - dmTitle, - handleLabel, - workspaceInitial, - } from "./lib/chat/people"; + import { collectRecentPeople, dmTitle } from "./lib/chat/people"; import { redirectTypingToComposer } from "./lib/chat/typeToFocus"; import ChatComposer from "./components/composer/ChatComposer.svelte"; import ImageViewer from "./components/media/ImageViewer.svelte"; import MessageList from "./components/messages/MessageList.svelte"; + import GuildRail from "./components/navigation/GuildRail.svelte"; + import Sidebar from "./components/navigation/Sidebar.svelte"; import ProfilePane from "./components/profile/ProfilePane.svelte"; import ProfileSettingsModal from "./components/profile/ProfileSettingsModal.svelte"; + import SearchResults from "./components/search/SearchResults.svelte"; import ThreadPanel from "./components/thread/ThreadPanel.svelte"; - import { time } from "./lib/format"; + import Topbar from "./components/topbar/Topbar.svelte"; import type { Channel, DirectConversation, Message, RealtimeEvent, SearchResult, ThreadState, Upload, User, Workspace } from "./lib/types"; let user: User | null = null; @@ -170,6 +164,13 @@ connectRealtime(); } + async function selectWorkspace(workspaceID: string) { + selectedWorkspaceID = workspaceID; + await loadChannels(); + await loadDirectConversations(); + connectRealtime(); + } + async function loadChannels() { if (!selectedWorkspaceID) return; const data = await api<{ channels: Channel[] }>(`/api/workspaces/${selectedWorkspaceID}/channels`); @@ -195,6 +196,16 @@ await loadMessages(); } + async function selectChannel(channelID: string) { + selectedChannelID = channelID; + selectedDirectID = ""; + selectedThread = null; + selectedProfile = null; + activeComposerContext = "message"; + mobileNavOpen = false; + await loadMessages(); + } + async function loadMessages() { if (selectedDirectID) { const data = await api<{ messages: Message[] }>(`/api/dms/${selectedDirectID}/messages`); @@ -322,6 +333,25 @@ searchResults = data.results; } + function resetSearch() { + searchQuery = ""; + searchResults = []; + } + + async function openSearchResult(result: SearchResult) { + searchResults = []; + if (result.message.channel_id) { + selectedChannelID = result.message.channel_id; + selectedDirectID = ""; + await loadMessages(); + } + if (result.message.direct_conversation_id) { + selectedDirectID = result.message.direct_conversation_id; + selectedChannelID = ""; + await loadMessages(); + } + } + async function uploadFile(event: Event) { const input = event.currentTarget as HTMLInputElement; const file = input.files?.[0]; @@ -356,6 +386,16 @@ await loadMessages(); } + async function selectDirectConversation(conversationID: string) { + selectedDirectID = conversationID; + selectedChannelID = ""; + selectedThread = null; + selectedProfile = null; + activeComposerContext = "message"; + mobileNavOpen = false; + await loadMessages(); + } + async function startDirectWithUser(memberID: string) { if (!selectedWorkspaceID || !memberID) return; const existing = directConversations.find((conversation) => @@ -495,6 +535,11 @@ replies = []; } + function toggleSidePanelFromTopbar() { + if (sidePanelOpen) closeSidePanel(); + else status = "pick a message to open its thread"; + } + function closeModal() { selectedImage = null; showProfileSettings = false; @@ -565,339 +610,63 @@ {#if mobileNavOpen}×{:else}{/if} - + void selectWorkspace(workspaceID)} + onToggleWorkspaceCreate={() => (showWorkspaceCreate = !showWorkspaceCreate)} + onWorkspaceName={(value) => (workspaceName = value)} + onCreateWorkspace={() => void createWorkspace()} + /> - + (sidebarCollapsed = !sidebarCollapsed)} + onSelectChannel={(channelID) => void selectChannel(channelID)} + onChannelName={(value) => (channelName = value)} + onCreateChannel={() => void createChannel()} + onSelectDirect={(conversationID) => void selectDirectConversation(conversationID)} + onDirectMemberID={(value) => (directMemberID = value)} + onCreateDirect={() => void createDirectConversation()} + onOpenProfile={openUserProfile} + onOpenSettings={openProfileSettings} + />
    -
    -
    - {#if selectedDirect} -

    {`@${dmTitle(selectedDirect, user?.id)}`}

    - {:else if selectedChannel} -

    {`#${selectedChannel.name}`}

    - {:else} -

    ClickClack

    - {/if} - -

    {selectedWorkspace?.name || "no workspace"}

    -
    - -
    - - -
    -
    - - {#if searchResults.length > 0} -
    -
    - {searchResults.length} {searchResults.length === 1 ? "result" : "results"} - -
    - {#each searchResults as result (result.message.id)} - - {/each} -
    - {/if} + (searchQuery = value)} + onSearch={() => void searchMessages()} + onResetSearch={resetSearch} + onToggleThread={toggleSidePanelFromTopbar} + onPinnedItems={() => (status = "no pinned items")} + /> + + (searchResults = [])} + onOpenResult={(result) => void openSearchResult(result)} + /> + import type { Channel } from "../../lib/types"; + + type Props = { + channels: Channel[]; + selectedChannelID: string; + selectedDirectID: string; + channelName: string; + onSelectChannel: (channelID: string) => void; + onChannelName: (value: string) => void; + onCreateChannel: () => void; + }; + + let { + channels, + selectedChannelID, + selectedDirectID, + channelName, + onSelectChannel, + onChannelName, + onCreateChannel, + }: Props = $props(); + + + diff --git a/apps/web/src/components/navigation/DirectMessageList.svelte b/apps/web/src/components/navigation/DirectMessageList.svelte new file mode 100644 index 0000000..87fc61a --- /dev/null +++ b/apps/web/src/components/navigation/DirectMessageList.svelte @@ -0,0 +1,69 @@ + + + diff --git a/apps/web/src/components/navigation/GuildRail.svelte b/apps/web/src/components/navigation/GuildRail.svelte new file mode 100644 index 0000000..eaf478a --- /dev/null +++ b/apps/web/src/components/navigation/GuildRail.svelte @@ -0,0 +1,64 @@ + + + diff --git a/apps/web/src/components/navigation/Sidebar.svelte b/apps/web/src/components/navigation/Sidebar.svelte new file mode 100644 index 0000000..9c85087 --- /dev/null +++ b/apps/web/src/components/navigation/Sidebar.svelte @@ -0,0 +1,169 @@ + + + diff --git a/apps/web/src/components/search/SearchResults.svelte b/apps/web/src/components/search/SearchResults.svelte new file mode 100644 index 0000000..dc59b98 --- /dev/null +++ b/apps/web/src/components/search/SearchResults.svelte @@ -0,0 +1,40 @@ + + +{#if results.length > 0} +
    +
    + {results.length} {results.length === 1 ? "result" : "results"} + +
    + {#each results as result (result.message.id)} + + {/each} +
    +{/if} diff --git a/apps/web/src/components/topbar/Topbar.svelte b/apps/web/src/components/topbar/Topbar.svelte new file mode 100644 index 0000000..e39f6d1 --- /dev/null +++ b/apps/web/src/components/topbar/Topbar.svelte @@ -0,0 +1,88 @@ + + +
    +
    + {#if selectedDirect} +

    {`@${dmTitle(selectedDirect, currentUserID)}`}

    + {:else if selectedChannel} +

    {`#${selectedChannel.name}`}

    + {:else} +

    ClickClack

    + {/if} + +

    {workspaceName || "no workspace"}

    +
    + +
    + + +
    +
    From 8b5dd9c8e0d73472cfba8d8e99c9dac0d559a411 Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 8 May 2026 15:27:07 +0100 Subject: [PATCH 6/7] refactor: split chat styles --- apps/web/src/styles.css | 2944 +----------------------------- apps/web/src/styles/base.css | 121 ++ apps/web/src/styles/composer.css | 349 ++++ apps/web/src/styles/layout.css | 402 ++++ apps/web/src/styles/messages.css | 643 +++++++ apps/web/src/styles/modals.css | 620 +++++++ apps/web/src/styles/sidebar.css | 476 +++++ apps/web/src/styles/thread.css | 326 ++++ 8 files changed, 2944 insertions(+), 2937 deletions(-) create mode 100644 apps/web/src/styles/base.css create mode 100644 apps/web/src/styles/composer.css create mode 100644 apps/web/src/styles/layout.css create mode 100644 apps/web/src/styles/messages.css create mode 100644 apps/web/src/styles/modals.css create mode 100644 apps/web/src/styles/sidebar.css create mode 100644 apps/web/src/styles/thread.css diff --git a/apps/web/src/styles.css b/apps/web/src/styles.css index 455861d..d48eeda 100644 --- a/apps/web/src/styles.css +++ b/apps/web/src/styles.css @@ -1,2937 +1,7 @@ -:root { - color-scheme: light dark; - font-family: - "Inter", - "SF Pro Text", - ui-sans-serif, - system-ui, - -apple-system, - BlinkMacSystemFont, - "Segoe UI", - sans-serif; - font-feature-settings: "ss01", "cv11"; - --rail: #e9e1d7; - --bg: #f7f3ed; - --panel: #fffaf2; - --panel-2: #efe7dc; - --panel-3: #e4dbcf; - --hover: rgba(16, 32, 39, 0.05); - --hover-strong: rgba(16, 32, 39, 0.08); - --line: rgba(16, 32, 39, 0.1); - --line-strong: rgba(16, 32, 39, 0.16); - --text: #22201d; - --text-strong: #11100e; - --muted: #6f675f; - --muted-2: #958b80; - --accent: #dd5d45; - --accent-2: #006d77; - --accent-soft: rgba(221, 93, 69, 0.16); - --accent-glow: 0 0 0 1px rgba(221, 93, 69, 0.28), 0 8px 30px -12px rgba(221, 93, 69, 0.45); - --success: #168b51; - --warn: #f5b050; - --danger: #c84343; - --shadow: 0 24px 60px -24px rgba(16, 32, 39, 0.32); - --radius-sm: 6px; - --radius: 8px; - --radius-lg: 14px; - --radius-xl: 18px; - background: var(--bg); - color: var(--text); -} - -@media (prefers-color-scheme: dark) { - :root { - --rail: #0d0e12; - --bg: #131419; - --panel: #1a1b22; - --panel-2: #20222b; - --panel-3: #272a35; - --hover: rgba(255, 255, 255, 0.04); - --hover-strong: rgba(255, 255, 255, 0.07); - --line: rgba(255, 255, 255, 0.07); - --line-strong: rgba(255, 255, 255, 0.12); - --text: #e7e9ee; - --text-strong: #ffffff; - --muted: #8a8f9c; - --muted-2: #5d626d; - --accent: #6f7eff; - --accent-2: #5666ee; - --accent-soft: rgba(111, 126, 255, 0.18); - --accent-glow: 0 0 0 1px rgba(111, 126, 255, 0.4), 0 8px 30px -12px rgba(111, 126, 255, 0.6); - --success: #2ecc71; - --warn: #f5b050; - --danger: #ff6b6b; - --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6); - } -} - -* { - box-sizing: border-box; -} - -html, -body { - margin: 0; - padding: 0; - height: 100%; -} - -body { - background: - radial-gradient(1000px 600px at 0% 0%, rgba(111, 126, 255, 0.08), transparent 60%), - radial-gradient(900px 700px at 100% 100%, rgba(255, 130, 200, 0.05), transparent 60%), var(--bg); - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -button, -input, -textarea { - font: inherit; - color: inherit; -} - -button { - cursor: pointer; -} - -input, -textarea { - background: transparent; - border: 0; - outline: 0; -} - -::-webkit-scrollbar { - width: 10px; - height: 10px; -} - -::-webkit-scrollbar-thumb { - background: rgba(255, 255, 255, 0.06); - border-radius: 999px; - border: 2px solid transparent; - background-clip: content-box; -} - -::-webkit-scrollbar-thumb:hover { - background: rgba(255, 255, 255, 0.12); - background-clip: content-box; -} - -/* ---------- AUTH ---------- */ - -.auth-shell { - display: grid; - min-height: 100vh; - place-items: center; - padding: 32px; - background: - radial-gradient(700px 500px at 30% 20%, rgba(111, 126, 255, 0.18), transparent 60%), - radial-gradient(700px 500px at 80% 90%, rgba(255, 110, 196, 0.12), transparent 60%), var(--bg); -} - -.auth-panel { - display: grid; - gap: 22px; - width: min(100%, 440px); - border: 1px solid var(--line-strong); - border-radius: var(--radius-xl); - background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)) - var(--panel); - box-shadow: var(--shadow); - padding: 36px; -} - -.auth-brand { - display: flex; - align-items: center; - gap: 12px; -} - -.auth-brand .mark { - width: 44px; - height: 44px; - display: grid; - place-items: center; - border-radius: 12px; - background: linear-gradient(135deg, var(--accent), #b46cff); - color: white; - font-weight: 800; - letter-spacing: -0.02em; - box-shadow: 0 10px 24px -8px rgba(111, 126, 255, 0.7); -} - -.auth-brand .brand-text strong { - display: block; - color: var(--text-strong); - letter-spacing: -0.01em; -} - -.auth-brand .brand-text span { - display: block; - color: var(--muted); - font-size: 12px; -} - -.auth-copy { - display: grid; - gap: 8px; - margin-top: 8px; -} - -.auth-copy h1 { - margin: 0; - font-size: 28px; - letter-spacing: -0.02em; - color: var(--text-strong); -} - -.auth-copy p { - margin: 0; - color: var(--muted); - line-height: 1.5; -} - -.github-login { - display: inline-flex; - align-items: center; - justify-content: center; - gap: 10px; - min-height: 46px; - border-radius: 12px; - background: #0d1117; - color: white; - font-weight: 600; - text-decoration: none; - border: 1px solid #2b2f36; - transition: - transform 80ms ease, - background 120ms ease, - border-color 120ms ease; -} - -.github-login:hover { - background: #161b22; - border-color: #3f4750; - transform: translateY(-1px); -} - -.auth-foot { - margin: 0; - color: var(--muted-2); - font-size: 12px; - text-align: center; -} - -/* ---------- SHELL ---------- */ - -.shell { - display: grid; - grid-template-columns: 72px 260px minmax(0, 1fr) 0; - height: 100vh; - min-height: 100vh; - overflow: hidden; - transition: grid-template-columns 220ms cubic-bezier(0.2, 0.8, 0.2, 1); -} - -.shell.thread-open { - grid-template-columns: 72px 260px minmax(0, 1fr) minmax(340px, 28vw); -} - -.shell.sidebar-collapsed { - grid-template-columns: 72px 0 minmax(0, 1fr) 0; -} - -.shell.sidebar-collapsed.thread-open { - grid-template-columns: 72px 0 minmax(0, 1fr) minmax(340px, 28vw); -} - -/* ---------- GUILD RAIL (Discord style) ---------- */ - -.guild-rail { - display: flex; - flex-direction: column; - align-items: center; - gap: 8px; - padding: 14px 0; - background: var(--rail); - border-right: 1px solid var(--line); - overflow-y: auto; - position: relative; -} - -.guild-rail .guild { - width: 48px; - height: 48px; - border-radius: 16px; - display: grid; - place-items: center; - background: var(--panel-2); - color: var(--text); - border: 0; - font-weight: 700; - font-size: 14px; - letter-spacing: -0.02em; - position: relative; - transition: - border-radius 140ms ease, - background 120ms ease, - transform 120ms ease; - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset; -} - -.guild-rail .guild:hover { - border-radius: 12px; - background: var(--accent); - color: white; - box-shadow: 0 8px 24px -10px rgba(111, 126, 255, 0.6); -} - -.guild-rail .guild.home { - background: linear-gradient(135deg, var(--accent), #b46cff); - color: white; - font-weight: 800; -} - -.guild-rail .guild.home:hover { - border-radius: 12px; - filter: brightness(1.1); -} - -.guild-rail .guild.add { - background: transparent; - color: var(--success); - border: 1px dashed rgba(46, 204, 113, 0.4); -} - -.guild-rail .guild.add:hover { - background: rgba(46, 204, 113, 0.12); - color: white; - border-style: solid; - border-color: var(--success); -} - -.guild-divider { - width: 36px; - height: 1px; - background: var(--line-strong); - margin: 4px 0; -} - -.guild-list { - display: flex; - flex-direction: column; - align-items: center; - gap: 8px; -} - -.guild-wrap { - position: relative; -} - -.guild-wrap::before { - content: ""; - position: absolute; - left: -14px; - top: 50%; - transform: translate(0, -50%) scaleY(0.2); - width: 4px; - height: 28px; - border-radius: 0 4px 4px 0; - background: var(--text-strong); - opacity: 0; - transition: - opacity 140ms ease, - transform 140ms ease; -} - -.guild-wrap:hover::before { - opacity: 0.6; - transform: translate(0, -50%) scaleY(0.5); -} - -.guild-wrap.active::before { - opacity: 1; - transform: translate(0, -50%) scaleY(1); -} - -.guild-wrap.active .guild { - border-radius: 14px; - background: var(--accent); - color: white; -} - -.guild-create { - position: absolute; - left: 100%; - top: 14px; - margin-left: 8px; - background: var(--panel); - border: 1px solid var(--line-strong); - border-radius: var(--radius); - padding: 8px; - box-shadow: var(--shadow); - z-index: 20; -} - -.guild-create input { - height: 32px; - padding: 0 10px; - width: 200px; - border-radius: var(--radius-sm); - background: var(--panel-2); - color: var(--text); -} - -/* ---------- SIDEBAR (Slack style) ---------- */ - -.sidebar { - display: grid; - grid-template-rows: auto minmax(0, 1fr) auto; - background: var(--panel); - border-right: 1px solid var(--line); - overflow: hidden; - min-width: 0; - transition: - opacity 160ms ease, - transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1); -} - -.sidebar-collapsed .sidebar { - opacity: 0; - pointer-events: none; - transform: translateX(-14px); -} - -.workspace-header { - padding: 14px 16px; - border-bottom: 1px solid var(--line); - display: flex; - align-items: center; - justify-content: space-between; - min-height: 60px; -} - -.sidebar-collapse { - width: 30px; - height: 30px; - display: grid; - place-items: center; - border: 0; - border-radius: 8px; - background: var(--panel-2); - color: var(--muted); - transition: - color 120ms ease, - background 120ms ease, - transform 120ms ease; -} - -.sidebar-collapse:hover { - background: var(--panel-3); - color: var(--text-strong); - transform: translateX(-1px); -} - -.workspace-name { - display: flex; - flex-direction: column; - gap: 2px; - min-width: 0; -} - -.workspace-name strong { - color: var(--text-strong); - letter-spacing: -0.01em; - font-size: 15px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.workspace-name .presence { - display: inline-flex; - align-items: center; - gap: 6px; - color: var(--muted); - font-size: 11px; -} - -.workspace-name .presence::before { - content: ""; - width: 7px; - height: 7px; - border-radius: 50%; - background: var(--muted-2); -} - -.workspace-name .presence.online { - color: var(--success); -} - -.workspace-name .presence.online::before { - background: var(--success); - box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.18); -} - -.sidebar-scroll { - overflow-y: auto; - padding: 12px 8px 16px; -} - -.nav-section + .nav-section { - margin-top: 12px; -} - -.section-title { - display: flex; - align-items: center; - gap: 6px; - width: 100%; - border: 0; - background: transparent; - color: var(--muted); - text-transform: uppercase; - font-size: 11px; - font-weight: 700; - letter-spacing: 0.04em; - padding: 6px 8px; - border-radius: var(--radius-sm); -} - -.section-title:hover { - color: var(--text); - background: var(--hover); -} - -.section-title .caret { - font-size: 10px; - opacity: 0.7; -} - -.section-title .label { - flex: 1; - text-align: left; -} - -.section-title .add-button { - width: 18px; - height: 18px; - border-radius: 4px; - display: grid; - place-items: center; - font-size: 14px; - font-weight: 700; - background: rgba(255, 255, 255, 0.06); - color: var(--text); -} - -.section-title:hover .add-button { - background: var(--accent); - color: white; -} - -.nav-list { - display: flex; - flex-direction: column; - gap: 1px; - margin-top: 4px; -} - -.nav-item { - display: flex; - align-items: center; - gap: 8px; - width: 100%; - border: 0; - border-radius: var(--radius-sm); - background: transparent; - color: var(--muted); - text-align: left; - padding: 6px 10px; - min-height: 30px; - transition: - background 100ms ease, - color 100ms ease; -} - -.nav-item:hover { - background: var(--hover); - color: var(--text); -} - -.nav-item.active { - background: var(--accent-soft); - color: var(--text-strong); -} - -.nav-item .hash { - color: var(--muted); - font-weight: 600; - width: 14px; - text-align: center; -} - -.nav-item.active .hash { - color: var(--accent); -} - -.nav-label { - flex: 1; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - font-size: 14px; -} - -.nav-empty { - margin: 4px 8px; - color: var(--muted-2); - font-size: 12px; -} - -.dm-avatar { - width: 22px; - height: 22px; - border-radius: 50%; - display: grid; - place-items: center; - font-size: 11px; - font-weight: 700; - color: white; - background: linear-gradient( - 135deg, - hsl(var(--hue, 220deg) 70% 55%), - hsl(calc(var(--hue, 220deg) + 40deg) 70% 45%) - ); - flex-shrink: 0; - overflow: hidden; -} - -.dm-avatar img, -.avatar img { - width: 100%; - height: 100%; - display: block; - object-fit: cover; -} - -.presence-dot { - width: 8px; - height: 8px; - border-radius: 50%; - background: var(--muted-2); - flex-shrink: 0; -} - -.presence-dot.active { - background: var(--success); - box-shadow: 0 0 0 2px var(--panel); -} - -.inline-create { - display: grid; - grid-template-columns: minmax(0, 1fr) auto; - gap: 6px; - margin: 6px 4px 2px; -} - -.inline-create input { - width: 100%; - min-width: 0; - height: 30px; - padding: 0 10px; - border-radius: var(--radius-sm); - background: var(--panel-2); - color: var(--text); - border: 1px solid var(--line); -} - -.inline-create input:focus { - border-color: var(--accent); - background: var(--panel-3); -} - -.inline-create button.ghost, -button.ghost { - width: 30px; - height: 30px; - border: 0; - border-radius: var(--radius-sm); - background: var(--panel-3); - color: var(--muted); - font-weight: 600; - padding: 0; - font-size: 14px; - display: grid; - place-items: center; -} - -.inline-create button.ghost:hover { - background: var(--accent); - color: white; -} - -.user-card { - display: flex; - align-items: center; - gap: 10px; - width: 100%; - padding: 10px 12px; - background: var(--panel-2); - border-top: 1px solid var(--line); - border-right: 0; - border-bottom: 0; - border-left: 0; - color: inherit; - text-align: left; - cursor: pointer; - transition: background 120ms ease; -} - -.user-card:hover { - background: var(--panel-3); -} - -.user-card .dm-avatar { - width: 28px; - height: 28px; - font-size: 12px; -} - -.user-card .user-meta { - flex: 1; - min-width: 0; -} - -.user-card .user-meta strong { - display: block; - color: var(--text-strong); - font-size: 13px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.user-card .user-meta span { - display: block; - color: var(--muted); - font-size: 11px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -/* ---------- TIMELINE ---------- */ - -.timeline { - display: flex; - flex-direction: column; - min-width: 0; - background: var(--bg); - overflow: hidden; -} - -.timeline > * { - min-width: 0; - flex-shrink: 0; -} - -.timeline > .messages { - flex: 1 1 0; - min-height: 0; -} - -.topbar { - display: flex; - align-items: center; - gap: 14px; - padding: 12px 20px; - min-height: 60px; - border-bottom: 1px solid var(--line); - background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent), var(--bg); -} - -.topbar-title { - display: flex; - align-items: center; - gap: 10px; - min-width: 0; - flex: 1; -} - -.topbar-title h1 { - margin: 0; - font-size: 16px; - font-weight: 700; - letter-spacing: -0.01em; - color: var(--text-strong); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.topbar-title h1.with-glyph::first-letter { - color: var(--muted); - margin-right: 1px; -} - -.topbar-divider { - width: 1px; - height: 18px; - background: var(--line-strong); - margin: 0 6px; -} - -.topbar-meta { - margin: 0; - color: var(--muted); - font-size: 12px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.search { - display: flex; - align-items: center; - gap: 8px; - width: min(280px, 30vw); - height: 34px; - padding: 0 10px; - border-radius: var(--radius); - background: var(--panel); - border: 1px solid var(--line); - color: var(--muted); - transition: - border-color 120ms ease, - background 120ms ease; -} - -.search:focus-within { - border-color: var(--accent); - background: var(--panel-2); - color: var(--text); -} - -.search input { - flex: 1; - min-width: 0; - height: 100%; - color: var(--text); -} - -.search input::placeholder { - color: var(--muted); -} - -.search-clear { - width: 18px; - height: 18px; - border-radius: 50%; - border: 0; - background: var(--panel-3); - color: var(--muted); - display: grid; - place-items: center; - font-size: 14px; - line-height: 1; -} - -.search-clear:hover { - background: var(--accent); - color: white; -} - -.search-submit { - height: 22px; - padding: 0 8px; - border: 0; - border-radius: 5px; - background: var(--accent-soft); - color: var(--accent); - font-size: 10.5px; - font-weight: 700; - letter-spacing: 0.04em; - text-transform: uppercase; -} - -.search-submit:hover { - background: var(--accent); - color: white; -} - -.topbar-actions { - display: inline-flex; - align-items: center; - gap: 6px; -} - -.topbar-actions button { - width: 32px; - height: 32px; - display: grid; - place-items: center; - border: 1px solid var(--line); - border-radius: 9px; - background: var(--panel); - color: var(--muted); - transition: - background 120ms ease, - color 120ms ease, - border-color 120ms ease, - transform 80ms ease; -} - -.topbar-actions button:hover, -.topbar-actions button.active { - background: var(--accent-soft); - border-color: color-mix(in srgb, var(--accent) 55%, transparent); - color: var(--accent); -} - -.topbar-actions button:active { - transform: translateY(1px); -} - -@keyframes pulse { - 0%, - 100% { - opacity: 1; - } - 50% { - opacity: 0.5; - } -} - -/* ---------- SEARCH RESULTS ---------- */ - -.search-results { - display: flex; - flex-direction: column; - gap: 2px; - padding: 10px 14px 14px; - border-bottom: 1px solid var(--line); - background: var(--panel); - max-height: 280px; - overflow-y: auto; -} - -.search-results-head { - display: flex; - align-items: center; - justify-content: space-between; - padding: 0 6px 8px; -} - -.search-results-head strong { - color: var(--text-strong); - font-size: 13px; -} - -.search-results-head button { - border: 0; - background: transparent; - color: var(--muted); - font-size: 12px; - padding: 4px 8px; - border-radius: var(--radius-sm); -} - -.search-results-head button:hover { - background: var(--hover); - color: var(--text); -} - -.search-result { - display: flex; - align-items: flex-start; - gap: 10px; - border: 0; - background: transparent; - color: var(--text); - padding: 8px; - border-radius: var(--radius-sm); - text-align: left; -} - -.search-result:hover { - background: var(--hover); -} - -.search-result .dm-avatar { - width: 30px; - height: 30px; - font-size: 13px; -} - -.search-result-body { - display: flex; - flex-direction: column; - gap: 2px; - min-width: 0; - flex: 1; -} - -.search-result-body > div { - display: flex; - align-items: baseline; - gap: 8px; -} - -.search-result-body strong { - color: var(--text-strong); - font-size: 13px; -} - -.search-result-body time { - color: var(--muted); - font-size: 11px; -} - -.search-result-body span { - color: var(--muted); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -/* ---------- MESSAGES ---------- */ - -.messages { - overflow-y: auto; - padding: 16px 4px 24px; - scroll-behavior: smooth; -} - -.empty { - display: grid; - place-items: center; - align-content: center; - text-align: center; - gap: 10px; - min-height: 50vh; - padding: 48px 24px; -} - -.empty-icon { - width: 64px; - height: 64px; - border-radius: 18px; - background: linear-gradient(135deg, var(--accent), #b46cff); - color: white; - display: grid; - place-items: center; - font-size: 26px; - font-weight: 800; - box-shadow: 0 18px 40px -16px rgba(111, 126, 255, 0.7); -} - -.empty strong { - color: var(--text-strong); - font-size: 18px; - letter-spacing: -0.01em; -} - -.empty span { - color: var(--muted); - max-width: 380px; - line-height: 1.5; -} - -.day-divider { - display: flex; - align-items: center; - gap: 12px; - margin: 18px 18px 8px; - position: sticky; - top: 0; - z-index: 1; - pointer-events: none; -} - -.day-divider::before, -.day-divider::after { - content: ""; - flex: 1; - height: 1px; - background: var(--line); -} - -.day-divider span { - background: var(--bg); - border: 1px solid var(--line); - border-radius: 999px; - padding: 4px 12px; - font-size: 11px; - font-weight: 600; - color: var(--muted); - text-transform: uppercase; - letter-spacing: 0.04em; -} - -.message-group { - display: grid; - grid-template-columns: 56px minmax(0, 1fr); - padding: 8px 18px; - position: relative; -} - -.message-group:hover { - background: var(--hover); -} - -.avatar { - width: 38px; - height: 38px; - border-radius: 12px; - display: grid; - place-items: center; - color: white; - font-weight: 700; - font-size: 14px; - background: linear-gradient( - 135deg, - hsl(var(--hue, 220deg) 70% 55%), - hsl(calc(var(--hue, 220deg) + 40deg) 70% 45%) - ); - box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.6); - margin-top: 2px; - overflow: hidden; -} - -.avatar-button { - position: relative; - z-index: 2; - border: 0; - padding: 0; - cursor: pointer; - transition: - transform 100ms ease, - box-shadow 120ms ease, - filter 120ms ease; -} - -.avatar-button:hover { - transform: translateY(-1px); - filter: brightness(1.05); - box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.8); -} - -.avatar.small { - width: 30px; - height: 30px; - font-size: 12px; - border-radius: 10px; -} - -.avatar.large { - width: 56px; - height: 56px; - border-radius: 16px; - font-size: 18px; - margin: 0; -} - -.group-body { - min-width: 0; -} - -.group-body > header { - display: flex; - align-items: baseline; - gap: 8px; - margin-bottom: 2px; -} - -.group-body > header strong { - color: var(--text-strong); - font-size: 14.5px; - letter-spacing: -0.005em; - font-weight: 700; -} - -.author-name { - border: 0; - background: transparent; - color: var(--text-strong); - padding: 0; - border-radius: 4px; - font-size: 14.5px; - letter-spacing: 0; - font-weight: 700; -} - -.author-name:hover { - color: var(--accent); - text-decoration: underline; - text-underline-offset: 2px; -} - -.group-body > header time { - color: var(--muted); - font-size: 11px; -} - -.group-body > header span { - color: var(--muted); - font-size: 12px; -} - -.message-row { - margin-left: -56px; - padding: 1px 0 1px 56px; - position: relative; - border-radius: 0; - transition: background 80ms ease; -} - -.message-row:not(:first-child) { - margin-top: 1px; -} - -.message-row:hover { - background: var(--hover-strong); -} - -.message-row.selected { - background: var(--accent-soft); -} - -.message-row.selected::before { - content: ""; - position: absolute; - left: 0; - top: 0; - bottom: 0; - width: 3px; - background: var(--accent); -} - -.row-stamp { - position: absolute; - left: 8px; - top: 4px; - font-size: 10px; - color: var(--muted-2); - opacity: 0; - font-variant-numeric: tabular-nums; -} - -.message-row:hover .row-stamp { - opacity: 1; -} - -.message-content { - min-width: 0; -} - -.message-actions { - display: flex; - align-items: flex-start; - gap: 4px; - padding-right: 12px; - opacity: 0; - transform: translateY(-50%); - position: absolute; - right: 8px; - top: 0; - background: var(--panel); - border: 1px solid var(--line-strong); - border-radius: 8px; - padding: 2px; - box-shadow: var(--shadow); - transition: - opacity 100ms ease, - transform 100ms ease; -} - -.message-row:hover .message-actions, -.message-row.selected .message-actions { - opacity: 1; -} - -.message-actions button { - width: 28px; - height: 28px; - display: grid; - place-items: center; - border: 0; - border-radius: 6px; - background: transparent; - color: var(--muted); -} - -.message-actions button:hover { - background: var(--hover-strong); - color: var(--text-strong); -} - -.markdown { - line-height: 1.5; - color: var(--text); - font-size: 14.5px; - overflow-wrap: anywhere; - word-break: break-word; -} - -.markdown > :first-child { - margin-top: 0; -} - -.markdown > :last-child { - margin-bottom: 0; -} - -.markdown p { - margin: 0; -} - -.markdown p + p, -.markdown ul, -.markdown ol, -.markdown blockquote, -.markdown pre { - margin-top: 6px; -} - -.markdown a { - color: var(--accent); - text-decoration: none; -} - -.markdown a:hover { - text-decoration: underline; -} - -.markdown code { - background: var(--panel-2); - border: 1px solid var(--line); - border-radius: 4px; - padding: 1px 5px; - font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; - font-size: 0.9em; -} - -.markdown pre { - background: var(--panel-2); - border: 1px solid var(--line); - border-radius: var(--radius); - padding: 12px 14px; - overflow-x: auto; -} - -.markdown pre code { - background: transparent; - border: 0; - padding: 0; -} - -.markdown blockquote { - border-left: 3px solid var(--accent); - margin: 0; - padding: 4px 0 4px 12px; - color: var(--muted); -} - -.markdown ul, -.markdown ol { - padding-left: 22px; -} - -.markdown img { - max-width: 100%; - max-height: 360px; - border-radius: var(--radius); - margin-top: 6px; - border: 1px solid var(--line); - object-fit: contain; - background: var(--panel); - cursor: zoom-in; -} - -.attachment-grid { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); - gap: 8px; - margin-top: 8px; - max-width: 560px; -} - -.attachment-grid.compact { - grid-template-columns: minmax(0, 1fr); - max-width: 420px; -} - -.media-tile { - position: relative; - display: block; - width: 100%; - margin: 0; - padding: 0; - border: 1px solid var(--line); - border-radius: var(--radius-lg); - background: #0a0c12; - overflow: hidden; - isolation: isolate; - text-align: left; - color: inherit; - text-decoration: none; - cursor: pointer; - transition: - border-color 140ms ease, - transform 140ms ease, - box-shadow 140ms ease; -} - -.media-tile:hover { - border-color: var(--line-strong); - box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.9); -} - -.media-tile:focus-visible { - outline: none; - border-color: var(--line-strong); - box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); -} - -.media-tile--image { - cursor: zoom-in; -} - -.media-tile__open { - display: block; - width: 100%; - margin: 0; - padding: 0; - border: 0; - background: transparent; - color: inherit; - cursor: zoom-in; -} - -.media-tile__open:focus { - outline: 0; -} - -.media-tile__open:focus-visible + .media-tile__caption .media-tile__name { - text-decoration: underline; - text-decoration-thickness: 1px; - text-underline-offset: 3px; -} - -.media-tile--video { - cursor: default; -} - -.media-tile img, -.media-tile video { - display: block; - width: 100%; - max-height: 360px; - object-fit: contain; - background: #05070d; -} - -.media-tile--image img { - max-height: 320px; -} - -.media-tile__caption { - position: absolute; - inset: auto 0 0 0; - z-index: 3; - display: flex; - align-items: center; - gap: 8px; - padding: 22px 10px 8px; - background: linear-gradient( - to top, - rgba(0, 0, 0, 0.78) 0%, - rgba(0, 0, 0, 0.5) 40%, - rgba(0, 0, 0, 0) 100% - ); - opacity: 0; - pointer-events: auto; - transition: opacity 140ms ease; -} - -.media-tile:hover .media-tile__caption, -.media-tile:focus-within .media-tile__caption { - opacity: 1; -} - -.media-tile--video.is-started .media-tile__caption { - display: none; -} - -.media-tile__name { - flex: 1; - min-width: 0; - color: white; - font-size: 12px; - font-weight: 500; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); -} - -.media-tile__chip { - position: relative; - z-index: 4; - display: inline-grid; - place-items: center; - width: 28px; - height: 28px; - flex: none; - border-radius: 8px; - background: rgba(0, 0, 0, 0.5); - color: white; - border: 1px solid rgba(255, 255, 255, 0.18); - backdrop-filter: blur(10px); - text-decoration: none; - transition: - background 120ms ease, - border-color 120ms ease, - transform 120ms ease; -} - -.media-tile__chip:hover { - background: rgba(0, 0, 0, 0.7); - border-color: rgba(255, 255, 255, 0.32); - transform: translateY(-1px); -} - -.media-tile__play { - position: absolute; - inset: 0 0 48px 0; - display: grid; - place-items: center; - width: 100%; - height: auto; - border: 0; - margin: 0; - padding: 0; - background: transparent; - cursor: pointer; - z-index: 1; -} - -.media-tile__play::before { - content: ""; - position: absolute; - inset: 0; - background: radial-gradient( - ellipse at center, - rgba(0, 0, 0, 0.18) 0%, - rgba(0, 0, 0, 0.05) 45%, - rgba(0, 0, 0, 0) 70% - ); - opacity: 0.7; - transition: opacity 160ms ease; - pointer-events: none; -} - -.media-tile__play:hover::before { - opacity: 0.9; -} - -.media-tile__play-icon { - position: relative; - display: grid; - place-items: center; - width: 46px; - height: 46px; - border-radius: 999px; - background: rgba(0, 0, 0, 0.55); - color: white; - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.55); - padding-left: 3px; /* optical centering of the play glyph */ - transition: - transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), - background 180ms ease, - box-shadow 200ms ease; -} - -.media-tile__play-icon svg { - filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); -} - -.media-tile__play:hover .media-tile__play-icon { - transform: scale(1.06); - background: rgba(0, 0, 0, 0.7); - box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.65); -} - -.media-tile__play:active .media-tile__play-icon { - transform: scale(0.97); - transition-duration: 80ms; -} - -.media-tile__play:focus-visible { - outline: none; -} - -.media-tile__play:focus-visible .media-tile__play-icon { - box-shadow: - 0 0 0 2px rgba(255, 255, 255, 0.6), - 0 10px 28px -10px rgba(0, 0, 0, 0.65); -} - -.media-tile__duration { - position: absolute; - left: 8px; - bottom: 8px; - z-index: 2; - padding: 2px 6px; - border-radius: 4px; - background: rgba(0, 0, 0, 0.72); - color: white; - font-size: 11px; - font-variant-numeric: tabular-nums; - font-weight: 600; - letter-spacing: 0.02em; - pointer-events: none; -} - -.file-attachment { - display: flex; - align-items: center; - gap: 10px; - max-width: 360px; - padding: 10px; - border: 1px solid var(--line); - border-radius: var(--radius); - background: var(--panel); -} - -.file-attachment:hover { - border-color: var(--line-strong); - background: var(--panel-2); -} - -.file-icon { - width: 34px; - height: 34px; - display: grid; - place-items: center; - border-radius: 8px; - background: var(--accent-soft); - color: var(--accent); - font-weight: 800; -} - -.file-attachment strong, -.file-attachment small { - display: block; -} - -.file-attachment strong { - color: var(--text-strong); - font-size: 13px; -} - -.file-attachment small { - color: var(--muted); - font-size: 11px; -} - -/* ---------- COMPOSER ---------- */ - -.composer { - padding: 18px 18px 10px; - background: var(--bg); - display: grid; - gap: 0; - position: relative; -} - -.composer-card { - display: flex; - flex-direction: column; - background: var(--panel); - border: 1px solid var(--line-strong); - border-radius: var(--radius-lg); - overflow: hidden; - transition: - border-color 120ms ease, - box-shadow 120ms ease; -} - -.composer:focus-within .composer-card { - border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong)); - box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); -} - -.composer-toolbar { - display: inline-flex; - align-items: center; - gap: 2px; - width: 100%; - padding: 4px 6px; - margin: 0; - border: 0; - border-top: 1px solid var(--line); - border-radius: 0; - background: color-mix(in srgb, var(--panel-2) 35%, transparent); - box-shadow: none; -} - -.composer-toolbar button { - min-width: 28px; - height: 26px; - display: grid; - place-items: center; - border: 0; - border-radius: 6px; - background: transparent; - color: var(--text); - opacity: 0.78; - font-size: 11.5px; - font-weight: 700; - transition: - background 100ms ease, - color 100ms ease, - opacity 100ms ease, - transform 80ms ease; -} - -.composer-toolbar button:hover { - background: var(--hover-strong); - color: var(--text-strong); - opacity: 1; -} - -.composer-toolbar button.active { - background: var(--accent-soft); - color: var(--accent); - opacity: 1; -} - -.composer-toolbar button:active { - transform: translateY(1px); -} - -.gif-picker { - margin-top: 8px; - margin-bottom: 8px; - width: min(520px, calc(100vw - 40px)); - border: 1px solid var(--line-strong); - border-radius: 16px; - background: color-mix(in srgb, var(--panel) 96%, transparent); - box-shadow: var(--shadow); - padding: 10px; - animation: picker-in 160ms cubic-bezier(0.2, 0.8, 0.2, 1); -} - -.gif-picker-head { - display: grid; - grid-template-columns: auto minmax(0, 1fr); - align-items: center; - gap: 10px; - padding: 2px 2px 10px; -} - -.gif-picker-head strong { - color: var(--text-strong); - font-size: 13px; -} - -.gif-picker-head input { - min-width: 0; - height: 32px; - padding: 0 10px; - border: 1px solid var(--line); - border-radius: var(--radius); - background: var(--panel-2); -} - -.gif-grid { - display: grid; - grid-template-columns: repeat(3, minmax(0, 1fr)); - gap: 8px; - max-height: 240px; - overflow-y: auto; -} - -.gif-grid button { - position: relative; - overflow: hidden; - aspect-ratio: 4 / 3; - border: 0; - border-radius: 12px; - background: var(--panel-2); - color: white; - padding: 0; - box-shadow: inset 0 0 0 1px var(--line); - transition: - transform 120ms ease, - box-shadow 120ms ease; -} - -.gif-grid button:hover { - transform: translateY(-2px); - box-shadow: - inset 0 0 0 2px var(--accent), - 0 14px 30px -22px rgba(0, 0, 0, 0.8); -} - -.gif-grid img { - width: 100%; - height: 100%; - display: block; - object-fit: cover; -} - -.gif-grid span { - position: absolute; - left: 6px; - right: 6px; - bottom: 6px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - border-radius: 999px; - background: rgba(0, 0, 0, 0.56); - padding: 4px 7px; - font-size: 10.5px; - font-weight: 700; - backdrop-filter: blur(8px); -} - -@keyframes picker-in { - from { - opacity: 0; - transform: translateY(8px) scale(0.98); - } - to { - opacity: 1; - transform: translateY(0) scale(1); - } -} - -.composer-row { - --composer-control-size: 36px; - --composer-line-height: 22px; - --composer-text-padding-block: 7px; - - display: grid; - grid-template-columns: auto minmax(0, 1fr) auto; - align-items: start; - gap: 4px; - padding: 8px 8px 4px 10px; - background: transparent; - border: 0; - border-radius: 0; -} - -.composer:focus-within .composer-toolbar, -.composer-row:focus-within { - border-color: transparent; -} - -.composer-row:focus-within { - box-shadow: none; -} - -.composer-icon { - align-self: start; - width: var(--composer-control-size); - height: var(--composer-control-size); - margin-top: calc(var(--composer-text-padding-block) + (var(--composer-line-height) - var(--composer-control-size)) / 2); - display: grid; - place-items: center; - color: var(--muted); - border-radius: 10px; - cursor: pointer; - transition: - background 120ms ease, - color 120ms ease; -} - -.composer-icon:hover { - background: var(--hover-strong); - color: var(--text-strong); -} - -.composer-icon input[type="file"] { - position: absolute; - inline-size: 1px; - block-size: 1px; - opacity: 0; - pointer-events: none; -} - -.composer textarea, -.reply-composer textarea { - width: 100%; - height: auto; - min-height: 44px; - max-height: 50vh; - padding: var(--composer-text-padding-block) 4px; - resize: none; - color: var(--text); - line-height: var(--composer-line-height); - font-size: 14.5px; - align-self: start; - overflow-y: auto; - box-sizing: border-box; -} - -.composer textarea::placeholder, -.reply-composer textarea::placeholder { - color: var(--muted); -} - -.send { - align-self: start; - width: var(--composer-control-size); - height: var(--composer-control-size); - margin-top: calc(var(--composer-text-padding-block) + (var(--composer-line-height) - var(--composer-control-size)) / 2); - display: grid; - place-items: center; - border: 0; - border-radius: 10px; - background: var(--accent); - color: white; - transition: - background 120ms ease, - transform 80ms ease, - opacity 120ms ease; -} - -.send:hover:not(:disabled) { - background: var(--accent-2); - transform: translateY(-1px); -} - -.send:disabled { - background: var(--panel-3); - color: var(--muted-2); - cursor: not-allowed; -} - -.composer-attachment { - margin-top: 8px; - margin-bottom: 8px; - display: inline-flex; - align-items: center; - gap: 8px; - padding: 6px 10px; - background: var(--panel); - border: 1px solid var(--line); - border-radius: var(--radius); - color: var(--text); - font-size: 13px; - width: fit-content; -} - -.attachment-icon { - display: grid; - place-items: center; - width: 20px; - height: 20px; - border-radius: 6px; - background: var(--accent-soft); - color: var(--accent); -} - -.pending-image { - width: 42px; - height: 32px; - object-fit: cover; - border-radius: 7px; - border: 1px solid var(--line); - background: var(--panel-2); -} - -.attachment-name { - max-width: 240px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.attachment-remove { - width: 18px; - height: 18px; - border: 0; - background: transparent; - color: var(--muted); - border-radius: 50%; - font-size: 14px; - line-height: 1; -} - -.attachment-remove:hover { - background: var(--danger); - color: white; -} - -.composer-hint { - color: var(--muted-2); - font-size: 11px; - padding: 7px 4px 0; -} - -.composer-hint kbd { - display: inline-block; - background: var(--panel-2); - border: 1px solid var(--line); - border-radius: 4px; - padding: 0 5px; - font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; - font-size: 10.5px; - color: var(--text); -} - -/* ---------- THREAD ---------- */ - -.thread { - display: grid; - grid-template-rows: auto minmax(0, 1fr) auto; - background: var(--panel); - border-left: 1px solid var(--line); - min-width: 0; - overflow: hidden; - opacity: 0; - transform: translateX(28px); - pointer-events: none; - transition: - opacity 180ms ease, - transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1); -} - -.thread.open { - opacity: 1; - transform: translateX(0); - pointer-events: auto; -} - -.thread > header { - display: flex; - align-items: center; - justify-content: space-between; - padding: 12px 16px; - min-height: 60px; - border-bottom: 1px solid var(--line); - background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent), var(--panel); -} - -.thread > header p, -.thread > header strong { - margin: 0; -} - -.thread > header p { - color: var(--muted); - font-size: 11px; - text-transform: uppercase; - letter-spacing: 0.04em; - font-weight: 700; -} - -.thread > header strong { - display: block; - color: var(--text-strong); - font-size: 14px; -} - -.thread .close { - width: 28px; - height: 28px; - border: 0; - border-radius: 50%; - background: var(--panel-2); - color: var(--muted); - font-size: 18px; - line-height: 1; -} - -.thread .close:hover { - background: var(--panel-3); - color: var(--text-strong); -} - -.thread-scroll { - overflow-y: auto; - padding: 12px 16px; -} - -.thread-root { - display: grid; - grid-template-columns: 38px minmax(0, 1fr); - gap: 12px; - padding-bottom: 12px; - border-bottom: 1px solid var(--line); -} - -.thread-divider { - display: flex; - align-items: center; - gap: 10px; - margin: 14px 0 10px; -} - -.thread-divider::before, -.thread-divider::after { - content: ""; - flex: 1; - height: 1px; - background: var(--line); -} - -.thread-divider span { - font-size: 11px; - color: var(--muted); - text-transform: uppercase; - letter-spacing: 0.04em; - font-weight: 700; -} - -.reply-list { - display: flex; - flex-direction: column; - gap: 10px; -} - -.reply { - display: grid; - grid-template-columns: 30px minmax(0, 1fr); - gap: 10px; - padding: 6px; - border-radius: var(--radius-sm); -} - -.reply:hover { - background: var(--hover); -} - -.reply-composer { - padding: 10px 14px 14px; - background: var(--panel); - border-top: 1px solid var(--line); -} - -.reply-composer .composer-row { - border-radius: 0; -} - -.thread-empty { - display: grid; - place-items: center; - align-content: center; - gap: 8px; - padding: 32px 24px; - text-align: center; - grid-row: span 3; -} - -.thread-icon { - width: 56px; - height: 56px; - border-radius: 16px; - background: var(--panel-2); - color: var(--muted); - display: grid; - place-items: center; -} - -.thread-empty strong { - color: var(--text-strong); - font-size: 15px; -} - -.thread-empty span { - color: var(--muted); - font-size: 13px; - max-width: 260px; - line-height: 1.5; -} - -/* ---------- PROFILE PANE ---------- */ - -.profile-pane { - overflow-y: auto; -} - -.profile-hero { - min-height: 210px; - display: grid; - place-items: end center; - padding: 28px 20px; - background: - linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.24)), - linear-gradient( - 135deg, - hsl(var(--hue, 220deg) 76% 58%), - hsl(calc(var(--hue, 220deg) + 54deg) 74% 38%) - ); - border-bottom: 1px solid var(--line); -} - -.profile-avatar { - width: min(240px, 70%); - aspect-ratio: 1; - display: grid; - place-items: center; - overflow: hidden; - border-radius: 16px; - background: rgba(255, 255, 255, 0.18); - color: white; - font-size: clamp(48px, 12vw, 88px); - font-weight: 800; - box-shadow: 0 26px 60px -30px rgba(0, 0, 0, 0.9); -} - -.profile-avatar img { - width: 100%; - height: 100%; - object-fit: cover; -} - -.profile-pane-body { - display: grid; - gap: 18px; - padding: 18px 16px 22px; -} - -.profile-pane-title { - display: flex; - align-items: flex-start; - justify-content: space-between; - gap: 12px; -} - -.profile-pane-title h2 { - margin: 0; - color: var(--text-strong); - font-size: 22px; - letter-spacing: 0; -} - -.profile-pane-title span { - display: block; - margin-top: 3px; - color: var(--muted); - font-size: 13px; -} - -.text-action { - border: 0; - border-radius: 6px; - background: transparent; - color: var(--accent); - font-size: 13px; - font-weight: 700; - padding: 4px 6px; -} - -.text-action:hover { - background: var(--accent-soft); -} - -.profile-presence { - display: inline-flex; - align-items: center; - gap: 8px; - color: var(--text); - font-size: 14px; -} - -.profile-actions-row { - display: flex; - gap: 8px; - flex-wrap: wrap; -} - -.profile-actions-row .primary-action, -.profile-actions-row .ghost-action { - min-width: 110px; -} - -.profile-info { - display: grid; - gap: 12px; - padding-top: 18px; - border-top: 1px solid var(--line); -} - -.profile-info header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 10px; -} - -.profile-info header strong { - color: var(--text-strong); - font-size: 14px; -} - -.profile-info-row { - display: grid; - grid-template-columns: 34px minmax(0, 1fr); - gap: 10px; - align-items: center; -} - -.info-icon { - width: 34px; - height: 34px; - display: grid; - place-items: center; - border-radius: 9px; - background: var(--panel-2); - color: var(--muted); - font-size: 11px; - font-weight: 800; -} - -.profile-info-row small, -.profile-info-row span { - display: block; -} - -.profile-info-row small { - color: var(--muted); - font-size: 11px; -} - -.profile-info-row span { - color: var(--text); - font-size: 13px; - overflow-wrap: anywhere; -} - -.profile-note { - margin: 0; - color: var(--muted); - line-height: 1.5; - font-size: 13px; -} - -/* ---------- ACCOUNT SETTINGS ---------- */ - -.modal-scrim { - position: fixed; - inset: 0; - z-index: 50; - display: grid; - place-items: center; - padding: 24px; - background: rgba(5, 8, 15, 0.54); - backdrop-filter: blur(14px); -} - -.modal-backdrop { - position: absolute; - inset: 0; - border: 0; - background: transparent; -} - -.modal-backdrop:focus { - outline: 0; -} - -.profile-modal { - position: relative; - z-index: 1; - width: min(480px, 100%); - border: 1px solid var(--line-strong); - border-radius: 14px; - background: var(--panel); - color: var(--text); - box-shadow: var(--shadow); - overflow: hidden; -} - -.profile-modal > header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 16px; - padding: 18px 20px; - border-bottom: 1px solid var(--line); - background: var(--panel-2); -} - -.profile-modal p { - margin: 0 0 3px; - color: var(--muted); - font-size: 11px; - font-weight: 700; - text-transform: uppercase; - letter-spacing: 0.06em; -} - -.profile-modal h2 { - margin: 0; - color: var(--text-strong); - font-size: 20px; - letter-spacing: 0; -} - -.profile-modal > header button { - width: 32px; - height: 32px; - border: 0; - border-radius: 8px; - background: transparent; - color: var(--muted); - font-size: 22px; -} - -.profile-modal > header button:hover { - background: var(--hover); - color: var(--text-strong); -} - -.profile-form { - display: grid; - gap: 14px; - padding: 20px; -} - -.profile-preview { - display: flex; - align-items: center; - gap: 14px; - padding: 14px; - border: 1px solid var(--line); - border-radius: var(--radius); - background: var(--panel-2); -} - -.profile-preview strong, -.profile-preview span { - display: block; -} - -.profile-preview strong { - color: var(--text-strong); - font-size: 15px; -} - -.profile-preview span { - color: var(--muted); - font-size: 13px; -} - -.field { - display: grid; - gap: 6px; -} - -.field span { - color: var(--muted); - font-size: 12px; - font-weight: 700; -} - -.field input { - width: 100%; - height: 38px; - padding: 0 12px; - border: 1px solid var(--line); - border-radius: var(--radius-sm); - background: var(--panel-2); - color: var(--text); -} - -.field input:focus { - border-color: var(--accent); - outline: 0; - box-shadow: 0 0 0 3px var(--accent-soft); -} - -.profile-status { - color: var(--success); - font-size: 12px; -} - -.profile-status.error { - color: var(--danger); -} - -.profile-actions { - display: flex; - justify-content: flex-end; - gap: 8px; - padding-top: 4px; -} - -.ghost-action, -.primary-action { - height: 36px; - padding: 0 14px; - border-radius: var(--radius-sm); - font-weight: 700; -} - -.ghost-action { - border: 1px solid var(--line); - background: var(--panel); - color: var(--text); -} - -.primary-action { - border: 0; - background: var(--accent); - color: white; -} - -.ghost-action:hover { - background: var(--hover); -} - -.primary-action:hover { - filter: brightness(1.04); -} - -/* ---------- IMAGE VIEWER ---------- */ - -.image-viewer-scrim { - padding: 28px; - background: rgba(0, 0, 0, 0.78); - backdrop-filter: blur(18px); -} - -.image-viewer { - position: relative; - z-index: 1; - display: grid; - grid-template-rows: auto minmax(0, 1fr); - width: min(1120px, 100%); - max-height: min(86vh, 900px); - overflow: hidden; - border-radius: 14px; - background: #07090f; - color: white; - box-shadow: 0 34px 90px -34px rgba(0, 0, 0, 0.95); - animation: picker-in 150ms cubic-bezier(0.2, 0.8, 0.2, 1); -} - -.image-viewer > header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 16px; - min-height: 52px; - padding: 10px 12px 10px 16px; - border-bottom: 1px solid rgba(255, 255, 255, 0.1); - background: rgba(255, 255, 255, 0.04); -} - -.image-viewer > header strong { - min-width: 0; - overflow: hidden; - color: white; - font-size: 13px; - text-overflow: ellipsis; - white-space: nowrap; -} - -.image-viewer > header div { - display: inline-flex; - align-items: center; - gap: 8px; - flex-shrink: 0; -} - -.image-viewer > header a { - height: 30px; - display: inline-flex; - align-items: center; - padding: 0 10px; - border-radius: 7px; - background: rgba(255, 255, 255, 0.08); - color: white; - font-size: 12px; - font-weight: 700; - text-decoration: none; -} - -.image-viewer > header a:hover { - background: rgba(255, 255, 255, 0.14); -} - -.image-viewer > header button { - width: 30px; - height: 30px; - display: grid; - place-items: center; - border: 0; - border-radius: 7px; - background: transparent; - color: rgba(255, 255, 255, 0.78); - font-size: 22px; - line-height: 1; -} - -.image-viewer > header button:hover { - background: rgba(255, 255, 255, 0.12); - color: white; -} - -.image-viewer-stage { - display: grid; - place-items: center; - min-height: 0; - padding: 18px; -} - -.image-viewer-stage img { - display: block; - max-width: 100%; - max-height: calc(86vh - 96px); - object-fit: contain; - border-radius: 8px; - background: rgba(255, 255, 255, 0.04); -} - -/* ---------- MOBILE ---------- */ - -.mobile-nav-toggle { - display: none; - position: fixed; - top: 14px; - left: 14px; - z-index: 30; - width: 38px; - height: 38px; - border-radius: 10px; - border: 1px solid var(--line-strong); - background: var(--panel); - color: var(--text); - font-size: 22px; - line-height: 1; -} - -.mobile-nav-toggle .bars { - display: grid; - gap: 3px; -} - -.mobile-nav-toggle .bars i { - display: block; - width: 16px; - height: 2px; - background: currentColor; - border-radius: 2px; -} - -@media (max-width: 1180px) { - .shell { - grid-template-columns: 72px 240px minmax(0, 1fr); - } - .shell.sidebar-collapsed, - .shell.sidebar-collapsed.thread-open { - grid-template-columns: 72px 0 minmax(0, 1fr); - } - .thread { - position: fixed; - inset: 0 0 0 auto; - width: min(420px, 100vw); - box-shadow: var(--shadow); - transform: translateX(100%); - transition: transform 180ms ease; - z-index: 4; - border-left: 1px solid var(--line-strong); - } - .thread.open { - transform: translateX(0); - } -} - -@media (max-width: 820px) { - .mobile-nav-toggle { - display: grid; - place-items: center; - } - .shell { - grid-template-columns: 1fr; - } - .shell.thread-open, - .shell.sidebar-collapsed, - .shell.sidebar-collapsed.thread-open { - grid-template-columns: 1fr; - } - .sidebar-collapsed .sidebar { - opacity: 1; - pointer-events: auto; - transform: translateX(-100%); - } - .guild-rail, - .sidebar { - position: fixed; - inset: 0 auto 0 0; - z-index: 20; - transform: translateX(-100%); - transition: transform 180ms ease; - } - .guild-rail { - width: 72px; - } - .sidebar { - left: 72px; - width: 260px; - } - .nav-open .guild-rail, - .nav-open .sidebar { - transform: translateX(0); - } - .topbar { - padding-left: 64px; - } - .search { - width: 180px; - } -} - -@media (max-width: 520px) { - .search { - display: none; - } - .topbar-meta, - .topbar-divider { - display: none; - } -} - -/* Inline quote-reply */ -.message-row.highlight, -.thread-root.highlight, -.reply.highlight { - animation: quote-flash 1.4s ease-out; -} - -@keyframes quote-flash { - 0% { - background: rgba(99, 102, 241, 0.22); - } - 100% { - background: transparent; - } -} - -.quote-block { - display: inline-flex; - align-items: stretch; - gap: 0.5rem; - margin: 0 0 0.35rem; - padding: 0.25rem 0.5rem 0.25rem 0; - background: transparent; - border: 0; - border-radius: 6px; - color: inherit; - cursor: pointer; - text-align: left; - max-width: 100%; - font: inherit; -} - -.quote-block:hover:not(:disabled) { - background: rgba(99, 102, 241, 0.08); -} - -.quote-block:disabled { - cursor: default; - opacity: 0.75; -} - -.quote-block .quote-bar { - width: 3px; - align-self: stretch; - background: var(--accent, #6366f1); - border-radius: 2px; - flex: 0 0 3px; -} - -.quote-block .quote-content { - display: flex; - flex-direction: column; - gap: 0.1rem; - min-width: 0; -} - -.quote-block .quote-author { - font-size: 0.78rem; - font-weight: 600; - color: var(--accent, #6366f1); -} - -.quote-block .quote-snippet { - font-size: 0.85rem; - color: var(--text-muted, #6b7280); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - max-width: 56ch; -} - -.quote-block .quote-snippet.muted { - font-style: italic; - opacity: 0.75; -} - -.quote-preview { - display: flex; - align-items: center; - gap: 0.5rem; - padding: 6px 10px 6px 12px; - margin: 0; - background: color-mix(in srgb, var(--accent) 5%, transparent); - border: 0; - border-bottom: 1px solid var(--line); - border-radius: 0; - font-size: 12.5px; - color: var(--muted); -} - -.quote-preview .quote-bar { - display: none; -} - -.quote-preview-body { - display: flex; - align-items: baseline; - gap: 0.4rem; - flex: 1; - min-width: 0; - overflow: hidden; -} - -.quote-preview-label { - font-size: 12px; - color: color-mix(in srgb, var(--accent) 85%, var(--text)); - white-space: nowrap; -} - -.quote-preview-label strong { - color: var(--text-strong); - font-weight: 600; -} - -.quote-preview-snippet { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - color: var(--muted); - font-size: 12px; - flex: 1; - min-width: 0; -} - -.quote-preview-clear { - background: transparent; - border: 0; - color: var(--muted); - font-size: 16px; - line-height: 1; - cursor: pointer; - padding: 2px 6px; - border-radius: 6px; - transition: - background 100ms ease, - color 100ms ease; -} - -.quote-preview-clear:hover { - color: var(--text-strong); - background: var(--hover-strong); -} - -.reply-quote-btn { - position: relative; - margin-left: auto; - background: transparent; - border: 0; - color: var(--text-muted, #6b7280); - cursor: pointer; - font-size: 0.95rem; - padding: 0 0.3rem; - opacity: 0; - transition: opacity 0.15s; -} - -.reply:hover .reply-quote-btn, -.thread-root:hover .reply-quote-btn, -.reply-quote-btn:focus-visible { - opacity: 1; -} - -.reply-quote-btn:hover { - color: var(--accent, #6366f1); -} - -.tooltip { - position: relative; -} - -.tooltip::before, -.reply-quote-btn::before { - content: attr(data-tooltip); - position: absolute; - left: 50%; - bottom: calc(100% + 12px); - z-index: 20; - transform: translate(-50%, 4px) scale(0.96); - padding: 0.42rem 0.62rem; - border-radius: 9px; - background: #3a3a44; - color: #f4f4f7; - box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); - font-size: 0.78rem; - font-weight: 700; - line-height: 1; - white-space: nowrap; - opacity: 0; - pointer-events: none; - transition: - opacity 120ms ease, - transform 120ms ease; -} - -.tooltip::after, -.reply-quote-btn::after { - content: ""; - position: absolute; - left: 50%; - bottom: calc(100% + 5px); - z-index: 20; - width: 12px; - height: 12px; - border-radius: 2px; - background: #3a3a44; - transform: translate(-50%, 4px) rotate(45deg) scale(0.9); - opacity: 0; - pointer-events: none; - transition: - opacity 120ms ease, - transform 120ms ease; -} - -.tooltip:hover::before, -.tooltip:focus-visible::before, -.reply-quote-btn:hover::before, -.reply-quote-btn:focus-visible::before, -.tooltip:hover::after, -.tooltip:focus-visible::after, -.reply-quote-btn:hover::after, -.reply-quote-btn:focus-visible::after { - opacity: 1; - transform: translate(-50%, 0) scale(1); -} - -.tooltip:hover::after, -.tooltip:focus-visible::after, -.reply-quote-btn:hover::after, -.reply-quote-btn:focus-visible::after { - transform: translate(-50%, 0) rotate(45deg) scale(1); -} +@import "./styles/base.css"; +@import "./styles/layout.css"; +@import "./styles/sidebar.css"; +@import "./styles/messages.css"; +@import "./styles/composer.css"; +@import "./styles/thread.css"; +@import "./styles/modals.css"; diff --git a/apps/web/src/styles/base.css b/apps/web/src/styles/base.css new file mode 100644 index 0000000..22c5727 --- /dev/null +++ b/apps/web/src/styles/base.css @@ -0,0 +1,121 @@ +:root { + color-scheme: light dark; + font-family: + "Inter", + "SF Pro Text", + ui-sans-serif, + system-ui, + -apple-system, + BlinkMacSystemFont, + "Segoe UI", + sans-serif; + font-feature-settings: "ss01", "cv11"; + --rail: #e9e1d7; + --bg: #f7f3ed; + --panel: #fffaf2; + --panel-2: #efe7dc; + --panel-3: #e4dbcf; + --hover: rgba(16, 32, 39, 0.05); + --hover-strong: rgba(16, 32, 39, 0.08); + --line: rgba(16, 32, 39, 0.1); + --line-strong: rgba(16, 32, 39, 0.16); + --text: #22201d; + --text-strong: #11100e; + --muted: #6f675f; + --muted-2: #958b80; + --accent: #dd5d45; + --accent-2: #006d77; + --accent-soft: rgba(221, 93, 69, 0.16); + --accent-glow: 0 0 0 1px rgba(221, 93, 69, 0.28), 0 8px 30px -12px rgba(221, 93, 69, 0.45); + --success: #168b51; + --warn: #f5b050; + --danger: #c84343; + --shadow: 0 24px 60px -24px rgba(16, 32, 39, 0.32); + --radius-sm: 6px; + --radius: 8px; + --radius-lg: 14px; + --radius-xl: 18px; + background: var(--bg); + color: var(--text); +} + +@media (prefers-color-scheme: dark) { + :root { + --rail: #0d0e12; + --bg: #131419; + --panel: #1a1b22; + --panel-2: #20222b; + --panel-3: #272a35; + --hover: rgba(255, 255, 255, 0.04); + --hover-strong: rgba(255, 255, 255, 0.07); + --line: rgba(255, 255, 255, 0.07); + --line-strong: rgba(255, 255, 255, 0.12); + --text: #e7e9ee; + --text-strong: #ffffff; + --muted: #8a8f9c; + --muted-2: #5d626d; + --accent: #6f7eff; + --accent-2: #5666ee; + --accent-soft: rgba(111, 126, 255, 0.18); + --accent-glow: 0 0 0 1px rgba(111, 126, 255, 0.4), 0 8px 30px -12px rgba(111, 126, 255, 0.6); + --success: #2ecc71; + --warn: #f5b050; + --danger: #ff6b6b; + --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6); + } +} + +* { + box-sizing: border-box; +} + +html, +body { + margin: 0; + padding: 0; + height: 100%; +} + +body { + background: + radial-gradient(1000px 600px at 0% 0%, rgba(111, 126, 255, 0.08), transparent 60%), + radial-gradient(900px 700px at 100% 100%, rgba(255, 130, 200, 0.05), transparent 60%), var(--bg); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +button, +input, +textarea { + font: inherit; + color: inherit; +} + +button { + cursor: pointer; +} + +input, +textarea { + background: transparent; + border: 0; + outline: 0; +} + +::-webkit-scrollbar { + width: 10px; + height: 10px; +} + +::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.06); + border-radius: 999px; + border: 2px solid transparent; + background-clip: content-box; +} + +::-webkit-scrollbar-thumb:hover { + background: rgba(255, 255, 255, 0.12); + background-clip: content-box; +} + diff --git a/apps/web/src/styles/composer.css b/apps/web/src/styles/composer.css new file mode 100644 index 0000000..a0557b8 --- /dev/null +++ b/apps/web/src/styles/composer.css @@ -0,0 +1,349 @@ +/* ---------- COMPOSER ---------- */ + +.composer { + padding: 18px 18px 10px; + background: var(--bg); + display: grid; + gap: 0; + position: relative; +} + +.composer-card { + display: flex; + flex-direction: column; + background: var(--panel); + border: 1px solid var(--line-strong); + border-radius: var(--radius-lg); + overflow: hidden; + transition: + border-color 120ms ease, + box-shadow 120ms ease; +} + +.composer:focus-within .composer-card { + border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong)); + box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); +} + +.composer-toolbar { + display: inline-flex; + align-items: center; + gap: 2px; + width: 100%; + padding: 4px 6px; + margin: 0; + border: 0; + border-top: 1px solid var(--line); + border-radius: 0; + background: color-mix(in srgb, var(--panel-2) 35%, transparent); + box-shadow: none; +} + +.composer-toolbar button { + min-width: 28px; + height: 26px; + display: grid; + place-items: center; + border: 0; + border-radius: 6px; + background: transparent; + color: var(--text); + opacity: 0.78; + font-size: 11.5px; + font-weight: 700; + transition: + background 100ms ease, + color 100ms ease, + opacity 100ms ease, + transform 80ms ease; +} + +.composer-toolbar button:hover { + background: var(--hover-strong); + color: var(--text-strong); + opacity: 1; +} + +.composer-toolbar button.active { + background: var(--accent-soft); + color: var(--accent); + opacity: 1; +} + +.composer-toolbar button:active { + transform: translateY(1px); +} + +.gif-picker { + margin-top: 8px; + margin-bottom: 8px; + width: min(520px, calc(100vw - 40px)); + border: 1px solid var(--line-strong); + border-radius: 16px; + background: color-mix(in srgb, var(--panel) 96%, transparent); + box-shadow: var(--shadow); + padding: 10px; + animation: picker-in 160ms cubic-bezier(0.2, 0.8, 0.2, 1); +} + +.gif-picker-head { + display: grid; + grid-template-columns: auto minmax(0, 1fr); + align-items: center; + gap: 10px; + padding: 2px 2px 10px; +} + +.gif-picker-head strong { + color: var(--text-strong); + font-size: 13px; +} + +.gif-picker-head input { + min-width: 0; + height: 32px; + padding: 0 10px; + border: 1px solid var(--line); + border-radius: var(--radius); + background: var(--panel-2); +} + +.gif-grid { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 8px; + max-height: 240px; + overflow-y: auto; +} + +.gif-grid button { + position: relative; + overflow: hidden; + aspect-ratio: 4 / 3; + border: 0; + border-radius: 12px; + background: var(--panel-2); + color: white; + padding: 0; + box-shadow: inset 0 0 0 1px var(--line); + transition: + transform 120ms ease, + box-shadow 120ms ease; +} + +.gif-grid button:hover { + transform: translateY(-2px); + box-shadow: + inset 0 0 0 2px var(--accent), + 0 14px 30px -22px rgba(0, 0, 0, 0.8); +} + +.gif-grid img { + width: 100%; + height: 100%; + display: block; + object-fit: cover; +} + +.gif-grid span { + position: absolute; + left: 6px; + right: 6px; + bottom: 6px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + border-radius: 999px; + background: rgba(0, 0, 0, 0.56); + padding: 4px 7px; + font-size: 10.5px; + font-weight: 700; + backdrop-filter: blur(8px); +} + +@keyframes picker-in { + from { + opacity: 0; + transform: translateY(8px) scale(0.98); + } + to { + opacity: 1; + transform: translateY(0) scale(1); + } +} + +.composer-row { + --composer-control-size: 36px; + --composer-line-height: 22px; + --composer-text-padding-block: 7px; + + display: grid; + grid-template-columns: auto minmax(0, 1fr) auto; + align-items: start; + gap: 4px; + padding: 8px 8px 4px 10px; + background: transparent; + border: 0; + border-radius: 0; +} + +.composer:focus-within .composer-toolbar, +.composer-row:focus-within { + border-color: transparent; +} + +.composer-row:focus-within { + box-shadow: none; +} + +.composer-icon { + align-self: start; + width: var(--composer-control-size); + height: var(--composer-control-size); + margin-top: calc(var(--composer-text-padding-block) + (var(--composer-line-height) - var(--composer-control-size)) / 2); + display: grid; + place-items: center; + color: var(--muted); + border-radius: 10px; + cursor: pointer; + transition: + background 120ms ease, + color 120ms ease; +} + +.composer-icon:hover { + background: var(--hover-strong); + color: var(--text-strong); +} + +.composer-icon input[type="file"] { + position: absolute; + inline-size: 1px; + block-size: 1px; + opacity: 0; + pointer-events: none; +} + +.composer textarea, +.reply-composer textarea { + width: 100%; + height: auto; + min-height: 44px; + max-height: 50vh; + padding: var(--composer-text-padding-block) 4px; + resize: none; + color: var(--text); + line-height: var(--composer-line-height); + font-size: 14.5px; + align-self: start; + overflow-y: auto; + box-sizing: border-box; +} + +.composer textarea::placeholder, +.reply-composer textarea::placeholder { + color: var(--muted); +} + +.send { + align-self: start; + width: var(--composer-control-size); + height: var(--composer-control-size); + margin-top: calc(var(--composer-text-padding-block) + (var(--composer-line-height) - var(--composer-control-size)) / 2); + display: grid; + place-items: center; + border: 0; + border-radius: 10px; + background: var(--accent); + color: white; + transition: + background 120ms ease, + transform 80ms ease, + opacity 120ms ease; +} + +.send:hover:not(:disabled) { + background: var(--accent-2); + transform: translateY(-1px); +} + +.send:disabled { + background: var(--panel-3); + color: var(--muted-2); + cursor: not-allowed; +} + +.composer-attachment { + margin-top: 8px; + margin-bottom: 8px; + display: inline-flex; + align-items: center; + gap: 8px; + padding: 6px 10px; + background: var(--panel); + border: 1px solid var(--line); + border-radius: var(--radius); + color: var(--text); + font-size: 13px; + width: fit-content; +} + +.attachment-icon { + display: grid; + place-items: center; + width: 20px; + height: 20px; + border-radius: 6px; + background: var(--accent-soft); + color: var(--accent); +} + +.pending-image { + width: 42px; + height: 32px; + object-fit: cover; + border-radius: 7px; + border: 1px solid var(--line); + background: var(--panel-2); +} + +.attachment-name { + max-width: 240px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.attachment-remove { + width: 18px; + height: 18px; + border: 0; + background: transparent; + color: var(--muted); + border-radius: 50%; + font-size: 14px; + line-height: 1; +} + +.attachment-remove:hover { + background: var(--danger); + color: white; +} + +.composer-hint { + color: var(--muted-2); + font-size: 11px; + padding: 7px 4px 0; +} + +.composer-hint kbd { + display: inline-block; + background: var(--panel-2); + border: 1px solid var(--line); + border-radius: 4px; + padding: 0 5px; + font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; + font-size: 10.5px; + color: var(--text); +} + diff --git a/apps/web/src/styles/layout.css b/apps/web/src/styles/layout.css new file mode 100644 index 0000000..3a851dd --- /dev/null +++ b/apps/web/src/styles/layout.css @@ -0,0 +1,402 @@ +/* ---------- AUTH ---------- */ + +.auth-shell { + display: grid; + min-height: 100vh; + place-items: center; + padding: 32px; + background: + radial-gradient(700px 500px at 30% 20%, rgba(111, 126, 255, 0.18), transparent 60%), + radial-gradient(700px 500px at 80% 90%, rgba(255, 110, 196, 0.12), transparent 60%), var(--bg); +} + +.auth-panel { + display: grid; + gap: 22px; + width: min(100%, 440px); + border: 1px solid var(--line-strong); + border-radius: var(--radius-xl); + background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)) + var(--panel); + box-shadow: var(--shadow); + padding: 36px; +} + +.auth-brand { + display: flex; + align-items: center; + gap: 12px; +} + +.auth-brand .mark { + width: 44px; + height: 44px; + display: grid; + place-items: center; + border-radius: 12px; + background: linear-gradient(135deg, var(--accent), #b46cff); + color: white; + font-weight: 800; + letter-spacing: -0.02em; + box-shadow: 0 10px 24px -8px rgba(111, 126, 255, 0.7); +} + +.auth-brand .brand-text strong { + display: block; + color: var(--text-strong); + letter-spacing: -0.01em; +} + +.auth-brand .brand-text span { + display: block; + color: var(--muted); + font-size: 12px; +} + +.auth-copy { + display: grid; + gap: 8px; + margin-top: 8px; +} + +.auth-copy h1 { + margin: 0; + font-size: 28px; + letter-spacing: -0.02em; + color: var(--text-strong); +} + +.auth-copy p { + margin: 0; + color: var(--muted); + line-height: 1.5; +} + +.github-login { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 10px; + min-height: 46px; + border-radius: 12px; + background: #0d1117; + color: white; + font-weight: 600; + text-decoration: none; + border: 1px solid #2b2f36; + transition: + transform 80ms ease, + background 120ms ease, + border-color 120ms ease; +} + +.github-login:hover { + background: #161b22; + border-color: #3f4750; + transform: translateY(-1px); +} + +.auth-foot { + margin: 0; + color: var(--muted-2); + font-size: 12px; + text-align: center; +} + +/* ---------- SHELL ---------- */ + +.shell { + display: grid; + grid-template-columns: 72px 260px minmax(0, 1fr) 0; + height: 100vh; + min-height: 100vh; + overflow: hidden; + transition: grid-template-columns 220ms cubic-bezier(0.2, 0.8, 0.2, 1); +} + +.shell.thread-open { + grid-template-columns: 72px 260px minmax(0, 1fr) minmax(340px, 28vw); +} + +.shell.sidebar-collapsed { + grid-template-columns: 72px 0 minmax(0, 1fr) 0; +} + +.shell.sidebar-collapsed.thread-open { + grid-template-columns: 72px 0 minmax(0, 1fr) minmax(340px, 28vw); +} + +/* ---------- TIMELINE ---------- */ + +.timeline { + display: flex; + flex-direction: column; + min-width: 0; + background: var(--bg); + overflow: hidden; +} + +.timeline > * { + min-width: 0; + flex-shrink: 0; +} + +.timeline > .messages { + flex: 1 1 0; + min-height: 0; +} + +.topbar { + display: flex; + align-items: center; + gap: 14px; + padding: 12px 20px; + min-height: 60px; + border-bottom: 1px solid var(--line); + background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent), var(--bg); +} + +.topbar-title { + display: flex; + align-items: center; + gap: 10px; + min-width: 0; + flex: 1; +} + +.topbar-title h1 { + margin: 0; + font-size: 16px; + font-weight: 700; + letter-spacing: -0.01em; + color: var(--text-strong); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.topbar-title h1.with-glyph::first-letter { + color: var(--muted); + margin-right: 1px; +} + +.topbar-divider { + width: 1px; + height: 18px; + background: var(--line-strong); + margin: 0 6px; +} + +.topbar-meta { + margin: 0; + color: var(--muted); + font-size: 12px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.search { + display: flex; + align-items: center; + gap: 8px; + width: min(280px, 30vw); + height: 34px; + padding: 0 10px; + border-radius: var(--radius); + background: var(--panel); + border: 1px solid var(--line); + color: var(--muted); + transition: + border-color 120ms ease, + background 120ms ease; +} + +.search:focus-within { + border-color: var(--accent); + background: var(--panel-2); + color: var(--text); +} + +.search input { + flex: 1; + min-width: 0; + height: 100%; + color: var(--text); +} + +.search input::placeholder { + color: var(--muted); +} + +.search-clear { + width: 18px; + height: 18px; + border-radius: 50%; + border: 0; + background: var(--panel-3); + color: var(--muted); + display: grid; + place-items: center; + font-size: 14px; + line-height: 1; +} + +.search-clear:hover { + background: var(--accent); + color: white; +} + +.search-submit { + height: 22px; + padding: 0 8px; + border: 0; + border-radius: 5px; + background: var(--accent-soft); + color: var(--accent); + font-size: 10.5px; + font-weight: 700; + letter-spacing: 0.04em; + text-transform: uppercase; +} + +.search-submit:hover { + background: var(--accent); + color: white; +} + +.topbar-actions { + display: inline-flex; + align-items: center; + gap: 6px; +} + +.topbar-actions button { + width: 32px; + height: 32px; + display: grid; + place-items: center; + border: 1px solid var(--line); + border-radius: 9px; + background: var(--panel); + color: var(--muted); + transition: + background 120ms ease, + color 120ms ease, + border-color 120ms ease, + transform 80ms ease; +} + +.topbar-actions button:hover, +.topbar-actions button.active { + background: var(--accent-soft); + border-color: color-mix(in srgb, var(--accent) 55%, transparent); + color: var(--accent); +} + +.topbar-actions button:active { + transform: translateY(1px); +} + +@keyframes pulse { + 0%, + 100% { + opacity: 1; + } + 50% { + opacity: 0.5; + } +} + +/* ---------- SEARCH RESULTS ---------- */ + +.search-results { + display: flex; + flex-direction: column; + gap: 2px; + padding: 10px 14px 14px; + border-bottom: 1px solid var(--line); + background: var(--panel); + max-height: 280px; + overflow-y: auto; +} + +.search-results-head { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 6px 8px; +} + +.search-results-head strong { + color: var(--text-strong); + font-size: 13px; +} + +.search-results-head button { + border: 0; + background: transparent; + color: var(--muted); + font-size: 12px; + padding: 4px 8px; + border-radius: var(--radius-sm); +} + +.search-results-head button:hover { + background: var(--hover); + color: var(--text); +} + +.search-result { + display: flex; + align-items: flex-start; + gap: 10px; + border: 0; + background: transparent; + color: var(--text); + padding: 8px; + border-radius: var(--radius-sm); + text-align: left; +} + +.search-result:hover { + background: var(--hover); +} + +.search-result .dm-avatar { + width: 30px; + height: 30px; + font-size: 13px; +} + +.search-result-body { + display: flex; + flex-direction: column; + gap: 2px; + min-width: 0; + flex: 1; +} + +.search-result-body > div { + display: flex; + align-items: baseline; + gap: 8px; +} + +.search-result-body strong { + color: var(--text-strong); + font-size: 13px; +} + +.search-result-body time { + color: var(--muted); + font-size: 11px; +} + +.search-result-body span { + color: var(--muted); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + diff --git a/apps/web/src/styles/messages.css b/apps/web/src/styles/messages.css new file mode 100644 index 0000000..8940997 --- /dev/null +++ b/apps/web/src/styles/messages.css @@ -0,0 +1,643 @@ +/* ---------- MESSAGES ---------- */ + +.messages { + overflow-y: auto; + padding: 16px 4px 24px; + scroll-behavior: smooth; +} + +.empty { + display: grid; + place-items: center; + align-content: center; + text-align: center; + gap: 10px; + min-height: 50vh; + padding: 48px 24px; +} + +.empty-icon { + width: 64px; + height: 64px; + border-radius: 18px; + background: linear-gradient(135deg, var(--accent), #b46cff); + color: white; + display: grid; + place-items: center; + font-size: 26px; + font-weight: 800; + box-shadow: 0 18px 40px -16px rgba(111, 126, 255, 0.7); +} + +.empty strong { + color: var(--text-strong); + font-size: 18px; + letter-spacing: -0.01em; +} + +.empty span { + color: var(--muted); + max-width: 380px; + line-height: 1.5; +} + +.day-divider { + display: flex; + align-items: center; + gap: 12px; + margin: 18px 18px 8px; + position: sticky; + top: 0; + z-index: 1; + pointer-events: none; +} + +.day-divider::before, +.day-divider::after { + content: ""; + flex: 1; + height: 1px; + background: var(--line); +} + +.day-divider span { + background: var(--bg); + border: 1px solid var(--line); + border-radius: 999px; + padding: 4px 12px; + font-size: 11px; + font-weight: 600; + color: var(--muted); + text-transform: uppercase; + letter-spacing: 0.04em; +} + +.message-group { + display: grid; + grid-template-columns: 56px minmax(0, 1fr); + padding: 8px 18px; + position: relative; +} + +.message-group:hover { + background: var(--hover); +} + +.avatar { + width: 38px; + height: 38px; + border-radius: 12px; + display: grid; + place-items: center; + color: white; + font-weight: 700; + font-size: 14px; + background: linear-gradient( + 135deg, + hsl(var(--hue, 220deg) 70% 55%), + hsl(calc(var(--hue, 220deg) + 40deg) 70% 45%) + ); + box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.6); + margin-top: 2px; + overflow: hidden; +} + +.avatar-button { + position: relative; + z-index: 2; + border: 0; + padding: 0; + cursor: pointer; + transition: + transform 100ms ease, + box-shadow 120ms ease, + filter 120ms ease; +} + +.avatar-button:hover { + transform: translateY(-1px); + filter: brightness(1.05); + box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.8); +} + +.avatar.small { + width: 30px; + height: 30px; + font-size: 12px; + border-radius: 10px; +} + +.avatar.large { + width: 56px; + height: 56px; + border-radius: 16px; + font-size: 18px; + margin: 0; +} + +.group-body { + min-width: 0; +} + +.group-body > header { + display: flex; + align-items: baseline; + gap: 8px; + margin-bottom: 2px; +} + +.group-body > header strong { + color: var(--text-strong); + font-size: 14.5px; + letter-spacing: -0.005em; + font-weight: 700; +} + +.author-name { + border: 0; + background: transparent; + color: var(--text-strong); + padding: 0; + border-radius: 4px; + font-size: 14.5px; + letter-spacing: 0; + font-weight: 700; +} + +.author-name:hover { + color: var(--accent); + text-decoration: underline; + text-underline-offset: 2px; +} + +.group-body > header time { + color: var(--muted); + font-size: 11px; +} + +.group-body > header span { + color: var(--muted); + font-size: 12px; +} + +.message-row { + margin-left: -56px; + padding: 1px 0 1px 56px; + position: relative; + border-radius: 0; + transition: background 80ms ease; +} + +.message-row:not(:first-child) { + margin-top: 1px; +} + +.message-row:hover { + background: var(--hover-strong); +} + +.message-row.selected { + background: var(--accent-soft); +} + +.message-row.selected::before { + content: ""; + position: absolute; + left: 0; + top: 0; + bottom: 0; + width: 3px; + background: var(--accent); +} + +.row-stamp { + position: absolute; + left: 8px; + top: 4px; + font-size: 10px; + color: var(--muted-2); + opacity: 0; + font-variant-numeric: tabular-nums; +} + +.message-row:hover .row-stamp { + opacity: 1; +} + +.message-content { + min-width: 0; +} + +.message-actions { + display: flex; + align-items: flex-start; + gap: 4px; + padding-right: 12px; + opacity: 0; + transform: translateY(-50%); + position: absolute; + right: 8px; + top: 0; + background: var(--panel); + border: 1px solid var(--line-strong); + border-radius: 8px; + padding: 2px; + box-shadow: var(--shadow); + transition: + opacity 100ms ease, + transform 100ms ease; +} + +.message-row:hover .message-actions, +.message-row.selected .message-actions { + opacity: 1; +} + +.message-actions button { + width: 28px; + height: 28px; + display: grid; + place-items: center; + border: 0; + border-radius: 6px; + background: transparent; + color: var(--muted); +} + +.message-actions button:hover { + background: var(--hover-strong); + color: var(--text-strong); +} + +.markdown { + line-height: 1.5; + color: var(--text); + font-size: 14.5px; + overflow-wrap: anywhere; + word-break: break-word; +} + +.markdown > :first-child { + margin-top: 0; +} + +.markdown > :last-child { + margin-bottom: 0; +} + +.markdown p { + margin: 0; +} + +.markdown p + p, +.markdown ul, +.markdown ol, +.markdown blockquote, +.markdown pre { + margin-top: 6px; +} + +.markdown a { + color: var(--accent); + text-decoration: none; +} + +.markdown a:hover { + text-decoration: underline; +} + +.markdown code { + background: var(--panel-2); + border: 1px solid var(--line); + border-radius: 4px; + padding: 1px 5px; + font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; + font-size: 0.9em; +} + +.markdown pre { + background: var(--panel-2); + border: 1px solid var(--line); + border-radius: var(--radius); + padding: 12px 14px; + overflow-x: auto; +} + +.markdown pre code { + background: transparent; + border: 0; + padding: 0; +} + +.markdown blockquote { + border-left: 3px solid var(--accent); + margin: 0; + padding: 4px 0 4px 12px; + color: var(--muted); +} + +.markdown ul, +.markdown ol { + padding-left: 22px; +} + +.markdown img { + max-width: 100%; + max-height: 360px; + border-radius: var(--radius); + margin-top: 6px; + border: 1px solid var(--line); + object-fit: contain; + background: var(--panel); + cursor: zoom-in; +} + +.attachment-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); + gap: 8px; + margin-top: 8px; + max-width: 560px; +} + +.attachment-grid.compact { + grid-template-columns: minmax(0, 1fr); + max-width: 420px; +} + +.media-tile { + position: relative; + display: block; + width: 100%; + margin: 0; + padding: 0; + border: 1px solid var(--line); + border-radius: var(--radius-lg); + background: #0a0c12; + overflow: hidden; + isolation: isolate; + text-align: left; + color: inherit; + text-decoration: none; + cursor: pointer; + transition: + border-color 140ms ease, + transform 140ms ease, + box-shadow 140ms ease; +} + +.media-tile:hover { + border-color: var(--line-strong); + box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.9); +} + +.media-tile:focus-visible { + outline: none; + border-color: var(--line-strong); + box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); +} + +.media-tile--image { + cursor: zoom-in; +} + +.media-tile__open { + display: block; + width: 100%; + margin: 0; + padding: 0; + border: 0; + background: transparent; + color: inherit; + cursor: zoom-in; +} + +.media-tile__open:focus { + outline: 0; +} + +.media-tile__open:focus-visible + .media-tile__caption .media-tile__name { + text-decoration: underline; + text-decoration-thickness: 1px; + text-underline-offset: 3px; +} + +.media-tile--video { + cursor: default; +} + +.media-tile img, +.media-tile video { + display: block; + width: 100%; + max-height: 360px; + object-fit: contain; + background: #05070d; +} + +.media-tile--image img { + max-height: 320px; +} + +.media-tile__caption { + position: absolute; + inset: auto 0 0 0; + z-index: 3; + display: flex; + align-items: center; + gap: 8px; + padding: 22px 10px 8px; + background: linear-gradient( + to top, + rgba(0, 0, 0, 0.78) 0%, + rgba(0, 0, 0, 0.5) 40%, + rgba(0, 0, 0, 0) 100% + ); + opacity: 0; + pointer-events: auto; + transition: opacity 140ms ease; +} + +.media-tile:hover .media-tile__caption, +.media-tile:focus-within .media-tile__caption { + opacity: 1; +} + +.media-tile--video.is-started .media-tile__caption { + display: none; +} + +.media-tile__name { + flex: 1; + min-width: 0; + color: white; + font-size: 12px; + font-weight: 500; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} + +.media-tile__chip { + position: relative; + z-index: 4; + display: inline-grid; + place-items: center; + width: 28px; + height: 28px; + flex: none; + border-radius: 8px; + background: rgba(0, 0, 0, 0.5); + color: white; + border: 1px solid rgba(255, 255, 255, 0.18); + backdrop-filter: blur(10px); + text-decoration: none; + transition: + background 120ms ease, + border-color 120ms ease, + transform 120ms ease; +} + +.media-tile__chip:hover { + background: rgba(0, 0, 0, 0.7); + border-color: rgba(255, 255, 255, 0.32); + transform: translateY(-1px); +} + +.media-tile__play { + position: absolute; + inset: 0 0 48px 0; + display: grid; + place-items: center; + width: 100%; + height: auto; + border: 0; + margin: 0; + padding: 0; + background: transparent; + cursor: pointer; + z-index: 1; +} + +.media-tile__play::before { + content: ""; + position: absolute; + inset: 0; + background: radial-gradient( + ellipse at center, + rgba(0, 0, 0, 0.18) 0%, + rgba(0, 0, 0, 0.05) 45%, + rgba(0, 0, 0, 0) 70% + ); + opacity: 0.7; + transition: opacity 160ms ease; + pointer-events: none; +} + +.media-tile__play:hover::before { + opacity: 0.9; +} + +.media-tile__play-icon { + position: relative; + display: grid; + place-items: center; + width: 46px; + height: 46px; + border-radius: 999px; + background: rgba(0, 0, 0, 0.55); + color: white; + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.55); + padding-left: 3px; /* optical centering of the play glyph */ + transition: + transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), + background 180ms ease, + box-shadow 200ms ease; +} + +.media-tile__play-icon svg { + filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); +} + +.media-tile__play:hover .media-tile__play-icon { + transform: scale(1.06); + background: rgba(0, 0, 0, 0.7); + box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.65); +} + +.media-tile__play:active .media-tile__play-icon { + transform: scale(0.97); + transition-duration: 80ms; +} + +.media-tile__play:focus-visible { + outline: none; +} + +.media-tile__play:focus-visible .media-tile__play-icon { + box-shadow: + 0 0 0 2px rgba(255, 255, 255, 0.6), + 0 10px 28px -10px rgba(0, 0, 0, 0.65); +} + +.media-tile__duration { + position: absolute; + left: 8px; + bottom: 8px; + z-index: 2; + padding: 2px 6px; + border-radius: 4px; + background: rgba(0, 0, 0, 0.72); + color: white; + font-size: 11px; + font-variant-numeric: tabular-nums; + font-weight: 600; + letter-spacing: 0.02em; + pointer-events: none; +} + +.file-attachment { + display: flex; + align-items: center; + gap: 10px; + max-width: 360px; + padding: 10px; + border: 1px solid var(--line); + border-radius: var(--radius); + background: var(--panel); +} + +.file-attachment:hover { + border-color: var(--line-strong); + background: var(--panel-2); +} + +.file-icon { + width: 34px; + height: 34px; + display: grid; + place-items: center; + border-radius: 8px; + background: var(--accent-soft); + color: var(--accent); + font-weight: 800; +} + +.file-attachment strong, +.file-attachment small { + display: block; +} + +.file-attachment strong { + color: var(--text-strong); + font-size: 13px; +} + +.file-attachment small { + color: var(--muted); + font-size: 11px; +} + diff --git a/apps/web/src/styles/modals.css b/apps/web/src/styles/modals.css new file mode 100644 index 0000000..eb333d6 --- /dev/null +++ b/apps/web/src/styles/modals.css @@ -0,0 +1,620 @@ +/* ---------- ACCOUNT SETTINGS ---------- */ + +.modal-scrim { + position: fixed; + inset: 0; + z-index: 50; + display: grid; + place-items: center; + padding: 24px; + background: rgba(5, 8, 15, 0.54); + backdrop-filter: blur(14px); +} + +.modal-backdrop { + position: absolute; + inset: 0; + border: 0; + background: transparent; +} + +.modal-backdrop:focus { + outline: 0; +} + +.profile-modal { + position: relative; + z-index: 1; + width: min(480px, 100%); + border: 1px solid var(--line-strong); + border-radius: 14px; + background: var(--panel); + color: var(--text); + box-shadow: var(--shadow); + overflow: hidden; +} + +.profile-modal > header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; + padding: 18px 20px; + border-bottom: 1px solid var(--line); + background: var(--panel-2); +} + +.profile-modal p { + margin: 0 0 3px; + color: var(--muted); + font-size: 11px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.06em; +} + +.profile-modal h2 { + margin: 0; + color: var(--text-strong); + font-size: 20px; + letter-spacing: 0; +} + +.profile-modal > header button { + width: 32px; + height: 32px; + border: 0; + border-radius: 8px; + background: transparent; + color: var(--muted); + font-size: 22px; +} + +.profile-modal > header button:hover { + background: var(--hover); + color: var(--text-strong); +} + +.profile-form { + display: grid; + gap: 14px; + padding: 20px; +} + +.profile-preview { + display: flex; + align-items: center; + gap: 14px; + padding: 14px; + border: 1px solid var(--line); + border-radius: var(--radius); + background: var(--panel-2); +} + +.profile-preview strong, +.profile-preview span { + display: block; +} + +.profile-preview strong { + color: var(--text-strong); + font-size: 15px; +} + +.profile-preview span { + color: var(--muted); + font-size: 13px; +} + +.field { + display: grid; + gap: 6px; +} + +.field span { + color: var(--muted); + font-size: 12px; + font-weight: 700; +} + +.field input { + width: 100%; + height: 38px; + padding: 0 12px; + border: 1px solid var(--line); + border-radius: var(--radius-sm); + background: var(--panel-2); + color: var(--text); +} + +.field input:focus { + border-color: var(--accent); + outline: 0; + box-shadow: 0 0 0 3px var(--accent-soft); +} + +.profile-status { + color: var(--success); + font-size: 12px; +} + +.profile-status.error { + color: var(--danger); +} + +.profile-actions { + display: flex; + justify-content: flex-end; + gap: 8px; + padding-top: 4px; +} + +.ghost-action, +.primary-action { + height: 36px; + padding: 0 14px; + border-radius: var(--radius-sm); + font-weight: 700; +} + +.ghost-action { + border: 1px solid var(--line); + background: var(--panel); + color: var(--text); +} + +.primary-action { + border: 0; + background: var(--accent); + color: white; +} + +.ghost-action:hover { + background: var(--hover); +} + +.primary-action:hover { + filter: brightness(1.04); +} + +/* ---------- IMAGE VIEWER ---------- */ + +.image-viewer-scrim { + padding: 28px; + background: rgba(0, 0, 0, 0.78); + backdrop-filter: blur(18px); +} + +.image-viewer { + position: relative; + z-index: 1; + display: grid; + grid-template-rows: auto minmax(0, 1fr); + width: min(1120px, 100%); + max-height: min(86vh, 900px); + overflow: hidden; + border-radius: 14px; + background: #07090f; + color: white; + box-shadow: 0 34px 90px -34px rgba(0, 0, 0, 0.95); + animation: picker-in 150ms cubic-bezier(0.2, 0.8, 0.2, 1); +} + +.image-viewer > header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; + min-height: 52px; + padding: 10px 12px 10px 16px; + border-bottom: 1px solid rgba(255, 255, 255, 0.1); + background: rgba(255, 255, 255, 0.04); +} + +.image-viewer > header strong { + min-width: 0; + overflow: hidden; + color: white; + font-size: 13px; + text-overflow: ellipsis; + white-space: nowrap; +} + +.image-viewer > header div { + display: inline-flex; + align-items: center; + gap: 8px; + flex-shrink: 0; +} + +.image-viewer > header a { + height: 30px; + display: inline-flex; + align-items: center; + padding: 0 10px; + border-radius: 7px; + background: rgba(255, 255, 255, 0.08); + color: white; + font-size: 12px; + font-weight: 700; + text-decoration: none; +} + +.image-viewer > header a:hover { + background: rgba(255, 255, 255, 0.14); +} + +.image-viewer > header button { + width: 30px; + height: 30px; + display: grid; + place-items: center; + border: 0; + border-radius: 7px; + background: transparent; + color: rgba(255, 255, 255, 0.78); + font-size: 22px; + line-height: 1; +} + +.image-viewer > header button:hover { + background: rgba(255, 255, 255, 0.12); + color: white; +} + +.image-viewer-stage { + display: grid; + place-items: center; + min-height: 0; + padding: 18px; +} + +.image-viewer-stage img { + display: block; + max-width: 100%; + max-height: calc(86vh - 96px); + object-fit: contain; + border-radius: 8px; + background: rgba(255, 255, 255, 0.04); +} + +/* ---------- MOBILE ---------- */ + +.mobile-nav-toggle { + display: none; + position: fixed; + top: 14px; + left: 14px; + z-index: 30; + width: 38px; + height: 38px; + border-radius: 10px; + border: 1px solid var(--line-strong); + background: var(--panel); + color: var(--text); + font-size: 22px; + line-height: 1; +} + +.mobile-nav-toggle .bars { + display: grid; + gap: 3px; +} + +.mobile-nav-toggle .bars i { + display: block; + width: 16px; + height: 2px; + background: currentColor; + border-radius: 2px; +} + +@media (max-width: 1180px) { + .shell { + grid-template-columns: 72px 240px minmax(0, 1fr); + } + .shell.sidebar-collapsed, + .shell.sidebar-collapsed.thread-open { + grid-template-columns: 72px 0 minmax(0, 1fr); + } + .thread { + position: fixed; + inset: 0 0 0 auto; + width: min(420px, 100vw); + box-shadow: var(--shadow); + transform: translateX(100%); + transition: transform 180ms ease; + z-index: 4; + border-left: 1px solid var(--line-strong); + } + .thread.open { + transform: translateX(0); + } +} + +@media (max-width: 820px) { + .mobile-nav-toggle { + display: grid; + place-items: center; + } + .shell { + grid-template-columns: 1fr; + } + .shell.thread-open, + .shell.sidebar-collapsed, + .shell.sidebar-collapsed.thread-open { + grid-template-columns: 1fr; + } + .sidebar-collapsed .sidebar { + opacity: 1; + pointer-events: auto; + transform: translateX(-100%); + } + .guild-rail, + .sidebar { + position: fixed; + inset: 0 auto 0 0; + z-index: 20; + transform: translateX(-100%); + transition: transform 180ms ease; + } + .guild-rail { + width: 72px; + } + .sidebar { + left: 72px; + width: 260px; + } + .nav-open .guild-rail, + .nav-open .sidebar { + transform: translateX(0); + } + .topbar { + padding-left: 64px; + } + .search { + width: 180px; + } +} + +@media (max-width: 520px) { + .search { + display: none; + } + .topbar-meta, + .topbar-divider { + display: none; + } +} + +/* Inline quote-reply */ +.message-row.highlight, +.thread-root.highlight, +.reply.highlight { + animation: quote-flash 1.4s ease-out; +} + +@keyframes quote-flash { + 0% { + background: rgba(99, 102, 241, 0.22); + } + 100% { + background: transparent; + } +} + +.quote-block { + display: inline-flex; + align-items: stretch; + gap: 0.5rem; + margin: 0 0 0.35rem; + padding: 0.25rem 0.5rem 0.25rem 0; + background: transparent; + border: 0; + border-radius: 6px; + color: inherit; + cursor: pointer; + text-align: left; + max-width: 100%; + font: inherit; +} + +.quote-block:hover:not(:disabled) { + background: rgba(99, 102, 241, 0.08); +} + +.quote-block:disabled { + cursor: default; + opacity: 0.75; +} + +.quote-block .quote-bar { + width: 3px; + align-self: stretch; + background: var(--accent, #6366f1); + border-radius: 2px; + flex: 0 0 3px; +} + +.quote-block .quote-content { + display: flex; + flex-direction: column; + gap: 0.1rem; + min-width: 0; +} + +.quote-block .quote-author { + font-size: 0.78rem; + font-weight: 600; + color: var(--accent, #6366f1); +} + +.quote-block .quote-snippet { + font-size: 0.85rem; + color: var(--text-muted, #6b7280); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 56ch; +} + +.quote-block .quote-snippet.muted { + font-style: italic; + opacity: 0.75; +} + +.quote-preview { + display: flex; + align-items: center; + gap: 0.5rem; + padding: 6px 10px 6px 12px; + margin: 0; + background: color-mix(in srgb, var(--accent) 5%, transparent); + border: 0; + border-bottom: 1px solid var(--line); + border-radius: 0; + font-size: 12.5px; + color: var(--muted); +} + +.quote-preview .quote-bar { + display: none; +} + +.quote-preview-body { + display: flex; + align-items: baseline; + gap: 0.4rem; + flex: 1; + min-width: 0; + overflow: hidden; +} + +.quote-preview-label { + font-size: 12px; + color: color-mix(in srgb, var(--accent) 85%, var(--text)); + white-space: nowrap; +} + +.quote-preview-label strong { + color: var(--text-strong); + font-weight: 600; +} + +.quote-preview-snippet { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: var(--muted); + font-size: 12px; + flex: 1; + min-width: 0; +} + +.quote-preview-clear { + background: transparent; + border: 0; + color: var(--muted); + font-size: 16px; + line-height: 1; + cursor: pointer; + padding: 2px 6px; + border-radius: 6px; + transition: + background 100ms ease, + color 100ms ease; +} + +.quote-preview-clear:hover { + color: var(--text-strong); + background: var(--hover-strong); +} + +.reply-quote-btn { + position: relative; + margin-left: auto; + background: transparent; + border: 0; + color: var(--text-muted, #6b7280); + cursor: pointer; + font-size: 0.95rem; + padding: 0 0.3rem; + opacity: 0; + transition: opacity 0.15s; +} + +.reply:hover .reply-quote-btn, +.thread-root:hover .reply-quote-btn, +.reply-quote-btn:focus-visible { + opacity: 1; +} + +.reply-quote-btn:hover { + color: var(--accent, #6366f1); +} + +.tooltip { + position: relative; +} + +.tooltip::before, +.reply-quote-btn::before { + content: attr(data-tooltip); + position: absolute; + left: 50%; + bottom: calc(100% + 12px); + z-index: 20; + transform: translate(-50%, 4px) scale(0.96); + padding: 0.42rem 0.62rem; + border-radius: 9px; + background: #3a3a44; + color: #f4f4f7; + box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); + font-size: 0.78rem; + font-weight: 700; + line-height: 1; + white-space: nowrap; + opacity: 0; + pointer-events: none; + transition: + opacity 120ms ease, + transform 120ms ease; +} + +.tooltip::after, +.reply-quote-btn::after { + content: ""; + position: absolute; + left: 50%; + bottom: calc(100% + 5px); + z-index: 20; + width: 12px; + height: 12px; + border-radius: 2px; + background: #3a3a44; + transform: translate(-50%, 4px) rotate(45deg) scale(0.9); + opacity: 0; + pointer-events: none; + transition: + opacity 120ms ease, + transform 120ms ease; +} + +.tooltip:hover::before, +.tooltip:focus-visible::before, +.reply-quote-btn:hover::before, +.reply-quote-btn:focus-visible::before, +.tooltip:hover::after, +.tooltip:focus-visible::after, +.reply-quote-btn:hover::after, +.reply-quote-btn:focus-visible::after { + opacity: 1; + transform: translate(-50%, 0) scale(1); +} + +.tooltip:hover::after, +.tooltip:focus-visible::after, +.reply-quote-btn:hover::after, +.reply-quote-btn:focus-visible::after { + transform: translate(-50%, 0) rotate(45deg) scale(1); +} diff --git a/apps/web/src/styles/sidebar.css b/apps/web/src/styles/sidebar.css new file mode 100644 index 0000000..7e70af4 --- /dev/null +++ b/apps/web/src/styles/sidebar.css @@ -0,0 +1,476 @@ +/* ---------- GUILD RAIL (Discord style) ---------- */ + +.guild-rail { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; + padding: 14px 0; + background: var(--rail); + border-right: 1px solid var(--line); + overflow-y: auto; + position: relative; +} + +.guild-rail .guild { + width: 48px; + height: 48px; + border-radius: 16px; + display: grid; + place-items: center; + background: var(--panel-2); + color: var(--text); + border: 0; + font-weight: 700; + font-size: 14px; + letter-spacing: -0.02em; + position: relative; + transition: + border-radius 140ms ease, + background 120ms ease, + transform 120ms ease; + box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset; +} + +.guild-rail .guild:hover { + border-radius: 12px; + background: var(--accent); + color: white; + box-shadow: 0 8px 24px -10px rgba(111, 126, 255, 0.6); +} + +.guild-rail .guild.home { + background: linear-gradient(135deg, var(--accent), #b46cff); + color: white; + font-weight: 800; +} + +.guild-rail .guild.home:hover { + border-radius: 12px; + filter: brightness(1.1); +} + +.guild-rail .guild.add { + background: transparent; + color: var(--success); + border: 1px dashed rgba(46, 204, 113, 0.4); +} + +.guild-rail .guild.add:hover { + background: rgba(46, 204, 113, 0.12); + color: white; + border-style: solid; + border-color: var(--success); +} + +.guild-divider { + width: 36px; + height: 1px; + background: var(--line-strong); + margin: 4px 0; +} + +.guild-list { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; +} + +.guild-wrap { + position: relative; +} + +.guild-wrap::before { + content: ""; + position: absolute; + left: -14px; + top: 50%; + transform: translate(0, -50%) scaleY(0.2); + width: 4px; + height: 28px; + border-radius: 0 4px 4px 0; + background: var(--text-strong); + opacity: 0; + transition: + opacity 140ms ease, + transform 140ms ease; +} + +.guild-wrap:hover::before { + opacity: 0.6; + transform: translate(0, -50%) scaleY(0.5); +} + +.guild-wrap.active::before { + opacity: 1; + transform: translate(0, -50%) scaleY(1); +} + +.guild-wrap.active .guild { + border-radius: 14px; + background: var(--accent); + color: white; +} + +.guild-create { + position: absolute; + left: 100%; + top: 14px; + margin-left: 8px; + background: var(--panel); + border: 1px solid var(--line-strong); + border-radius: var(--radius); + padding: 8px; + box-shadow: var(--shadow); + z-index: 20; +} + +.guild-create input { + height: 32px; + padding: 0 10px; + width: 200px; + border-radius: var(--radius-sm); + background: var(--panel-2); + color: var(--text); +} + +/* ---------- SIDEBAR (Slack style) ---------- */ + +.sidebar { + display: grid; + grid-template-rows: auto minmax(0, 1fr) auto; + background: var(--panel); + border-right: 1px solid var(--line); + overflow: hidden; + min-width: 0; + transition: + opacity 160ms ease, + transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1); +} + +.sidebar-collapsed .sidebar { + opacity: 0; + pointer-events: none; + transform: translateX(-14px); +} + +.workspace-header { + padding: 14px 16px; + border-bottom: 1px solid var(--line); + display: flex; + align-items: center; + justify-content: space-between; + min-height: 60px; +} + +.sidebar-collapse { + width: 30px; + height: 30px; + display: grid; + place-items: center; + border: 0; + border-radius: 8px; + background: var(--panel-2); + color: var(--muted); + transition: + color 120ms ease, + background 120ms ease, + transform 120ms ease; +} + +.sidebar-collapse:hover { + background: var(--panel-3); + color: var(--text-strong); + transform: translateX(-1px); +} + +.workspace-name { + display: flex; + flex-direction: column; + gap: 2px; + min-width: 0; +} + +.workspace-name strong { + color: var(--text-strong); + letter-spacing: -0.01em; + font-size: 15px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.workspace-name .presence { + display: inline-flex; + align-items: center; + gap: 6px; + color: var(--muted); + font-size: 11px; +} + +.workspace-name .presence::before { + content: ""; + width: 7px; + height: 7px; + border-radius: 50%; + background: var(--muted-2); +} + +.workspace-name .presence.online { + color: var(--success); +} + +.workspace-name .presence.online::before { + background: var(--success); + box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.18); +} + +.sidebar-scroll { + overflow-y: auto; + padding: 12px 8px 16px; +} + +.nav-section + .nav-section { + margin-top: 12px; +} + +.section-title { + display: flex; + align-items: center; + gap: 6px; + width: 100%; + border: 0; + background: transparent; + color: var(--muted); + text-transform: uppercase; + font-size: 11px; + font-weight: 700; + letter-spacing: 0.04em; + padding: 6px 8px; + border-radius: var(--radius-sm); +} + +.section-title:hover { + color: var(--text); + background: var(--hover); +} + +.section-title .caret { + font-size: 10px; + opacity: 0.7; +} + +.section-title .label { + flex: 1; + text-align: left; +} + +.section-title .add-button { + width: 18px; + height: 18px; + border-radius: 4px; + display: grid; + place-items: center; + font-size: 14px; + font-weight: 700; + background: rgba(255, 255, 255, 0.06); + color: var(--text); +} + +.section-title:hover .add-button { + background: var(--accent); + color: white; +} + +.nav-list { + display: flex; + flex-direction: column; + gap: 1px; + margin-top: 4px; +} + +.nav-item { + display: flex; + align-items: center; + gap: 8px; + width: 100%; + border: 0; + border-radius: var(--radius-sm); + background: transparent; + color: var(--muted); + text-align: left; + padding: 6px 10px; + min-height: 30px; + transition: + background 100ms ease, + color 100ms ease; +} + +.nav-item:hover { + background: var(--hover); + color: var(--text); +} + +.nav-item.active { + background: var(--accent-soft); + color: var(--text-strong); +} + +.nav-item .hash { + color: var(--muted); + font-weight: 600; + width: 14px; + text-align: center; +} + +.nav-item.active .hash { + color: var(--accent); +} + +.nav-label { + flex: 1; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 14px; +} + +.nav-empty { + margin: 4px 8px; + color: var(--muted-2); + font-size: 12px; +} + +.dm-avatar { + width: 22px; + height: 22px; + border-radius: 50%; + display: grid; + place-items: center; + font-size: 11px; + font-weight: 700; + color: white; + background: linear-gradient( + 135deg, + hsl(var(--hue, 220deg) 70% 55%), + hsl(calc(var(--hue, 220deg) + 40deg) 70% 45%) + ); + flex-shrink: 0; + overflow: hidden; +} + +.dm-avatar img, +.avatar img { + width: 100%; + height: 100%; + display: block; + object-fit: cover; +} + +.presence-dot { + width: 8px; + height: 8px; + border-radius: 50%; + background: var(--muted-2); + flex-shrink: 0; +} + +.presence-dot.active { + background: var(--success); + box-shadow: 0 0 0 2px var(--panel); +} + +.inline-create { + display: grid; + grid-template-columns: minmax(0, 1fr) auto; + gap: 6px; + margin: 6px 4px 2px; +} + +.inline-create input { + width: 100%; + min-width: 0; + height: 30px; + padding: 0 10px; + border-radius: var(--radius-sm); + background: var(--panel-2); + color: var(--text); + border: 1px solid var(--line); +} + +.inline-create input:focus { + border-color: var(--accent); + background: var(--panel-3); +} + +.inline-create button.ghost, +button.ghost { + width: 30px; + height: 30px; + border: 0; + border-radius: var(--radius-sm); + background: var(--panel-3); + color: var(--muted); + font-weight: 600; + padding: 0; + font-size: 14px; + display: grid; + place-items: center; +} + +.inline-create button.ghost:hover { + background: var(--accent); + color: white; +} + +.user-card { + display: flex; + align-items: center; + gap: 10px; + width: 100%; + padding: 10px 12px; + background: var(--panel-2); + border-top: 1px solid var(--line); + border-right: 0; + border-bottom: 0; + border-left: 0; + color: inherit; + text-align: left; + cursor: pointer; + transition: background 120ms ease; +} + +.user-card:hover { + background: var(--panel-3); +} + +.user-card .dm-avatar { + width: 28px; + height: 28px; + font-size: 12px; +} + +.user-card .user-meta { + flex: 1; + min-width: 0; +} + +.user-card .user-meta strong { + display: block; + color: var(--text-strong); + font-size: 13px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.user-card .user-meta span { + display: block; + color: var(--muted); + font-size: 11px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + diff --git a/apps/web/src/styles/thread.css b/apps/web/src/styles/thread.css new file mode 100644 index 0000000..eb0d3ce --- /dev/null +++ b/apps/web/src/styles/thread.css @@ -0,0 +1,326 @@ +/* ---------- THREAD ---------- */ + +.thread { + display: grid; + grid-template-rows: auto minmax(0, 1fr) auto; + background: var(--panel); + border-left: 1px solid var(--line); + min-width: 0; + overflow: hidden; + opacity: 0; + transform: translateX(28px); + pointer-events: none; + transition: + opacity 180ms ease, + transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1); +} + +.thread.open { + opacity: 1; + transform: translateX(0); + pointer-events: auto; +} + +.thread > header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12px 16px; + min-height: 60px; + border-bottom: 1px solid var(--line); + background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent), var(--panel); +} + +.thread > header p, +.thread > header strong { + margin: 0; +} + +.thread > header p { + color: var(--muted); + font-size: 11px; + text-transform: uppercase; + letter-spacing: 0.04em; + font-weight: 700; +} + +.thread > header strong { + display: block; + color: var(--text-strong); + font-size: 14px; +} + +.thread .close { + width: 28px; + height: 28px; + border: 0; + border-radius: 50%; + background: var(--panel-2); + color: var(--muted); + font-size: 18px; + line-height: 1; +} + +.thread .close:hover { + background: var(--panel-3); + color: var(--text-strong); +} + +.thread-scroll { + overflow-y: auto; + padding: 12px 16px; +} + +.thread-root { + display: grid; + grid-template-columns: 38px minmax(0, 1fr); + gap: 12px; + padding-bottom: 12px; + border-bottom: 1px solid var(--line); +} + +.thread-divider { + display: flex; + align-items: center; + gap: 10px; + margin: 14px 0 10px; +} + +.thread-divider::before, +.thread-divider::after { + content: ""; + flex: 1; + height: 1px; + background: var(--line); +} + +.thread-divider span { + font-size: 11px; + color: var(--muted); + text-transform: uppercase; + letter-spacing: 0.04em; + font-weight: 700; +} + +.reply-list { + display: flex; + flex-direction: column; + gap: 10px; +} + +.reply { + display: grid; + grid-template-columns: 30px minmax(0, 1fr); + gap: 10px; + padding: 6px; + border-radius: var(--radius-sm); +} + +.reply:hover { + background: var(--hover); +} + +.reply-composer { + padding: 10px 14px 14px; + background: var(--panel); + border-top: 1px solid var(--line); +} + +.reply-composer .composer-row { + border-radius: 0; +} + +.thread-empty { + display: grid; + place-items: center; + align-content: center; + gap: 8px; + padding: 32px 24px; + text-align: center; + grid-row: span 3; +} + +.thread-icon { + width: 56px; + height: 56px; + border-radius: 16px; + background: var(--panel-2); + color: var(--muted); + display: grid; + place-items: center; +} + +.thread-empty strong { + color: var(--text-strong); + font-size: 15px; +} + +.thread-empty span { + color: var(--muted); + font-size: 13px; + max-width: 260px; + line-height: 1.5; +} + +/* ---------- PROFILE PANE ---------- */ + +.profile-pane { + overflow-y: auto; +} + +.profile-hero { + min-height: 210px; + display: grid; + place-items: end center; + padding: 28px 20px; + background: + linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.24)), + linear-gradient( + 135deg, + hsl(var(--hue, 220deg) 76% 58%), + hsl(calc(var(--hue, 220deg) + 54deg) 74% 38%) + ); + border-bottom: 1px solid var(--line); +} + +.profile-avatar { + width: min(240px, 70%); + aspect-ratio: 1; + display: grid; + place-items: center; + overflow: hidden; + border-radius: 16px; + background: rgba(255, 255, 255, 0.18); + color: white; + font-size: clamp(48px, 12vw, 88px); + font-weight: 800; + box-shadow: 0 26px 60px -30px rgba(0, 0, 0, 0.9); +} + +.profile-avatar img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.profile-pane-body { + display: grid; + gap: 18px; + padding: 18px 16px 22px; +} + +.profile-pane-title { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; +} + +.profile-pane-title h2 { + margin: 0; + color: var(--text-strong); + font-size: 22px; + letter-spacing: 0; +} + +.profile-pane-title span { + display: block; + margin-top: 3px; + color: var(--muted); + font-size: 13px; +} + +.text-action { + border: 0; + border-radius: 6px; + background: transparent; + color: var(--accent); + font-size: 13px; + font-weight: 700; + padding: 4px 6px; +} + +.text-action:hover { + background: var(--accent-soft); +} + +.profile-presence { + display: inline-flex; + align-items: center; + gap: 8px; + color: var(--text); + font-size: 14px; +} + +.profile-actions-row { + display: flex; + gap: 8px; + flex-wrap: wrap; +} + +.profile-actions-row .primary-action, +.profile-actions-row .ghost-action { + min-width: 110px; +} + +.profile-info { + display: grid; + gap: 12px; + padding-top: 18px; + border-top: 1px solid var(--line); +} + +.profile-info header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; +} + +.profile-info header strong { + color: var(--text-strong); + font-size: 14px; +} + +.profile-info-row { + display: grid; + grid-template-columns: 34px minmax(0, 1fr); + gap: 10px; + align-items: center; +} + +.info-icon { + width: 34px; + height: 34px; + display: grid; + place-items: center; + border-radius: 9px; + background: var(--panel-2); + color: var(--muted); + font-size: 11px; + font-weight: 800; +} + +.profile-info-row small, +.profile-info-row span { + display: block; +} + +.profile-info-row small { + color: var(--muted); + font-size: 11px; +} + +.profile-info-row span { + color: var(--text); + font-size: 13px; + overflow-wrap: anywhere; +} + +.profile-note { + margin: 0; + color: var(--muted); + line-height: 1.5; + font-size: 13px; +} + From 9e9e5c38cba5cd9c1a9f2dc12a6aacf994f7b315 Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 8 May 2026 15:31:11 +0100 Subject: [PATCH 7/7] chore: update embedded web assets --- .../webassets/dist/assets/index-BXrPY37w.js | 72 ------------------- .../webassets/dist/assets/index-CJGH_9qR.js | 72 +++++++++++++++++++ ...{index-C_U7opSQ.css => index-DqdK3eqN.css} | 2 +- apps/api/internal/webassets/dist/index.html | 4 +- 4 files changed, 75 insertions(+), 75 deletions(-) delete mode 100644 apps/api/internal/webassets/dist/assets/index-BXrPY37w.js create mode 100644 apps/api/internal/webassets/dist/assets/index-CJGH_9qR.js rename apps/api/internal/webassets/dist/assets/{index-C_U7opSQ.css => index-DqdK3eqN.css} (78%) diff --git a/apps/api/internal/webassets/dist/assets/index-BXrPY37w.js b/apps/api/internal/webassets/dist/assets/index-BXrPY37w.js deleted file mode 100644 index 1521542..0000000 --- a/apps/api/internal/webassets/dist/assets/index-BXrPY37w.js +++ /dev/null @@ -1,72 +0,0 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const nc=!1;var al=Array.isArray,rc=Array.prototype.indexOf,Or=Array.prototype.includes,Qa=Array.from,ac=Object.defineProperty,Lr=Object.getOwnPropertyDescriptor,il=Object.getOwnPropertyDescriptors,ic=Object.prototype,sc=Array.prototype,Ui=Object.getPrototypeOf,Ts=Object.isExtensible;const lc=()=>{};function oc(t){return t()}function ki(t){for(var e=0;e{t=a,e=r});return{promise:n,resolve:t,reject:e}}const st=2,Mr=4,ka=8,ll=1<<24,ln=16,Jt=32,Hn=64,wi=128,Ut=512,Me=1024,et=2048,Kt=4096,vt=8192,Dt=16384,fr=32768,yi=1<<25,Pr=65536,xi=1<<17,ol=1<<18,dr=1<<19,cl=1<<20,sn=1<<25,sr=65536,ja=1<<21,ma=1<<22,Bn=1<<23,nr=Symbol("$state"),cc=Symbol("legacy props"),uc=Symbol(""),wn=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},fc=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function ul(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function dc(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function pc(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function hc(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function vc(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function gc(t){throw new Error("https://svelte.dev/e/effect_orphan")}function mc(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function _c(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function bc(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function kc(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function wc(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function yc(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const xc=1,Tc=2,fl=4,Sc=8,Ec=16,Ac=1,Rc=2,Cc=4,Ic=8,Dc=16,Lc=1,Oc=2,qe=Symbol(),dl="http://www.w3.org/1999/xhtml",Mc="http://www.w3.org/2000/svg",Pc="http://www.w3.org/1998/Math/MathML";function Nc(){console.warn("https://svelte.dev/e/derived_inert")}function zc(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function pl(t){return t===this.v}function hl(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function vl(t){return!hl(t,this.v)}let Ur=!1,Fc=!1;function Uc(){Ur=!0}let we=null;function Nr(t){we=t}function Wt(t,e=!1,n){we={p:we,i:!1,c:null,e:null,s:t,x:null,r:J,l:Ur&&!e?{s:null,u:null,$:[]}:null}}function jt(t){var e=we,n=e.e;if(n!==null){e.e=null;for(var a of n)Nl(a)}return e.i=!0,we=e.p,{}}function wa(){return!Ur||we!==null&&we.l===null}let $n=[];function gl(){var t=$n;$n=[],ki(t)}function Gn(t){if($n.length===0&&!va){var e=$n;queueMicrotask(()=>{e===$n&&gl()})}$n.push(t)}function Bc(){for(;$n.length>0;)gl()}function ml(t){var e=J;if(e===null)return re.f|=Bn,t;if((e.f&fr)===0&&(e.f&Mr)===0)throw t;Fn(t,e)}function Fn(t,e){for(;e!==null;){if((e.f&wi)!==0){if((e.f&fr)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const Gc=-7169;function Ae(t,e){t.f=t.f&Gc|e}function Bi(t){(t.f&Ut)!==0||t.deps===null?Ae(t,Me):Ae(t,Kt)}function _l(t){if(t!==null)for(const e of t)(e.f&st)===0||(e.f&sr)===0||(e.f^=sr,_l(e.deps))}function bl(t,e,n){(t.f&et)!==0?e.add(t):(t.f&Kt)!==0&&n.add(t),_l(t.deps),Ae(t,Me)}let Fa=!1;function Hc(t){var e=Fa;try{return Fa=!1,[t(),Fa]}finally{Fa=e}}const Vn=new Set;let K=null,Vt=null,Ti=null,va=!1,di=!1,Rr=null,qa=null;var Ss=0;let qc=1;class qn{id=qc++;current=new Map;previous=new Map;#n=new Set;#o=new Set;#e=new Set;#a=new Map;#r=new Map;#i=null;#t=[];#s=[];#c=new Set;#u=new Set;#l=new Map;#d=new Set;is_fork=!1;#h=!1;#p=new Set;#f(){return this.is_fork||this.#r.size>0}#m(){for(const a of this.#p)for(const r of a.#r.keys()){for(var e=!1,n=r;n.parent!==null;){if(this.#l.has(n)){e=!0;break}n=n.parent}if(!e)return!0}return!1}skip_effect(e){this.#l.has(e)||this.#l.set(e,{d:[],m:[]}),this.#d.delete(e)}unskip_effect(e,n=a=>this.schedule(a)){var a=this.#l.get(e);if(a){this.#l.delete(e);for(var r of a.d)Ae(r,et),n(r);for(r of a.m)Ae(r,Kt),n(r)}this.#d.add(e)}#v(){if(Ss++>1e3&&(Vn.delete(this),jc()),!this.#f()){for(const c of this.#c)this.#u.delete(c),Ae(c,et),this.schedule(c);for(const c of this.#u)Ae(c,Kt),this.schedule(c)}const e=this.#t;this.#t=[],this.apply();var n=Rr=[],a=[],r=qa=[];for(const c of e)try{this.#_(c,n,a)}catch(o){throw yl(c),o}if(K=null,r.length>0){var s=qn.ensure();for(const c of r)s.schedule(c)}if(Rr=null,qa=null,this.#f()||this.#m()){this.#g(a),this.#g(n);for(const[c,o]of this.#l)wl(c,o)}else{this.#a.size===0&&Vn.delete(this),this.#c.clear(),this.#u.clear();for(const c of this.#n)c(this);this.#n.clear(),Es(a),Es(n),this.#i?.resolve()}var l=K;if(this.#t.length>0){const c=l??=this;c.#t.push(...this.#t.filter(o=>!c.#t.includes(o)))}l!==null&&(Vn.add(l),l.#v())}#_(e,n,a){e.f^=Me;for(var r=e.first;r!==null;){var s=r.f,l=(s&(Jt|Hn))!==0,c=l&&(s&Me)!==0,o=c||(s&vt)!==0||this.#l.has(r);if(!o&&r.fn!==null){l?r.f^=Me:(s&Mr)!==0?n.push(r):Gr(r)&&((s&ln)!==0&&this.#u.add(r),cr(r));var u=r.first;if(u!==null){r=u;continue}}for(;r!==null;){var f=r.next;if(f!==null){r=f;break}r=r.parent}}}#g(e){for(var n=0;n!this.current.has(m));if(r.length===0)e&&f.discard();else if(n.length>0){if(e)for(const m of this.#d)f.unskip_effect(m,v=>{(v.f&(ln|ma))!==0?f.schedule(v):f.#g([v])});f.activate();var s=new Set,l=new Map;for(var c of n)kl(c,r,s,l);l=new Map;var o=[...f.current.keys()].filter(m=>this.current.has(m)?this.current.get(m)[0]!==m:!0);for(const m of this.#s)(m.f&(Dt|vt|xi))===0&&Gi(m,o,l)&&((m.f&(ma|ln))!==0?(Ae(m,et),f.schedule(m)):f.#c.add(m));if(f.#t.length>0){f.apply();for(var u of f.#t)f.#_(u,[],[]);f.#t=[]}f.deactivate()}}for(const f of Vn)f.#p.has(this)&&(f.#p.delete(this),f.#p.size===0&&!f.#f()&&(f.activate(),f.#v()))}increment(e,n){let a=this.#a.get(n)??0;if(this.#a.set(n,a+1),e){let r=this.#r.get(n)??0;this.#r.set(n,r+1)}}decrement(e,n,a){let r=this.#a.get(n)??0;if(r===1?this.#a.delete(n):this.#a.set(n,r-1),e){let s=this.#r.get(n)??0;s===1?this.#r.delete(n):this.#r.set(n,s-1)}this.#h||a||(this.#h=!0,Gn(()=>{this.#h=!1,this.flush()}))}transfer_effects(e,n){for(const a of e)this.#c.add(a);for(const a of n)this.#u.add(a);e.clear(),n.clear()}oncommit(e){this.#n.add(e)}ondiscard(e){this.#o.add(e)}on_fork_commit(e){this.#e.add(e)}run_fork_commit_callbacks(){for(const e of this.#e)e(this);this.#e.clear()}settled(){return(this.#i??=sl()).promise}static ensure(){if(K===null){const e=K=new qn;di||(Vn.add(K),va||Gn(()=>{K===e&&e.flush()}))}return K}apply(){{Vt=null;return}}schedule(e){if(Ti=e,e.b?.is_pending&&(e.f&(Mr|ka|ll))!==0&&(e.f&fr)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var a=n.f;if(Rr!==null&&n===J&&(re===null||(re.f&st)===0))return;if((a&(Hn|Jt))!==0){if((a&Me)===0)return;n.f^=Me}}this.#t.push(n)}}function Wc(t){var e=va;va=!0;try{for(var n;;){if(Bc(),K===null)return n;K.flush()}}finally{va=e}}function jc(){try{mc()}catch(t){Fn(t,Ti)}}let kn=null;function Es(t){var e=t.length;if(e!==0){for(var n=0;n0)){rr.clear();for(const r of kn){if((r.f&(Dt|vt))!==0)continue;const s=[r];let l=r.parent;for(;l!==null;)kn.has(l)&&(kn.delete(l),s.push(l)),l=l.parent;for(let c=s.length-1;c>=0;c--){const o=s[c];(o.f&(Dt|vt))===0&&cr(o)}}kn.clear()}}kn=null}}function kl(t,e,n,a){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const r of t.reactions){const s=r.f;(s&st)!==0?kl(r,e,n,a):(s&(ma|ln))!==0&&(s&et)===0&&Gi(r,e,a)&&(Ae(r,et),Hi(r))}}function Gi(t,e,n){const a=n.get(t);if(a!==void 0)return a;if(t.deps!==null)for(const r of t.deps){if(Or.call(e,r))return!0;if((r.f&st)!==0&&Gi(r,e,n))return n.set(r,!0),!0}return n.set(t,!1),!1}function Hi(t){K.schedule(t)}function wl(t,e){if(!((t.f&Jt)!==0&&(t.f&Me)!==0)){(t.f&et)!==0?e.d.push(t):(t.f&Kt)!==0&&e.m.push(t),Ae(t,Me);for(var n=t.first;n!==null;)wl(n,e),n=n.next}}function yl(t){Ae(t,Me);for(var e=t.first;e!==null;)yl(e),e=e.next}function Zc(t){let e=0,n=or(0),a;return()=>{Wi()&&(i(n),Br(()=>(e===0&&(a=T(()=>t(()=>ga(n)))),e+=1,()=>{Gn(()=>{e-=1,e===0&&(a?.(),a=void 0,ga(n))})})))}}var Yc=Pr|dr;function Xc(t,e,n,a){new Vc(t,e,n,a)}class Vc{parent;is_pending=!1;transform_error;#n;#o=null;#e;#a;#r;#i=null;#t=null;#s=null;#c=null;#u=0;#l=0;#d=!1;#h=new Set;#p=new Set;#f=null;#m=Zc(()=>(this.#f=or(this.#u),()=>{this.#f=null}));constructor(e,n,a,r){this.#n=e,this.#e=n,this.#a=s=>{var l=J;l.b=this,l.f|=wi,a(s)},this.parent=J.b,this.transform_error=r??this.parent?.transform_error??(s=>s),this.#r=Ka(()=>{this.#b()},Yc)}#v(){try{this.#i=Ft(()=>this.#a(this.#n))}catch(e){this.error(e)}}#_(e){const n=this.#e.failed;n&&(this.#s=Ft(()=>{n(this.#n,()=>e,()=>()=>{})}))}#g(){const e=this.#e.pending;e&&(this.is_pending=!0,this.#t=Ft(()=>e(this.#n)),Gn(()=>{var n=this.#c=document.createDocumentFragment(),a=on();n.append(a),this.#i=this.#w(()=>Ft(()=>this.#a(a))),this.#l===0&&(this.#n.before(n),this.#c=null,ar(this.#t,()=>{this.#t=null}),this.#k(K))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#u=0,this.#i=Ft(()=>{this.#a(this.#n)}),this.#l>0){var e=this.#c=document.createDocumentFragment();Xi(this.#i,e);const n=this.#e.pending;this.#t=Ft(()=>n(this.#n))}else this.#k(K)}catch(n){this.error(n)}}#k(e){this.is_pending=!1,e.transfer_effects(this.#h,this.#p)}defer_effect(e){bl(e,this.#h,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#e.pending}#w(e){var n=J,a=re,r=we;Ht(this.#r),Gt(this.#r),Nr(this.#r.ctx);try{return qn.ensure(),e()}catch(s){return ml(s),null}finally{Ht(n),Gt(a),Nr(r)}}#y(e,n){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(e,n);return}this.#l+=e,this.#l===0&&(this.#k(n),this.#t&&ar(this.#t,()=>{this.#t=null}),this.#c&&(this.#n.before(this.#c),this.#c=null))}update_pending_count(e,n){this.#y(e,n),this.#u+=e,!(!this.#f||this.#d)&&(this.#d=!0,Gn(()=>{this.#d=!1,this.#f&&zr(this.#f,this.#u)}))}get_effect_pending(){return this.#m(),i(this.#f)}error(e){if(!this.#e.onerror&&!this.#e.failed)throw e;K?.is_fork?(this.#i&&K.skip_effect(this.#i),this.#t&&K.skip_effect(this.#t),this.#s&&K.skip_effect(this.#s),K.on_fork_commit(()=>{this.#x(e)})):this.#x(e)}#x(e){this.#i&&(yt(this.#i),this.#i=null),this.#t&&(yt(this.#t),this.#t=null),this.#s&&(yt(this.#s),this.#s=null);var n=this.#e.onerror;let a=this.#e.failed;var r=!1,s=!1;const l=()=>{if(r){zc();return}r=!0,s&&yc(),this.#s!==null&&ar(this.#s,()=>{this.#s=null}),this.#w(()=>{this.#b()})},c=o=>{try{s=!0,n?.(o,l),s=!1}catch(u){Fn(u,this.#r&&this.#r.parent)}a&&(this.#s=this.#w(()=>{try{return Ft(()=>{var u=J;u.b=this,u.f|=wi,a(this.#n,()=>o,()=>l)})}catch(u){return Fn(u,this.#r.parent),null}}))};Gn(()=>{var o;try{o=this.transform_error(e)}catch(u){Fn(u,this.#r&&this.#r.parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(c,u=>Fn(u,this.#r&&this.#r.parent)):c(o)})}}function Qc(t,e,n,a){const r=wa()?ya:Nt;var s=t.filter(v=>!v.settled);if(n.length===0&&s.length===0){a(e.map(r));return}var l=J,c=Jc(),o=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(v=>v.promise)):null;function u(v){c();try{a(v)}catch(x){(l.f&Dt)===0&&Fn(x,l)}Za()}if(n.length===0){o.then(()=>u(e.map(r)));return}var f=xl();function m(){Promise.all(n.map(v=>Kc(v))).then(v=>u([...e.map(r),...v])).catch(v=>Fn(v,l)).finally(()=>f())}o?o.then(()=>{c(),m(),Za()}):m()}function Jc(){var t=J,e=re,n=we,a=K;return function(s=!0){Ht(t),Gt(e),Nr(n),s&&(t.f&Dt)===0&&(a?.activate(),a?.apply())}}function Za(t=!0){Ht(null),Gt(null),Nr(null),t&&K?.deactivate()}function xl(){var t=J,e=t.b,n=K,a=e.is_rendered();return e.update_pending_count(1,n),n.increment(a,t),(r=!1)=>{e.update_pending_count(-1,n),n.decrement(a,t,r)}}function ya(t){var e=st|et;return J!==null&&(J.f|=dr),{ctx:we,deps:null,effects:null,equals:pl,f:e,fn:t,reactions:null,rv:0,v:qe,wv:0,parent:J,ac:null}}function Kc(t,e,n){let a=J;a===null&&dc();var r=void 0,s=or(qe),l=!re,c=new Map;return fu(()=>{var o=J,u=sl();r=u.promise;try{Promise.resolve(t()).then(u.resolve,u.reject).finally(Za)}catch(x){u.reject(x),Za()}var f=K;if(l){if((o.f&fr)!==0)var m=xl();if(a.b.is_rendered())c.get(f)?.reject(wn),c.delete(f);else{for(const x of c.values())x.reject(wn);c.clear()}c.set(f,u)}const v=(x,b=void 0)=>{if(m){var E=b===wn;m(E)}if(!(b===wn||(o.f&Dt)!==0)){if(f.activate(),b)s.f|=Bn,zr(s,b);else{(s.f&Bn)!==0&&(s.f^=Bn),zr(s,x);for(const[k,_]of c){if(c.delete(k),k===f)break;_.reject(wn)}}f.deactivate()}};u.promise.then(v,x=>v(null,x||"unknown"))}),Pl(()=>{for(const o of c.values())o.reject(wn)}),new Promise(o=>{function u(f){function m(){f===r?o(s):u(r)}f.then(m,m)}u(r)})}function lr(t){const e=ya(t);return Hl(e),e}function Nt(t){const e=ya(t);return e.equals=vl,e}function $c(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;ni(t))),e}function h(t,e,n=!1){re!==null&&(!Qt||(re.f&xi)!==0)&&wa()&&(re.f&(st|ln|ma|xi))!==0&&(Bt===null||!Or.call(Bt,t))&&wc();let a=n?Cr(e):e;return zr(t,a,qa)}function zr(t,e,n=null){if(!t.equals(e)){rr.set(t,xn?e:t.v);var a=qn.ensure();if(a.capture(t,e),(t.f&st)!==0){const r=t;(t.f&et)!==0&&qi(r),Vt===null&&Bi(r)}t.wv=Wl(),Al(t,et,n),wa()&&J!==null&&(J.f&Me)!==0&&(J.f&(Jt|Hn))===0&&(zt===null?pu([t]):zt.push(t)),!a.is_fork&&Si.size>0&&!El&&nu()}return e}function nu(){El=!1;for(const t of Si)(t.f&Me)!==0&&Ae(t,Kt),Gr(t)&&cr(t);Si.clear()}function ga(t){h(t,t.v+1)}function Al(t,e,n){var a=t.reactions;if(a!==null)for(var r=wa(),s=a.length,l=0;l{if(ir===s)return c();var o=re,u=ir;Gt(null),Cs(s);var f=c();return Gt(o),Cs(u),f};return a&&n.set("length",Ct(t.length)),new Proxy(t,{defineProperty(c,o,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&bc();var f=n.get(o);return f===void 0?l(()=>{var m=Ct(u.value);return n.set(o,m),m}):h(f,u.value,!0),!0},deleteProperty(c,o){var u=n.get(o);if(u===void 0){if(o in c){const f=l(()=>Ct(qe));n.set(o,f),ga(r)}}else h(u,qe),ga(r);return!0},get(c,o,u){if(o===nr)return t;var f=n.get(o),m=o in c;if(f===void 0&&(!m||Lr(c,o)?.writable)&&(f=l(()=>{var x=Cr(m?c[o]:qe),b=Ct(x);return b}),n.set(o,f)),f!==void 0){var v=i(f);return v===qe?void 0:v}return Reflect.get(c,o,u)},getOwnPropertyDescriptor(c,o){var u=Reflect.getOwnPropertyDescriptor(c,o);if(u&&"value"in u){var f=n.get(o);f&&(u.value=i(f))}else if(u===void 0){var m=n.get(o),v=m?.v;if(m!==void 0&&v!==qe)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return u},has(c,o){if(o===nr)return!0;var u=n.get(o),f=u!==void 0&&u.v!==qe||Reflect.has(c,o);if(u!==void 0||J!==null&&(!f||Lr(c,o)?.writable)){u===void 0&&(u=l(()=>{var v=f?Cr(c[o]):qe,x=Ct(v);return x}),n.set(o,u));var m=i(u);if(m===qe)return!1}return f},set(c,o,u,f){var m=n.get(o),v=o in c;if(a&&o==="length")for(var x=u;xCt(qe)),n.set(x+"",b))}if(m===void 0)(!v||Lr(c,o)?.writable)&&(m=l(()=>Ct(void 0)),h(m,Cr(u)),n.set(o,m));else{v=m.v!==qe;var E=l(()=>Cr(u));h(m,E)}var k=Reflect.getOwnPropertyDescriptor(c,o);if(k?.set&&k.set.call(f,u),!v){if(a&&typeof o=="string"){var _=n.get("length"),z=Number(o);Number.isInteger(z)&&z>=_.v&&h(_,z+1)}ga(r)}return!0},ownKeys(c){i(r);var o=Reflect.ownKeys(c).filter(m=>{var v=n.get(m);return v===void 0||v.v!==qe});for(var[u,f]of n)f.v!==qe&&!(u in c)&&o.push(u);return o},setPrototypeOf(){kc()}})}var Ei,Rl,Cl,Il,Dl;function ru(){if(Ei===void 0){Ei=window,Rl=document,Cl=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Il=Lr(e,"firstChild").get,Dl=Lr(e,"nextSibling").get,Ts(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Ts(n)&&(n.__t=void 0)}}function on(t=""){return document.createTextNode(t)}function Un(t){return Il.call(t)}function xa(t){return Dl.call(t)}function p(t,e){return Un(t)}function yn(t,e=!1){{var n=Un(t);return n instanceof Comment&&n.data===""?xa(n):n}}function g(t,e=1,n=!1){let a=t;for(;e--;)a=xa(a);return a}function au(t){t.textContent=""}function Ll(){return!1}function Ol(t,e,n){return document.createElementNS(e??dl,t,void 0)}let As=!1;function iu(){As||(As=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{if(!t.defaultPrevented)for(const e of t.target.elements)e.__on_r?.()})},{capture:!0}))}function Ja(t){var e=re,n=J;Gt(null),Ht(null);try{return t()}finally{Gt(e),Ht(n)}}function su(t,e,n,a=n){t.addEventListener(e,()=>Ja(n));const r=t.__on_r;r?t.__on_r=()=>{r(),a(!0)}:t.__on_r=()=>a(!0),iu()}function Ml(t){J===null&&(re===null&&gc(),vc()),xn&&hc()}function lu(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function cn(t,e){var n=J;n!==null&&(n.f&vt)!==0&&(t|=vt);var a={ctx:we,deps:null,nodes:null,f:t|et|Ut,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};K?.register_created_effect(a);var r=a;if((t&Mr)!==0)Rr!==null?Rr.push(a):qn.ensure().schedule(a);else if(e!==null){try{cr(a)}catch(l){throw yt(a),l}r.deps===null&&r.teardown===null&&r.nodes===null&&r.first===r.last&&(r.f&dr)===0&&(r=r.first,(t&ln)!==0&&(t&Pr)!==0&&r!==null&&(r.f|=Pr))}if(r!==null&&(r.parent=n,n!==null&&lu(r,n),re!==null&&(re.f&st)!==0&&(t&Hn)===0)){var s=re;(s.effects??=[]).push(r)}return a}function Wi(){return re!==null&&!Qt}function Pl(t){const e=cn(ka,null);return Ae(e,Me),e.teardown=t,e}function _a(t){Ml();var e=J.f,n=!re&&(e&Jt)!==0&&(e&fr)===0;if(n){var a=we;(a.e??=[]).push(t)}else return Nl(t)}function Nl(t){return cn(Mr|cl,t)}function ou(t){return Ml(),cn(ka|cl,t)}function cu(t){qn.ensure();const e=cn(Hn|dr,t);return(n={})=>new Promise(a=>{n.outro?ar(e,()=>{yt(e),a(void 0)}):(yt(e),a(void 0))})}function ji(t){return cn(Mr,t)}function _n(t,e){var n=we,a={effect:null,ran:!1,deps:t};n.l.$.push(a),a.effect=Br(()=>{if(t(),!a.ran){a.ran=!0;var r=J;try{Ht(r.parent),T(e)}finally{Ht(r)}}})}function uu(){var t=we;Br(()=>{for(var e of t.l.$){e.deps();var n=e.effect;(n.f&Me)!==0&&n.deps!==null&&Ae(n,Kt),Gr(n)&&cr(n),e.ran=!1}})}function fu(t){return cn(ma|dr,t)}function Br(t,e=0){return cn(ka|e,t)}function N(t,e=[],n=[],a=[]){Qc(a,e,n,r=>{cn(ka,()=>t(...r.map(i)))})}function Ka(t,e=0){var n=cn(ln|e,t);return n}function Ft(t){return cn(Jt|dr,t)}function zl(t){var e=t.teardown;if(e!==null){const n=xn,a=re;Rs(!0),Gt(null);try{e.call(null)}finally{Rs(n),Gt(a)}}}function Zi(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const r=n.ac;r!==null&&Ja(()=>{r.abort(wn)});var a=n.next;(n.f&Hn)!==0?n.parent=null:yt(n,e),n=a}}function du(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Jt)===0&&yt(e),e=n}}function yt(t,e=!0){var n=!1;(e||(t.f&ol)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(Fl(t.nodes.start,t.nodes.end),n=!0),Ae(t,yi),Zi(t,e&&!n),ba(t,0);var a=t.nodes&&t.nodes.t;if(a!==null)for(const s of a)s.stop();zl(t),t.f^=yi,t.f|=Dt;var r=t.parent;r!==null&&r.first!==null&&Ul(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function Fl(t,e){for(;t!==null;){var n=t===e?null:xa(t);t.remove(),t=n}}function Ul(t){var e=t.parent,n=t.prev,a=t.next;n!==null&&(n.next=a),a!==null&&(a.prev=n),e!==null&&(e.first===t&&(e.first=a),e.last===t&&(e.last=n))}function ar(t,e,n=!0){var a=[];Bl(t,a,!0);var r=()=>{n&&yt(t),e&&e()},s=a.length;if(s>0){var l=()=>--s||r();for(var c of a)c.out(l)}else r()}function Bl(t,e,n){if((t.f&vt)===0){t.f^=vt;var a=t.nodes&&t.nodes.t;if(a!==null)for(const c of a)(c.is_global||n)&&e.push(c);for(var r=t.first;r!==null;){var s=r.next;if((r.f&Hn)===0){var l=(r.f&Pr)!==0||(r.f&Jt)!==0&&(t.f&ln)!==0;Bl(r,e,l?n:!1)}r=s}}}function Yi(t){Gl(t,!0)}function Gl(t,e){if((t.f&vt)!==0){t.f^=vt,(t.f&Me)===0&&(Ae(t,et),qn.ensure().schedule(t));for(var n=t.first;n!==null;){var a=n.next,r=(n.f&Pr)!==0||(n.f&Jt)!==0;Gl(n,r?e:!1),n=a}var s=t.nodes&&t.nodes.t;if(s!==null)for(const l of s)(l.is_global||e)&&l.in()}}function Xi(t,e){if(t.nodes)for(var n=t.nodes.start,a=t.nodes.end;n!==null;){var r=n===a?null:xa(n);e.append(n),n=r}}let Wa=!1,xn=!1;function Rs(t){xn=t}let re=null,Qt=!1;function Gt(t){re=t}let J=null;function Ht(t){J=t}let Bt=null;function Hl(t){re!==null&&(Bt===null?Bt=[t]:Bt.push(t))}let wt=null,Rt=0,zt=null;function pu(t){zt=t}let ql=1,er=0,ir=er;function Cs(t){ir=t}function Wl(){return++ql}function Gr(t){var e=t.f;if((e&et)!==0)return!0;if(e&st&&(t.f&=~sr),(e&Kt)!==0){for(var n=t.deps,a=n.length,r=0;rt.wv)return!0}(e&Ut)!==0&&Vt===null&&Ae(t,Me)}return!1}function jl(t,e,n=!0){var a=t.reactions;if(a!==null&&!(Bt!==null&&Or.call(Bt,t)))for(var r=0;r{t.ac.abort(wn)}),t.ac=null);try{t.f|=ja;var f=t.fn,m=f();t.f|=fr;var v=t.deps,x=K?.is_fork;if(wt!==null){var b;if(x||ba(t,Rt),v!==null&&Rt>0)for(v.length=Rt+wt.length,b=0;bn?.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Gn(()=>{e.addEventListener(t,r,a)}):e.addEventListener(t,r,a),r}function an(t,e,n,a,r){var s={capture:a,passive:r},l=mu(t,e,n,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Pl(()=>{e.removeEventListener(t,l,s)})}function H(t,e,n){(e[ua]??={})[t]=n}function un(t){for(var e=0;e{throw k});throw v}}finally{t[ua]=e,delete t.currentTarget,Gt(f),Ht(m)}}}const _u=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function bu(t){return _u?.createHTML(t)??t}function ku(t){var e=Ol("template");return e.innerHTML=bu(t.replaceAll("","")),e.content}function Fr(t,e){var n=J;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function L(t,e){var n=(e&Lc)!==0,a=(e&Oc)!==0,r,s=!t.startsWith("");return()=>{r===void 0&&(r=ku(s?t:""+t),n||(r=Un(r)));var l=a||Cl?document.importNode(r,!0):r.cloneNode(!0);if(n){var c=Un(l),o=l.lastChild;Fr(c,o)}else Fr(l,l);return l}}function pt(t=""){{var e=on(t+"");return Fr(e,e),e}}function $a(){var t=document.createDocumentFragment(),e=document.createComment(""),n=on();return t.append(e,n),Fr(e,n),t}function R(t,e){t!==null&&t.before(e)}function O(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t.__t??=t.nodeValue)&&(t.__t=n,t.nodeValue=`${n}`)}function wu(t,e){return yu(t,e)}const Ua=new Map;function yu(t,{target:e,anchor:n,props:a={},events:r,context:s,intro:l=!0,transformError:c}){ru();var o=void 0,u=cu(()=>{var f=n??e.appendChild(on());Xc(f,{pending:()=>{}},x=>{Wt({});var b=we;s&&(b.c=s),r&&(a.$$events=r),o=t(x,a)||{},jt()},c);var m=new Set,v=x=>{for(var b=0;b{for(var x of m)for(const k of[e,document]){var b=Ua.get(k),E=b.get(x);--E==0?(k.removeEventListener(x,Ii),b.delete(x),b.size===0&&Ua.delete(k)):b.set(x,E)}Ci.delete(v),f!==n&&f.parentNode?.removeChild(f)}});return xu.set(o,u),o}let xu=new WeakMap;class Tu{anchor;#n=new Map;#o=new Map;#e=new Map;#a=new Set;#r=!0;constructor(e,n=!0){this.anchor=e,this.#r=n}#i=e=>{if(this.#n.has(e)){var n=this.#n.get(e),a=this.#o.get(n);if(a)Yi(a),this.#a.delete(n);else{var r=this.#e.get(n);r&&(this.#o.set(n,r.effect),this.#e.delete(n),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),a=r.effect)}for(const[s,l]of this.#n){if(this.#n.delete(s),s===e)break;const c=this.#e.get(l);c&&(yt(c.effect),this.#e.delete(l))}for(const[s,l]of this.#o){if(s===n||this.#a.has(s))continue;const c=()=>{if(Array.from(this.#n.values()).includes(s)){var u=document.createDocumentFragment();Xi(l,u),u.append(on()),this.#e.set(s,{effect:l,fragment:u})}else yt(l);this.#a.delete(s),this.#o.delete(s)};this.#r||!a?(this.#a.add(s),ar(l,c,!1)):c()}}};#t=e=>{this.#n.delete(e);const n=Array.from(this.#n.values());for(const[a,r]of this.#e)n.includes(a)||(yt(r.effect),this.#e.delete(a))};ensure(e,n){var a=K,r=Ll();if(n&&!this.#o.has(e)&&!this.#e.has(e))if(r){var s=document.createDocumentFragment(),l=on();s.append(l),this.#e.set(e,{effect:Ft(()=>n(l)),fragment:s})}else this.#o.set(e,Ft(()=>n(this.anchor)));if(this.#n.set(a,e),r){for(const[c,o]of this.#o)c===e?a.unskip_effect(o):a.skip_effect(o);for(const[c,o]of this.#e)c===e?a.unskip_effect(o.effect):a.skip_effect(o.effect);a.oncommit(this.#i),a.ondiscard(this.#t)}else this.#i(a)}}function q(t,e,n=!1){var a=new Tu(t),r=n?Pr:0;function s(l,c){a.ensure(l,c)}Ka(()=>{var l=!1;e((c,o=0)=>{l=!0,s(o,c)}),l||s(-1,null)},r)}function Su(t,e){return e}function Eu(t,e,n){for(var a=[],r=e.length,s,l=e.length,c=0;c{if(s){if(s.pending.delete(m),s.done.add(m),s.pending.size===0){var v=t.outrogroups;Di(t,Qa(s.done)),v.delete(s),v.size===0&&(t.outrogroups=null)}}else l-=1},!1)}if(l===0){var o=a.length===0&&n!==null;if(o){var u=n,f=u.parentNode;au(f),f.append(u),t.items.clear()}Di(t,e,!o)}else s={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(s)}function Di(t,e,n=!0){var a;if(t.pending.size>0){a=new Set;for(const l of t.pending.values())for(const c of l)a.add(t.items.get(c).e)}for(var r=0;r{var y=n();return al(y)?y:y==null?[]:Qa(y)}),v,x=new Map,b=!0;function E(y){(z.effect.f&Dt)===0&&(z.pending.delete(y),z.fallback=f,Au(z,v,l,e,a),f!==null&&(v.length===0?(f.f&sn)===0?Yi(f):(f.f^=sn,fa(f,null,l)):ar(f,()=>{f=null})))}function k(y){z.pending.delete(y)}var _=Ka(()=>{v=i(m);for(var y=v.length,I=new Set,G=K,te=Ll(),ae=0;aes(l)):(f=Ft(()=>s(Ds??=on())),f.f|=sn)),y>I.size&&pc(),!b)if(x.set(G,I),te){for(const[X,le]of c)I.has(X)||G.skip_effect(le.e);G.oncommit(E),G.ondiscard(k)}else E(G);i(m)}),z={effect:_,items:c,pending:x,outrogroups:null,fallback:f};b=!1}function ra(t){for(;t!==null&&(t.f&Jt)===0;)t=t.next;return t}function Au(t,e,n,a,r){var s=(a&Sc)!==0,l=e.length,c=t.items,o=ra(t.effect.first),u,f=null,m,v=[],x=[],b,E,k,_;if(s)for(_=0;_0){var _e=(a&fl)!==0&&l===0?n:null;if(s){for(_=0;_{if(m!==void 0)for(k of m)k.nodes?.a?.apply()})}function Ru(t,e,n,a,r,s,l,c){var o=(l&xc)!==0?(l&Ec)===0?j(n,!1,!1):or(n):null,u=(l&Tc)!==0?or(r):null;return{v:o,i:u,e:Ft(()=>(s(e,o??n,u??r,c),()=>{t.delete(a)}))}}function fa(t,e,n){if(t.nodes)for(var a=t.nodes.start,r=t.nodes.end,s=e&&(e.f&sn)===0?e.nodes.start:n;a!==null;){var l=xa(a);if(s.before(a),a===r)return;a=l}}function Nn(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function Li(t,e,n=!1,a=!1,r=!1,s=!1){var l=t,c="";if(n)var o=t;N(()=>{var u=J;if(c!==(c=e()??"")){if(n){u.nodes=null,o.innerHTML=c,c!==""&&Fr(Un(o),o.lastChild);return}if(u.nodes!==null&&(Fl(u.nodes.start,u.nodes.end),u.nodes=null),c!==""){var f=a?Mc:r?Pc:void 0,m=Ol(a?"svg":r?"math":"template",f);m.innerHTML=c;var v=a||r?m:m.content;if(Fr(Un(v),v.lastChild),a||r)for(;Un(v);)l.before(Un(v));else l.before(v)}}})}function Ql(t,e){var n;n=document.head.appendChild(on()),Ka(()=>e(n),ol|dr)}function Cu(t,e,n){ji(()=>{var a=T(()=>e(t,n?.())||{});if(n&&a?.update){var r=!1,s={};Br(()=>{var l=n();Z(l),r&&hl(s,l)&&(s=l,a.update(l))}),r=!0}if(a?.destroy)return()=>a.destroy()})}function Jl(t){var e,n,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e=0;){var c=l+s;(l===0||Ls.includes(a[l-1]))&&(c===a.length||Ls.includes(a[c]))?a=(l===0?"":a.substring(0,l))+a.substring(c+1):l=c}}return a===""?null:a}function Ou(t,e){return t==null?null:String(t)}function dt(t,e,n,a,r,s){var l=t.__className;if(l!==n||l===void 0){var c=Lu(n,a,s);c==null?t.removeAttribute("class"):t.className=c,t.__className=n}else if(s&&r!==s)for(var o in s){var u=!!s[o];(r==null||u!==!!r[o])&&t.classList.toggle(o,u)}return s}function bn(t,e,n,a){var r=t.__style;if(r!==e){var s=Ou(e);s==null?t.removeAttribute("style"):t.style.cssText=s,t.__style=e}return a}const Mu=Symbol("is custom element"),Pu=Symbol("is html"),Nu=fc?"progress":"PROGRESS";function Kl(t,e){var n=$l(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==Nu)||(t.value=e??"")}function F(t,e,n,a){var r=$l(t);r[e]!==(r[e]=n)&&(e==="loading"&&(t[uc]=n),n==null?t.removeAttribute(e):typeof n!="string"&&zu(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function $l(t){return t.__attributes??={[Mu]:t.nodeName.includes("-"),[Pu]:t.namespaceURI===dl}}var Os=new Map;function zu(t){var e=t.getAttribute("is")||t.nodeName,n=Os.get(e);if(n)return n;Os.set(e,n=[]);for(var a,r=t,s=Element.prototype;s!==r;){a=il(r);for(var l in a)a[l].set&&n.push(l);r=Ui(r)}return n}function Qn(t,e,n=e){var a=new WeakSet;su(t,"input",async r=>{var s=r?t.defaultValue:t.value;if(s=pi(t)?hi(s):s,n(s),K!==null&&a.add(K),await Ai(),s!==(s=e())){var l=t.selectionStart,c=t.selectionEnd,o=t.value.length;if(t.value=s??"",c!==null){var u=t.value.length;l===c&&c===o&&u>o?(t.selectionStart=u,t.selectionEnd=u):(t.selectionStart=l,t.selectionEnd=Math.min(c,u))}}}),T(e)==null&&t.value&&(n(pi(t)?hi(t.value):t.value),K!==null&&a.add(K)),Br(()=>{var r=e();if(t===document.activeElement){var s=K;if(a.has(s))return}pi(t)&&r===hi(t.value)||t.type==="date"&&!r&&!t.value||r!==t.value&&(t.value=r??"")})}function pi(t){var e=t.type;return e==="number"||e==="range"}function hi(t){return t===""?null:+t}function Ms(t,e){return t===e||t?.[nr]===e}function Vi(t={},e,n,a){var r=we.r,s=J;return ji(()=>{var l,c;return Br(()=>{l=c,c=[],T(()=>{t!==n(...c)&&(e(t,...c),l&&Ms(n(...l),t)&&e(null,...l))})}),()=>{let o=s;for(;o!==r&&o.parent!==null&&o.parent.f&yi;)o=o.parent;const u=()=>{c&&Ms(n(...c),t)&&e(null,...c)},f=o.teardown;o.teardown=()=>{u(),f?.()}}}),t}function eo(t=!1){const e=we,n=e.l.u;if(!n)return;let a=()=>Z(e.s);if(t){let r=0,s={};const l=ya(()=>{let c=!1;const o=e.s;for(const u in o)o[u]!==s[u]&&(s[u]=o[u],c=!0);return c&&r++,r});a=()=>i(l)}n.b.length&&ou(()=>{Ps(e,a),ki(n.b)}),_a(()=>{const r=T(()=>n.m.map(oc));return()=>{for(const s of r)typeof s=="function"&&s()}}),n.a.length&&_a(()=>{Ps(e,a),ki(n.a)})}function Ps(t,e){if(t.l.s)for(const n of t.l.s)i(n);e()}function Qe(t,e,n,a){var r=!Ur||(n&Rc)!==0,s=(n&Ic)!==0,l=(n&Dc)!==0,c=a,o=!0,u=()=>(o&&(o=!1,c=l?T(a):a),c);let f;if(s){var m=nr in t||cc in t;f=Lr(t,e)?.set??(m&&e in t?y=>t[e]=y:void 0)}var v,x=!1;s?[v,x]=Hc(()=>t[e]):v=t[e],v===void 0&&a!==void 0&&(v=u(),f&&(r&&_c(),f(v)));var b;if(r?b=()=>{var y=t[e];return y===void 0?u():(o=!0,y)}:b=()=>{var y=t[e];return y!==void 0&&(c=void 0),y===void 0?c:y},r&&(n&Cc)===0)return b;if(f){var E=t.$$legacy;return(function(y,I){return arguments.length>0?((!r||!I||E||x)&&f(I?b():y),y):b()})}var k=!1,_=((n&Ac)!==0?ya:Nt)(()=>(k=!1,b()));s&&i(_);var z=J;return(function(y,I){if(arguments.length>0){const G=I?i(_):r&&s?Cr(y):y;return h(_,G),k=!0,c!==void 0&&(c=G),y}return xn&&k||(z.f&Dt)!==0?_.v:i(_)})}function to(t){we===null&&ul(),Ur&&we.l!==null?Uu(we).m.push(t):_a(()=>{const e=T(t);if(typeof e=="function")return e})}function Fu(t){we===null&&ul(),to(()=>()=>T(t))}function Uu(t){var e=t.l;return e.u??={a:[],b:[],m:[]}}const Bu="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Bu);Uc();class no extends Error{constructor(e,n){super(n),this.status=e}status}async function Ve(t,e={}){const n=new Headers(e.headers);n.set("Accept","application/json"),e.body&&!(e.body instanceof FormData)&&n.set("Content-Type","application/json");const a=await fetch(t,{...e,headers:n});if(!a.ok)throw new no(a.status,await a.text());return a.json()}const Gu=[{title:"Ship it",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYjJ1bm1meHE4N2x3bnN0djJkMWtjNGc5bXYzZDFiOHBsbG16M3F0ZSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/l0HlHFRbmaZtBRhXG/giphy.gif",tags:["ship","launch","done"]},{title:"Approved",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExazBpbzJ6ODZ3bXQ3OHBvNGJidWZoajc0cHV6YnVub3MzZ3c1a2Z2dSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/111ebonMs90YLu/giphy.gif",tags:["yes","approved","nice"]},{title:"Deploy dance",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExY3NkaTVmZW9ydWNnZnl0ZWQ5aHQyeGNrd2k3NG4wZWNqYzNmd3k1ZCZlcD12MV9naWZzX3NlYXJjaCZjdD1n/GeimqsH0TLDt4tScGw/giphy.gif",tags:["deploy","dance","celebrate"]},{title:"Looking",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYWZ3emE0dm5mN2h0bGVsY2w0OXBodGd2cGJlNDRiZXo1YWNtdWRmZyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/26n6WywJyh39n1pBu/giphy.gif",tags:["search","looking","debug"]},{title:"Typing faster",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExOWFlbnJnbnIzbHYxcDIzdXZ3NGF3N2FocHNvMmR5enU3bHpycHBlZSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/13HgwGsXF0aiGY/giphy.gif",tags:["typing","code","work"]},{title:"Tiny victory",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdjJ2b2tqNmF4dG16NjE0eXhuc3h5bTlvamgwNTR0Zmd6ZjhtM2JuaSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/3o7abKhOpu0NwenH3O/giphy.gif",tags:["win","victory","celebrate"]}];function tr(t,e=120){if(!t)return"";const n=t.replace(/\s+/g," ").trim();return n.length>e?n.slice(0,e-1)+"...":n}function Ir(t){return t.quoted_author?.display_name||"Unknown"}function Hu(t,e){return e===t.id?"Open":"Thread"}function qu(t){const e=new Date(t),n=new Date,a=new Date;a.setDate(n.getDate()-1);const r=(s,l)=>s.getFullYear()===l.getFullYear()&&s.getMonth()===l.getMonth()&&s.getDate()===l.getDate();return r(e,n)?"Today":r(e,a)?"Yesterday":new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric"}).format(e)}function Wu(t){const e=[];let n="",a="",r=0;for(const s of t){const l=new Date(s.created_at),c=l.toDateString(),o=s.author?.id||s.author_id||"local",u=c!==n,f=o!==a,m=l.getTime()-r>300*1e3;u||f||m||e.length===0?e.push({key:s.id,dayLabel:u?qu(s.created_at):null,messages:[s],authorName:s.author?.display_name||"Local User",authorHandle:s.author?.handle||"",authorAvatarURL:s.author?.avatar_url||"",authorID:o,timestamp:s.created_at}):e[e.length-1].messages.push(s),n=c,a=o,r=l.getTime()}return e}function Ns(t){const e=t.trim();if(!e)return"?";const n=e.split(/\s+/);return n.length>=2?(n[0][0]+n[1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function Je(t){if(!t)return"?";const e=t.trim();return e?e[0].toUpperCase():"?"}function ut(t){return t?`@${t}`:""}function Ke(t){let e=0;for(let n=0;n>>0;return e%360}function zs(t,e){return t.members.find(n=>n.id!==e)||t.members[0]}function Jn(t,e){const n=t.members.filter(r=>r.id!==e);return(n.length>0?n:t.members).map(r=>r.display_name).join(", ")}function ju(t,e,n){const a=new Map;for(const r of e)for(const s of r.members)s.id&&s.id!==n&&a.set(s.id,s);for(const r of[...t].reverse()){const s=r.author;s?.id&&s.id!==n&&a.set(s.id,s)}return[...a.values()].slice(0,12)}function Fs(t,e){return t.find(n=>n.members.some(a=>a.id===e))}const Zu=new Set(["button","checkbox","combobox","link","listbox","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","option","radio","radiogroup","slider","spinbutton","switch","tab","tablist","textbox","tree","treeitem"]),Yu=new Set(["INPUT","TEXTAREA","SELECT","BUTTON","A","DETAILS","SUMMARY","VIDEO","AUDIO"]);function Xu(t){if(!t)return!1;if(t.isContentEditable)return!0;if(t instanceof HTMLInputElement){const e=(t.type||"text").toLowerCase();return e!=="checkbox"&&e!=="radio"&&e!=="button"&&e!=="submit"&&e!=="reset"&&e!=="file"}return t instanceof HTMLTextAreaElement}function Vu(t){if(!t||Qu(t))return!1;if(Yu.has(t.tagName))return!0;const e=t.getAttribute("role");if(e&&Zu.has(e))return!0;const n=t.getAttribute("tabindex");return!!(n!==null&&n!=="-1"&&t.hasAttribute("aria-keyshortcuts"))}function Qu(t){if(!t.closest(".messages, .thread"))return!1;if(t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement)return!0;const e=t.getAttribute("role");return e==="button"||e==="link"}function Ju(){const t=typeof window<"u"?window.getSelection():null;if(!t||t.isCollapsed||t.rangeCount===0)return!1;const e=t.getRangeAt(0).commonAncestorContainer;return e?!!(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(".messages, .thread, .markdown"):!1}function Ku(t,e){if(e.authRequired||e.isModalOpen()||t.defaultPrevented||t.isComposing||t.keyCode===229||t.ctrlKey||t.metaKey||t.altKey||t.key.length!==1||Ju())return!1;const n=document.activeElement;return!(n===e.messageInput||n===e.replyInput||Xu(n)||Vu(n))}function $u(t,e){if(!Ku(t,e))return;const n=e.target();if(!n||n.disabled||n.readOnly)return;t.key===" "&&t.preventDefault(),n.focus({preventScroll:!0});const a=n.value.length;if(n.setSelectionRange(a,a),t.key===" "){const r=n.selectionStart??a,s=n.selectionEnd??a;n.setRangeText(" ",r,s,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))}}const{entries:ro,setPrototypeOf:Us,isFrozen:ef,getPrototypeOf:tf,getOwnPropertyDescriptor:nf}=Object;let{freeze:gt,seal:qt,create:Er}=Object,{apply:Oi,construct:Mi}=typeof Reflect<"u"&&Reflect;gt||(gt=function(e){return e});qt||(qt=function(e){return e});Oi||(Oi=function(e,n){for(var a=arguments.length,r=new Array(a>2?a-2:0),s=2;s1?n-1:0),r=1;r"u"?null:Pe(BigInt.prototype.toString),Ws=typeof Symbol>"u"?null:Pe(Symbol.prototype.toString),Ee=Pe(Object.prototype.hasOwnProperty),sa=Pe(Object.prototype.toString),$e=Pe(RegExp.prototype.test),Ba=cf(TypeError);function Pe(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:da;if(Us&&Us(t,null),!ft(e))return t;let a=e.length;for(;a--;){let r=e[a];if(typeof r=="string"){const s=n(r);s!==r&&(ef(e)||(e[a]=s),r=s)}t[r]=!0}return t}function uf(t){for(let e=0;e/gm),mf=qt(/\$\{[\w\W]*/gm),_f=qt(/^data-[\-\w.\u00B7-\uFFFF]+$/),bf=qt(/^aria-[\-\w]+$/),ao=qt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kf=qt(/^(?:\w+script|data):/i),wf=qt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),io=qt(/^html$/i),yf=qt(/^[a-z][.\w]*(-[.\w]+)+$/i);var Vs=Object.freeze({__proto__:null,ARIA_ATTR:bf,ATTR_WHITESPACE:wf,CUSTOM_ELEMENT:yf,DATA_ATTR:_f,DOCTYPE_NAME:io,ERB_EXPR:gf,IS_ALLOWED_URI:ao,IS_SCRIPT_OR_DATA:kf,MUSTACHE_EXPR:vf,TMPLIT_EXPR:mf});const la={element:1,text:3,progressingInstruction:7,comment:8,document:9},xf=function(){return typeof window>"u"?null:window},Tf=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let a=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(a=n.getAttribute(r));const s="dompurify"+(a?"#"+a:"");try{return e.createPolicy(s,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Qs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function so(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xf();const e=B=>so(B);if(e.version="3.4.2",e.removed=[],!t||!t.document||t.document.nodeType!==la.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const a=n,r=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:c,Element:o,NodeFilter:u,NamedNodeMap:f=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:m,DOMParser:v,trustedTypes:x}=t,b=o.prototype,E=Ar(b,"cloneNode"),k=Ar(b,"remove"),_=Ar(b,"nextSibling"),z=Ar(b,"childNodes"),y=Ar(b,"parentNode");if(typeof l=="function"){const B=n.createElement("template");B.content&&B.content.ownerDocument&&(n=B.content.ownerDocument)}let I,G="";const{implementation:te,createNodeIterator:ae,createDocumentFragment:fe,getElementsByTagName:_e}=n,{importNode:ie}=a;let X=Qs();e.isSupported=typeof ro=="function"&&typeof y=="function"&&te&&te.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:le,ERB_EXPR:Ne,TMPLIT_EXPR:he,DATA_ATTR:lt,ARIA_ATTR:tt,IS_SCRIPT_OR_DATA:nt,ATTR_WHITESPACE:W,CUSTOM_ELEMENT:We}=Vs;let{IS_ALLOWED_URI:Lt}=Vs,se=null;const Tn=Y({},[...js,...gi,...mi,..._i,...Zs]);let de=null;const xt=Y({},[...Ys,...bi,...Xs,...Ga]);let oe=Object.seal(Er(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ze=null,Tt=null;const je=Object.seal(Er(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let $t=!0,ve=!0,Ge=!1,hr=!0,Ot=!1,Re=!0,fn=!1,Sn=!1,qr=!1,En=!1,vr=!1,dn=!1,Sa=!0,mt=!1;const gr="user-content-";let mr=!0,An=!1,pn={},_t=null;const _r=Y({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ea=null;const bt=Y({},["audio","video","img","source","image","track"]);let br=null;const Aa=Y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kr="http://www.w3.org/1998/Math/MathML",Rn="http://www.w3.org/2000/svg",Mt="http://www.w3.org/1999/xhtml";let Cn=Mt,In=!1,Wr=null;const Ra=Y({},[kr,Rn,Mt],vi);let jr=Y({},["mi","mo","mn","ms","mtext"]),Zr=Y({},["annotation-xml"]);const wr=Y({},["title","style","font","a","script"]);let Dn=null;const Yr=["application/xhtml+xml","text/html"],ni="text/html";let Ce=null,en=null;const Ln=n.createElement("form"),Xr=function(d){return d instanceof RegExp||d instanceof Function},Vr=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(en&&en===d)return;(!d||typeof d!="object")&&(d={}),d=kt(d),Dn=Yr.indexOf(d.PARSER_MEDIA_TYPE)===-1?ni:d.PARSER_MEDIA_TYPE,Ce=Dn==="application/xhtml+xml"?vi:da,se=Ee(d,"ALLOWED_TAGS")&&ft(d.ALLOWED_TAGS)?Y({},d.ALLOWED_TAGS,Ce):Tn,de=Ee(d,"ALLOWED_ATTR")&&ft(d.ALLOWED_ATTR)?Y({},d.ALLOWED_ATTR,Ce):xt,Wr=Ee(d,"ALLOWED_NAMESPACES")&&ft(d.ALLOWED_NAMESPACES)?Y({},d.ALLOWED_NAMESPACES,vi):Ra,br=Ee(d,"ADD_URI_SAFE_ATTR")&&ft(d.ADD_URI_SAFE_ATTR)?Y(kt(Aa),d.ADD_URI_SAFE_ATTR,Ce):Aa,Ea=Ee(d,"ADD_DATA_URI_TAGS")&&ft(d.ADD_DATA_URI_TAGS)?Y(kt(bt),d.ADD_DATA_URI_TAGS,Ce):bt,_t=Ee(d,"FORBID_CONTENTS")&&ft(d.FORBID_CONTENTS)?Y({},d.FORBID_CONTENTS,Ce):_r,ze=Ee(d,"FORBID_TAGS")&&ft(d.FORBID_TAGS)?Y({},d.FORBID_TAGS,Ce):kt({}),Tt=Ee(d,"FORBID_ATTR")&&ft(d.FORBID_ATTR)?Y({},d.FORBID_ATTR,Ce):kt({}),pn=Ee(d,"USE_PROFILES")?d.USE_PROFILES&&typeof d.USE_PROFILES=="object"?kt(d.USE_PROFILES):d.USE_PROFILES:!1,$t=d.ALLOW_ARIA_ATTR!==!1,ve=d.ALLOW_DATA_ATTR!==!1,Ge=d.ALLOW_UNKNOWN_PROTOCOLS||!1,hr=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ot=d.SAFE_FOR_TEMPLATES||!1,Re=d.SAFE_FOR_XML!==!1,fn=d.WHOLE_DOCUMENT||!1,En=d.RETURN_DOM||!1,vr=d.RETURN_DOM_FRAGMENT||!1,dn=d.RETURN_TRUSTED_TYPE||!1,qr=d.FORCE_BODY||!1,Sa=d.SANITIZE_DOM!==!1,mt=d.SANITIZE_NAMED_PROPS||!1,mr=d.KEEP_CONTENT!==!1,An=d.IN_PLACE||!1,Lt=df(d.ALLOWED_URI_REGEXP)?d.ALLOWED_URI_REGEXP:ao,Cn=typeof d.NAMESPACE=="string"?d.NAMESPACE:Mt,jr=Ee(d,"MATHML_TEXT_INTEGRATION_POINTS")&&d.MATHML_TEXT_INTEGRATION_POINTS&&typeof d.MATHML_TEXT_INTEGRATION_POINTS=="object"?kt(d.MATHML_TEXT_INTEGRATION_POINTS):Y({},["mi","mo","mn","ms","mtext"]),Zr=Ee(d,"HTML_INTEGRATION_POINTS")&&d.HTML_INTEGRATION_POINTS&&typeof d.HTML_INTEGRATION_POINTS=="object"?kt(d.HTML_INTEGRATION_POINTS):Y({},["annotation-xml"]);const S=Ee(d,"CUSTOM_ELEMENT_HANDLING")&&d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING=="object"?kt(d.CUSTOM_ELEMENT_HANDLING):Er(null);if(oe=Er(null),Ee(S,"tagNameCheck")&&Xr(S.tagNameCheck)&&(oe.tagNameCheck=S.tagNameCheck),Ee(S,"attributeNameCheck")&&Xr(S.attributeNameCheck)&&(oe.attributeNameCheck=S.attributeNameCheck),Ee(S,"allowCustomizedBuiltInElements")&&typeof S.allowCustomizedBuiltInElements=="boolean"&&(oe.allowCustomizedBuiltInElements=S.allowCustomizedBuiltInElements),Ot&&(ve=!1),vr&&(En=!0),pn&&(se=Y({},Zs),de=Er(null),pn.html===!0&&(Y(se,js),Y(de,Ys)),pn.svg===!0&&(Y(se,gi),Y(de,bi),Y(de,Ga)),pn.svgFilters===!0&&(Y(se,mi),Y(de,bi),Y(de,Ga)),pn.mathMl===!0&&(Y(se,_i),Y(de,Xs),Y(de,Ga))),je.tagCheck=null,je.attributeCheck=null,Ee(d,"ADD_TAGS")&&(typeof d.ADD_TAGS=="function"?je.tagCheck=d.ADD_TAGS:ft(d.ADD_TAGS)&&(se===Tn&&(se=kt(se)),Y(se,d.ADD_TAGS,Ce))),Ee(d,"ADD_ATTR")&&(typeof d.ADD_ATTR=="function"?je.attributeCheck=d.ADD_ATTR:ft(d.ADD_ATTR)&&(de===xt&&(de=kt(de)),Y(de,d.ADD_ATTR,Ce))),Ee(d,"ADD_URI_SAFE_ATTR")&&ft(d.ADD_URI_SAFE_ATTR)&&Y(br,d.ADD_URI_SAFE_ATTR,Ce),Ee(d,"FORBID_CONTENTS")&&ft(d.FORBID_CONTENTS)&&(_t===_r&&(_t=kt(_t)),Y(_t,d.FORBID_CONTENTS,Ce)),Ee(d,"ADD_FORBID_CONTENTS")&&ft(d.ADD_FORBID_CONTENTS)&&(_t===_r&&(_t=kt(_t)),Y(_t,d.ADD_FORBID_CONTENTS,Ce)),mr&&(se["#text"]=!0),fn&&Y(se,["html","head","body"]),se.table&&(Y(se,["tbody"]),delete ze.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ba('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ba('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=d.TRUSTED_TYPES_POLICY,G=I.createHTML("")}else I===void 0&&(I=Tf(x,r)),I!==null&&typeof G=="string"&&(G=I.createHTML(""));gt&>(d),en=d},Ca=Y({},[...gi,...mi,...pf]),Ia=Y({},[..._i,...hf]),w=function(d){let S=y(d);(!S||!S.tagName)&&(S={namespaceURI:Cn,tagName:"template"});const M=da(d.tagName),pe=da(S.tagName);return Wr[d.namespaceURI]?d.namespaceURI===Rn?S.namespaceURI===Mt?M==="svg":S.namespaceURI===kr?M==="svg"&&(pe==="annotation-xml"||jr[pe]):!!Ca[M]:d.namespaceURI===kr?S.namespaceURI===Mt?M==="math":S.namespaceURI===Rn?M==="math"&&Zr[pe]:!!Ia[M]:d.namespaceURI===Mt?S.namespaceURI===Rn&&!Zr[pe]||S.namespaceURI===kr&&!jr[pe]?!1:!Ia[M]&&(wr[M]||!Ca[M]):!!(Dn==="application/xhtml+xml"&&Wr[d.namespaceURI]):!1},D=function(d){ia(e.removed,{element:d});try{y(d).removeChild(d)}catch{k(d)}},$=function(d,S){try{ia(e.removed,{attribute:S.getAttributeNode(d),from:S})}catch{ia(e.removed,{attribute:null,from:S})}if(S.removeAttribute(d),d==="is")if(En||vr)try{D(S)}catch{}else try{S.setAttribute(d,"")}catch{}},ye=function(d){let S=null,M=null;if(qr)d=""+d;else{const Se=Gs(d,/^[\r\n\t ]+/);M=Se&&Se[0]}Dn==="application/xhtml+xml"&&Cn===Mt&&(d=''+d+"");const pe=I?I.createHTML(d):d;if(Cn===Mt)try{S=new v().parseFromString(pe,Dn)}catch{}if(!S||!S.documentElement){S=te.createDocument(Cn,"template",null);try{S.documentElement.innerHTML=In?G:pe}catch{}}const Ue=S.body||S.documentElement;return d&&M&&Ue.insertBefore(n.createTextNode(M),Ue.childNodes[0]||null),Cn===Mt?_e.call(S,fn?"html":"body")[0]:fn?S.documentElement:Ue},Ze=function(d){return ae.call(d.ownerDocument||d,d,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Pt=function(d){return d instanceof m&&(typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||!(d.attributes instanceof f)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function")},St=function(d){return typeof c=="function"&&d instanceof c};function Fe(B,d,S){aa(B,M=>{M.call(e,d,S,en)})}const Qr=function(d){let S=null;if(Fe(X.beforeSanitizeElements,d,null),Pt(d))return D(d),!0;const M=Ce(d.nodeName);if(Fe(X.uponSanitizeElement,d,{tagName:M,allowedTags:se}),Re&&d.hasChildNodes()&&!St(d.firstElementChild)&&$e(/<[/\w!]/g,d.innerHTML)&&$e(/<[/\w!]/g,d.textContent)||Re&&d.namespaceURI===Mt&&M==="style"&&St(d.firstElementChild)||d.nodeType===la.progressingInstruction||Re&&d.nodeType===la.comment&&$e(/<[/\w]/g,d.data))return D(d),!0;if(ze[M]||!(je.tagCheck instanceof Function&&je.tagCheck(M))&&!se[M]){if(!ze[M]&&La(M)&&(oe.tagNameCheck instanceof RegExp&&$e(oe.tagNameCheck,M)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(M)))return!1;if(mr&&!_t[M]){const pe=y(d)||d.parentNode,Ue=z(d)||d.childNodes;if(Ue&&pe){const Se=Ue.length;for(let rt=Se-1;rt>=0;--rt){const Ye=E(Ue[rt],!0);pe.insertBefore(Ye,_(d))}}}return D(d),!0}return d instanceof o&&!w(d)||(M==="noscript"||M==="noembed"||M==="noframes")&&$e(/<\/no(script|embed|frames)/i,d.innerHTML)?(D(d),!0):(Ot&&d.nodeType===la.text&&(S=d.textContent,aa([le,Ne,he],pe=>{S=Sr(S,pe," ")}),d.textContent!==S&&(ia(e.removed,{element:d.cloneNode()}),d.textContent=S)),Fe(X.afterSanitizeElements,d,null),!1)},Jr=function(d,S,M){if(Tt[S]||Sa&&(S==="id"||S==="name")&&(M in n||M in Ln))return!1;const pe=de[S]||je.attributeCheck instanceof Function&&je.attributeCheck(S,d);if(!(ve&&!Tt[S]&&$e(lt,S))){if(!($t&&$e(tt,S))){if(!pe||Tt[S]){if(!(La(d)&&(oe.tagNameCheck instanceof RegExp&&$e(oe.tagNameCheck,d)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(d))&&(oe.attributeNameCheck instanceof RegExp&&$e(oe.attributeNameCheck,S)||oe.attributeNameCheck instanceof Function&&oe.attributeNameCheck(S,d))||S==="is"&&oe.allowCustomizedBuiltInElements&&(oe.tagNameCheck instanceof RegExp&&$e(oe.tagNameCheck,M)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(M))))return!1}else if(!br[S]){if(!$e(Lt,Sr(M,W,""))){if(!((S==="src"||S==="xlink:href"||S==="href")&&d!=="script"&&Hs(M,"data:")===0&&Ea[d])){if(!(Ge&&!$e(nt,Sr(M,W,"")))){if(M)return!1}}}}}}return!0},Da=Y({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),La=function(d){return!Da[da(d)]&&$e(We,d)},Oa=function(d){Fe(X.beforeSanitizeAttributes,d,null);const{attributes:S}=d;if(!S||Pt(d))return;const M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:de,forceKeepAttr:void 0};let pe=S.length;for(;pe--;){const Ue=S[pe],{name:Se,namespaceURI:rt,value:Ye}=Ue,Et=Ce(Se),Kr=Ye;let Ie=Se==="value"?Kr:sf(Kr);if(M.attrName=Et,M.attrValue=Ie,M.keepAttr=!0,M.forceKeepAttr=void 0,Fe(X.uponSanitizeAttribute,d,M),Ie=M.attrValue,mt&&(Et==="id"||Et==="name")&&Hs(Ie,gr)!==0&&($(Se,d),Ie=gr+Ie),Re&&$e(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ie)){$(Se,d);continue}if(Et==="attributename"&&Gs(Ie,"href")){$(Se,d);continue}if(M.forceKeepAttr)continue;if(!M.keepAttr){$(Se,d);continue}if(!hr&&$e(/\/>/i,Ie)){$(Se,d);continue}Ot&&aa([le,Ne,he],ea=>{Ie=Sr(Ie,ea," ")});const $r=Ce(d.nodeName);if(!Jr($r,Et,Ie)){$(Se,d);continue}if(I&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!rt)switch(x.getAttributeType($r,Et)){case"TrustedHTML":{Ie=I.createHTML(Ie);break}case"TrustedScriptURL":{Ie=I.createScriptURL(Ie);break}}if(Ie!==Kr)try{rt?d.setAttributeNS(rt,Se,Ie):d.setAttribute(Se,Ie),Pt(d)?D(d):Bs(e.removed)}catch{$(Se,d)}}Fe(X.afterSanitizeAttributes,d,null)},Ma=function(d){let S=null;const M=Ze(d);for(Fe(X.beforeSanitizeShadowDOM,d,null);S=M.nextNode();)Fe(X.uponSanitizeShadowNode,S,null),Qr(S),Oa(S),S.content instanceof s&&Ma(S.content);Fe(X.afterSanitizeShadowDOM,d,null)};return e.sanitize=function(B){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,M=null,pe=null,Ue=null;if(In=!B,In&&(B=""),typeof B!="string"&&!St(B)&&(B=ff(B),typeof B!="string"))throw Ba("dirty is not a string, aborting");if(!e.isSupported)return B;if(Sn||Vr(d),e.removed=[],typeof B=="string"&&(An=!1),An){const Ye=B.nodeName;if(typeof Ye=="string"){const Et=Ce(Ye);if(!se[Et]||ze[Et])throw Ba("root node is forbidden and cannot be sanitized in-place")}}else if(B instanceof c)S=ye(""),M=S.ownerDocument.importNode(B,!0),M.nodeType===la.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?S=M:S.appendChild(M);else{if(!En&&!Ot&&!fn&&B.indexOf("<")===-1)return I&&dn?I.createHTML(B):B;if(S=ye(B),!S)return En?null:dn?G:""}S&&qr&&D(S.firstChild);const Se=Ze(An?B:S);for(;pe=Se.nextNode();)Qr(pe),Oa(pe),pe.content instanceof s&&Ma(pe.content);if(An)return B;if(En){if(Ot){S.normalize();let Ye=S.innerHTML;aa([le,Ne,he],Et=>{Ye=Sr(Ye,Et," ")}),S.innerHTML=Ye}if(vr)for(Ue=fe.call(S.ownerDocument);S.firstChild;)Ue.appendChild(S.firstChild);else Ue=S;return(de.shadowroot||de.shadowrootmode)&&(Ue=ie.call(a,Ue,!0)),Ue}let rt=fn?S.outerHTML:S.innerHTML;return fn&&se["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&$e(io,S.ownerDocument.doctype.name)&&(rt=" -`+rt),Ot&&aa([le,Ne,he],Ye=>{rt=Sr(rt,Ye," ")}),I&&dn?I.createHTML(rt):rt},e.setConfig=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vr(B),Sn=!0},e.clearConfig=function(){en=null,Sn=!1},e.isValidAttribute=function(B,d,S){en||Vr({});const M=Ce(B),pe=Ce(d);return Jr(M,pe,S)},e.addHook=function(B,d){typeof d=="function"&&ia(X[B],d)},e.removeHook=function(B,d){if(d!==void 0){const S=rf(X[B],d);return S===-1?void 0:af(X[B],S,1)[0]}return Bs(X[B])},e.removeHooks=function(B){X[B]=[]},e.removeAllHooks=function(){X=Qs()},e}var Sf=so();function Qi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var pr=Qi();function lo(t){pr=t}var Kn={exec:()=>null};function ne(t,e=""){let n=typeof t=="string"?t:t.source,a={replace:(r,s)=>{let l=typeof s=="string"?s:s.source;return l=l.replace(ht.caret,"$1"),n=n.replace(r,l),a},getRegex:()=>new RegExp(n,e)};return a}var Ef=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Af=/^(?:[ \t]*(?:\n|$))+/,Rf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Cf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ta=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,If=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ji=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,oo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,co=ne(oo).replace(/bull/g,Ji).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Df=ne(oo).replace(/bull/g,Ji).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ki=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Lf=/^[^\n]+/,$i=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Of=ne(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$i).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Mf=ne(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ji).getRegex(),ei="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",es=/|$))/,Pf=ne("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",es).replace("tag",ei).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),uo=ne(Ki).replace("hr",Ta).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ei).getRegex(),Nf=ne(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",uo).getRegex(),ts={blockquote:Nf,code:Rf,def:Of,fences:Cf,heading:If,hr:Ta,html:Pf,lheading:co,list:Mf,newline:Af,paragraph:uo,table:Kn,text:Lf},Js=ne("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ta).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ei).getRegex(),zf={...ts,lheading:Df,table:Js,paragraph:ne(Ki).replace("hr",Ta).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Js).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ei).getRegex()},Ff={...ts,html:ne(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",es).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Kn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ne(Ki).replace("hr",Ta).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",co).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Uf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Bf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,fo=/^( {2,}|\\)\n(?!\s*$)/,Gf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ef?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ho=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Zf=ne(ho,"u").replace(/punct/g,Hr).getRegex(),Yf=ne(ho,"u").replace(/punct/g,po).getRegex(),vo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Xf=ne(vo,"gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,ti).replace(/punct/g,Hr).getRegex(),Vf=ne(vo,"gu").replace(/notPunctSpace/g,Wf).replace(/punctSpace/g,qf).replace(/punct/g,po).getRegex(),Qf=ne("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,ti).replace(/punct/g,Hr).getRegex(),Jf=ne(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Hr).getRegex(),Kf="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",$f=ne(Kf,"gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,ti).replace(/punct/g,Hr).getRegex(),ed=ne(/\\(punct)/,"gu").replace(/punct/g,Hr).getRegex(),td=ne(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),nd=ne(es).replace("(?:-->|$)","-->").getRegex(),rd=ne("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",nd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ya=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ad=ne(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ya).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),go=ne(/^!?\[(label)\]\[(ref)\]/).replace("label",Ya).replace("ref",$i).getRegex(),mo=ne(/^!?\[(ref)\](?:\[\])?/).replace("ref",$i).getRegex(),id=ne("reflink|nolink(?!\\()","g").replace("reflink",go).replace("nolink",mo).getRegex(),Ks=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,rs={_backpedal:Kn,anyPunctuation:ed,autolink:td,blockSkip:jf,br:fo,code:Bf,del:Kn,delLDelim:Kn,delRDelim:Kn,emStrongLDelim:Zf,emStrongRDelimAst:Xf,emStrongRDelimUnd:Qf,escape:Uf,link:ad,nolink:mo,punctuation:Hf,reflink:go,reflinkSearch:id,tag:rd,text:Gf,url:Kn},sd={...rs,link:ne(/^!?\[(label)\]\((.*?)\)/).replace("label",Ya).getRegex(),reflink:ne(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ya).getRegex()},Pi={...rs,emStrongRDelimAst:Vf,emStrongLDelim:Yf,delLDelim:Jf,delRDelim:$f,url:ne(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ks).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ne(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},$s=t=>od[t];function rn(t,e){if(e){if(ht.escapeTest.test(t))return t.replace(ht.escapeReplace,$s)}else if(ht.escapeTestNoEncode.test(t))return t.replace(ht.escapeReplaceNoEncode,$s);return t}function el(t){try{t=encodeURI(t).replace(ht.percentDecode,"%")}catch{return null}return t}function tl(t,e){let n=t.replace(ht.findPipe,(s,l,c)=>{let o=!1,u=l;for(;--u>=0&&c[u]==="\\";)o=!o;return o?"|":" |"}),a=n.split(ht.splitPipe),r=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length0?-2:-1}function ud(t,e=0){let n=e,a="";for(let r of t)if(r===" "){let s=4-n%4;a+=" ".repeat(s),n+=s}else a+=r,n++;return a}function nl(t,e,n,a,r){let s=e.href,l=e.title||null,c=t[1].replace(r.other.outputLinkReplace,"$1");a.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:l,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,o}function fd(t,e,n){let a=t.match(n.other.indentCodeCompensation);if(a===null)return e;let r=a[1];return e.split(` -`).map(s=>{let l=s.match(n.other.beginningSpace);if(l===null)return s;let[c]=l;return c.length>=r.length?s.slice(r.length):s}).join(` -`)}var Xa=class{options;rules;lexer;constructor(t){this.options=t||pr}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ca(n,` -`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],a=fd(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:a}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let a=ca(n,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(n=a.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:ca(e[0],` -`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=ca(e[0],` -`).split(` -`),a="",r="",s=[];for(;n.length>0;){let l=!1,c=[],o;for(o=0;o1,r={type:"list",raw:"",ordered:a,start:a?+n.slice(0,-1):"",loose:!1,items:[]};n=a?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=a?n:"[*+-]");let s=this.rules.other.listItemRegex(n),l=!1;for(;t;){let o=!1,u="",f="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;u=e[0],t=t.substring(u.length);let m=ud(e[2].split(` -`,1)[0],e[1].length),v=t.split(` -`,1)[0],x=!m.trim(),b=0;if(this.options.pedantic?(b=2,f=m.trimStart()):x?b=e[1].length+1:(b=m.search(this.rules.other.nonSpaceChar),b=b>4?1:b,f=m.slice(b),b+=e[1].length),x&&this.rules.other.blankLine.test(v)&&(u+=v+` -`,t=t.substring(v.length+1),o=!0),!o){let E=this.rules.other.nextBulletRegex(b),k=this.rules.other.hrRegex(b),_=this.rules.other.fencesBeginRegex(b),z=this.rules.other.headingBeginRegex(b),y=this.rules.other.htmlBeginRegex(b),I=this.rules.other.blockquoteBeginRegex(b);for(;t;){let G=t.split(` -`,1)[0],te;if(v=G,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),te=v):te=v.replace(this.rules.other.tabCharGlobal," "),_.test(v)||z.test(v)||y.test(v)||I.test(v)||E.test(v)||k.test(v))break;if(te.search(this.rules.other.nonSpaceChar)>=b||!v.trim())f+=` -`+te.slice(b);else{if(x||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(m)||z.test(m)||k.test(m))break;f+=` -`+v}x=!v.trim(),u+=G+` -`,t=t.substring(G.length+1),m=te.slice(b)}}r.loose||(l?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(l=!0)),r.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),r.raw+=u}let c=r.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let o of r.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(o.raw);if(u){let f={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};o.checked=f.checked,r.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=f.raw+o.tokens[0].raw,o.tokens[0].text=f.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(f)):o.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):o.tokens.unshift(f)}}if(!r.loose){let u=o.tokens.filter(m=>m.type==="space"),f=u.length>0&&u.some(m=>this.rules.other.anyLine.test(m.raw));r.loose=f}}if(r.loose)for(let o of r.items){o.loose=!0;for(let u of o.tokens)u.type==="text"&&(u.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:a,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=tl(e[1]),a=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(` -`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===a.length){for(let l of a)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[o]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===` -`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=ca(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=cd(e[2],"()");if(s===-2)return;if(s>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let a=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(a);s&&(a=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?a=a.slice(1):a=a.slice(1,-1)),nl(e,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let a=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[a.toLowerCase()];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return nl(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!(!a||!a[1]&&!a[2]&&!a[3]&&!a[4]||a[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...a[0]].length-1,s,l,c=r,o=0,u=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+r);(a=u.exec(e))!==null;){if(s=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!s)continue;if(l=[...s].length,a[3]||a[4]){c+=l;continue}else if((a[5]||a[6])&&r%3&&!((r+l)%3)){o+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+o);let f=[...a[0]][0].length,m=t.slice(0,r+a.index+f+l);if(Math.min(r,l)%2){let x=m.slice(1,-1);return{type:"em",raw:m,text:x,tokens:this.lexer.inlineTokens(x)}}let v=m.slice(2,-2);return{type:"strong",raw:m,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return a&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let a=this.rules.inline.delLDelim.exec(t);if(a&&(!a[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...a[0]].length-1,s,l,c=r,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*t.length+r);(a=o.exec(e))!==null;){if(s=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!s||(l=[...s].length,l!==r))continue;if(a[3]||a[4]){c+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c);let u=[...a[0]][0].length,f=t.slice(0,r+a.index+u+l),m=f.slice(r,-r);return{type:"del",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,a;return e[2]==="@"?(n=e[1],a="mailto:"+n):(n=e[1],a=n),{type:"link",raw:e[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,a;if(e[2]==="@")n=e[0],a="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?a="http://"+e[0]:a=e[0]}return{type:"link",raw:e[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Yt=class Ni{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||pr,this.options.tokenizer=this.options.tokenizer||new Xa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:ht,block:Ha.normal,inline:oa.normal};this.options.pedantic?(n.block=Ha.pedantic,n.inline=oa.pedantic):this.options.gfm&&(n.block=Ha.gfm,this.options.breaks?n.inline=oa.breaks:n.inline=oa.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ha,inline:oa}}static lex(e,n){return new Ni(n).lex(e)}static lexInline(e,n){return new Ni(n).inlineTokens(e)}lex(e){e=e.replace(ht.carriageReturn,` -`),this.blockTokens(e,this.tokens);for(let n=0;n(r=l.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let l=n.at(-1);r.raw.length===1&&l!==void 0?l.raw+=` -`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(` -`)?"":` -`)+r.raw,l.text+=` -`+r.text,this.inlineQueue.at(-1).src=l.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(` -`)?"":` -`)+r.raw,l.text+=` -`+r.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},n.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let l=1/0,c=e.slice(1),o;this.options.extensions.startBlock.forEach(u=>{o=u.call({lexer:this},c),typeof o=="number"&&o>=0&&(l=Math.min(l,o))}),l<1/0&&l>=0&&(s=e.substring(0,l+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let l=n.at(-1);a&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(` -`)?"":` -`)+r.raw,l.text+=` -`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(r),a=s.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(` -`)?"":` -`)+r.raw,l.text+=` -`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(r);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let a=e,r=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(a))!==null;)o.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(a))!==null;)a=a.slice(0,r.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(a))!==null;)s=r[2]?r[2].length:0,a=a.slice(0,r.index+s)+"["+"a".repeat(r[0].length-s-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let l=!1,c="";for(;e;){l||(c=""),l=!1;let o;if(this.options.extensions?.inline?.some(f=>(o=f.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let f=n.at(-1);o.type==="text"&&f?.type==="text"?(f.raw+=o.raw,f.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(e,a,c)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e,a,c)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let u=e;if(this.options.extensions?.startInline){let f=1/0,m=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},m),typeof v=="number"&&v>=0&&(f=Math.min(f,v))}),f<1/0&&f>=0&&(u=e.substring(0,f+1))}if(o=this.tokenizer.inlineText(u)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(c=o.raw.slice(-1)),l=!0;let f=n.at(-1);f?.type==="text"?(f.raw+=o.raw,f.text+=o.text):n.push(o);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return n}},Va=class{options;parser;constructor(t){this.options=t||pr}space(t){return""}code({text:t,lang:e,escaped:n}){let a=(e||"").match(ht.notSpaceStart)?.[0],r=t.replace(ht.endingNewline,"")+` -`;return a?'
    '+(n?r:rn(r,!0))+`
    -`:"
    "+(n?r:rn(r,!0))+`
    -`}blockquote({tokens:t}){return`
    -${this.parser.parse(t)}
    -`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`${this.parser.parseInline(t)} -`}hr(t){return`
    -`}list(t){let e=t.ordered,n=t.start,a="";for(let l=0;l -`+a+" -`}listitem(t){return`
  • ${this.parser.parse(t.tokens)}
  • -`}checkbox({checked:t}){return" '}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    -`}table(t){let e="",n="";for(let r=0;r${a}`),` - -`+e+` -`+a+`
    -`}tablerow({text:t}){return` -${t} -`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+` -`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${rn(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:e,tokens:n}){let a=this.parser.parseInline(n),r=el(t);if(r===null)return a;t=r;let s='
    ",s}image({href:t,title:e,text:n,tokens:a}){a&&(n=this.parser.parseInline(a,this.parser.textRenderer));let r=el(t);if(r===null)return rn(n);t=r;let s=`${rn(n)}{let l=r[s].flat(1/0);n=n.concat(this.walkTokens(l,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let a={...n};if(a.async=this.defaults.async||a.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let s=e.renderers[r.name];s?e.renderers[r.name]=function(...l){let c=r.renderer.apply(this,l);return c===!1&&(c=s.apply(this,l)),c}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[r.level];s?s.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),a.extensions=e),n.renderer){let r=this.defaults.renderer||new Va(this.defaults);for(let s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let l=s,c=n.renderer[l],o=r[l];r[l]=(...u)=>{let f=c.apply(r,u);return f===!1&&(f=o.apply(r,u)),f||""}}a.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Xa(this.defaults);for(let s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let l=s,c=n.tokenizer[l],o=r[l];r[l]=(...u)=>{let f=c.apply(r,u);return f===!1&&(f=o.apply(r,u)),f}}a.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new pa;for(let s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let l=s,c=n.hooks[l],o=r[l];pa.passThroughHooks.has(s)?r[l]=u=>{if(this.defaults.async&&pa.passThroughHooksRespectAsync.has(s))return(async()=>{let m=await c.call(r,u);return o.call(r,m)})();let f=c.call(r,u);return o.call(r,f)}:r[l]=(...u)=>{if(this.defaults.async)return(async()=>{let m=await c.apply(r,u);return m===!1&&(m=await o.apply(r,u)),m})();let f=c.apply(r,u);return f===!1&&(f=o.apply(r,u)),f}}a.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,s=n.walkTokens;a.walkTokens=function(l){let c=[];return c.push(s.call(this,l)),r&&(c=c.concat(r.call(this,l))),c}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Yt.lex(t,e??this.defaults)}parser(t,e){return Xt.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let a={...n},r={...this.defaults,...a},s=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&a.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let l=r.hooks?await r.hooks.preprocess(e):e,c=await(r.hooks?await r.hooks.provideLexer(t):t?Yt.lex:Yt.lexInline)(l,r),o=r.hooks?await r.hooks.processAllTokens(c):c;r.walkTokens&&await Promise.all(this.walkTokens(o,r.walkTokens));let u=await(r.hooks?await r.hooks.provideParser(t):t?Xt.parse:Xt.parseInline)(o,r);return r.hooks?await r.hooks.postprocess(u):u})().catch(s);try{r.hooks&&(e=r.hooks.preprocess(e));let l=(r.hooks?r.hooks.provideLexer(t):t?Yt.lex:Yt.lexInline)(e,r);r.hooks&&(l=r.hooks.processAllTokens(l)),r.walkTokens&&this.walkTokens(l,r.walkTokens);let c=(r.hooks?r.hooks.provideParser(t):t?Xt.parse:Xt.parseInline)(l,r);return r.hooks&&(c=r.hooks.postprocess(c)),c}catch(l){return s(l)}}}onError(t,e){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,t){let a="

    An error occurred:

    "+rn(n.message+"",!0)+"
    ";return e?Promise.resolve(a):a}if(e)return Promise.reject(n);throw n}}},ur=new dd;function ue(t,e){return ur.parse(t,e)}ue.options=ue.setOptions=function(t){return ur.setOptions(t),ue.defaults=ur.defaults,lo(ue.defaults),ue};ue.getDefaults=Qi;ue.defaults=pr;ue.use=function(...t){return ur.use(...t),ue.defaults=ur.defaults,lo(ue.defaults),ue};ue.walkTokens=function(t,e){return ur.walkTokens(t,e)};ue.parseInline=ur.parseInline;ue.Parser=Xt;ue.parser=Xt.parse;ue.Renderer=Va;ue.TextRenderer=as;ue.Lexer=Yt;ue.lexer=Yt.lex;ue.Tokenizer=Xa;ue.Hooks=pa;ue.parse=ue;ue.options;ue.setOptions;ue.use;ue.walkTokens;ue.parseInline;Xt.parse;Yt.lex;function ha(t){return Sf.sanitize(ue.parse(t,{async:!1,breaks:!0,gfm:!0}))}function zn(t){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(t))}function Dr(t){return`/api/uploads/${encodeURIComponent(t.id)}`}function pd(t){return t.content_type.startsWith("image/")}function hd(t){return t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function vd(t,e){const n=()=>{const s=t.style.height;t.style.height="auto";const l=`${t.scrollHeight}px`;s!==l?t.style.height=l:t.style.height=s},a=()=>n(),r=()=>n();return requestAnimationFrame(n),t.addEventListener("input",a),window.addEventListener("resize",r),{update(){requestAnimationFrame(n)},destroy(){t.removeEventListener("input",a),window.removeEventListener("resize",r)}}}var gd=L('
    ');function md(t,e){Wt(e,!0);var n=gd(),a=p(n),r=g(a,2),s=g(r,2),l=p(s);l.textContent="<>";var c=g(s,2),o=p(c);o.textContent="{}";var u=g(c,2),f=g(u,2);let m;N(()=>m=dt(f,1,"",null,m,{active:e.showGifPicker})),H("click",a,()=>e.onWrap("**")),H("click",r,()=>e.onWrap("_")),H("click",s,()=>e.onWrap("`")),H("click",c,()=>e.onWrap("```","\n```")),H("click",u,()=>e.onAppend("[label](https://)")),H("click",f,function(...v){e.onToggleGif?.apply(this,v)}),R(t,n),jt()}un(["click"]);var _d=L(''),bd=L('
    GIFs
    ');function kd(t,e){Wt(e,!0);var n=bd(),a=p(n),r=g(p(a),2),s=g(a,2);It(s,21,()=>e.gifs,l=>l.url,(l,c)=>{var o=_d(),u=p(o),f=g(u,2),m=p(f);N(()=>{F(u,"src",i(c).url),F(u,"alt",i(c).title),O(m,i(c).title)}),H("click",o,()=>e.onPick(i(c).url,i(c).title)),R(l,o)}),N(()=>Kl(r,e.query)),H("input",r,l=>e.onQuery(l.currentTarget.value)),R(t,n),jt()}un(["input","click"]);var wd=L('
    Replying to
    ');function yd(t,e){Wt(e,!0);var n=wd(),a=g(p(n),2),r=p(a),s=g(p(r)),l=p(s),c=g(r,2),o=p(c),u=g(a,2);N(f=>{O(l,e.target.author?.display_name||"Local User"),O(o,f)},[()=>tr(e.target.body)]),H("click",u,function(...f){e.onClear?.apply(this,f)}),R(t,n),jt()}un(["click"]);var xd=L(''),Td=L('
    '),Sd=L(''),Ed=L('
    ');function rl(t,e){Wt(e,!0);let n=Qe(e,"formClass",3,"composer"),a=Qe(e,"pendingUpload",3,null),r=Qe(e,"replyTarget",3,null),s=Qe(e,"showUpload",3,!1),l=Qe(e,"showToolbar",3,!1),c=Qe(e,"showGifPicker",3,!1),o=Qe(e,"gifQuery",3,""),u=Qe(e,"filteredGifs",19,()=>[]),f=Qe(e,"onUploadFile",3,()=>{}),m=Qe(e,"onRemoveUpload",3,()=>{}),v=Qe(e,"onClearReply",3,()=>{}),x=Qe(e,"onApplyMarkdownWrap",3,()=>{}),b=Qe(e,"onAppendToComposer",3,()=>{}),E=Qe(e,"onToggleGif",3,()=>{}),k=Qe(e,"onGifQuery",3,()=>{}),_=Qe(e,"onPickGif",3,()=>{}),z=Ct(null);_a(()=>(e.onInputRef(i(z)),()=>e.onInputRef(null)));var y=Ed(),I=p(y);{var G=W=>{kd(W,{get gifs(){return u()},get query(){return o()},get onQuery(){return k()},get onPick(){return _()}})};q(I,W=>{c()&&W(G)})}var te=g(I,2),ae=p(te);{var fe=W=>{var We=Td(),Lt=g(p(We),2);{var se=ze=>{var Tt=xd();N(je=>{F(Tt,"src",je),F(Tt,"alt",a().filename)},[()=>Dr(a())]),R(ze,Tt)},Tn=lr(()=>pd(a()));q(Lt,ze=>{i(Tn)&&ze(se)})}var de=g(Lt,2),xt=p(de),oe=g(de,2);N(ze=>O(xt,`${a().filename??""} · ${ze??""}`),[()=>hd(a().byte_size)]),H("click",oe,function(...ze){m()?.apply(this,ze)}),R(W,We)};q(ae,W=>{a()&&W(fe)})}var _e=g(ae,2);{var ie=W=>{yd(W,{get target(){return r()},get onClear(){return v()}})};q(_e,W=>{r()&&W(ie)})}var X=g(_e,2),le=p(X);{var Ne=W=>{var We=Sd(),Lt=p(We);H("change",Lt,function(...se){f()?.apply(this,se)}),R(W,We)};q(le,W=>{s()&&W(Ne)})}var he=g(le,2);Vi(he,W=>h(z,W),()=>i(z)),Cu(he,(W,We)=>vd?.(W),()=>e.value);var lt=g(he,2),tt=g(X,2);{var nt=W=>{md(W,{get showGifPicker(){return c()},get onWrap(){return x()},get onAppend(){return b()},get onToggleGif(){return E()}})};q(tt,W=>{l()&&W(nt)})}N(W=>{dt(y,1,Du(n())),Kl(he,e.value),F(he,"placeholder",e.placeholder),F(he,"aria-label",e.ariaLabel),F(lt,"aria-label",e.submitLabel),lt.disabled=W},[()=>!e.value.trim()]),an("submit",y,W=>{W.preventDefault(),e.onSubmit()}),H("input",he,W=>e.onValue(W.currentTarget.value)),an("focus",he,function(...W){e.onFocus?.apply(this,W)}),H("keydown",he,function(...W){e.onKeydown?.apply(this,W)}),R(t,y),jt()}un(["click","change","input","keydown"]);var Ad=L('
    '),Rd=L(''),Cd=L(' ',1),Id=L('
    ',2),Dd=L(' ');function Fi(t,e){Wt(e,!0);let n=Qe(e,"onOpenImage",3,()=>{}),a=Ct(null),r=Ct(!1),s=Ct(""),l=lr(()=>e.upload.content_type?.startsWith("image/")??!1),c=lr(()=>e.upload.content_type?.startsWith("video/")??!1);function o(){h(r,!0)}function u(){if(!i(a)||!isFinite(i(a).duration))return;const _=Math.floor(i(a).duration),z=Math.floor(_/60),y=_%60;h(s,`${z}:${y.toString().padStart(2,"0")}`)}function f(){i(a)&&(h(r,!0),i(a).play())}function m(_){return _<1024?`${_} B`:_<1024*1024?`${Math.round(_/1024)} KB`:`${(_/(1024*1024)).toFixed(1)} MB`}var v=$a(),x=yn(v);{var b=_=>{var z=Ad(),y=p(z),I=p(y),G=g(y,2),te=p(G),ae=p(te),fe=g(te,2);N(()=>{F(y,"aria-label",`Open image ${e.upload.filename}`),F(I,"src",e.url),F(I,"alt",e.upload.filename),O(ae,e.upload.filename),F(fe,"href",e.url),F(fe,"download",e.upload.filename),F(fe,"aria-label",`Download ${e.upload.filename}`)}),H("click",y,()=>n()(e.url,e.upload.filename)),H("click",fe,_e=>_e.stopPropagation()),R(_,z)},E=_=>{var z=Id();let y;var I=p(z),G=p(I);Vi(I,le=>h(a,le),()=>i(a));var te=g(I,2);{var ae=le=>{var Ne=Cd(),he=yn(Ne),lt=g(he,2);{var tt=nt=>{var W=Rd(),We=p(W);N(()=>O(We,i(s))),R(nt,W)};q(lt,nt=>{i(s)&&nt(tt)})}N(()=>F(he,"aria-label",`Play ${e.upload.filename}`)),H("click",he,f),R(le,Ne)};q(te,le=>{i(r)||le(ae)})}var fe=g(te,2),_e=p(fe),ie=p(_e),X=g(_e,2);N(()=>{y=dt(z,1,"media-tile media-tile--video",null,y,{"is-started":i(r)}),I.controls=i(r),F(I,"aria-label",e.upload.filename),F(G,"src",e.url),F(G,"type",e.upload.content_type),O(ie,e.upload.filename),F(X,"href",e.url),F(X,"download",e.upload.filename),F(X,"aria-label",`Download ${e.upload.filename}`)}),an("play",I,o),an("loadedmetadata",I,u),H("click",X,le=>le.stopPropagation()),R(_,z)},k=_=>{var z=Dd(),y=g(p(z),2),I=p(y),G=p(I),te=g(I,2),ae=p(te);N(fe=>{F(z,"href",e.url),O(G,e.upload.filename),O(ae,fe)},[()=>m(e.upload.byte_size)]),R(_,z)};q(x,_=>{i(l)?_(b):i(c)?_(E,1):_(k,-1)})}R(t,v),jt()}un(["click"]);var Ld=L(' '),Od=L(' '),Md=L('');function Pd(t,e){Wt(e,!0);var n=$a(),a=yn(n);{var r=s=>{var l=Md();let c;var o=g(p(l),2),u=p(o),f=p(u),m=g(u,2);{var v=b=>{var E=Ld(),k=p(E);N(_=>O(k,_),[()=>tr(e.message.quoted_body_snapshot)]),R(b,E)},x=b=>{var E=Od(),k=p(E);N(_=>O(k,`[original deleted] ${_??""}`),[()=>tr(e.message.quoted_body_snapshot)]),R(b,E)};q(m,b=>{e.message.quoted_message_id?b(v):b(x,-1)})}N((b,E)=>{c=dt(l,1,"quote-block",null,c,{dangling:!e.message.quoted_message_id}),l.disabled=!e.message.quoted_message_id,F(l,"aria-label",b),O(f,E)},[()=>e.message.quoted_message_id?`Jump to quoted message from ${Ir(e.message)}`:"Original message was deleted",()=>Ir(e.message)]),H("click",l,()=>e.onJump(e.message)),R(s,l)};q(a,s=>{(e.message.quoted_message_id||e.message.quoted_body_snapshot)&&s(r)})}R(t,n),jt()}un(["click"]);var Nd=L('
    '),zd=L('
    ');function Fd(t,e){Wt(e,!0);var n=zd();let a;var r=p(n),s=p(r),l=g(r,2),c=p(l);Pd(c,{get message(){return e.message},get onJump(){return e.onJumpToQuote}});var o=g(c,2);Li(o,()=>ha(e.message.body),!0);var u=g(o,2);{var f=b=>{var E=Nd();It(E,21,()=>e.message.attachments,k=>k.id,(k,_)=>{{let z=lr(()=>Dr(i(_)));Fi(k,{get upload(){return i(_)},get url(){return i(z)},get onOpenImage(){return e.onOpenImage}})}}),R(b,E)};q(u,b=>{e.message.attachments?.length&&b(f)})}var m=g(l,2),v=p(m),x=g(v,2);N((b,E)=>{a=dt(n,1,"message-row",null,a,{selected:e.selected}),F(n,"data-message-id",e.message.id),O(s,b),F(x,"data-tooltip",E)},[()=>e.index===0?"":zn(e.message.created_at),()=>Hu(e.message,e.selectedThreadID)]),H("click",v,()=>e.onReply(e.message,e.replyContext)),H("click",x,()=>e.onOpenThread(e.message)),R(t,n),jt()}un(["click"]);var Ud=L(''),Bd=L(" "),Gd=L('
    ');function Hd(t,e){Wt(e,!0);var n=Gd(),a=p(n),r=p(a);{var s=k=>{var _=Ud();N(()=>F(_,"src",e.group.authorAvatarURL)),R(k,_)},l=k=>{var _=pt();N(z=>O(_,z),[()=>Je(e.group.authorName)]),R(k,_)};q(r,k=>{e.group.authorAvatarURL?k(s):k(l,-1)})}var c=g(a,2),o=p(c),u=p(o),f=p(u),m=g(u,2);{var v=k=>{var _=Bd(),z=p(_);N(y=>O(z,y),[()=>ut(e.group.authorHandle)]),R(k,_)};q(m,k=>{e.group.authorHandle&&k(v)})}var x=g(m,2),b=p(x),E=g(o,2);It(E,19,()=>e.group.messages,k=>k.id,(k,_,z)=>{{let y=lr(()=>e.selectedThreadID===i(_).id);Fd(k,{get message(){return i(_)},get index(){return i(z)},get selected(){return i(y)},get replyContext(){return e.replyContext},get selectedThreadID(){return e.selectedThreadID},get onReply(){return e.onReply},get onOpenThread(){return e.onOpenThread},get onJumpToQuote(){return e.onJumpToQuote},get onOpenImage(){return e.onOpenImage}})}}),N((k,_)=>{bn(a,`--hue: ${k??""}deg`),F(a,"aria-label",`View profile for ${e.group.authorName}`),O(f,e.group.authorName),O(b,_)},[()=>Ke(e.group.authorID),()=>zn(e.group.timestamp)]),H("click",a,()=>e.onOpenProfile(e.group.messages[0]?.author)),H("click",u,()=>e.onOpenProfile(e.group.messages[0]?.author)),R(t,n),jt()}un(["click"]);var qd=L('
    Send a message in Markdown — code fences, lists, links all work. Threads open from any message.
    '),Wd=L('
    '),jd=L(" ",1),Zd=L('
    ');function Yd(t,e){Wt(e,!0);let n=Ct(null),a=lr(()=>Wu(e.messages)),r=lr(()=>e.selectedDirect?"dm":"channel");_a(()=>(e.onListRef(i(n)),()=>e.onListRef(null)));var s=Zd(),l=p(s);{var c=u=>{var f=qd(),m=p(f),v=p(m);{var x=I=>{var G=pt("@");R(I,G)},b=I=>{var G=pt("#");R(I,G)};q(v,I=>{e.selectedDirect?I(x):I(b,-1)})}var E=g(m,2),k=p(E);{var _=I=>{var G=pt();N(te=>O(G,`This is the start of your conversation with ${te??""}.`),[()=>Jn(e.selectedDirect,e.currentUserID)]),R(I,G)},z=I=>{var G=pt();N(()=>O(G,`Welcome to #${e.selectedChannel.name??""}!`)),R(I,G)},y=I=>{var G=pt("Pick a channel to get started.");R(I,G)};q(k,I=>{e.selectedDirect?I(_):e.selectedChannel?I(z,1):I(y,-1)})}R(u,f)};q(l,u=>{e.messages.length===0&&u(c)})}var o=g(l,2);It(o,17,()=>i(a),u=>u.key,(u,f)=>{var m=jd(),v=yn(m);{var x=E=>{var k=Wd(),_=p(k),z=p(_);N(()=>O(z,i(f).dayLabel)),R(E,k)};q(v,E=>{i(f).dayLabel&&E(x)})}var b=g(v,2);Hd(b,{get group(){return i(f)},get selectedThreadID(){return e.selectedThreadID},get replyContext(){return i(r)},get onOpenProfile(){return e.onOpenProfile},get onReply(){return e.onReply},get onOpenThread(){return e.onOpenThread},get onJumpToQuote(){return e.onJumpToQuote},get onOpenImage(){return e.onOpenImage}}),R(u,m)}),Vi(s,u=>h(n,u),()=>i(n)),H("pointerdown",s,function(...u){e.onActivateMessageComposer?.apply(this,u)}),H("pointerup",s,function(...u){e.onInlineImagePointerUp?.apply(this,u)}),R(t,s),jt()}un(["pointerdown","pointerup"]);var Xd=L(''),Vd=L(`
    cc
    ClickClack OpenClaw workspace chat

    Welcome back.

    Workspace chat for the OpenClaw crew. Sign in with the GitHub account that's a member of the org.

    Limited to active members of the OpenClaw org.

    `),Qd=L(''),Jd=L('
    '),Kd=L('
    '),$d=L(''),ep=L(''),tp=L(''),np=L(''),rp=L(''),ap=L(''),ip=L(''),sp=L(''),lp=L(''),op=L(''),cp=L('

    '),up=L('

    '),fp=L('

    ClickClack

    '),dp=L(''),pp=L(''),hp=L(''),vp=L('
    '),gp=L(''),mp=L(" "),_p=L('
    '),bp=L(''),kp=L(" "),wp=L(' '),yp=L(' '),xp=L(''),Tp=L('
    '),Sp=L('
    '),Ep=L('

    Thread

    ',1),Ap=L(''),Rp=L(" "),Cp=L(''),Ip=L(''),Dp=L(''),Lp=L('

    Profile

    Active
    Contact information
    Handle
    User ID
    About

    ',1),Op=L('
    No thread open Hover any message and tap the bubble to keep side conversations tidy.
    '),Mp=L(''),Pp=L("

    "),Np=L(''),zp=L(''),Fp=L('

    ',1);function Up(t,e){Wt(e,!1);const n=j(),a=j(),r=j(),s=j(),l=j(),c=j();let o=j(null),u=j([]),f=j([]),m=j([]),v=j([]),x=j([]),b=j(""),E=j(""),k=j(""),_=j(null),z=j(null),y=j(null),I=j(null),G=j(""),te=j(""),ae=j(""),fe=j(""),_e=j(""),ie=j(""),X=j([]),le=j(null),Ne=j(!1),he=j(!1),lt=j(""),tt=j(""),nt=j(""),W=j(""),We=j(""),Lt=j(!1),se=j("loading"),Tn=j(!1),de=null,xt=j(!1),oe,ze=j(null),Tt=j(!1),je=j(!1),$t=j(!1),ve=j(null),Ge=j(null),hr=j(null),Ot=j(null),Re=j("message");to(()=>{fn()}),Fu(()=>{const w=de;de=null,h(xt,!1),w?.close(),oe&&window.clearTimeout(oe)});async function fn(){try{const w=await Ve("/api/me");h(o,w.user),await En(),h(se,"ready")}catch(w){if(w instanceof no&&(w.status===401||w.status===403)){h(Tn,!0),h(se,"auth");return}h(se,w instanceof Error?w.message:"Could not load ClickClack")}}function Sn(){i(o)&&(h(tt,i(o).display_name),h(nt,i(o).handle?`@${i(o).handle}`:""),h(W,i(o).avatar_url),h(We,""),h(Lt,!1),h(he,!0))}async function qr(){h(We,""),h(Lt,!1);try{const w=await Ve("/api/me",{method:"PATCH",body:JSON.stringify({display_name:i(tt),handle:i(nt),avatar_url:i(W)})});h(o,w.user),h(v,i(v).map(D=>D.author?.id===i(o)?.id?{...D,author:w.user}:D)),h(x,i(x).map(D=>D.author?.id===i(o)?.id?{...D,author:w.user}:D)),i(_)?.author?.id===i(o).id&&h(_,{...i(_),author:w.user}),h(We,"Saved"),h(he,!1)}catch(w){h(We,w instanceof Error?w.message:"Could not save profile"),h(Lt,!0)}}async function En(){const w=await Ve("/api/workspaces");h(u,w.workspaces),h(b,i(b)||i(u)[0]?.id||""),await dn(),await Rn(),i(u).length===0&&h(se,"create a workspace"),In()}async function vr(){if(!i(ae).trim())return;const w=await Ve("/api/workspaces",{method:"POST",body:JSON.stringify({name:i(ae)})});h(ae,""),h(Tt,!1),h(u,[...i(u),w.workspace]),h(b,w.workspace.id),await dn(),await Rn(),In()}async function dn(){if(!i(b))return;const w=await Ve(`/api/workspaces/${i(b)}/channels`);h(f,w.channels),h(E,i(f).find(D=>D.id===i(E))?.id||i(f)[0]?.id||""),h(_,null),h(y,null),h(Re,"message"),h(x,[]),await mt()}async function Sa(){if(!i(b)||!i(fe).trim())return;const w=await Ve(`/api/workspaces/${i(b)}/channels`,{method:"POST",body:JSON.stringify({name:i(fe),kind:"public"})});h(fe,""),h(f,[...i(f),w.channel]),h(E,w.channel.id),h(k,""),await mt()}async function mt(){if(i(k)){const D=await Ve(`/api/dms/${i(k)}/messages`);h(v,D.messages),await gr();return}if(!i(E)){h(v,[]);return}const w=await Ve(`/api/channels/${i(E)}/messages`);h(v,w.messages),await gr()}async function gr(){await Ai(),i(ze)&&tu(ze,i(ze).scrollTop=i(ze).scrollHeight)}async function mr(){const w=i(G).trim();if(!w)return;if(!i(E)&&!i(k)){h(se,"pick or create a channel");return}const D=i(k)?"dm":"channel",$=i(ve)&&i(Ge)===D?i(ve):null;h(G,"");const ye=i(k)?`/api/dms/${i(k)}/messages`:`/api/channels/${i(E)}/messages`,Ze={body:w};$&&(Ze.quoted_message_id=$.id);const Pt=await Ve(ye,{method:"POST",body:JSON.stringify(Ze)});let St=Pt.message;if($&&bt(),i(le)){const Fe=i(le);await Ve(`/api/messages/${Pt.message.id}/attachments`,{method:"POST",body:JSON.stringify({upload_id:Fe.id})}),h(le,null),St={...St,attachments:[...St.attachments||[],Fe]}}i(v).some(Fe=>Fe.id===St.id)?h(v,i(v).map(Fe=>Fe.id===St.id?St:Fe)):h(v,[...i(v),St]),await gr()}async function An(w){h(y,null),h(_,w),h(Re,"thread");const D=await Ve(`/api/messages/${w.id}/thread`);h(_,D.root),h(x,D.replies),h(z,D.thread_state)}async function pn(){const w=i(te).trim();if(!w||!i(_))return;const D=i(ve)&&i(Ge)==="thread"?i(ve):null;h(te,"");const $={body:w};D&&($.quoted_message_id=D.id);const ye=await Ve(`/api/messages/${i(_).id}/thread/replies`,{method:"POST",body:JSON.stringify($)});D&&bt(),i(x).some(Ze=>Ze.id===ye.message.id)||h(x,[...i(x),ye.message]),h(z,ye.thread_state)}function _t(w,D){h(ve,w),h(Ge,D),h(Re,D==="thread"?"thread":"message")}function _r(){return i(I)!==null||i(he)}function Ea(){return i(Re)==="thread"&&i(_)&&i(Ot)?i(Ot):i(hr)}function bt(){h(ve,null),h(Ge,null)}async function br(w){const D=w.quoted_message_id;if(!D)return;await Ai();const $=document.querySelector(`[data-message-id="${CSS.escape(D)}"]`);$&&($.scrollIntoView({behavior:"smooth",block:"center"}),$.classList.add("highlight"),window.setTimeout(()=>$.classList.remove("highlight"),1500))}async function Aa(){if(!i(b)||!i(ie).trim()){h(X,[]);return}const w=await Ve(`/api/search?workspace_id=${encodeURIComponent(i(b))}&q=${encodeURIComponent(i(ie).trim())}`);h(X,w.results)}async function kr(w){const D=w.currentTarget,$=D.files?.[0];if(!$||!i(b))return;const ye=new FormData;ye.set("workspace_id",i(b)),ye.set("file",$);const Ze=await Ve("/api/uploads",{method:"POST",body:ye});h(le,Ze.upload),D.value=""}async function Rn(){if(!i(b))return;const w=await Ve(`/api/dms?workspace_id=${i(b)}`);h(m,w.conversations)}async function Mt(){if(!i(b)||!i(_e).trim())return;const w=await Ve("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:i(b),member_ids:[i(_e).trim()]})});h(_e,""),h(m,[...i(m),w.conversation]),h(k,w.conversation.id),h(E,""),h(_,null),h(y,null),h(Re,"message"),await mt()}async function Cn(w){if(!i(b)||!w)return;const D=i(m).find(ye=>ye.members.some(Ze=>Ze.id===w));if(D){h(k,D.id),h(E,""),h(_,null),h(y,null),h(Re,"message"),await mt();return}const $=await Ve("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:i(b),member_ids:[w]})});h(m,[...i(m),$.conversation]),h(k,$.conversation.id),h(E,""),h(_,null),h(y,null),h(Re,"message"),await mt()}function In(){oe&&window.clearTimeout(oe);const w=de;if(de=null,h(xt,!1),w?.close(),!i(b))return;const D=localStorage.getItem(`clickclack:${i(b)}:cursor`)||"",$=new URL("/api/realtime/ws",window.location.href);$.protocol=window.location.protocol==="https:"?"wss:":"ws:",$.searchParams.set("workspace_id",i(b)),D&&$.searchParams.set("after_cursor",D);const ye=new WebSocket($);de=ye,ye.addEventListener("open",()=>{de===ye&&h(xt,!0)}),ye.addEventListener("message",Ze=>{const Pt=JSON.parse(String(Ze.data));Pt.cursor&&localStorage.setItem(`clickclack:${i(b)}:cursor`,Pt.cursor),Wr(Pt)}),ye.addEventListener("close",()=>{de===ye&&(h(xt,!1),oe=window.setTimeout(In,1200))})}async function Wr(w){if((w.type==="channel.created"||w.type==="channel.updated")&&w.workspace_id===i(b)){await dn();return}(w.channel_id===i(E)||w.payload.direct_conversation_id===i(k))&&(w.type==="message.created"||w.type==="message.updated"||w.type==="message.deleted")&&await mt();const D=w.payload.root_message_id||w.payload.message_id;i(_)&&D===i(_).id&&await An(i(_))}function Ra(w){w&&(h(_,null),h(y,w))}function jr(w){if(w.key==="Escape"&&i(ve)&&i(Ge)!=="thread"){w.preventDefault(),bt();return}w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),mr())}function Zr(w){if(w.key==="Escape"&&i(ve)&&i(Ge)==="thread"){w.preventDefault(),bt();return}w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),pn())}function wr(w,D){h(I,{url:w,title:D})}function Dn(w){const D=w.target;D instanceof HTMLImageElement&&D.closest(".markdown")&&(w.preventDefault(),wr(D.currentSrc||D.src,D.alt||"Image"))}function Yr(w){const D=i(G)&&!i(G).endsWith(` -`)?` -`:"";h(G,`${i(G)}${D}${w}`)}function ni(w,D=w){Yr(`${w}${w==="```"?` -code -`:"text"}${D}`)}function Ce(w,D){Yr(`![${D}](${w})`),h(Ne,!1),h(lt,"")}function en(){i(Ge)==="thread"&&bt(),h(_,null),h(y,null),h(Re,"message"),h(x,[])}function Ln(){h(I,null),h(he,!1)}_n(()=>(i(u),i(b)),()=>{h(n,i(u).find(w=>w.id===i(b)))}),_n(()=>(i(f),i(E)),()=>{h(a,i(f).find(w=>w.id===i(E)))}),_n(()=>(i(m),i(k)),()=>{h(r,i(m).find(w=>w.id===i(k)))}),_n(()=>(i(_),i(y)),()=>{h(s,i(_)!==null||i(y)!==null)}),_n(()=>(i(v),i(m),i(o)),()=>{h(l,ju(i(v),i(m),i(o)?.id||""))}),_n(()=>(i(Ge),i(ve),i(v)),()=>{i(Ge)==="channel"&&i(ve)&&!i(v).some(w=>w.id===i(ve)?.id)&&bt()}),_n(()=>(i(Ge),i(ve),i(v)),()=>{i(Ge)==="dm"&&i(ve)&&!i(v).some(w=>w.id===i(ve)?.id)&&bt()}),_n(()=>(i(Ge),i(ve),i(_),i(x)),()=>{i(Ge)==="thread"&&i(ve)&&i(_)&&i(ve).id!==i(_).id&&!i(x).some(w=>w.id===i(ve)?.id)&&bt()}),_n(()=>i(lt),()=>{h(c,Gu.filter(w=>{const D=i(lt).trim().toLowerCase();return!D||w.title.toLowerCase().includes(D)||w.tags.some($=>$.includes(D))}))}),uu(),eo();var Xr=$a();Ql("1oa2eo8",w=>{var D=Xd();R(w,D)}),an("keydown",Ei,w=>{if(w.key==="Escape"){if(_r())Ln();else if(i(ve)){w.preventDefault(),bt();return}}$u(w,{authRequired:i(Tn),isModalOpen:_r,messageInput:i(hr),replyInput:i(Ot),target:Ea})});var Vr=yn(Xr);{var Ca=w=>{var D=Vd();R(w,D)},Ia=w=>{var D=Fp(),$=yn(D);let ye;var Ze=p($),Pt=p(Ze);{var St=A=>{var C=pt("×");R(A,C)},Fe=A=>{var C=Qd();R(A,C)};q(Pt,A=>{i($t)?A(St):A(Fe,-1)})}var Qr=g(Ze,2),Jr=g(p(Qr),4),Da=p(Jr);It(Da,1,()=>i(u),A=>A.id,(A,C)=>{var U=Jd();let ee;var be=p(U),xe=p(be),He=p(xe);N(Te=>{ee=dt(U,1,"guild-wrap",null,ee,{active:i(C).id===i(b)}),F(be,"title",(i(C),T(()=>i(C).name))),O(He,Te)},[()=>(Z(Ns),i(C),T(()=>Ns(i(C).name)))]),H("click",be,async()=>{h(b,i(C).id),await dn(),await Rn(),In()}),R(A,U)});var La=g(Da,2),Oa=g(Jr,2);{var Ma=A=>{var C=Kd(),U=p(C);an("submit",C,ee=>{ee.preventDefault(),vr()}),Qn(U,()=>i(ae),ee=>h(ae,ee)),R(A,C)};q(Oa,A=>{i(Tt)&&A(Ma)})}var B=g(Qr,2),d=p(B),S=p(d),M=p(S),pe=p(M),Ue=g(M,2);let Se;var rt=p(Ue),Ye=g(S,2),Et=p(Ye),Kr=p(Et),Ie=g(d,2),$r=p(Ie),ea=g(p($r),2),is=p(ea);It(is,1,()=>i(f),A=>A.id,(A,C)=>{var U=$d();let ee;var be=g(p(U),2),xe=p(be);N(()=>{ee=dt(U,1,"nav-item channel",null,ee,{active:i(C).id===i(E)&&!i(k)}),O(xe,(i(C),T(()=>i(C).name)))}),H("click",U,async()=>{h(E,i(C).id),h(k,""),h(_,null),h(y,null),h(Re,"message"),h($t,!1),await mt()}),R(A,U)});var _o=g(is,2);{var bo=A=>{var C=ep();R(A,C)};q(_o,A=>{i(f),T(()=>i(f).length===0)&&A(bo)})}var ss=g(ea,2),ko=p(ss),ls=g($r,2),os=g(p(ls),2),cs=p(os);It(cs,1,()=>i(m),A=>A.id,(A,C)=>{const U=Nt(()=>(Z(zs),i(C),i(o),T(()=>zs(i(C),i(o)?.id))));var ee=np();let be;var xe=p(ee),He=p(xe);{var Te=Q=>{var ce=tp();N(()=>F(ce,"src",(Z(i(U)),T(()=>i(U).avatar_url)))),R(Q,ce)},V=Q=>{var ce=pt();N(at=>O(ce,at),[()=>(Z(Je),Z(i(U)),T(()=>Je(i(U)?.display_name)))]),R(Q,ce)};q(He,Q=>{Z(i(U)),T(()=>i(U)?.avatar_url)?Q(Te):Q(V,-1)})}var Be=g(xe,2),Xe=p(Be);N((Q,ce)=>{be=dt(ee,1,"nav-item dm",null,be,{active:i(C).id===i(k)}),bn(xe,`--hue: ${Q??""}deg`),O(Xe,ce)},[()=>(Z(Ke),Z(i(U)),i(C),T(()=>Ke(i(U)?.id||i(C).id))),()=>(Z(Jn),i(C),i(o),T(()=>Jn(i(C),i(o)?.id)))]),H("click",ee,async()=>{h(k,i(C).id),h(E,""),h(_,null),h(y,null),h(Re,"message"),h($t,!1),await mt()}),R(A,ee)});var wo=g(cs,2);{var yo=A=>{var C=rp();R(A,C)};q(wo,A=>{i(m),T(()=>i(m).length===0)&&A(yo)})}var us=g(os,2),xo=p(us),To=g(ls,2),So=g(p(To),2),fs=p(So);It(fs,1,()=>i(l),A=>A.id,(A,C)=>{const U=Nt(()=>(Z(Fs),i(m),i(C),T(()=>Fs(i(m),i(C).id))));var ee=ip();let be;var xe=p(ee),He=p(xe);{var Te=Q=>{var ce=ap();N(()=>F(ce,"src",(i(C),T(()=>i(C).avatar_url)))),R(Q,ce)},V=Q=>{var ce=pt();N(at=>O(ce,at),[()=>(Z(Je),i(C),T(()=>Je(i(C).display_name)))]),R(Q,ce)};q(He,Q=>{i(C),T(()=>i(C).avatar_url)?Q(Te):Q(V,-1)})}var Be=g(xe,2),Xe=p(Be);N(Q=>{be=dt(ee,1,"nav-item dm",null,be,{active:i(U)?.id===i(k)||i(y)?.id===i(C).id}),bn(xe,`--hue: ${Q??""}deg`),O(Xe,(i(C),T(()=>i(C).display_name)))},[()=>(Z(Ke),i(C),T(()=>Ke(i(C).id)))]),H("click",ee,async()=>{i(U)?(h(k,i(U).id),h(E,""),h(_,null),h(y,null),h(Re,"message"),h($t,!1),await mt()):Ra(i(C))}),R(A,ee)});var Eo=g(fs,2);{var Ao=A=>{var C=sp();R(A,C)};q(Eo,A=>{i(l),T(()=>i(l).length===0)&&A(Ao)})}var Ro=g(Ie,2);{var Co=A=>{var C=op(),U=p(C),ee=p(U);{var be=Q=>{var ce=lp();N(()=>F(ce,"src",(i(o),T(()=>i(o).avatar_url)))),R(Q,ce)},xe=Q=>{var ce=pt();N(at=>O(ce,at),[()=>(Z(Je),i(o),T(()=>Je(i(o).display_name)))]),R(Q,ce)};q(ee,Q=>{i(o),T(()=>i(o).avatar_url)?Q(be):Q(xe,-1)})}var He=g(U,2),Te=p(He),V=p(Te),Be=g(Te,2),Xe=p(Be);N((Q,ce,at)=>{F(C,"aria-label",Q),bn(U,`--hue: ${ce??""}deg`),O(V,(i(o),T(()=>i(o).display_name))),O(Xe,at)},[()=>(i(o),Z(ut),T(()=>`Account settings for ${i(o).display_name} ${ut(i(o).handle)}`)),()=>(Z(Ke),i(o),T(()=>Ke(i(o).id))),()=>(i(o),Z(ut),i(xt),T(()=>i(o).handle?ut(i(o).handle):i(xt)?"Active":"Reconnecting…"))]),H("click",C,Sn),H("contextmenu",C,Q=>{Q.preventDefault(),Sn()}),R(A,C)};q(Ro,A=>{i(o)&&A(Co)})}var ds=g(B,2),ps=p(ds),hs=p(ps),vs=p(hs);{var Io=A=>{var C=cp(),U=p(C);N(ee=>O(U,ee),[()=>(Z(Jn),i(r),i(o),T(()=>`@${Jn(i(r),i(o)?.id)}`))]),R(A,C)},Do=A=>{var C=up(),U=p(C);N(()=>O(U,(i(a),T(()=>`#${i(a).name}`)))),R(A,C)},Lo=A=>{var C=fp();R(A,C)};q(vs,A=>{i(r)?A(Io):i(a)?A(Do,1):A(Lo,-1)})}var Oo=g(vs,4),Mo=p(Oo),ri=g(hs,2),gs=g(p(ri),2),Po=g(gs,2);{var No=A=>{var C=dp();H("click",C,()=>{h(ie,""),h(X,[])}),R(A,C)};q(Po,A=>{i(ie)&&A(No)})}var zo=g(ri,2),ta=p(zo);let ms;var Fo=g(ta,2),_s=g(ps,2);{var Uo=A=>{var C=vp(),U=p(C),ee=p(U),be=p(ee),xe=g(ee,2),He=g(U,2);It(He,1,()=>i(X),Te=>Te.message.id,(Te,V)=>{var Be=hp(),Xe=p(Be),Q=p(Xe);{var ce=it=>{var ot=pp();N(()=>F(ot,"src",(i(V),T(()=>i(V).message.author.avatar_url)))),R(it,ot)},at=it=>{var ot=pt();N(Zn=>O(ot,Zn),[()=>(Z(Je),i(V),T(()=>Je(i(V).message.author?.display_name)))]),R(it,ot)};q(Q,it=>{i(V),T(()=>i(V).message.author?.avatar_url)?it(ce):it(at,-1)})}var hn=g(Xe,2),tn=p(hn),vn=p(tn),gn=p(vn),Wn=g(vn,2),mn=p(Wn),jn=g(tn,2),On=p(jn);N((it,ot)=>{bn(Xe,`--hue: ${it??""}deg`),O(gn,(i(V),T(()=>i(V).message.author?.display_name||"Local User"))),O(mn,ot),O(On,(i(V),T(()=>i(V).message.body)))},[()=>(Z(Ke),i(V),T(()=>Ke(i(V).message.author?.id||i(V).message.author_id||"x"))),()=>(Z(zn),i(V),T(()=>zn(i(V).message.created_at)))]),H("click",Be,async()=>{h(X,[]),i(V).message.channel_id&&(h(E,i(V).message.channel_id),h(k,""),await mt()),i(V).message.direct_conversation_id&&(h(k,i(V).message.direct_conversation_id),h(E,""),await mt())}),R(Te,Be)}),N(()=>O(be,`${i(X),T(()=>i(X).length)??""} ${i(X),T(()=>i(X).length===1?"result":"results")??""}`)),H("click",xe,()=>{h(X,[])}),R(A,C)};q(_s,A=>{i(X),T(()=>i(X).length>0)&&A(Uo)})}var bs=g(_s,2);{let A=Nt(()=>(i(_),T(()=>i(_)?.id))),C=Nt(()=>(i(o),T(()=>i(o)?.id)));Yd(bs,{get messages(){return i(v)},get selectedDirect(){return i(r)},get selectedChannel(){return i(a)},get selectedThreadID(){return i(A)},get currentUserID(){return i(C)},onListRef:U=>h(ze,U),onActivateMessageComposer:()=>h(Re,"message"),onInlineImagePointerUp:Dn,onOpenProfile:Ra,onReply:_t,onOpenThread:An,onJumpToQuote:U=>{br(U)},onOpenImage:wr})}var Bo=g(bs,2);{let A=Nt(()=>(i(r),Z(Jn),i(o),i(a),T(()=>i(r)?`Message ${Jn(i(r),i(o)?.id)}`:i(a)?`Message #${i(a).name}`:"Pick a channel to start"))),C=Nt(()=>i(ve)&&i(Ge)===(i(k)?"dm":"channel")?i(ve):null);rl(Bo,{get value(){return i(G)},get placeholder(){return i(A)},ariaLabel:"Message body",submitLabel:"Send",get pendingUpload(){return i(le)},get replyTarget(){return i(C)},showUpload:!0,showToolbar:!0,get showGifPicker(){return i(Ne)},get gifQuery(){return i(lt)},get filteredGifs(){return i(c)},onValue:U=>h(G,U),onSubmit:()=>{mr()},onKeydown:jr,onFocus:()=>h(Re,"message"),onInputRef:U=>h(hr,U),onUploadFile:kr,onRemoveUpload:()=>h(le,null),onClearReply:bt,onApplyMarkdownWrap:ni,onAppendToComposer:Yr,onToggleGif:()=>h(Ne,!i(Ne)),onGifQuery:U=>h(lt,U),onPickGif:Ce})}var ai=g(ds,2);let ks;var Go=p(ai);{var Ho=A=>{var C=Ep(),U=yn(C),ee=p(U),be=g(p(ee),2),xe=p(be),He=g(ee,2),Te=g(U,2),V=p(Te),Be=p(V),Xe=p(Be);{var Q=ge=>{var P=gp();N(()=>F(P,"src",(i(_),T(()=>i(_).author.avatar_url)))),R(ge,P)},ce=ge=>{var P=pt();N(At=>O(P,At),[()=>(Z(Je),i(_),T(()=>Je(i(_).author?.display_name)))]),R(ge,P)};q(Xe,ge=>{i(_),T(()=>i(_).author?.avatar_url)?ge(Q):ge(ce,-1)})}var at=g(Be,2),hn=p(at),tn=p(hn),vn=p(tn),gn=g(tn,2);{var Wn=ge=>{var P=mp(),At=p(P);N(Zt=>O(At,Zt),[()=>(Z(ut),i(_),T(()=>ut(i(_).author.handle)))]),R(ge,P)};q(gn,ge=>{i(_),T(()=>i(_).author?.handle)&&ge(Wn)})}var mn=g(gn,2),jn=p(mn),On=g(mn,2),it=g(hn,2);Li(it,()=>(Z(ha),i(_),T(()=>ha(i(_).body))),!0);var ot=g(it,2);{var Zn=ge=>{var P=_p();It(P,5,()=>(i(_),T(()=>i(_).attachments)),At=>At.id,(At,Zt)=>{{let na=Nt(()=>(Z(Dr),i(Zt),T(()=>Dr(i(Zt)))));Fi(At,{get upload(){return i(Zt)},get url(){return i(na)},onOpenImage:wr})}}),R(ge,P)};q(ot,ge=>{i(_),T(()=>i(_).attachments?.length)&&ge(Zn)})}var yr=g(V,2),xr=p(yr),ke=p(xr),ct=g(yr,2);It(ct,5,()=>i(x),ge=>ge.id,(ge,P)=>{var At=Sp(),Zt=p(At),na=p(Zt);{var ii=Le=>{var Oe=bp();N(()=>F(Oe,"src",(i(P),T(()=>i(P).author.avatar_url)))),R(Le,Oe)},si=Le=>{var Oe=pt();N(nn=>O(Oe,nn),[()=>(Z(Je),i(P),T(()=>Je(i(P).author?.display_name)))]),R(Le,Oe)};q(na,Le=>{i(P),T(()=>i(P).author?.avatar_url)?Le(ii):Le(si,-1)})}var li=g(Zt,2),Pa=p(li),Na=p(Pa),oi=p(Na),me=g(Na,2);{var De=Le=>{var Oe=kp(),nn=p(Oe);N(Yn=>O(nn,Yn),[()=>(Z(ut),i(P),T(()=>ut(i(P).author.handle)))]),R(Le,Oe)};q(me,Le=>{i(P),T(()=>i(P).author?.handle)&&Le(De)})}var Tr=g(me,2),ci=p(Tr),Xo=g(Tr,2),ys=g(Pa,2);{var Vo=Le=>{var Oe=xp();let nn;var Yn=g(p(Oe),2),za=p(Yn),Ko=p(za),$o=g(za,2);{var ec=Pn=>{var Xn=wp(),ui=p(Xn);N(fi=>O(ui,fi),[()=>(Z(tr),i(P),T(()=>tr(i(P).quoted_body_snapshot)))]),R(Pn,Xn)},tc=Pn=>{var Xn=yp(),ui=p(Xn);N(fi=>O(ui,`[original deleted] ${fi??""}`),[()=>(Z(tr),i(P),T(()=>tr(i(P).quoted_body_snapshot)))]),R(Pn,Xn)};q($o,Pn=>{i(P),T(()=>i(P).quoted_message_id)?Pn(ec):Pn(tc,-1)})}N((Pn,Xn)=>{nn=dt(Oe,1,"quote-block",null,nn,{dangling:!i(P).quoted_message_id}),Oe.disabled=(i(P),T(()=>!i(P).quoted_message_id)),F(Oe,"aria-label",Pn),O(Ko,Xn)},[()=>(i(P),Z(Ir),T(()=>i(P).quoted_message_id?`Jump to quoted message from ${Ir(i(P))}`:"Original message was deleted")),()=>(Z(Ir),i(P),T(()=>Ir(i(P))))]),H("click",Oe,()=>br(i(P))),R(Le,Oe)};q(ys,Le=>{i(P),T(()=>i(P).quoted_message_id||i(P).quoted_body_snapshot)&&Le(Vo)})}var xs=g(ys,2);Li(xs,()=>(Z(ha),i(P),T(()=>ha(i(P).body))),!0);var Qo=g(xs,2);{var Jo=Le=>{var Oe=Tp();It(Oe,5,()=>(i(P),T(()=>i(P).attachments)),nn=>nn.id,(nn,Yn)=>{{let za=Nt(()=>(Z(Dr),i(Yn),T(()=>Dr(i(Yn)))));Fi(nn,{get upload(){return i(Yn)},get url(){return i(za)},onOpenImage:wr})}}),R(Le,Oe)};q(Qo,Le=>{i(P),T(()=>i(P).attachments?.length)&&Le(Jo)})}N((Le,Oe)=>{F(At,"data-message-id",(i(P),T(()=>i(P).id))),bn(Zt,`--hue: ${Le??""}deg`),O(oi,(i(P),T(()=>i(P).author?.display_name||"Local User"))),O(ci,Oe)},[()=>(Z(Ke),i(P),T(()=>Ke(i(P).author?.id||i(P).author_id||"x"))),()=>(Z(zn),i(P),T(()=>zn(i(P).created_at)))]),H("click",Xo,()=>_t(i(P),"thread")),R(ge,At)});var Mn=g(Te,2);{let ge=Nt(()=>i(ve)&&i(Ge)==="thread"?i(ve):null);rl(Mn,{get value(){return i(te)},placeholder:"Reply in thread",ariaLabel:"Reply body",submitLabel:"Reply",formClass:"composer reply-composer",get replyTarget(){return i(ge)},onValue:P=>h(te,P),onSubmit:()=>{pn()},onKeydown:Zr,onFocus:()=>h(Re,"thread"),onInputRef:P=>h(Ot,P),onClearReply:bt})}N((ge,P)=>{O(xe,`${i(z),i(x),T(()=>i(z)?.reply_count??i(x).length)??""} ${i(z),i(x),T(()=>(i(z)?.reply_count??i(x).length)===1?"reply":"replies")??""}`),F(V,"data-message-id",(i(_),T(()=>i(_).id))),bn(Be,`--hue: ${ge??""}deg`),O(vn,(i(_),T(()=>i(_).author?.display_name||"Local User"))),O(jn,P),O(ke,`${i(x),T(()=>i(x).length)??""} ${i(x),T(()=>i(x).length===1?"reply":"replies")??""}`)},[()=>(Z(Ke),i(_),T(()=>Ke(i(_).author?.id||i(_).author_id||"x"))),()=>(Z(zn),i(_),T(()=>zn(i(_).created_at)))]),H("click",He,()=>{en()}),H("pointerdown",Te,()=>h(Re,"thread")),H("pointerup",Te,Dn),H("click",On,()=>i(_)&&_t(i(_),"thread")),R(A,C)},qo=A=>{var C=Lp(),U=yn(C),ee=p(U),be=g(p(ee),2),xe=p(be),He=g(ee,2),Te=g(U,2),V=p(Te),Be=p(V),Xe=p(Be);{var Q=me=>{var De=Ap();N(()=>F(De,"src",(i(y),T(()=>i(y).avatar_url)))),R(me,De)},ce=me=>{var De=pt();N(Tr=>O(De,Tr),[()=>(Z(Je),i(y),T(()=>Je(i(y).display_name)))]),R(me,De)};q(Xe,me=>{i(y),T(()=>i(y).avatar_url)?me(Q):me(ce,-1)})}var at=g(V,2),hn=p(at),tn=p(hn),vn=p(tn),gn=p(vn),Wn=g(vn,2);{var mn=me=>{var De=Rp(),Tr=p(De);N(ci=>O(Tr,ci),[()=>(Z(ut),i(y),T(()=>ut(i(y).handle)))]),R(me,De)};q(Wn,me=>{i(y),T(()=>i(y).handle)&&me(mn)})}var jn=g(tn,2);{var On=me=>{var De=Cp();H("click",De,Sn),R(me,De)};q(jn,me=>{i(o),i(y),T(()=>i(o)?.id===i(y).id)&&me(On)})}var it=g(hn,4),ot=p(it);{var Zn=me=>{var De=Ip();H("click",De,()=>Cn(i(y)?.id||"")),R(me,De)};q(ot,me=>{i(o),i(y),T(()=>i(o)?.id!==i(y).id)&&me(Zn)})}var yr=g(ot,2),xr=g(it,2),ke=p(xr),ct=g(p(ke),2);{var Mn=me=>{var De=Dp();H("click",De,Sn),R(me,De)};q(ct,me=>{i(o),i(y),T(()=>i(o)?.id===i(y).id)&&me(Mn)})}var ge=g(ke,2),P=g(p(ge),2),At=g(p(P),2),Zt=p(At),na=g(ge,2),ii=g(p(na),2),si=g(p(ii),2),li=p(si),Pa=g(xr,2),Na=g(p(Pa),2),oi=p(Na);N((me,De)=>{O(xe,(i(y),T(()=>i(y).display_name))),bn(V,`--hue: ${me??""}deg`),O(gn,(i(y),T(()=>i(y).display_name))),O(Zt,De),O(li,(i(y),T(()=>i(y).id))),O(oi,`Member of ${i(n),T(()=>i(n)?.name||"this workspace")??""}. Click Message to keep the conversation in your sidebar.`)},[()=>(Z(Ke),i(y),T(()=>Ke(i(y).id))),()=>(i(y),Z(ut),T(()=>i(y).handle?ut(i(y).handle):"No handle set"))]),H("click",He,en),H("click",yr,()=>h(se,"status messages are coming soon")),R(A,C)},Wo=A=>{var C=Op();R(A,C)};q(Go,A=>{i(_)?A(Ho):i(y)?A(qo,1):A(Wo,-1)})}var ws=g($,2);{var jo=A=>{var C=Np(),U=p(C),ee=g(U,2),be=p(ee),xe=g(p(be),2),He=g(be,2),Te=p(He),V=p(Te),Be=p(V);{var Xe=ke=>{var ct=Mp();N(()=>F(ct,"src",i(W))),R(ke,ct)},Q=ke=>{var ct=pt();N(Mn=>O(ct,Mn),[()=>(Z(Je),i(tt),T(()=>Je(i(tt))))]),R(ke,ct)};q(Be,ke=>{i(W)?ke(Xe):ke(Q,-1)})}var ce=g(V,2),at=p(ce),hn=p(at),tn=g(at,2),vn=p(tn),gn=g(Te,2),Wn=g(p(gn),2),mn=g(gn,2),jn=g(p(mn),2),On=g(mn,2),it=g(p(On),2),ot=g(On,2);{var Zn=ke=>{var ct=Pp();let Mn;var ge=p(ct);N(()=>{Mn=dt(ct,1,"profile-status",null,Mn,{error:i(Lt)}),O(ge,i(We))}),R(ke,ct)};q(ot,ke=>{i(We)&&ke(Zn)})}var yr=g(ot,2),xr=p(yr);N((ke,ct)=>{bn(V,`--hue: ${ke??""}deg`),O(hn,(i(tt),i(o),T(()=>i(tt)||i(o).display_name))),O(vn,ct)},[()=>(Z(Ke),i(o),T(()=>Ke(i(o).id))),()=>(i(nt),Z(ut),i(o),T(()=>i(nt)||ut(i(o).handle)||"No handle set"))]),H("click",U,Ln),H("click",xe,Ln),an("submit",He,ke=>{ke.preventDefault(),qr()}),Qn(Wn,()=>i(tt),ke=>h(tt,ke)),Qn(jn,()=>i(nt),ke=>h(nt,ke)),Qn(it,()=>i(W),ke=>h(W,ke)),H("click",xr,Ln),R(A,C)};q(ws,A=>{i(he)&&i(o)&&A(jo)})}var Zo=g(ws,2);{var Yo=A=>{var C=zp(),U=p(C),ee=g(U,2),be=p(ee),xe=p(be),He=p(xe),Te=g(xe,2),V=p(Te),Be=g(V,2),Xe=g(be,2),Q=p(Xe);N(()=>{O(He,(i(I),T(()=>i(I).title))),F(V,"href",(i(I),T(()=>i(I).url))),F(Q,"src",(i(I),T(()=>i(I).url))),F(Q,"alt",(i(I),T(()=>i(I).title)))}),H("click",U,Ln),H("click",Be,Ln),R(A,C)};q(Zo,A=>{i(I)&&A(Yo)})}N(()=>{ye=dt($,1,"shell",null,ye,{"nav-open":i($t),"sidebar-collapsed":i(je),"thread-open":i(s)}),O(pe,(i(n),T(()=>i(n)?.name||"Pick a workspace"))),Se=dt(Ue,1,"presence",null,Se,{online:i(xt)}),O(rt,i(xt)?"Connected":i(se)),F(Ye,"aria-label",i(je)?"Expand sidebar":"Collapse sidebar"),F(Ye,"title",i(je)?"Expand sidebar":"Collapse sidebar"),F(Kr,"d",i(je)?"m9 6 6 6-6 6":"m15 6-6 6 6 6"),O(Mo,(i(n),T(()=>i(n)?.name||"no workspace"))),F(ta,"title",i(_)?"Close thread":"Open a message thread"),F(ta,"aria-label",i(_)?"Close thread":"Open a message thread"),ms=dt(ta,1,"",null,ms,{active:i(s)}),ks=dt(ai,1,"thread",null,ks,{open:i(s)}),F(ai,"aria-label",i(y)?"Profile pane":"Thread pane")}),H("click",Ze,()=>h($t,!i($t))),H("click",La,()=>h(Tt,!i(Tt))),H("click",Ye,()=>h(je,!i(je))),an("submit",ss,A=>{A.preventDefault(),Sa()}),Qn(ko,()=>i(fe),A=>h(fe,A)),an("submit",us,A=>{A.preventDefault(),Mt()}),Qn(xo,()=>i(_e),A=>h(_e,A)),an("submit",ri,A=>{A.preventDefault(),Aa()}),Qn(gs,()=>i(ie),A=>h(ie,A)),H("click",ta,()=>{i(s)?en():h(se,"pick a message to open its thread")}),H("click",Fo,()=>h(se,"no pinned items")),R(w,D)};q(Vr,w=>{i(Tn)?w(Ca):w(Ia,-1)})}R(t,Xr),jt()}un(["click","contextmenu","pointerdown","pointerup"]);var Bp=L(' ',1),Gp=L("

    "),Hp=L(`

    Self-hostable chat. Serious tool. Mild brine.

    ClickClack

    A single-binary chat app for teams, communities, bots, and agents: - Slack-style threads, durable realtime, OpenAPI, SQLite, and a CLI that - can drive the whole thing from a shell.

    What it is

    Chat infrastructure that stays boring when the socket drops.

    WebSocket is the pipe. The database is the truth. Every durable message, - thread reply, reaction, and channel update can be recovered over HTTP with - a cursor, so clients and agents can reconnect without drama.

    Agent path

    A friendly CLI, no LLM baked in.

    External agents, CI jobs, and humans use the same public API as the web - app. Tokens and workspace defaults are scoped per server, so switching - hosts does not leak credentials or stale IDs.

     

    Destinations

    Product at the root. Docs and app where people expect them.

    `);function qp(t,e){Wt(e,!1);const n="https://docs.clickclack.chat",a=["localhost","127.0.0.1","::1"].includes(window.location.hostname)?"/app":"https://app.clickclack.chat",r="https://github.com/openclaw/clickclack",s=[["Single binary","Go server, embedded Svelte app, embedded migrations, local SQLite and uploads."],["Threads that recover","Slack-style one-level threads with durable event replay after reconnects."],["Agent-friendly","A CLI, OpenAPI contract, TypeScript SDK, webhooks, and slash-command shapes."],["Self-host first","SQLite is the default, not the demo. Postgres can arrive behind the store layer."]],l=["clickclack serve --data ./data","clickclack login --magic-token mgt_...",'clickclack send --channel general "deploy started"',"clickclack threads reply msg_... --stdin {var Ne=Bp();ji(()=>{Rl.title="ClickClack - Self-hostable chat with claws"}),R(le,Ne)});var o=p(c),u=g(p(o),2),f=g(p(u),2),m=p(f);F(m,"href",n);var v=g(m,2),x=g(v,2);F(x,"href",r);var b=g(u,2),E=g(p(b),6),k=p(E),_=g(k,2);F(_,"href",n);var z=g(_,2);F(z,"href",r);var y=g(o,4);It(y,5,()=>s,Su,(le,Ne)=>{var he=Gp(),lt=p(he),tt=p(lt),nt=g(lt,2),W=p(nt);N(()=>{O(tt,i(Ne)[0]),O(W,i(Ne)[1])}),R(le,he)});var I=g(y,2),G=g(p(I),2),te=p(G),ae=g(I,2),fe=g(p(ae),2),_e=g(p(fe),2);F(_e,"href",n);var ie=g(_e,2),X=g(ie,2);F(X,"href",r),N(le=>{F(v,"href",a),F(k,"href",a),O(te,le),F(ie,"href",a)},[()=>l.join(` -`)]),R(t,c),jt()}function Wp(t){const e=window.location.pathname,a=window.location.hostname.startsWith("app.")||e==="/app"||e.startsWith("/app/");var r=$a(),s=yn(r);{var l=o=>{Up(o,{})},c=o=>{qp(o,{})};q(s,o=>{a?o(l):o(c,-1)})}R(t,r)}wu(Wp,{target:document.getElementById("app")}); diff --git a/apps/api/internal/webassets/dist/assets/index-CJGH_9qR.js b/apps/api/internal/webassets/dist/assets/index-CJGH_9qR.js new file mode 100644 index 0000000..cf8319d --- /dev/null +++ b/apps/api/internal/webassets/dist/assets/index-CJGH_9qR.js @@ -0,0 +1,72 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&a(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();const Vs=!1;var Oi=Array.isArray,Js=Array.prototype.indexOf,Wn=Array.prototype.includes,ea=Array.from,Ks=Object.defineProperty,Gn=Object.getOwnPropertyDescriptor,Li=Object.getOwnPropertyDescriptors,$s=Object.prototype,el=Array.prototype,La=Object.getPrototypeOf,ti=Object.isExtensible;const tl=()=>{};function nl(t){return t()}function ha(t){for(var e=0;e{t=a,e=r});return{promise:n,resolve:t,reject:e}}const qe=2,qn=4,Er=8,Ni=1<<24,Ft=16,Lt=32,cn=64,pa=128,wt=512,De=1024,Ge=2048,Mt=4096,Je=8192,pt=16384,Rn=32768,ga=1<<25,jn=65536,va=1<<17,Pi=1<<18,Cn=1<<19,Ui=1<<20,zt=1<<25,xn=65536,Xr=1<<21,yr=1<<22,ln=1<<23,kn=Symbol("$state"),rl=Symbol("legacy props"),al=Symbol(""),Qt=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},il=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function zi(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function sl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function ll(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function ol(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function cl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ul(t){throw new Error("https://svelte.dev/e/effect_orphan")}function fl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function dl(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function hl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function pl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function gl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function vl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const ml=1,_l=2,Fi=4,bl=8,kl=16,yl=1,wl=2,Tl=4,xl=8,Sl=16,El=1,Al=2,Ue=Symbol(),Bi="http://www.w3.org/1999/xhtml",Rl="http://www.w3.org/2000/svg",Cl="http://www.w3.org/1998/Math/MathML";function Il(){console.warn("https://svelte.dev/e/derived_inert")}function Dl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Hi(t){return t===this.v}function Gi(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Wi(t){return!Gi(t,this.v)}let Qn=!1,Ol=!1;function Ll(){Qn=!0}let _e=null;function Zn(t){_e=t}function Ae(t,e=!1,n){_e={p:_e,i:!1,c:null,e:null,s:t,x:null,r:ee,l:Qn&&!e?{s:null,u:null,$:[]}:null}}function Re(t){var e=_e,n=e.e;if(n!==null){e.e=null;for(var a of n)us(a)}return e.i=!0,_e=e.p,{}}function Ar(){return!Qn||_e!==null&&_e.l===null}let _n=[];function qi(){var t=_n;_n=[],ha(t)}function on(t){if(_n.length===0&&!br){var e=_n;queueMicrotask(()=>{e===_n&&qi()})}_n.push(t)}function Ml(){for(;_n.length>0;)qi()}function ji(t){var e=ee;if(e===null)return ce.f|=ln,t;if((e.f&Rn)===0&&(e.f&qn)===0)throw t;an(t,e)}function an(t,e){for(;e!==null;){if((e.f&pa)!==0){if((e.f&Rn)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const Nl=-7169;function xe(t,e){t.f=t.f&Nl|e}function Ma(t){(t.f&wt)!==0||t.deps===null?xe(t,De):xe(t,Mt)}function Zi(t){if(t!==null)for(const e of t)(e.f&qe)===0||(e.f&xn)===0||(e.f^=xn,Zi(e.deps))}function Yi(t,e,n){(t.f&Ge)!==0?e.add(t):(t.f&Mt)!==0&&n.add(t),Zi(t.deps),xe(t,De)}let Hr=!1;function Pl(t){var e=Hr;try{return Hr=!1,[t(),Hr]}finally{Hr=e}}const vn=new Set;let oe=null,Dt=null,ma=null,br=!1,la=!1,Bn=null,Zr=null;var ni=0;let Ul=1;class un{id=Ul++;current=new Map;previous=new Map;#n=new Set;#o=new Set;#e=new Set;#a=new Map;#r=new Map;#i=null;#t=[];#s=[];#c=new Set;#u=new Set;#l=new Map;#d=new Set;is_fork=!1;#p=!1;#h=new Set;#f(){return this.is_fork||this.#r.size>0}#m(){for(const a of this.#h)for(const r of a.#r.keys()){for(var e=!1,n=r;n.parent!==null;){if(this.#l.has(n)){e=!0;break}n=n.parent}if(!e)return!0}return!1}skip_effect(e){this.#l.has(e)||this.#l.set(e,{d:[],m:[]}),this.#d.delete(e)}unskip_effect(e,n=a=>this.schedule(a)){var a=this.#l.get(e);if(a){this.#l.delete(e);for(var r of a.d)xe(r,Ge),n(r);for(r of a.m)xe(r,Mt),n(r)}this.#d.add(e)}#g(){if(ni++>1e3&&(vn.delete(this),Fl()),!this.#f()){for(const c of this.#c)this.#u.delete(c),xe(c,Ge),this.schedule(c);for(const c of this.#u)xe(c,Mt),this.schedule(c)}const e=this.#t;this.#t=[],this.apply();var n=Bn=[],a=[],r=Zr=[];for(const c of e)try{this.#_(c,n,a)}catch(l){throw Vi(c),l}if(oe=null,r.length>0){var i=un.ensure();for(const c of r)i.schedule(c)}if(Bn=null,Zr=null,this.#f()||this.#m()){this.#v(a),this.#v(n);for(const[c,l]of this.#l)Qi(c,l)}else{this.#a.size===0&&vn.delete(this),this.#c.clear(),this.#u.clear();for(const c of this.#n)c(this);this.#n.clear(),ri(a),ri(n),this.#i?.resolve()}var s=oe;if(this.#t.length>0){const c=s??=this;c.#t.push(...this.#t.filter(l=>!c.#t.includes(l)))}s!==null&&(vn.add(s),s.#g())}#_(e,n,a){e.f^=De;for(var r=e.first;r!==null;){var i=r.f,s=(i&(Lt|cn))!==0,c=s&&(i&De)!==0,l=c||(i&Je)!==0||this.#l.has(r);if(!l&&r.fn!==null){s?r.f^=De:(i&qn)!==0?n.push(r):Vn(r)&&((i&Ft)!==0&&this.#u.add(r),En(r));var u=r.first;if(u!==null){r=u;continue}}for(;r!==null;){var f=r.next;if(f!==null){r=f;break}r=r.parent}}}#v(e){for(var n=0;n!this.current.has(p));if(r.length===0)e&&f.discard();else if(n.length>0){if(e)for(const p of this.#d)f.unskip_effect(p,h=>{(h.f&(Ft|yr))!==0?f.schedule(h):f.#v([h])});f.activate();var i=new Set,s=new Map;for(var c of n)Xi(c,r,i,s);s=new Map;var l=[...f.current.keys()].filter(p=>this.current.has(p)?this.current.get(p)[0]!==p:!0);for(const p of this.#s)(p.f&(pt|Je|va))===0&&Na(p,l,s)&&((p.f&(yr|Ft))!==0?(xe(p,Ge),f.schedule(p)):f.#c.add(p));if(f.#t.length>0){f.apply();for(var u of f.#t)f.#_(u,[],[]);f.#t=[]}f.deactivate()}}for(const f of vn)f.#h.has(this)&&(f.#h.delete(this),f.#h.size===0&&!f.#f()&&(f.activate(),f.#g()))}increment(e,n){let a=this.#a.get(n)??0;if(this.#a.set(n,a+1),e){let r=this.#r.get(n)??0;this.#r.set(n,r+1)}}decrement(e,n,a){let r=this.#a.get(n)??0;if(r===1?this.#a.delete(n):this.#a.set(n,r-1),e){let i=this.#r.get(n)??0;i===1?this.#r.delete(n):this.#r.set(n,i-1)}this.#p||a||(this.#p=!0,on(()=>{this.#p=!1,this.flush()}))}transfer_effects(e,n){for(const a of e)this.#c.add(a);for(const a of n)this.#u.add(a);e.clear(),n.clear()}oncommit(e){this.#n.add(e)}ondiscard(e){this.#o.add(e)}on_fork_commit(e){this.#e.add(e)}run_fork_commit_callbacks(){for(const e of this.#e)e(this);this.#e.clear()}settled(){return(this.#i??=Mi()).promise}static ensure(){if(oe===null){const e=oe=new un;la||(vn.add(oe),br||on(()=>{oe===e&&e.flush()}))}return oe}apply(){{Dt=null;return}}schedule(e){if(ma=e,e.b?.is_pending&&(e.f&(qn|Er|Ni))!==0&&(e.f&Rn)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var a=n.f;if(Bn!==null&&n===ee&&(ce===null||(ce.f&qe)===0))return;if((a&(cn|Lt))!==0){if((a&De)===0)return;n.f^=De}}this.#t.push(n)}}function zl(t){var e=br;br=!0;try{for(var n;;){if(Ml(),oe===null)return n;oe.flush()}}finally{br=e}}function Fl(){try{fl()}catch(t){an(t,ma)}}let Xt=null;function ri(t){var e=t.length;if(e!==0){for(var n=0;n0)){yn.clear();for(const r of Xt){if((r.f&(pt|Je))!==0)continue;const i=[r];let s=r.parent;for(;s!==null;)Xt.has(s)&&(Xt.delete(s),i.push(s)),s=s.parent;for(let c=i.length-1;c>=0;c--){const l=i[c];(l.f&(pt|Je))===0&&En(l)}}Xt.clear()}}Xt=null}}function Xi(t,e,n,a){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const r of t.reactions){const i=r.f;(i&qe)!==0?Xi(r,e,n,a):(i&(yr|Ft))!==0&&(i&Ge)===0&&Na(r,e,a)&&(xe(r,Ge),Pa(r))}}function Na(t,e,n){const a=n.get(t);if(a!==void 0)return a;if(t.deps!==null)for(const r of t.deps){if(Wn.call(e,r))return!0;if((r.f&qe)!==0&&Na(r,e,n))return n.set(r,!0),!0}return n.set(t,!1),!1}function Pa(t){oe.schedule(t)}function Qi(t,e){if(!((t.f&Lt)!==0&&(t.f&De)!==0)){(t.f&Ge)!==0?e.d.push(t):(t.f&Mt)!==0&&e.m.push(t),xe(t,De);for(var n=t.first;n!==null;)Qi(n,e),n=n.next}}function Vi(t){xe(t,De);for(var e=t.first;e!==null;)Vi(e),e=e.next}function Bl(t){let e=0,n=Sn(0),a;return()=>{Fa()&&(o(n),Ir(()=>(e===0&&(a=ze(()=>t(()=>kr(n)))),e+=1,()=>{on(()=>{e-=1,e===0&&(a?.(),a=void 0,kr(n))})})))}}var Hl=jn|Cn;function Gl(t,e,n,a){new Wl(t,e,n,a)}class Wl{parent;is_pending=!1;transform_error;#n;#o=null;#e;#a;#r;#i=null;#t=null;#s=null;#c=null;#u=0;#l=0;#d=!1;#p=new Set;#h=new Set;#f=null;#m=Bl(()=>(this.#f=Sn(this.#u),()=>{this.#f=null}));constructor(e,n,a,r){this.#n=e,this.#e=n,this.#a=i=>{var s=ee;s.b=this,s.f|=pa,a(i)},this.parent=ee.b,this.transform_error=r??this.parent?.transform_error??(i=>i),this.#r=ta(()=>{this.#b()},Hl)}#g(){try{this.#i=yt(()=>this.#a(this.#n))}catch(e){this.error(e)}}#_(e){const n=this.#e.failed;n&&(this.#s=yt(()=>{n(this.#n,()=>e,()=>()=>{})}))}#v(){const e=this.#e.pending;e&&(this.is_pending=!0,this.#t=yt(()=>e(this.#n)),on(()=>{var n=this.#c=document.createDocumentFragment(),a=Bt();n.append(a),this.#i=this.#y(()=>yt(()=>this.#a(a))),this.#l===0&&(this.#n.before(n),this.#c=null,wn(this.#t,()=>{this.#t=null}),this.#k(oe))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#u=0,this.#i=yt(()=>{this.#a(this.#n)}),this.#l>0){var e=this.#c=document.createDocumentFragment();Wa(this.#i,e);const n=this.#e.pending;this.#t=yt(()=>n(this.#n))}else this.#k(oe)}catch(n){this.error(n)}}#k(e){this.is_pending=!1,e.transfer_effects(this.#p,this.#h)}defer_effect(e){Yi(e,this.#p,this.#h)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#e.pending}#y(e){var n=ee,a=ce,r=_e;Et(this.#r),St(this.#r),Zn(this.#r.ctx);try{return un.ensure(),e()}catch(i){return ji(i),null}finally{Et(n),St(a),Zn(r)}}#w(e,n){if(!this.has_pending_snippet()){this.parent&&this.parent.#w(e,n);return}this.#l+=e,this.#l===0&&(this.#k(n),this.#t&&wn(this.#t,()=>{this.#t=null}),this.#c&&(this.#n.before(this.#c),this.#c=null))}update_pending_count(e,n){this.#w(e,n),this.#u+=e,!(!this.#f||this.#d)&&(this.#d=!0,on(()=>{this.#d=!1,this.#f&&Yn(this.#f,this.#u)}))}get_effect_pending(){return this.#m(),o(this.#f)}error(e){if(!this.#e.onerror&&!this.#e.failed)throw e;oe?.is_fork?(this.#i&&oe.skip_effect(this.#i),this.#t&&oe.skip_effect(this.#t),this.#s&&oe.skip_effect(this.#s),oe.on_fork_commit(()=>{this.#T(e)})):this.#T(e)}#T(e){this.#i&&(at(this.#i),this.#i=null),this.#t&&(at(this.#t),this.#t=null),this.#s&&(at(this.#s),this.#s=null);var n=this.#e.onerror;let a=this.#e.failed;var r=!1,i=!1;const s=()=>{if(r){Dl();return}r=!0,i&&vl(),this.#s!==null&&wn(this.#s,()=>{this.#s=null}),this.#y(()=>{this.#b()})},c=l=>{try{i=!0,n?.(l,s),i=!1}catch(u){an(u,this.#r&&this.#r.parent)}a&&(this.#s=this.#y(()=>{try{return yt(()=>{var u=ee;u.b=this,u.f|=pa,a(this.#n,()=>l,()=>s)})}catch(u){return an(u,this.#r.parent),null}}))};on(()=>{var l;try{l=this.transform_error(e)}catch(u){an(u,this.#r&&this.#r.parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(c,u=>an(u,this.#r&&this.#r.parent)):c(l)})}}function ql(t,e,n,a){const r=Ar()?Rr:dt;var i=t.filter(h=>!h.settled);if(n.length===0&&i.length===0){a(e.map(r));return}var s=ee,c=jl(),l=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(h=>h.promise)):null;function u(h){c();try{a(h)}catch(w){(s.f&pt)===0&&an(w,s)}Qr()}if(n.length===0){l.then(()=>u(e.map(r)));return}var f=Ji();function p(){Promise.all(n.map(h=>Zl(h))).then(h=>u([...e.map(r),...h])).catch(h=>an(h,s)).finally(()=>f())}l?l.then(()=>{c(),p(),Qr()}):p()}function jl(){var t=ee,e=ce,n=_e,a=oe;return function(i=!0){Et(t),St(e),Zn(n),i&&(t.f&pt)===0&&(a?.activate(),a?.apply())}}function Qr(t=!0){Et(null),St(null),Zn(null),t&&oe?.deactivate()}function Ji(){var t=ee,e=t.b,n=oe,a=e.is_rendered();return e.update_pending_count(1,n),n.increment(a,t),(r=!1)=>{e.update_pending_count(-1,n),n.decrement(a,t,r)}}function Rr(t){var e=qe|Ge;return ee!==null&&(ee.f|=Cn),{ctx:_e,deps:null,effects:null,equals:Hi,f:e,fn:t,reactions:null,rv:0,v:Ue,wv:0,parent:ee,ac:null}}function Zl(t,e,n){let a=ee;a===null&&sl();var r=void 0,i=Sn(Ue),s=!ce,c=new Map;return ro(()=>{var l=ee,u=Mi();r=u.promise;try{Promise.resolve(t()).then(u.resolve,u.reject).finally(Qr)}catch(w){u.reject(w),Qr()}var f=oe;if(s){if((l.f&Rn)!==0)var p=Ji();if(a.b.is_rendered())c.get(f)?.reject(Qt),c.delete(f);else{for(const w of c.values())w.reject(Qt);c.clear()}c.set(f,u)}const h=(w,v=void 0)=>{if(p){var T=v===Qt;p(T)}if(!(v===Qt||(l.f&pt)!==0)){if(f.activate(),v)i.f|=ln,Yn(i,v);else{(i.f&ln)!==0&&(i.f^=ln),Yn(i,w);for(const[b,y]of c){if(c.delete(b),b===f)break;y.reject(Qt)}}f.deactivate()}};u.promise.then(h,w=>h(null,w||"unknown"))}),cs(()=>{for(const l of c.values())l.reject(Qt)}),new Promise(l=>{function u(f){function p(){f===r?l(i):u(r)}f.then(p,p)}u(r)})}function xt(t){const e=Rr(t);return vs(e),e}function dt(t){const e=Rr(t);return e.equals=Wi,e}function Yl(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;no(t))),e}function m(t,e,n=!1){ce!==null&&(!Ot||(ce.f&va)!==0)&&Ar()&&(ce.f&(qe|Ft|yr|va))!==0&&(Tt===null||!Wn.call(Tt,t))&&gl();let a=n?Hn(e):e;return Yn(t,a,Zr)}function Yn(t,e,n=null){if(!t.equals(e)){yn.set(t,Jt?e:t.v);var a=un.ensure();if(a.capture(t,e),(t.f&qe)!==0){const r=t;(t.f&Ge)!==0&&Ua(r),Dt===null&&Ma(r)}t.wv=_s(),ts(t,Ge,n),Ar()&&ee!==null&&(ee.f&De)!==0&&(ee.f&(Lt|cn))===0&&(kt===null?io([t]):kt.push(t)),!a.is_fork&&_a.size>0&&!es&&Vl()}return e}function Vl(){es=!1;for(const t of _a)(t.f&De)!==0&&xe(t,Mt),Vn(t)&&En(t);_a.clear()}function kr(t){m(t,t.v+1)}function ts(t,e,n){var a=t.reactions;if(a!==null)for(var r=Ar(),i=a.length,s=0;s{if(Tn===i)return c();var l=ce,u=Tn;St(null),ii(i);var f=c();return St(l),ii(u),f};return a&&n.set("length",ht(t.length)),new Proxy(t,{defineProperty(c,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&hl();var f=n.get(l);return f===void 0?s(()=>{var p=ht(u.value);return n.set(l,p),p}):m(f,u.value,!0),!0},deleteProperty(c,l){var u=n.get(l);if(u===void 0){if(l in c){const f=s(()=>ht(Ue));n.set(l,f),kr(r)}}else m(u,Ue),kr(r);return!0},get(c,l,u){if(l===kn)return t;var f=n.get(l),p=l in c;if(f===void 0&&(!p||Gn(c,l)?.writable)&&(f=s(()=>{var w=Hn(p?c[l]:Ue),v=ht(w);return v}),n.set(l,f)),f!==void 0){var h=o(f);return h===Ue?void 0:h}return Reflect.get(c,l,u)},getOwnPropertyDescriptor(c,l){var u=Reflect.getOwnPropertyDescriptor(c,l);if(u&&"value"in u){var f=n.get(l);f&&(u.value=o(f))}else if(u===void 0){var p=n.get(l),h=p?.v;if(p!==void 0&&h!==Ue)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return u},has(c,l){if(l===kn)return!0;var u=n.get(l),f=u!==void 0&&u.v!==Ue||Reflect.has(c,l);if(u!==void 0||ee!==null&&(!f||Gn(c,l)?.writable)){u===void 0&&(u=s(()=>{var h=f?Hn(c[l]):Ue,w=ht(h);return w}),n.set(l,u));var p=o(u);if(p===Ue)return!1}return f},set(c,l,u,f){var p=n.get(l),h=l in c;if(a&&l==="length")for(var w=u;wht(Ue)),n.set(w+"",v))}if(p===void 0)(!h||Gn(c,l)?.writable)&&(p=s(()=>ht(void 0)),m(p,Hn(u)),n.set(l,p));else{h=p.v!==Ue;var T=s(()=>Hn(u));m(p,T)}var b=Reflect.getOwnPropertyDescriptor(c,l);if(b?.set&&b.set.call(f,u),!h){if(a&&typeof l=="string"){var y=n.get("length"),R=Number(l);Number.isInteger(R)&&R>=y.v&&m(y,R+1)}kr(r)}return!0},ownKeys(c){o(r);var l=Reflect.ownKeys(c).filter(p=>{var h=n.get(p);return h===void 0||h.v!==Ue});for(var[u,f]of n)f.v!==Ue&&!(u in c)&&l.push(u);return l},setPrototypeOf(){pl()}})}var ba,ns,rs,as,is;function Jl(){if(ba===void 0){ba=window,ns=document,rs=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;as=Gn(e,"firstChild").get,is=Gn(e,"nextSibling").get,ti(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),ti(n)&&(n.__t=void 0)}}function Bt(t=""){return document.createTextNode(t)}function sn(t){return as.call(t)}function Cr(t){return is.call(t)}function g(t,e){return sn(t)}function Ht(t,e=!1){{var n=sn(t);return n instanceof Comment&&n.data===""?Cr(n):n}}function _(t,e=1,n=!1){let a=t;for(;e--;)a=Cr(a);return a}function Kl(t){t.textContent=""}function ss(){return!1}function ls(t,e,n){return document.createElementNS(e??Bi,t,void 0)}function za(t){var e=ce,n=ee;St(null),Et(null);try{return t()}finally{St(e),Et(n)}}function os(t){ee===null&&(ce===null&&ul(),cl()),Jt&&ol()}function $l(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function Wt(t,e){var n=ee;n!==null&&(n.f&Je)!==0&&(t|=Je);var a={ctx:_e,deps:null,nodes:null,f:t|Ge|wt,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};oe?.register_created_effect(a);var r=a;if((t&qn)!==0)Bn!==null?Bn.push(a):un.ensure().schedule(a);else if(e!==null){try{En(a)}catch(s){throw at(a),s}r.deps===null&&r.teardown===null&&r.nodes===null&&r.first===r.last&&(r.f&Cn)===0&&(r=r.first,(t&Ft)!==0&&(t&jn)!==0&&r!==null&&(r.f|=jn))}if(r!==null&&(r.parent=n,n!==null&&$l(r,n),ce!==null&&(ce.f&qe)!==0&&(t&cn)===0)){var i=ce;(i.effects??=[]).push(r)}return a}function Fa(){return ce!==null&&!Ot}function cs(t){const e=Wt(Er,null);return xe(e,De),e.teardown=t,e}function wr(t){os();var e=ee.f,n=!ce&&(e&Lt)!==0&&(e&Rn)===0;if(n){var a=_e;(a.e??=[]).push(t)}else return us(t)}function us(t){return Wt(qn|Ui,t)}function eo(t){return os(),Wt(Er|Ui,t)}function to(t){un.ensure();const e=Wt(cn|Cn,t);return(n={})=>new Promise(a=>{n.outro?wn(e,()=>{at(e),a(void 0)}):(at(e),a(void 0))})}function Ba(t){return Wt(qn,t)}function Yt(t,e){var n=_e,a={effect:null,ran:!1,deps:t};n.l.$.push(a),a.effect=Ir(()=>{if(t(),!a.ran){a.ran=!0;var r=ee;try{Et(r.parent),ze(e)}finally{Et(r)}}})}function no(){var t=_e;Ir(()=>{for(var e of t.l.$){e.deps();var n=e.effect;(n.f&De)!==0&&n.deps!==null&&xe(n,Mt),Vn(n)&&En(n),e.ran=!1}})}function ro(t){return Wt(yr|Cn,t)}function Ir(t,e=0){return Wt(Er|e,t)}function M(t,e=[],n=[],a=[]){ql(a,e,n,r=>{Wt(Er,()=>t(...r.map(o)))})}function ta(t,e=0){var n=Wt(Ft|e,t);return n}function yt(t){return Wt(Lt|Cn,t)}function fs(t){var e=t.teardown;if(e!==null){const n=Jt,a=ce;ai(!0),St(null);try{e.call(null)}finally{ai(n),St(a)}}}function Ha(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const r=n.ac;r!==null&&za(()=>{r.abort(Qt)});var a=n.next;(n.f&cn)!==0?n.parent=null:at(n,e),n=a}}function ao(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Lt)===0&&at(e),e=n}}function at(t,e=!0){var n=!1;(e||(t.f&Pi)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(ds(t.nodes.start,t.nodes.end),n=!0),xe(t,ga),Ha(t,e&&!n),Tr(t,0);var a=t.nodes&&t.nodes.t;if(a!==null)for(const i of a)i.stop();fs(t),t.f^=ga,t.f|=pt;var r=t.parent;r!==null&&r.first!==null&&hs(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function ds(t,e){for(;t!==null;){var n=t===e?null:Cr(t);t.remove(),t=n}}function hs(t){var e=t.parent,n=t.prev,a=t.next;n!==null&&(n.next=a),a!==null&&(a.prev=n),e!==null&&(e.first===t&&(e.first=a),e.last===t&&(e.last=n))}function wn(t,e,n=!0){var a=[];ps(t,a,!0);var r=()=>{n&&at(t),e&&e()},i=a.length;if(i>0){var s=()=>--i||r();for(var c of a)c.out(s)}else r()}function ps(t,e,n){if((t.f&Je)===0){t.f^=Je;var a=t.nodes&&t.nodes.t;if(a!==null)for(const c of a)(c.is_global||n)&&e.push(c);for(var r=t.first;r!==null;){var i=r.next;if((r.f&cn)===0){var s=(r.f&jn)!==0||(r.f&Lt)!==0&&(t.f&Ft)!==0;ps(r,e,s?n:!1)}r=i}}}function Ga(t){gs(t,!0)}function gs(t,e){if((t.f&Je)!==0){t.f^=Je,(t.f&De)===0&&(xe(t,Ge),un.ensure().schedule(t));for(var n=t.first;n!==null;){var a=n.next,r=(n.f&jn)!==0||(n.f&Lt)!==0;gs(n,r?e:!1),n=a}var i=t.nodes&&t.nodes.t;if(i!==null)for(const s of i)(s.is_global||e)&&s.in()}}function Wa(t,e){if(t.nodes)for(var n=t.nodes.start,a=t.nodes.end;n!==null;){var r=n===a?null:Cr(n);e.append(n),n=r}}let Yr=!1,Jt=!1;function ai(t){Jt=t}let ce=null,Ot=!1;function St(t){ce=t}let ee=null;function Et(t){ee=t}let Tt=null;function vs(t){ce!==null&&(Tt===null?Tt=[t]:Tt.push(t))}let rt=null,ft=0,kt=null;function io(t){kt=t}let ms=1,bn=0,Tn=bn;function ii(t){Tn=t}function _s(){return++ms}function Vn(t){var e=t.f;if((e&Ge)!==0)return!0;if(e&qe&&(t.f&=~xn),(e&Mt)!==0){for(var n=t.deps,a=n.length,r=0;rt.wv)return!0}(e&wt)!==0&&Dt===null&&xe(t,De)}return!1}function bs(t,e,n=!0){var a=t.reactions;if(a!==null&&!(Tt!==null&&Wn.call(Tt,t)))for(var r=0;r{t.ac.abort(Qt)}),t.ac=null);try{t.f|=Xr;var f=t.fn,p=f();t.f|=Rn;var h=t.deps,w=oe?.is_fork;if(rt!==null){var v;if(w||Tr(t,ft),h!==null&&ft>0)for(h.length=ft+rt.length,v=0;vn?.call(this,i))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?on(()=>{e.addEventListener(t,r,a)}):e.addEventListener(t,r,a),r}function Gt(t,e,n,a,r){var i={capture:a,passive:r},s=co(t,e,n,i);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&cs(()=>{e.removeEventListener(t,s,i)})}function U(t,e,n){(e[gr]??={})[t]=n}function Le(t){for(var e=0;e{throw b});throw h}}finally{t[gr]=e,delete t.currentTarget,St(f),Et(p)}}}const uo=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function fo(t){return uo?.createHTML(t)??t}function ho(t){var e=ls("template");return e.innerHTML=fo(t.replaceAll("","")),e.content}function Xn(t,e){var n=ee;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function O(t,e){var n=(e&El)!==0,a=(e&Al)!==0,r,i=!t.startsWith("");return()=>{r===void 0&&(r=ho(i?t:""+t),n||(r=sn(r)));var s=a||rs?document.importNode(r,!0):r.cloneNode(!0);if(n){var c=sn(s),l=s.lastChild;Xn(c,l)}else Xn(s,s);return s}}function Qe(t=""){{var e=Bt(t+"");return Xn(e,e),e}}function Dr(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Bt();return t.append(e,n),Xn(e,n),t}function A(t,e){t!==null&&t.before(e)}function P(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t.__t??=t.nodeValue)&&(t.__t=n,t.nodeValue=`${n}`)}function po(t,e){return go(t,e)}const Gr=new Map;function go(t,{target:e,anchor:n,props:a={},events:r,context:i,intro:s=!0,transformError:c}){Jl();var l=void 0,u=to(()=>{var f=n??e.appendChild(Bt());Gl(f,{pending:()=>{}},w=>{Ae({});var v=_e;i&&(v.c=i),r&&(a.$$events=r),l=t(w,a)||{},Re()},c);var p=new Set,h=w=>{for(var v=0;v{for(var w of p)for(const b of[e,document]){var v=Gr.get(b),T=v.get(w);--T==0?(b.removeEventListener(w,wa),v.delete(w),v.size===0&&Gr.delete(b)):v.set(w,T)}ya.delete(h),f!==n&&f.parentNode?.removeChild(f)}});return vo.set(l,u),l}let vo=new WeakMap;class mo{anchor;#n=new Map;#o=new Map;#e=new Map;#a=new Set;#r=!0;constructor(e,n=!0){this.anchor=e,this.#r=n}#i=e=>{if(this.#n.has(e)){var n=this.#n.get(e),a=this.#o.get(n);if(a)Ga(a),this.#a.delete(n);else{var r=this.#e.get(n);r&&(this.#o.set(n,r.effect),this.#e.delete(n),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),a=r.effect)}for(const[i,s]of this.#n){if(this.#n.delete(i),i===e)break;const c=this.#e.get(s);c&&(at(c.effect),this.#e.delete(s))}for(const[i,s]of this.#o){if(i===n||this.#a.has(i))continue;const c=()=>{if(Array.from(this.#n.values()).includes(i)){var u=document.createDocumentFragment();Wa(s,u),u.append(Bt()),this.#e.set(i,{effect:s,fragment:u})}else at(s);this.#a.delete(i),this.#o.delete(i)};this.#r||!a?(this.#a.add(i),wn(s,c,!1)):c()}}};#t=e=>{this.#n.delete(e);const n=Array.from(this.#n.values());for(const[a,r]of this.#e)n.includes(a)||(at(r.effect),this.#e.delete(a))};ensure(e,n){var a=oe,r=ss();if(n&&!this.#o.has(e)&&!this.#e.has(e))if(r){var i=document.createDocumentFragment(),s=Bt();i.append(s),this.#e.set(e,{effect:yt(()=>n(s)),fragment:i})}else this.#o.set(e,yt(()=>n(this.anchor)));if(this.#n.set(a,e),r){for(const[c,l]of this.#o)c===e?a.unskip_effect(l):a.skip_effect(l);for(const[c,l]of this.#e)c===e?a.unskip_effect(l.effect):a.skip_effect(l.effect);a.oncommit(this.#i),a.ondiscard(this.#t)}else this.#i(a)}}function j(t,e,n=!1){var a=new mo(t),r=n?jn:0;function i(s,c){a.ensure(s,c)}ta(()=>{var s=!1;e((c,l=0)=>{s=!0,i(l,c)}),s||i(-1,null)},r)}function _o(t,e){return e}function bo(t,e,n){for(var a=[],r=e.length,i,s=e.length,c=0;c{if(i){if(i.pending.delete(p),i.done.add(p),i.pending.size===0){var h=t.outrogroups;Ta(t,ea(i.done)),h.delete(i),h.size===0&&(t.outrogroups=null)}}else s-=1},!1)}if(s===0){var l=a.length===0&&n!==null;if(l){var u=n,f=u.parentNode;Kl(f),f.append(u),t.items.clear()}Ta(t,e,!l)}else i={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(i)}function Ta(t,e,n=!0){var a;if(t.pending.size>0){a=new Set;for(const s of t.pending.values())for(const c of s)a.add(t.items.get(c).e)}for(var r=0;r{var x=n();return Oi(x)?x:x==null?[]:ea(x)}),h,w=new Map,v=!0;function T(x){(R.effect.f&pt)===0&&(R.pending.delete(x),R.fallback=f,ko(R,h,s,e,a),f!==null&&(h.length===0?(f.f&zt)===0?Ga(f):(f.f^=zt,vr(f,null,s)):wn(f,()=>{f=null})))}function b(x){R.pending.delete(x)}var y=ta(()=>{h=o(p);for(var x=h.length,S=new Set,I=oe,Z=ss(),z=0;zi(s)):(f=yt(()=>i(oi??=Bt())),f.f|=zt)),x>S.size&&ll(),!v)if(w.set(I,S),Z){for(const[H,D]of c)S.has(H)||I.skip_effect(D.e);I.oncommit(T),I.ondiscard(b)}else T(I);o(p)}),R={effect:y,items:c,pending:w,outrogroups:null,fallback:f};v=!1}function or(t){for(;t!==null&&(t.f&Lt)===0;)t=t.next;return t}function ko(t,e,n,a,r){var i=(a&bl)!==0,s=e.length,c=t.items,l=or(t.effect.first),u,f=null,p,h=[],w=[],v,T,b,y;if(i)for(y=0;y0){var V=(a&Fi)!==0&&s===0?n:null;if(i){for(y=0;y{if(p!==void 0)for(b of p)b.nodes?.a?.apply()})}function yo(t,e,n,a,r,i,s,c){var l=(s&ml)!==0?(s&kl)===0?X(n,!1,!1):Sn(n):null,u=(s&_l)!==0?Sn(r):null;return{v:l,i:u,e:yt(()=>(i(e,l??n,u??r,c),()=>{t.delete(a)}))}}function vr(t,e,n){if(t.nodes)for(var a=t.nodes.start,r=t.nodes.end,i=e&&(e.f&zt)===0?e.nodes.start:n;a!==null;){var s=Cr(a);if(i.before(a),a===r)return;a=s}}function rn(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function xa(t,e,n=!1,a=!1,r=!1,i=!1){var s=t,c="";if(n)var l=t;M(()=>{var u=ee;if(c!==(c=e()??"")){if(n){u.nodes=null,l.innerHTML=c,c!==""&&Xn(sn(l),l.lastChild);return}if(u.nodes!==null&&(ds(u.nodes.start,u.nodes.end),u.nodes=null),c!==""){var f=a?Rl:r?Cl:void 0,p=ls(a?"svg":r?"math":"template",f);p.innerHTML=c;var h=a||r?p:p.content;if(Xn(sn(h),h.lastChild),a||r)for(;sn(h);)s.before(sn(h));else s.before(h)}}})}function xs(t,e){var n;n=document.head.appendChild(Bt()),ta(()=>e(n),Pi|Cn)}function wo(t,e,n){Ba(()=>{var a=ze(()=>e(t,n?.())||{});if(n&&a?.update){var r=!1,i={};Ir(()=>{var s=n();qa(s),r&&Gi(i,s)&&(i=s,a.update(s))}),r=!0}if(a?.destroy)return()=>a.destroy()})}function Ss(t){var e,n,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e=0;){var c=s+i;(s===0||ci.includes(a[s-1]))&&(c===a.length||ci.includes(a[c]))?a=(s===0?"":a.substring(0,s))+a.substring(c+1):s=c}}return a===""?null:a}function Eo(t,e){return t==null?null:String(t)}function it(t,e,n,a,r,i){var s=t.__className;if(s!==n||s===void 0){var c=So(n,a,i);c==null?t.removeAttribute("class"):t.className=c,t.__className=n}else if(i&&r!==i)for(var l in i){var u=!!i[l];(r==null||u!==!!r[l])&&t.classList.toggle(l,u)}return i}function Kt(t,e,n,a){var r=t.__style;if(r!==e){var i=Eo(e);i==null?t.removeAttribute("style"):t.style.cssText=i,t.__style=e}return a}const Ao=Symbol("is custom element"),Ro=Symbol("is html"),Co=il?"progress":"PROGRESS";function Vt(t,e){var n=Es(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==Co)||(t.value=e??"")}function F(t,e,n,a){var r=Es(t);r[e]!==(r[e]=n)&&(e==="loading"&&(t[al]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Io(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function Es(t){return t.__attributes??={[Ao]:t.nodeName.includes("-"),[Ro]:t.namespaceURI===Bi}}var ui=new Map;function Io(t){var e=t.getAttribute("is")||t.nodeName,n=ui.get(e);if(n)return n;ui.set(e,n=[]);for(var a,r=t,i=Element.prototype;i!==r;){a=Li(r);for(var s in a)a[s].set&&n.push(s);r=La(r)}return n}function fi(t,e){return t===e||t?.[kn]===e}function ja(t={},e,n,a){var r=_e.r,i=ee;return Ba(()=>{var s,c;return Ir(()=>{s=c,c=[],ze(()=>{t!==n(...c)&&(e(t,...c),s&&fi(n(...s),t)&&e(null,...s))})}),()=>{let l=i;for(;l!==r&&l.parent!==null&&l.parent.f&ga;)l=l.parent;const u=()=>{c&&fi(n(...c),t)&&e(null,...c)},f=l.teardown;l.teardown=()=>{u(),f?.()}}}),t}function As(t=!1){const e=_e,n=e.l.u;if(!n)return;let a=()=>qa(e.s);if(t){let r=0,i={};const s=Rr(()=>{let c=!1;const l=e.s;for(const u in l)l[u]!==i[u]&&(i[u]=l[u],c=!0);return c&&r++,r});a=()=>o(s)}n.b.length&&eo(()=>{di(e,a),ha(n.b)}),wr(()=>{const r=ze(()=>n.m.map(nl));return()=>{for(const i of r)typeof i=="function"&&i()}}),n.a.length&&wr(()=>{di(e,a),ha(n.a)})}function di(t,e){if(t.l.s)for(const n of t.l.s)o(n);e()}function Be(t,e,n,a){var r=!Qn||(n&wl)!==0,i=(n&xl)!==0,s=(n&Sl)!==0,c=a,l=!0,u=()=>(l&&(l=!1,c=s?ze(a):a),c);let f;if(i){var p=kn in t||rl in t;f=Gn(t,e)?.set??(p&&e in t?x=>t[e]=x:void 0)}var h,w=!1;i?[h,w]=Pl(()=>t[e]):h=t[e],h===void 0&&a!==void 0&&(h=u(),f&&(r&&dl(),f(h)));var v;if(r?v=()=>{var x=t[e];return x===void 0?u():(l=!0,x)}:v=()=>{var x=t[e];return x!==void 0&&(c=void 0),x===void 0?c:x},r&&(n&Tl)===0)return v;if(f){var T=t.$$legacy;return(function(x,S){return arguments.length>0?((!r||!S||T||w)&&f(S?v():x),x):v()})}var b=!1,y=((n&yl)!==0?Rr:dt)(()=>(b=!1,v()));i&&o(y);var R=ee;return(function(x,S){if(arguments.length>0){const I=S?o(y):r&&i?Hn(x):x;return m(y,I),b=!0,c!==void 0&&(c=I),x}return Jt&&b||(R.f&pt)!==0?y.v:o(y)})}function Rs(t){_e===null&&zi(),Qn&&_e.l!==null?Oo(_e).m.push(t):wr(()=>{const e=ze(t);if(typeof e=="function")return e})}function Do(t){_e===null&&zi(),Rs(()=>()=>ze(t))}function Oo(t){var e=t.l;return e.u??={a:[],b:[],m:[]}}const Lo="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Lo);Ll();class Cs extends Error{constructor(e,n){super(n),this.status=e}status}async function Fe(t,e={}){const n=new Headers(e.headers);n.set("Accept","application/json"),e.body&&!(e.body instanceof FormData)&&n.set("Content-Type","application/json");const a=await fetch(t,{...e,headers:n});if(!a.ok)throw new Cs(a.status,await a.text());return a.json()}const Mo=[{title:"Ship it",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYjJ1bm1meHE4N2x3bnN0djJkMWtjNGc5bXYzZDFiOHBsbG16M3F0ZSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/l0HlHFRbmaZtBRhXG/giphy.gif",tags:["ship","launch","done"]},{title:"Approved",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExazBpbzJ6ODZ3bXQ3OHBvNGJidWZoajc0cHV6YnVub3MzZ3c1a2Z2dSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/111ebonMs90YLu/giphy.gif",tags:["yes","approved","nice"]},{title:"Deploy dance",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExY3NkaTVmZW9ydWNnZnl0ZWQ5aHQyeGNrd2k3NG4wZWNqYzNmd3k1ZCZlcD12MV9naWZzX3NlYXJjaCZjdD1n/GeimqsH0TLDt4tScGw/giphy.gif",tags:["deploy","dance","celebrate"]},{title:"Looking",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYWZ3emE0dm5mN2h0bGVsY2w0OXBodGd2cGJlNDRiZXo1YWNtdWRmZyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/26n6WywJyh39n1pBu/giphy.gif",tags:["search","looking","debug"]},{title:"Typing faster",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExOWFlbnJnbnIzbHYxcDIzdXZ3NGF3N2FocHNvMmR5enU3bHpycHBlZSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/13HgwGsXF0aiGY/giphy.gif",tags:["typing","code","work"]},{title:"Tiny victory",url:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdjJ2b2tqNmF4dG16NjE0eXhuc3h5bTlvamgwNTR0Zmd6ZjhtM2JuaSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/3o7abKhOpu0NwenH3O/giphy.gif",tags:["win","victory","celebrate"]}];function No(t){const e=t.trim();if(!e)return"?";const n=e.split(/\s+/);return n.length>=2?(n[0][0]+n[1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function $t(t){if(!t)return"?";const e=t.trim();return e?e[0].toUpperCase():"?"}function fn(t){return t?`@${t}`:""}function en(t){let e=0;for(let n=0;n>>0;return e%360}function Po(t,e){return t.members.find(n=>n.id!==e)||t.members[0]}function xr(t,e){const n=t.members.filter(r=>r.id!==e);return(n.length>0?n:t.members).map(r=>r.display_name).join(", ")}function Uo(t,e,n){const a=new Map;for(const r of e)for(const i of r.members)i.id&&i.id!==n&&a.set(i.id,i);for(const r of[...t].reverse()){const i=r.author;i?.id&&i.id!==n&&a.set(i.id,i)}return[...a.values()].slice(0,12)}function zo(t,e){return t.find(n=>n.members.some(a=>a.id===e))}const Fo=new Set(["button","checkbox","combobox","link","listbox","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","option","radio","radiogroup","slider","spinbutton","switch","tab","tablist","textbox","tree","treeitem"]),Bo=new Set(["INPUT","TEXTAREA","SELECT","BUTTON","A","DETAILS","SUMMARY","VIDEO","AUDIO"]);function Ho(t){if(!t)return!1;if(t.isContentEditable)return!0;if(t instanceof HTMLInputElement){const e=(t.type||"text").toLowerCase();return e!=="checkbox"&&e!=="radio"&&e!=="button"&&e!=="submit"&&e!=="reset"&&e!=="file"}return t instanceof HTMLTextAreaElement}function Go(t){if(!t||Wo(t))return!1;if(Bo.has(t.tagName))return!0;const e=t.getAttribute("role");if(e&&Fo.has(e))return!0;const n=t.getAttribute("tabindex");return!!(n!==null&&n!=="-1"&&t.hasAttribute("aria-keyshortcuts"))}function Wo(t){if(!t.closest(".messages, .thread"))return!1;if(t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement)return!0;const e=t.getAttribute("role");return e==="button"||e==="link"}function qo(){const t=typeof window<"u"?window.getSelection():null;if(!t||t.isCollapsed||t.rangeCount===0)return!1;const e=t.getRangeAt(0).commonAncestorContainer;return e?!!(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(".messages, .thread, .markdown"):!1}function jo(t,e){if(e.authRequired||e.isModalOpen()||t.defaultPrevented||t.isComposing||t.keyCode===229||t.ctrlKey||t.metaKey||t.altKey||t.key.length!==1||qo())return!1;const n=document.activeElement;return!(n===e.messageInput||n===e.replyInput||Ho(n)||Go(n))}function Zo(t,e){if(!jo(t,e))return;const n=e.target();if(!n||n.disabled||n.readOnly)return;t.key===" "&&t.preventDefault(),n.focus({preventScroll:!0});const a=n.value.length;if(n.setSelectionRange(a,a),t.key===" "){const r=n.selectionStart??a,i=n.selectionEnd??a;n.setRangeText(" ",r,i,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))}}function Yo(t,e){const n=()=>{const i=t.style.height;t.style.height="auto";const s=`${t.scrollHeight}px`;i!==s?t.style.height=s:t.style.height=i},a=()=>n(),r=()=>n();return requestAnimationFrame(n),t.addEventListener("input",a),window.addEventListener("resize",r),{update(){requestAnimationFrame(n)},destroy(){t.removeEventListener("input",a),window.removeEventListener("resize",r)}}}function Vr(t){return`/api/uploads/${encodeURIComponent(t.id)}`}function Xo(t){return t.content_type.startsWith("image/")}function Qo(t){return t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}var Vo=O('
    ');function Jo(t,e){Ae(e,!0);var n=Vo(),a=g(n),r=_(a,2),i=_(r,2),s=g(i);s.textContent="<>";var c=_(i,2),l=g(c);l.textContent="{}";var u=_(c,2),f=_(u,2);let p;M(()=>p=it(f,1,"",null,p,{active:e.showGifPicker})),U("click",a,()=>e.onWrap("**")),U("click",r,()=>e.onWrap("_")),U("click",i,()=>e.onWrap("`")),U("click",c,()=>e.onWrap("```","\n```")),U("click",u,()=>e.onAppend("[label](https://)")),U("click",f,function(...h){e.onToggleGif?.apply(this,h)}),A(t,n),Re()}Le(["click"]);var Ko=O(''),$o=O('
    GIFs
    ');function ec(t,e){Ae(e,!0);var n=$o(),a=g(n),r=_(g(a),2),i=_(a,2);gt(i,21,()=>e.gifs,s=>s.url,(s,c)=>{var l=Ko(),u=g(l),f=_(u,2),p=g(f);M(()=>{F(u,"src",o(c).url),F(u,"alt",o(c).title),P(p,o(c).title)}),U("click",l,()=>e.onPick(o(c).url,o(c).title)),A(s,l)}),M(()=>Vt(r,e.query)),U("input",r,s=>e.onQuery(s.currentTarget.value)),A(t,n),Re()}Le(["input","click"]);function Sa(t,e=120){if(!t)return"";const n=t.replace(/\s+/g," ").trim();return n.length>e?n.slice(0,e-1)+"...":n}function hi(t){return t.quoted_author?.display_name||"Unknown"}function tc(t,e){return e===t.id?"Open":"Thread"}function nc(t){const e=new Date(t),n=new Date,a=new Date;a.setDate(n.getDate()-1);const r=(i,s)=>i.getFullYear()===s.getFullYear()&&i.getMonth()===s.getMonth()&&i.getDate()===s.getDate();return r(e,n)?"Today":r(e,a)?"Yesterday":new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric"}).format(e)}function rc(t){const e=[];let n="",a="",r=0;for(const i of t){const s=new Date(i.created_at),c=s.toDateString(),l=i.author?.id||i.author_id||"local",u=c!==n,f=l!==a,p=s.getTime()-r>300*1e3;u||f||p||e.length===0?e.push({key:i.id,dayLabel:u?nc(i.created_at):null,messages:[i],authorName:i.author?.display_name||"Local User",authorHandle:i.author?.handle||"",authorAvatarURL:i.author?.avatar_url||"",authorID:l,timestamp:i.created_at}):e[e.length-1].messages.push(i),n=c,a=l,r=s.getTime()}return e}var ac=O('
    Replying to
    ');function ic(t,e){Ae(e,!0);var n=ac(),a=_(g(n),2),r=g(a),i=_(g(r)),s=g(i),c=_(r,2),l=g(c),u=_(a,2);M(f=>{P(s,e.target.author?.display_name||"Local User"),P(l,f)},[()=>Sa(e.target.body)]),U("click",u,function(...f){e.onClear?.apply(this,f)}),A(t,n),Re()}Le(["click"]);var sc=O(''),lc=O('
    '),oc=O(''),cc=O('
    ');function Is(t,e){Ae(e,!0);let n=Be(e,"formClass",3,"composer"),a=Be(e,"pendingUpload",3,null),r=Be(e,"replyTarget",3,null),i=Be(e,"showUpload",3,!1),s=Be(e,"showToolbar",3,!1),c=Be(e,"showGifPicker",3,!1),l=Be(e,"gifQuery",3,""),u=Be(e,"filteredGifs",19,()=>[]),f=Be(e,"onUploadFile",3,()=>{}),p=Be(e,"onRemoveUpload",3,()=>{}),h=Be(e,"onClearReply",3,()=>{}),w=Be(e,"onApplyMarkdownWrap",3,()=>{}),v=Be(e,"onAppendToComposer",3,()=>{}),T=Be(e,"onToggleGif",3,()=>{}),b=Be(e,"onGifQuery",3,()=>{}),y=Be(e,"onPickGif",3,()=>{}),R=ht(null);wr(()=>(e.onInputRef(o(R)),()=>e.onInputRef(null)));var x=cc(),S=g(x);{var I=C=>{ec(C,{get gifs(){return u()},get query(){return l()},get onQuery(){return b()},get onPick(){return y()}})};j(S,C=>{c()&&C(I)})}var Z=_(S,2),z=g(Z);{var B=C=>{var ne=lc(),ke=_(g(ne),2);{var re=q=>{var ae=sc();M(ve=>{F(ae,"src",ve),F(ae,"alt",a().filename)},[()=>Vr(a())]),A(q,ae)},vt=xt(()=>Xo(a()));j(ke,q=>{o(vt)&&q(re)})}var se=_(ke,2),je=g(se),le=_(se,2);M(q=>P(je,`${a().filename??""} · ${q??""}`),[()=>Qo(a().byte_size)]),U("click",le,function(...q){p()?.apply(this,q)}),A(C,ne)};j(z,C=>{a()&&C(B)})}var V=_(z,2);{var Q=C=>{ic(C,{get target(){return r()},get onClear(){return h()}})};j(V,C=>{r()&&C(Q)})}var H=_(V,2),D=g(H);{var J=C=>{var ne=oc(),ke=g(ne);U("change",ke,function(...re){f()?.apply(this,re)}),A(C,ne)};j(D,C=>{i()&&C(J)})}var K=_(D,2);ja(K,C=>m(R,C),()=>o(R)),wo(K,(C,ne)=>Yo?.(C),()=>e.value);var W=_(K,2),Y=_(H,2);{var ue=C=>{Jo(C,{get showGifPicker(){return c()},get onWrap(){return w()},get onAppend(){return v()},get onToggleGif(){return T()}})};j(Y,C=>{s()&&C(ue)})}M(C=>{it(x,1,xo(n())),Vt(K,e.value),F(K,"placeholder",e.placeholder),F(K,"aria-label",e.ariaLabel),F(W,"aria-label",e.submitLabel),W.disabled=C},[()=>!e.value.trim()]),Gt("submit",x,C=>{C.preventDefault(),e.onSubmit()}),U("input",K,C=>e.onValue(C.currentTarget.value)),Gt("focus",K,function(...C){e.onFocus?.apply(this,C)}),U("keydown",K,function(...C){e.onKeydown?.apply(this,C)}),A(t,x),Re()}Le(["click","change","input","keydown"]);var uc=O('');function fc(t,e){var n=uc(),a=g(n),r=_(a,2),i=g(r),s=g(i),c=g(s),l=_(s,2),u=g(l),f=_(u,2),p=_(i,2),h=g(p);M(()=>{P(c,e.title),F(u,"href",e.url),F(h,"src",e.url),F(h,"alt",e.title)}),U("click",a,function(...w){e.onClose?.apply(this,w)}),U("click",f,function(...w){e.onClose?.apply(this,w)}),A(t,n)}Le(["click"]);const{entries:Ds,setPrototypeOf:pi,isFrozen:dc,getPrototypeOf:hc,getOwnPropertyDescriptor:pc}=Object;let{freeze:Ke,seal:At,create:zn}=Object,{apply:Ea,construct:Aa}=typeof Reflect<"u"&&Reflect;Ke||(Ke=function(e){return e});At||(At=function(e){return e});Ea||(Ea=function(e,n){for(var a=arguments.length,r=new Array(a>2?a-2:0),i=2;i1?n-1:0),r=1;r"u"?null:Oe(BigInt.prototype.toString),bi=typeof Symbol>"u"?null:Oe(Symbol.prototype.toString),Te=Oe(Object.prototype.hasOwnProperty),fr=Oe(Object.prototype.toString),He=Oe(RegExp.prototype.test),Wr=kc(TypeError);function Oe(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:mr;if(pi&&pi(t,null),!Xe(e))return t;let a=e.length;for(;a--;){let r=e[a];if(typeof r=="string"){const i=n(r);i!==r&&(dc(e)||(e[a]=i),r=i)}t[r]=!0}return t}function yc(t){for(let e=0;e/gm),Rc=At(/\$\{[\w\W]*/gm),Cc=At(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ic=At(/^aria-[\-\w]+$/),Os=At(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Dc=At(/^(?:\w+script|data):/i),Oc=At(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ls=At(/^html$/i),Lc=At(/^[a-z][.\w]*(-[.\w]+)+$/i);var xi=Object.freeze({__proto__:null,ARIA_ATTR:Ic,ATTR_WHITESPACE:Oc,CUSTOM_ELEMENT:Lc,DATA_ATTR:Cc,DOCTYPE_NAME:Ls,ERB_EXPR:Ac,IS_ALLOWED_URI:Os,IS_SCRIPT_OR_DATA:Dc,MUSTACHE_EXPR:Ec,TMPLIT_EXPR:Rc});const dr={element:1,text:3,progressingInstruction:7,comment:8,document:9},Mc=function(){return typeof window>"u"?null:window},Nc=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let a=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(a=n.getAttribute(r));const i="dompurify"+(a?"#"+a:"");try{return e.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Si=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ms(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Mc();const e=G=>Ms(G);if(e.version="3.4.2",e.removed=[],!t||!t.document||t.document.nodeType!==dr.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const a=n,r=a.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:c,Element:l,NodeFilter:u,NamedNodeMap:f=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:h,trustedTypes:w}=t,v=l.prototype,T=Fn(v,"cloneNode"),b=Fn(v,"remove"),y=Fn(v,"nextSibling"),R=Fn(v,"childNodes"),x=Fn(v,"parentNode");if(typeof s=="function"){const G=n.createElement("template");G.content&&G.content.ownerDocument&&(n=G.content.ownerDocument)}let S,I="";const{implementation:Z,createNodeIterator:z,createDocumentFragment:B,getElementsByTagName:V}=n,{importNode:Q}=a;let H=Si();e.isSupported=typeof Ds=="function"&&typeof x=="function"&&Z&&Z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:D,ERB_EXPR:J,TMPLIT_EXPR:K,DATA_ATTR:W,ARIA_ATTR:Y,IS_SCRIPT_OR_DATA:ue,ATTR_WHITESPACE:C,CUSTOM_ELEMENT:ne}=xi;let{IS_ALLOWED_URI:ke}=xi,re=null;const vt=$({},[...ki,...ca,...ua,...fa,...yi]);let se=null;const je=$({},[...wi,...da,...Ti,...qr]);let le=Object.seal(zn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,ae=null;const ve=Object.seal(zn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let st=!0,de=!0,Se=!1,qt=!0,$e=!1,ye=!0,me=!1,Ce=!1,lt=!1,ot=!1,tn=!1,Dn=!1,dn=!0,Lr=!1;const Mr="user-content-";let et=!0,jt=!1,Zt={},ct=null;const On=$({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Kn=null;const $n=$({},["audio","video","img","source","image","track"]);let er=null;const tt=$({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),hn="http://www.w3.org/1998/Math/MathML",Ln="http://www.w3.org/2000/svg",mt="http://www.w3.org/1999/xhtml";let nn=mt,tr=!1,pn=null;const aa=$({},[hn,Ln,mt],oa);let nr=$({},["mi","mo","mn","ms","mtext"]),rr=$({},["annotation-xml"]);const Mn=$({},["title","style","font","a","script"]);let gn=null;const Nr=["application/xhtml+xml","text/html"],ia="text/html";let Ee=null,Nt=null;const Pr=n.createElement("form"),Nn=function(d){return d instanceof RegExp||d instanceof Function},ar=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Nt&&Nt===d)return;(!d||typeof d!="object")&&(d={}),d=nt(d),gn=Nr.indexOf(d.PARSER_MEDIA_TYPE)===-1?ia:d.PARSER_MEDIA_TYPE,Ee=gn==="application/xhtml+xml"?oa:mr,re=Te(d,"ALLOWED_TAGS")&&Xe(d.ALLOWED_TAGS)?$({},d.ALLOWED_TAGS,Ee):vt,se=Te(d,"ALLOWED_ATTR")&&Xe(d.ALLOWED_ATTR)?$({},d.ALLOWED_ATTR,Ee):je,pn=Te(d,"ALLOWED_NAMESPACES")&&Xe(d.ALLOWED_NAMESPACES)?$({},d.ALLOWED_NAMESPACES,oa):aa,er=Te(d,"ADD_URI_SAFE_ATTR")&&Xe(d.ADD_URI_SAFE_ATTR)?$(nt(tt),d.ADD_URI_SAFE_ATTR,Ee):tt,Kn=Te(d,"ADD_DATA_URI_TAGS")&&Xe(d.ADD_DATA_URI_TAGS)?$(nt($n),d.ADD_DATA_URI_TAGS,Ee):$n,ct=Te(d,"FORBID_CONTENTS")&&Xe(d.FORBID_CONTENTS)?$({},d.FORBID_CONTENTS,Ee):On,q=Te(d,"FORBID_TAGS")&&Xe(d.FORBID_TAGS)?$({},d.FORBID_TAGS,Ee):nt({}),ae=Te(d,"FORBID_ATTR")&&Xe(d.FORBID_ATTR)?$({},d.FORBID_ATTR,Ee):nt({}),Zt=Te(d,"USE_PROFILES")?d.USE_PROFILES&&typeof d.USE_PROFILES=="object"?nt(d.USE_PROFILES):d.USE_PROFILES:!1,st=d.ALLOW_ARIA_ATTR!==!1,de=d.ALLOW_DATA_ATTR!==!1,Se=d.ALLOW_UNKNOWN_PROTOCOLS||!1,qt=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$e=d.SAFE_FOR_TEMPLATES||!1,ye=d.SAFE_FOR_XML!==!1,me=d.WHOLE_DOCUMENT||!1,ot=d.RETURN_DOM||!1,tn=d.RETURN_DOM_FRAGMENT||!1,Dn=d.RETURN_TRUSTED_TYPE||!1,lt=d.FORCE_BODY||!1,dn=d.SANITIZE_DOM!==!1,Lr=d.SANITIZE_NAMED_PROPS||!1,et=d.KEEP_CONTENT!==!1,jt=d.IN_PLACE||!1,ke=Tc(d.ALLOWED_URI_REGEXP)?d.ALLOWED_URI_REGEXP:Os,nn=typeof d.NAMESPACE=="string"?d.NAMESPACE:mt,nr=Te(d,"MATHML_TEXT_INTEGRATION_POINTS")&&d.MATHML_TEXT_INTEGRATION_POINTS&&typeof d.MATHML_TEXT_INTEGRATION_POINTS=="object"?nt(d.MATHML_TEXT_INTEGRATION_POINTS):$({},["mi","mo","mn","ms","mtext"]),rr=Te(d,"HTML_INTEGRATION_POINTS")&&d.HTML_INTEGRATION_POINTS&&typeof d.HTML_INTEGRATION_POINTS=="object"?nt(d.HTML_INTEGRATION_POINTS):$({},["annotation-xml"]);const E=Te(d,"CUSTOM_ELEMENT_HANDLING")&&d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING=="object"?nt(d.CUSTOM_ELEMENT_HANDLING):zn(null);if(le=zn(null),Te(E,"tagNameCheck")&&Nn(E.tagNameCheck)&&(le.tagNameCheck=E.tagNameCheck),Te(E,"attributeNameCheck")&&Nn(E.attributeNameCheck)&&(le.attributeNameCheck=E.attributeNameCheck),Te(E,"allowCustomizedBuiltInElements")&&typeof E.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=E.allowCustomizedBuiltInElements),$e&&(de=!1),tn&&(ot=!0),Zt&&(re=$({},yi),se=zn(null),Zt.html===!0&&($(re,ki),$(se,wi)),Zt.svg===!0&&($(re,ca),$(se,da),$(se,qr)),Zt.svgFilters===!0&&($(re,ua),$(se,da),$(se,qr)),Zt.mathMl===!0&&($(re,fa),$(se,Ti),$(se,qr))),ve.tagCheck=null,ve.attributeCheck=null,Te(d,"ADD_TAGS")&&(typeof d.ADD_TAGS=="function"?ve.tagCheck=d.ADD_TAGS:Xe(d.ADD_TAGS)&&(re===vt&&(re=nt(re)),$(re,d.ADD_TAGS,Ee))),Te(d,"ADD_ATTR")&&(typeof d.ADD_ATTR=="function"?ve.attributeCheck=d.ADD_ATTR:Xe(d.ADD_ATTR)&&(se===je&&(se=nt(se)),$(se,d.ADD_ATTR,Ee))),Te(d,"ADD_URI_SAFE_ATTR")&&Xe(d.ADD_URI_SAFE_ATTR)&&$(er,d.ADD_URI_SAFE_ATTR,Ee),Te(d,"FORBID_CONTENTS")&&Xe(d.FORBID_CONTENTS)&&(ct===On&&(ct=nt(ct)),$(ct,d.FORBID_CONTENTS,Ee)),Te(d,"ADD_FORBID_CONTENTS")&&Xe(d.ADD_FORBID_CONTENTS)&&(ct===On&&(ct=nt(ct)),$(ct,d.ADD_FORBID_CONTENTS,Ee)),et&&(re["#text"]=!0),me&&$(re,["html","head","body"]),re.table&&($(re,["tbody"]),delete q.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=d.TRUSTED_TYPES_POLICY,I=S.createHTML("")}else S===void 0&&(S=Nc(w,r)),S!==null&&typeof I=="string"&&(I=S.createHTML(""));Ke&&Ke(d),Nt=d},Ur=$({},[...ca,...ua,...xc]),Pn=$({},[...fa,...Sc]),sa=function(d){let E=x(d);(!E||!E.tagName)&&(E={namespaceURI:nn,tagName:"template"});const N=mr(d.tagName),he=mr(E.tagName);return pn[d.namespaceURI]?d.namespaceURI===Ln?E.namespaceURI===mt?N==="svg":E.namespaceURI===hn?N==="svg"&&(he==="annotation-xml"||nr[he]):!!Ur[N]:d.namespaceURI===hn?E.namespaceURI===mt?N==="math":E.namespaceURI===Ln?N==="math"&&rr[he]:!!Pn[N]:d.namespaceURI===mt?E.namespaceURI===Ln&&!rr[he]||E.namespaceURI===hn&&!nr[he]?!1:!Pn[N]&&(Mn[N]||!Ur[N]):!!(gn==="application/xhtml+xml"&&pn[d.namespaceURI]):!1},Ze=function(d){ur(e.removed,{element:d});try{x(d).removeChild(d)}catch{b(d)}},Pt=function(d,E){try{ur(e.removed,{attribute:E.getAttributeNode(d),from:E})}catch{ur(e.removed,{attribute:null,from:E})}if(E.removeAttribute(d),d==="is")if(ot||tn)try{Ze(E)}catch{}else try{E.setAttribute(d,"")}catch{}},zr=function(d){let E=null,N=null;if(lt)d=""+d;else{const we=vi(d,/^[\r\n\t ]+/);N=we&&we[0]}gn==="application/xhtml+xml"&&nn===mt&&(d=''+d+"");const he=S?S.createHTML(d):d;if(nn===mt)try{E=new h().parseFromString(he,gn)}catch{}if(!E||!E.documentElement){E=Z.createDocument(nn,"template",null);try{E.documentElement.innerHTML=tr?I:he}catch{}}const Me=E.body||E.documentElement;return d&&N&&Me.insertBefore(n.createTextNode(N),Me.childNodes[0]||null),nn===mt?V.call(E,me?"html":"body")[0]:me?E.documentElement:Me},Fr=function(d){return z.call(d.ownerDocument||d,d,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},ir=function(d){return d instanceof p&&(typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||!(d.attributes instanceof f)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function")},k=function(d){return typeof c=="function"&&d instanceof c};function L(G,d,E){cr(G,N=>{N.call(e,d,E,Nt)})}const fe=function(d){let E=null;if(L(H.beforeSanitizeElements,d,null),ir(d))return Ze(d),!0;const N=Ee(d.nodeName);if(L(H.uponSanitizeElement,d,{tagName:N,allowedTags:re}),ye&&d.hasChildNodes()&&!k(d.firstElementChild)&&He(/<[/\w!]/g,d.innerHTML)&&He(/<[/\w!]/g,d.textContent)||ye&&d.namespaceURI===mt&&N==="style"&&k(d.firstElementChild)||d.nodeType===dr.progressingInstruction||ye&&d.nodeType===dr.comment&&He(/<[/\w]/g,d.data))return Ze(d),!0;if(q[N]||!(ve.tagCheck instanceof Function&&ve.tagCheck(N))&&!re[N]){if(!q[N]&&Rt(N)&&(le.tagNameCheck instanceof RegExp&&He(le.tagNameCheck,N)||le.tagNameCheck instanceof Function&&le.tagNameCheck(N)))return!1;if(et&&!ct[N]){const he=x(d)||d.parentNode,Me=R(d)||d.childNodes;if(Me&&he){const we=Me.length;for(let Pe=we-1;Pe>=0;--Pe){const Ye=T(Me[Pe],!0);he.insertBefore(Ye,y(d))}}}return Ze(d),!0}return d instanceof l&&!sa(d)||(N==="noscript"||N==="noembed"||N==="noframes")&&He(/<\/no(script|embed|frames)/i,d.innerHTML)?(Ze(d),!0):($e&&d.nodeType===dr.text&&(E=d.textContent,cr([D,J,K],he=>{E=Un(E,he," ")}),d.textContent!==E&&(ur(e.removed,{element:d.cloneNode()}),d.textContent=E)),L(H.afterSanitizeElements,d,null),!1)},be=function(d,E,N){if(ae[E]||dn&&(E==="id"||E==="name")&&(N in n||N in Pr))return!1;const he=se[E]||ve.attributeCheck instanceof Function&&ve.attributeCheck(E,d);if(!(de&&!ae[E]&&He(W,E))){if(!(st&&He(Y,E))){if(!he||ae[E]){if(!(Rt(d)&&(le.tagNameCheck instanceof RegExp&&He(le.tagNameCheck,d)||le.tagNameCheck instanceof Function&&le.tagNameCheck(d))&&(le.attributeNameCheck instanceof RegExp&&He(le.attributeNameCheck,E)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(E,d))||E==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&He(le.tagNameCheck,N)||le.tagNameCheck instanceof Function&&le.tagNameCheck(N))))return!1}else if(!er[E]){if(!He(ke,Un(N,C,""))){if(!((E==="src"||E==="xlink:href"||E==="href")&&d!=="script"&&mi(N,"data:")===0&&Kn[d])){if(!(Se&&!He(ue,Un(N,C,"")))){if(N)return!1}}}}}}return!0},We=$({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Rt=function(d){return!We[mr(d)]&&He(ne,d)},_t=function(d){L(H.beforeSanitizeAttributes,d,null);const{attributes:E}=d;if(!E||ir(d))return;const N={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:se,forceKeepAttr:void 0};let he=E.length;for(;he--;){const Me=E[he],{name:we,namespaceURI:Pe,value:Ye}=Me,ut=Ee(we),sr=Ye;let Ie=we==="value"?sr:mc(sr);if(N.attrName=ut,N.attrValue=Ie,N.keepAttr=!0,N.forceKeepAttr=void 0,L(H.uponSanitizeAttribute,d,N),Ie=N.attrValue,Lr&&(ut==="id"||ut==="name")&&mi(Ie,Mr)!==0&&(Pt(we,d),Ie=Mr+Ie),ye&&He(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ie)){Pt(we,d);continue}if(ut==="attributename"&&vi(Ie,"href")){Pt(we,d);continue}if(N.forceKeepAttr)continue;if(!N.keepAttr){Pt(we,d);continue}if(!qt&&He(/\/>/i,Ie)){Pt(we,d);continue}$e&&cr([D,J,K],lr=>{Ie=Un(Ie,lr," ")});const Br=Ee(d.nodeName);if(!be(Br,ut,Ie)){Pt(we,d);continue}if(S&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!Pe)switch(w.getAttributeType(Br,ut)){case"TrustedHTML":{Ie=S.createHTML(Ie);break}case"TrustedScriptURL":{Ie=S.createScriptURL(Ie);break}}if(Ie!==sr)try{Pe?d.setAttributeNS(Pe,we,Ie):d.setAttribute(we,Ie),ir(d)?Ze(d):gi(e.removed)}catch{Pt(we,d)}}L(H.afterSanitizeAttributes,d,null)},bt=function(d){let E=null;const N=Fr(d);for(L(H.beforeSanitizeShadowDOM,d,null);E=N.nextNode();)L(H.uponSanitizeShadowNode,E,null),fe(E),_t(E),E.content instanceof i&&bt(E.content);L(H.afterSanitizeShadowDOM,d,null)};return e.sanitize=function(G){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=null,N=null,he=null,Me=null;if(tr=!G,tr&&(G=""),typeof G!="string"&&!k(G)&&(G=wc(G),typeof G!="string"))throw Wr("dirty is not a string, aborting");if(!e.isSupported)return G;if(Ce||ar(d),e.removed=[],typeof G=="string"&&(jt=!1),jt){const Ye=G.nodeName;if(typeof Ye=="string"){const ut=Ee(Ye);if(!re[ut]||q[ut])throw Wr("root node is forbidden and cannot be sanitized in-place")}}else if(G instanceof c)E=zr(""),N=E.ownerDocument.importNode(G,!0),N.nodeType===dr.element&&N.nodeName==="BODY"||N.nodeName==="HTML"?E=N:E.appendChild(N);else{if(!ot&&!$e&&!me&&G.indexOf("<")===-1)return S&&Dn?S.createHTML(G):G;if(E=zr(G),!E)return ot?null:Dn?I:""}E&<&&Ze(E.firstChild);const we=Fr(jt?G:E);for(;he=we.nextNode();)fe(he),_t(he),he.content instanceof i&&bt(he.content);if(jt)return G;if(ot){if($e){E.normalize();let Ye=E.innerHTML;cr([D,J,K],ut=>{Ye=Un(Ye,ut," ")}),E.innerHTML=Ye}if(tn)for(Me=B.call(E.ownerDocument);E.firstChild;)Me.appendChild(E.firstChild);else Me=E;return(se.shadowroot||se.shadowrootmode)&&(Me=Q.call(a,Me,!0)),Me}let Pe=me?E.outerHTML:E.innerHTML;return me&&re["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&He(Ls,E.ownerDocument.doctype.name)&&(Pe=" +`+Pe),$e&&cr([D,J,K],Ye=>{Pe=Un(Pe,Ye," ")}),S&&Dn?S.createHTML(Pe):Pe},e.setConfig=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ar(G),Ce=!0},e.clearConfig=function(){Nt=null,Ce=!1},e.isValidAttribute=function(G,d,E){Nt||ar({});const N=Ee(G),he=Ee(d);return be(N,he,E)},e.addHook=function(G,d){typeof d=="function"&&ur(H[G],d)},e.removeHook=function(G,d){if(d!==void 0){const E=gc(H[G],d);return E===-1?void 0:vc(H[G],E,1)[0]}return gi(H[G])},e.removeHooks=function(G){H[G]=[]},e.removeAllHooks=function(){H=Si()},e}var Pc=Ms();function Za(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var In=Za();function Ns(t){In=t}var mn={exec:()=>null};function ie(t,e=""){let n=typeof t=="string"?t:t.source,a={replace:(r,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(Ve.caret,"$1"),n=n.replace(r,s),a},getRegex:()=>new RegExp(n,e)};return a}var Uc=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},zc=/^(?:[ \t]*(?:\n|$))+/,Fc=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Bc=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Or=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Hc=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ya=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ps=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Us=ie(Ps).replace(/bull/g,Ya).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Gc=ie(Ps).replace(/bull/g,Ya).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Xa=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Wc=/^[^\n]+/,Qa=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qc=ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Qa).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),jc=ie(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ya).getRegex(),na="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Va=/|$))/,Zc=ie("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Va).replace("tag",na).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),zs=ie(Xa).replace("hr",Or).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",na).getRegex(),Yc=ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",zs).getRegex(),Ja={blockquote:Yc,code:Fc,def:qc,fences:Bc,heading:Hc,hr:Or,html:Zc,lheading:Us,list:jc,newline:zc,paragraph:zs,table:mn,text:Wc},Ei=ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Or).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",na).getRegex(),Xc={...Ja,lheading:Gc,table:Ei,paragraph:ie(Xa).replace("hr",Or).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ei).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",na).getRegex()},Qc={...Ja,html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Va).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:mn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ie(Xa).replace("hr",Or).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Us).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Vc=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Jc=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Fs=/^( {2,}|\\)\n(?!\s*$)/,Kc=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Uc?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Hs=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ru=ie(Hs,"u").replace(/punct/g,Jn).getRegex(),au=ie(Hs,"u").replace(/punct/g,Bs).getRegex(),Gs="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",iu=ie(Gs,"gu").replace(/notPunctSpace/g,Ka).replace(/punctSpace/g,ra).replace(/punct/g,Jn).getRegex(),su=ie(Gs,"gu").replace(/notPunctSpace/g,tu).replace(/punctSpace/g,eu).replace(/punct/g,Bs).getRegex(),lu=ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ka).replace(/punctSpace/g,ra).replace(/punct/g,Jn).getRegex(),ou=ie(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Jn).getRegex(),cu="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",uu=ie(cu,"gu").replace(/notPunctSpace/g,Ka).replace(/punctSpace/g,ra).replace(/punct/g,Jn).getRegex(),fu=ie(/\\(punct)/,"gu").replace(/punct/g,Jn).getRegex(),du=ie(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),hu=ie(Va).replace("(?:-->|$)","-->").getRegex(),pu=ie("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",hu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Jr=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,gu=ie(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Jr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ws=ie(/^!?\[(label)\]\[(ref)\]/).replace("label",Jr).replace("ref",Qa).getRegex(),qs=ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",Qa).getRegex(),vu=ie("reflink|nolink(?!\\()","g").replace("reflink",Ws).replace("nolink",qs).getRegex(),Ai=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,$a={_backpedal:mn,anyPunctuation:fu,autolink:du,blockSkip:nu,br:Fs,code:Jc,del:mn,delLDelim:mn,delRDelim:mn,emStrongLDelim:ru,emStrongRDelimAst:iu,emStrongRDelimUnd:lu,escape:Vc,link:gu,nolink:qs,punctuation:$c,reflink:Ws,reflinkSearch:vu,tag:pu,text:Kc,url:mn},mu={...$a,link:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",Jr).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jr).getRegex()},Ra={...$a,emStrongRDelimAst:su,emStrongLDelim:au,delLDelim:ou,delRDelim:uu,url:ie(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ai).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ie(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Ri=t=>bu[t];function Ut(t,e){if(e){if(Ve.escapeTest.test(t))return t.replace(Ve.escapeReplace,Ri)}else if(Ve.escapeTestNoEncode.test(t))return t.replace(Ve.escapeReplaceNoEncode,Ri);return t}function Ci(t){try{t=encodeURI(t).replace(Ve.percentDecode,"%")}catch{return null}return t}function Ii(t,e){let n=t.replace(Ve.findPipe,(i,s,c)=>{let l=!1,u=s;for(;--u>=0&&c[u]==="\\";)l=!l;return l?"|":" |"}),a=n.split(Ve.splitPipe),r=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length0?-2:-1}function yu(t,e=0){let n=e,a="";for(let r of t)if(r===" "){let i=4-n%4;a+=" ".repeat(i),n+=i}else a+=r,n++;return a}function Di(t,e,n,a,r){let i=e.href,s=e.title||null,c=t[1].replace(r.other.outputLinkReplace,"$1");a.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:s,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,l}function wu(t,e,n){let a=t.match(n.other.indentCodeCompensation);if(a===null)return e;let r=a[1];return e.split(` +`).map(i=>{let s=i.match(n.other.beginningSpace);if(s===null)return i;let[c]=s;return c.length>=r.length?i.slice(r.length):i}).join(` +`)}var Kr=class{options;rules;lexer;constructor(t){this.options=t||In}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:pr(n,` +`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],a=wu(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:a}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let a=pr(n,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(n=a.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:pr(e[0],` +`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=pr(e[0],` +`).split(` +`),a="",r="",i=[];for(;n.length>0;){let s=!1,c=[],l;for(l=0;l1,r={type:"list",raw:"",ordered:a,start:a?+n.slice(0,-1):"",loose:!1,items:[]};n=a?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=a?n:"[*+-]");let i=this.rules.other.listItemRegex(n),s=!1;for(;t;){let l=!1,u="",f="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;u=e[0],t=t.substring(u.length);let p=yu(e[2].split(` +`,1)[0],e[1].length),h=t.split(` +`,1)[0],w=!p.trim(),v=0;if(this.options.pedantic?(v=2,f=p.trimStart()):w?v=e[1].length+1:(v=p.search(this.rules.other.nonSpaceChar),v=v>4?1:v,f=p.slice(v),v+=e[1].length),w&&this.rules.other.blankLine.test(h)&&(u+=h+` +`,t=t.substring(h.length+1),l=!0),!l){let T=this.rules.other.nextBulletRegex(v),b=this.rules.other.hrRegex(v),y=this.rules.other.fencesBeginRegex(v),R=this.rules.other.headingBeginRegex(v),x=this.rules.other.htmlBeginRegex(v),S=this.rules.other.blockquoteBeginRegex(v);for(;t;){let I=t.split(` +`,1)[0],Z;if(h=I,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),Z=h):Z=h.replace(this.rules.other.tabCharGlobal," "),y.test(h)||R.test(h)||x.test(h)||S.test(h)||T.test(h)||b.test(h))break;if(Z.search(this.rules.other.nonSpaceChar)>=v||!h.trim())f+=` +`+Z.slice(v);else{if(w||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(p)||R.test(p)||b.test(p))break;f+=` +`+h}w=!h.trim(),u+=I+` +`,t=t.substring(I.length+1),p=Z.slice(v)}}r.loose||(s?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(s=!0)),r.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),r.raw+=u}let c=r.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(l.raw);if(u){let f={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};l.checked=f.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=f.raw+l.tokens[0].raw,l.tokens[0].text=f.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(f)):l.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):l.tokens.unshift(f)}}if(!r.loose){let u=l.tokens.filter(p=>p.type==="space"),f=u.length>0&&u.some(p=>this.rules.other.anyLine.test(p.raw));r.loose=f}}if(r.loose)for(let l of r.items){l.loose=!0;for(let u of l.tokens)u.type==="text"&&(u.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:a,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Ii(e[1]),a=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(` +`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===a.length){for(let s of a)this.rules.other.tableAlignRight.test(s)?i.align.push("right"):this.rules.other.tableAlignCenter.test(s)?i.align.push("center"):this.rules.other.tableAlignLeft.test(s)?i.align.push("left"):i.align.push(null);for(let s=0;s({text:c,tokens:this.lexer.inline(c),header:!1,align:i.align[l]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===` +`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=pr(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=ku(e[2],"()");if(i===-2)return;if(i>-1){let s=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,s).trim(),e[3]=""}}let a=e[2],r="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(a);i&&(a=i[1],r=i[3])}else r=e[3]?e[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?a=a.slice(1):a=a.slice(1,-1)),Di(e,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let a=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[a.toLowerCase()];if(!r){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Di(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!(!a||!a[1]&&!a[2]&&!a[3]&&!a[4]||a[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...a[0]].length-1,i,s,c=r,l=0,u=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+r);(a=u.exec(e))!==null;){if(i=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!i)continue;if(s=[...i].length,a[3]||a[4]){c+=s;continue}else if((a[5]||a[6])&&r%3&&!((r+s)%3)){l+=s;continue}if(c-=s,c>0)continue;s=Math.min(s,s+c+l);let f=[...a[0]][0].length,p=t.slice(0,r+a.index+f+s);if(Math.min(r,s)%2){let w=p.slice(1,-1);return{type:"em",raw:p,text:w,tokens:this.lexer.inlineTokens(w)}}let h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return a&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let a=this.rules.inline.delLDelim.exec(t);if(a&&(!a[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...a[0]].length-1,i,s,c=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+r);(a=l.exec(e))!==null;){if(i=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!i||(s=[...i].length,s!==r))continue;if(a[3]||a[4]){c+=s;continue}if(c-=s,c>0)continue;s=Math.min(s,s+c);let u=[...a[0]][0].length,f=t.slice(0,r+a.index+u+s),p=f.slice(r,-r);return{type:"del",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,a;return e[2]==="@"?(n=e[1],a="mailto:"+n):(n=e[1],a=n),{type:"link",raw:e[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,a;if(e[2]==="@")n=e[0],a="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?a="http://"+e[0]:a=e[0]}return{type:"link",raw:e[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Ct=class Ca{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||In,this.options.tokenizer=this.options.tokenizer||new Kr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Ve,block:jr.normal,inline:hr.normal};this.options.pedantic?(n.block=jr.pedantic,n.inline=hr.pedantic):this.options.gfm&&(n.block=jr.gfm,this.options.breaks?n.inline=hr.breaks:n.inline=hr.gfm),this.tokenizer.rules=n}static get rules(){return{block:jr,inline:hr}}static lex(e,n){return new Ca(n).lex(e)}static lexInline(e,n){return new Ca(n).inlineTokens(e)}lex(e){e=e.replace(Ve.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let n=0;n(r=s.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let s=n.at(-1);r.raw.length===1&&s!==void 0?s.raw+=` +`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let s=n.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.text,this.inlineQueue.at(-1).src=s.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let s=n.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},n.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let s=1/0,c=e.slice(1),l;this.options.extensions.startBlock.forEach(u=>{l=u.call({lexer:this},c),typeof l=="number"&&l>=0&&(s=Math.min(s,l))}),s<1/0&&s>=0&&(i=e.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=n.at(-1);a&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):n.push(r),a=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let s=n.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):n.push(r);continue}if(e){let s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let a=e,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(a))!==null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(a))!==null;)a=a.slice(0,r.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(a))!==null;)i=r[2]?r[2].length:0,a=a.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let s=!1,c="";for(;e;){s||(c=""),s=!1;let l;if(this.options.extensions?.inline?.some(f=>(l=f.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let f=n.at(-1);l.type==="text"&&f?.type==="text"?(f.raw+=l.raw,f.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,a,c)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e,a,c)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let u=e;if(this.options.extensions?.startInline){let f=1/0,p=e.slice(1),h;this.options.extensions.startInline.forEach(w=>{h=w.call({lexer:this},p),typeof h=="number"&&h>=0&&(f=Math.min(f,h))}),f<1/0&&f>=0&&(u=e.substring(0,f+1))}if(l=this.tokenizer.inlineText(u)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(c=l.raw.slice(-1)),s=!0;let f=n.at(-1);f?.type==="text"?(f.raw+=l.raw,f.text+=l.text):n.push(l);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return n}},$r=class{options;parser;constructor(t){this.options=t||In}space(t){return""}code({text:t,lang:e,escaped:n}){let a=(e||"").match(Ve.notSpaceStart)?.[0],r=t.replace(Ve.endingNewline,"")+` +`;return a?'
    '+(n?r:Ut(r,!0))+`
    +`:"
    "+(n?r:Ut(r,!0))+`
    +`}blockquote({tokens:t}){return`
    +${this.parser.parse(t)}
    +`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`${this.parser.parseInline(t)} +`}hr(t){return`
    +`}list(t){let e=t.ordered,n=t.start,a="";for(let s=0;s +`+a+" +`}listitem(t){return`
  • ${this.parser.parse(t.tokens)}
  • +`}checkbox({checked:t}){return" '}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    +`}table(t){let e="",n="";for(let r=0;r${a}`),` + +`+e+` +`+a+`
    +`}tablerow({text:t}){return` +${t} +`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+` +`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${Ut(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:e,tokens:n}){let a=this.parser.parseInline(n),r=Ci(t);if(r===null)return a;t=r;let i='
    ",i}image({href:t,title:e,text:n,tokens:a}){a&&(n=this.parser.parseInline(a,this.parser.textRenderer));let r=Ci(t);if(r===null)return Ut(n);t=r;let i=`${Ut(n)}{let s=r[i].flat(1/0);n=n.concat(this.walkTokens(s,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let a={...n};if(a.async=this.defaults.async||a.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...s){let c=r.renderer.apply(this,s);return c===!1&&(c=i.apply(this,s)),c}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),a.extensions=e),n.renderer){let r=this.defaults.renderer||new $r(this.defaults);for(let i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let s=i,c=n.renderer[s],l=r[s];r[s]=(...u)=>{let f=c.apply(r,u);return f===!1&&(f=l.apply(r,u)),f||""}}a.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Kr(this.defaults);for(let i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let s=i,c=n.tokenizer[s],l=r[s];r[s]=(...u)=>{let f=c.apply(r,u);return f===!1&&(f=l.apply(r,u)),f}}a.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new _r;for(let i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let s=i,c=n.hooks[s],l=r[s];_r.passThroughHooks.has(i)?r[s]=u=>{if(this.defaults.async&&_r.passThroughHooksRespectAsync.has(i))return(async()=>{let p=await c.call(r,u);return l.call(r,p)})();let f=c.call(r,u);return l.call(r,f)}:r[s]=(...u)=>{if(this.defaults.async)return(async()=>{let p=await c.apply(r,u);return p===!1&&(p=await l.apply(r,u)),p})();let f=c.apply(r,u);return f===!1&&(f=l.apply(r,u)),f}}a.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,i=n.walkTokens;a.walkTokens=function(s){let c=[];return c.push(i.call(this,s)),r&&(c=c.concat(r.call(this,s))),c}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Ct.lex(t,e??this.defaults)}parser(t,e){return It.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let a={...n},r={...this.defaults,...a},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&a.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let s=r.hooks?await r.hooks.preprocess(e):e,c=await(r.hooks?await r.hooks.provideLexer(t):t?Ct.lex:Ct.lexInline)(s,r),l=r.hooks?await r.hooks.processAllTokens(c):c;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let u=await(r.hooks?await r.hooks.provideParser(t):t?It.parse:It.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(u):u})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let s=(r.hooks?r.hooks.provideLexer(t):t?Ct.lex:Ct.lexInline)(e,r);r.hooks&&(s=r.hooks.processAllTokens(s)),r.walkTokens&&this.walkTokens(s,r.walkTokens);let c=(r.hooks?r.hooks.provideParser(t):t?It.parse:It.parseInline)(s,r);return r.hooks&&(c=r.hooks.postprocess(c)),c}catch(s){return i(s)}}}onError(t,e){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,t){let a="

    An error occurred:

    "+Ut(n.message+"",!0)+"
    ";return e?Promise.resolve(a):a}if(e)return Promise.reject(n);throw n}}},An=new Tu;function ge(t,e){return An.parse(t,e)}ge.options=ge.setOptions=function(t){return An.setOptions(t),ge.defaults=An.defaults,Ns(ge.defaults),ge};ge.getDefaults=Za;ge.defaults=In;ge.use=function(...t){return An.use(...t),ge.defaults=An.defaults,Ns(ge.defaults),ge};ge.walkTokens=function(t,e){return An.walkTokens(t,e)};ge.parseInline=An.parseInline;ge.Parser=It;ge.parser=It.parse;ge.Renderer=$r;ge.TextRenderer=ei;ge.Lexer=Ct;ge.lexer=Ct.lex;ge.Tokenizer=Kr;ge.Hooks=_r;ge.parse=ge;ge.options;ge.setOptions;ge.use;ge.walkTokens;ge.parseInline;It.parse;Ct.lex;function Da(t){return Pc.sanitize(ge.parse(t,{async:!1,breaks:!0,gfm:!0}))}function Sr(t){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(t))}var xu=O('
    '),Su=O(''),Eu=O(' ',1),Au=O('
    ',2),Ru=O(' ');function Oa(t,e){Ae(e,!0);let n=Be(e,"onOpenImage",3,()=>{}),a=ht(null),r=ht(!1),i=ht(""),s=xt(()=>e.upload.content_type?.startsWith("image/")??!1),c=xt(()=>e.upload.content_type?.startsWith("video/")??!1);function l(){m(r,!0)}function u(){if(!o(a)||!isFinite(o(a).duration))return;const y=Math.floor(o(a).duration),R=Math.floor(y/60),x=y%60;m(i,`${R}:${x.toString().padStart(2,"0")}`)}function f(){o(a)&&(m(r,!0),o(a).play())}function p(y){return y<1024?`${y} B`:y<1024*1024?`${Math.round(y/1024)} KB`:`${(y/(1024*1024)).toFixed(1)} MB`}var h=Dr(),w=Ht(h);{var v=y=>{var R=xu(),x=g(R),S=g(x),I=_(x,2),Z=g(I),z=g(Z),B=_(Z,2);M(()=>{F(x,"aria-label",`Open image ${e.upload.filename}`),F(S,"src",e.url),F(S,"alt",e.upload.filename),P(z,e.upload.filename),F(B,"href",e.url),F(B,"download",e.upload.filename),F(B,"aria-label",`Download ${e.upload.filename}`)}),U("click",x,()=>n()(e.url,e.upload.filename)),U("click",B,V=>V.stopPropagation()),A(y,R)},T=y=>{var R=Au();let x;var S=g(R),I=g(S);ja(S,D=>m(a,D),()=>o(a));var Z=_(S,2);{var z=D=>{var J=Eu(),K=Ht(J),W=_(K,2);{var Y=ue=>{var C=Su(),ne=g(C);M(()=>P(ne,o(i))),A(ue,C)};j(W,ue=>{o(i)&&ue(Y)})}M(()=>F(K,"aria-label",`Play ${e.upload.filename}`)),U("click",K,f),A(D,J)};j(Z,D=>{o(r)||D(z)})}var B=_(Z,2),V=g(B),Q=g(V),H=_(V,2);M(()=>{x=it(R,1,"media-tile media-tile--video",null,x,{"is-started":o(r)}),S.controls=o(r),F(S,"aria-label",e.upload.filename),F(I,"src",e.url),F(I,"type",e.upload.content_type),P(Q,e.upload.filename),F(H,"href",e.url),F(H,"download",e.upload.filename),F(H,"aria-label",`Download ${e.upload.filename}`)}),Gt("play",S,l),Gt("loadedmetadata",S,u),U("click",H,D=>D.stopPropagation()),A(y,R)},b=y=>{var R=Ru(),x=_(g(R),2),S=g(x),I=g(S),Z=_(S,2),z=g(Z);M(B=>{F(R,"href",e.url),P(I,e.upload.filename),P(z,B)},[()=>p(e.upload.byte_size)]),A(y,R)};j(w,y=>{o(s)?y(v):o(c)?y(T,1):y(b,-1)})}A(t,h),Re()}Le(["click"]);var Cu=O(' '),Iu=O(' '),Du=O('');function js(t,e){Ae(e,!0);var n=Dr(),a=Ht(n);{var r=i=>{var s=Du();let c;var l=_(g(s),2),u=g(l),f=g(u),p=_(u,2);{var h=v=>{var T=Cu(),b=g(T);M(y=>P(b,y),[()=>Sa(e.message.quoted_body_snapshot)]),A(v,T)},w=v=>{var T=Iu(),b=g(T);M(y=>P(b,`[original deleted] ${y??""}`),[()=>Sa(e.message.quoted_body_snapshot)]),A(v,T)};j(p,v=>{e.message.quoted_message_id?v(h):v(w,-1)})}M((v,T)=>{c=it(s,1,"quote-block",null,c,{dangling:!e.message.quoted_message_id}),s.disabled=!e.message.quoted_message_id,F(s,"aria-label",v),P(f,T)},[()=>e.message.quoted_message_id?`Jump to quoted message from ${hi(e.message)}`:"Original message was deleted",()=>hi(e.message)]),U("click",s,()=>e.onJump(e.message)),A(i,s)};j(a,i=>{(e.message.quoted_message_id||e.message.quoted_body_snapshot)&&i(r)})}A(t,n),Re()}Le(["click"]);var Ou=O('
    '),Lu=O('
    ');function Mu(t,e){Ae(e,!0);var n=Lu();let a;var r=g(n),i=g(r),s=_(r,2),c=g(s);js(c,{get message(){return e.message},get onJump(){return e.onJumpToQuote}});var l=_(c,2);xa(l,()=>Da(e.message.body),!0);var u=_(l,2);{var f=v=>{var T=Ou();gt(T,21,()=>e.message.attachments,b=>b.id,(b,y)=>{{let R=xt(()=>Vr(o(y)));Oa(b,{get upload(){return o(y)},get url(){return o(R)},get onOpenImage(){return e.onOpenImage}})}}),A(v,T)};j(u,v=>{e.message.attachments?.length&&v(f)})}var p=_(s,2),h=g(p),w=_(h,2);M((v,T)=>{a=it(n,1,"message-row",null,a,{selected:e.selected}),F(n,"data-message-id",e.message.id),P(i,v),F(w,"data-tooltip",T)},[()=>e.index===0?"":Sr(e.message.created_at),()=>tc(e.message,e.selectedThreadID)]),U("click",h,()=>e.onReply(e.message,e.replyContext)),U("click",w,()=>e.onOpenThread(e.message)),A(t,n),Re()}Le(["click"]);var Nu=O(''),Pu=O(" "),Uu=O('
    ');function zu(t,e){Ae(e,!0);var n=Uu(),a=g(n),r=g(a);{var i=b=>{var y=Nu();M(()=>F(y,"src",e.group.authorAvatarURL)),A(b,y)},s=b=>{var y=Qe();M(R=>P(y,R),[()=>$t(e.group.authorName)]),A(b,y)};j(r,b=>{e.group.authorAvatarURL?b(i):b(s,-1)})}var c=_(a,2),l=g(c),u=g(l),f=g(u),p=_(u,2);{var h=b=>{var y=Pu(),R=g(y);M(x=>P(R,x),[()=>fn(e.group.authorHandle)]),A(b,y)};j(p,b=>{e.group.authorHandle&&b(h)})}var w=_(p,2),v=g(w),T=_(l,2);gt(T,19,()=>e.group.messages,b=>b.id,(b,y,R)=>{{let x=xt(()=>e.selectedThreadID===o(y).id);Mu(b,{get message(){return o(y)},get index(){return o(R)},get selected(){return o(x)},get replyContext(){return e.replyContext},get selectedThreadID(){return e.selectedThreadID},get onReply(){return e.onReply},get onOpenThread(){return e.onOpenThread},get onJumpToQuote(){return e.onJumpToQuote},get onOpenImage(){return e.onOpenImage}})}}),M((b,y)=>{Kt(a,`--hue: ${b??""}deg`),F(a,"aria-label",`View profile for ${e.group.authorName}`),P(f,e.group.authorName),P(v,y)},[()=>en(e.group.authorID),()=>Sr(e.group.timestamp)]),U("click",a,()=>e.onOpenProfile(e.group.messages[0]?.author)),U("click",u,()=>e.onOpenProfile(e.group.messages[0]?.author)),A(t,n),Re()}Le(["click"]);var Fu=O('
    Send a message in Markdown — code fences, lists, links all work. Threads open from any message.
    '),Bu=O('
    '),Hu=O(" ",1),Gu=O('
    ');function Wu(t,e){Ae(e,!0);let n=ht(null),a=xt(()=>rc(e.messages)),r=xt(()=>e.selectedDirect?"dm":"channel");wr(()=>(e.onListRef(o(n)),()=>e.onListRef(null)));var i=Gu(),s=g(i);{var c=u=>{var f=Fu(),p=g(f),h=g(p);{var w=S=>{var I=Qe("@");A(S,I)},v=S=>{var I=Qe("#");A(S,I)};j(h,S=>{e.selectedDirect?S(w):S(v,-1)})}var T=_(p,2),b=g(T);{var y=S=>{var I=Qe();M(Z=>P(I,`This is the start of your conversation with ${Z??""}.`),[()=>xr(e.selectedDirect,e.currentUserID)]),A(S,I)},R=S=>{var I=Qe();M(()=>P(I,`Welcome to #${e.selectedChannel.name??""}!`)),A(S,I)},x=S=>{var I=Qe("Pick a channel to get started.");A(S,I)};j(b,S=>{e.selectedDirect?S(y):e.selectedChannel?S(R,1):S(x,-1)})}A(u,f)};j(s,u=>{e.messages.length===0&&u(c)})}var l=_(s,2);gt(l,17,()=>o(a),u=>u.key,(u,f)=>{var p=Hu(),h=Ht(p);{var w=T=>{var b=Bu(),y=g(b),R=g(y);M(()=>P(R,o(f).dayLabel)),A(T,b)};j(h,T=>{o(f).dayLabel&&T(w)})}var v=_(h,2);zu(v,{get group(){return o(f)},get selectedThreadID(){return e.selectedThreadID},get replyContext(){return o(r)},get onOpenProfile(){return e.onOpenProfile},get onReply(){return e.onReply},get onOpenThread(){return e.onOpenThread},get onJumpToQuote(){return e.onJumpToQuote},get onOpenImage(){return e.onOpenImage}}),A(u,p)}),ja(i,u=>m(n,u),()=>o(n)),U("pointerdown",i,function(...u){e.onActivateMessageComposer?.apply(this,u)}),U("pointerup",i,function(...u){e.onInlineImagePointerUp?.apply(this,u)}),A(t,i),Re()}Le(["pointerdown","pointerup"]);var qu=O('
    '),ju=O('
    '),Zu=O('');function Yu(t,e){Ae(e,!0);var n=Zu(),a=_(g(n),4),r=g(a);gt(r,17,()=>e.workspaces,l=>l.id,(l,u)=>{var f=qu();let p;var h=g(f),w=g(h),v=g(w);M(T=>{p=it(f,1,"guild-wrap",null,p,{active:o(u).id===e.selectedWorkspaceID}),F(h,"title",o(u).name),P(v,T)},[()=>No(o(u).name)]),U("click",h,()=>e.onSelectWorkspace(o(u).id)),A(l,f)});var i=_(r,2),s=_(a,2);{var c=l=>{var u=ju(),f=g(u);M(()=>Vt(f,e.workspaceName)),Gt("submit",u,p=>{p.preventDefault(),e.onCreateWorkspace()}),U("input",f,p=>e.onWorkspaceName(p.currentTarget.value)),A(l,u)};j(s,l=>{e.showWorkspaceCreate&&l(c)})}U("click",i,function(...l){e.onToggleWorkspaceCreate?.apply(this,l)}),A(t,n),Re()}Le(["click","input"]);var Xu=O(''),Qu=O(''),Vu=O('');function Ju(t,e){Ae(e,!0);var n=Vu(),a=_(g(n),2),r=g(a);gt(r,17,()=>e.channels,u=>u.id,(u,f)=>{var p=Xu();let h;var w=_(g(p),2),v=g(w);M(()=>{h=it(p,1,"nav-item channel",null,h,{active:o(f).id===e.selectedChannelID&&!e.selectedDirectID}),P(v,o(f).name)}),U("click",p,()=>e.onSelectChannel(o(f).id)),A(u,p)});var i=_(r,2);{var s=u=>{var f=Qu();A(u,f)};j(i,u=>{e.channels.length===0&&u(s)})}var c=_(a,2),l=g(c);M(()=>Vt(l,e.channelName)),Gt("submit",c,u=>{u.preventDefault(),e.onCreateChannel()}),U("input",l,u=>e.onChannelName(u.currentTarget.value)),A(t,n),Re()}Le(["click","input"]);var Ku=O(''),$u=O(''),ef=O(''),tf=O('');function nf(t,e){Ae(e,!0);var n=tf(),a=_(g(n),2),r=g(a);gt(r,17,()=>e.conversations,u=>u.id,(u,f)=>{const p=xt(()=>Po(o(f),e.currentUserID));var h=$u();let w;var v=g(h),T=g(v);{var b=S=>{var I=Ku();M(()=>F(I,"src",o(p).avatar_url)),A(S,I)},y=S=>{var I=Qe();M(Z=>P(I,Z),[()=>$t(o(p)?.display_name)]),A(S,I)};j(T,S=>{o(p)?.avatar_url?S(b):S(y,-1)})}var R=_(v,2),x=g(R);M((S,I)=>{w=it(h,1,"nav-item dm",null,w,{active:o(f).id===e.selectedDirectID}),Kt(v,`--hue: ${S??""}deg`),P(x,I)},[()=>en(o(p)?.id||o(f).id),()=>xr(o(f),e.currentUserID)]),U("click",h,()=>e.onSelectDirect(o(f).id)),A(u,h)});var i=_(r,2);{var s=u=>{var f=ef();A(u,f)};j(i,u=>{e.conversations.length===0&&u(s)})}var c=_(a,2),l=g(c);M(()=>Vt(l,e.directMemberID)),Gt("submit",c,u=>{u.preventDefault(),e.onCreateDirect()}),U("input",l,u=>e.onDirectMemberID(u.currentTarget.value)),A(t,n),Re()}Le(["click","input"]);var rf=O(''),af=O(''),sf=O(''),lf=O(''),of=O(''),cf=O('');function uf(t,e){Ae(e,!0);var n=cf(),a=g(n),r=g(a),i=g(r),s=g(i),c=_(i,2);let l;var u=g(c),f=_(r,2),p=g(f),h=g(p),w=_(a,2),v=g(w);Ju(v,{get channels(){return e.channels},get selectedChannelID(){return e.selectedChannelID},get selectedDirectID(){return e.selectedDirectID},get channelName(){return e.channelName},get onSelectChannel(){return e.onSelectChannel},get onChannelName(){return e.onChannelName},get onCreateChannel(){return e.onCreateChannel}});var T=_(v,2);{let z=xt(()=>e.currentUser?.id);nf(T,{get conversations(){return e.directConversations},get currentUserID(){return o(z)},get selectedDirectID(){return e.selectedDirectID},get directMemberID(){return e.directMemberID},get onSelectDirect(){return e.onSelectDirect},get onDirectMemberID(){return e.onDirectMemberID},get onCreateDirect(){return e.onCreateDirect}})}var b=_(T,2),y=_(g(b),2),R=g(y);gt(R,17,()=>e.recentPeople,z=>z.id,(z,B)=>{const V=xt(()=>zo(e.directConversations,o(B).id));var Q=af();let H;var D=g(Q),J=g(D);{var K=C=>{var ne=rf();M(()=>F(ne,"src",o(B).avatar_url)),A(C,ne)},W=C=>{var ne=Qe();M(ke=>P(ne,ke),[()=>$t(o(B).display_name)]),A(C,ne)};j(J,C=>{o(B).avatar_url?C(K):C(W,-1)})}var Y=_(D,2),ue=g(Y);M(C=>{H=it(Q,1,"nav-item dm",null,H,{active:o(V)?.id===e.selectedDirectID||e.selectedProfile?.id===o(B).id}),Kt(D,`--hue: ${C??""}deg`),P(ue,o(B).display_name)},[()=>en(o(B).id)]),U("click",Q,()=>{o(V)?e.onSelectDirect(o(V).id):e.onOpenProfile(o(B))}),A(z,Q)});var x=_(R,2);{var S=z=>{var B=sf();A(z,B)};j(x,z=>{e.recentPeople.length===0&&z(S)})}var I=_(w,2);{var Z=z=>{var B=of(),V=g(B),Q=g(V);{var H=C=>{var ne=lf();M(()=>F(ne,"src",e.currentUser.avatar_url)),A(C,ne)},D=C=>{var ne=Qe();M(ke=>P(ne,ke),[()=>$t(e.currentUser.display_name)]),A(C,ne)};j(Q,C=>{e.currentUser.avatar_url?C(H):C(D,-1)})}var J=_(V,2),K=g(J),W=g(K),Y=_(K,2),ue=g(Y);M((C,ne,ke)=>{F(B,"aria-label",C),Kt(V,`--hue: ${ne??""}deg`),P(W,e.currentUser.display_name),P(ue,ke)},[()=>`Account settings for ${e.currentUser.display_name} ${fn(e.currentUser.handle)}`,()=>en(e.currentUser.id),()=>e.currentUser.handle?fn(e.currentUser.handle):e.connected?"Active":"Reconnecting…"]),U("click",B,function(...C){e.onOpenSettings?.apply(this,C)}),U("contextmenu",B,C=>{C.preventDefault(),e.onOpenSettings()}),A(z,B)};j(I,z=>{e.currentUser&&z(Z)})}M(()=>{P(s,e.workspaceName||"Pick a workspace"),l=it(c,1,"presence",null,l,{online:e.connected}),P(u,e.connected?"Connected":e.status),F(f,"aria-label",e.sidebarCollapsed?"Expand sidebar":"Collapse sidebar"),F(f,"title",e.sidebarCollapsed?"Expand sidebar":"Collapse sidebar"),F(h,"d",e.sidebarCollapsed?"m9 6 6 6-6 6":"m15 6-6 6 6 6")}),U("click",f,function(...z){e.onToggleCollapse?.apply(this,z)}),A(t,n),Re()}Le(["click","contextmenu"]);var ff=O(''),df=O(" "),hf=O(''),pf=O(''),gf=O(''),vf=O('

    Profile

    Active
    Contact information
    Handle
    User ID
    About

    ',1);function mf(t,e){Ae(e,!0);var n=vf(),a=Ht(n),r=g(a),i=_(g(r),2),s=g(i),c=_(r,2),l=_(a,2),u=g(l),f=g(u),p=g(f);{var h=q=>{var ae=ff();M(()=>F(ae,"src",e.profile.avatar_url)),A(q,ae)},w=q=>{var ae=Qe();M(ve=>P(ae,ve),[()=>$t(e.profile.display_name)]),A(q,ae)};j(p,q=>{e.profile.avatar_url?q(h):q(w,-1)})}var v=_(u,2),T=g(v),b=g(T),y=g(b),R=g(y),x=_(y,2);{var S=q=>{var ae=df(),ve=g(ae);M(st=>P(ve,st),[()=>fn(e.profile.handle)]),A(q,ae)};j(x,q=>{e.profile.handle&&q(S)})}var I=_(b,2);{var Z=q=>{var ae=hf();U("click",ae,function(...ve){e.onEdit?.apply(this,ve)}),A(q,ae)};j(I,q=>{e.currentUser?.id===e.profile.id&&q(Z)})}var z=_(T,4),B=g(z);{var V=q=>{var ae=pf();U("click",ae,()=>e.onMessage(e.profile.id)),A(q,ae)};j(B,q=>{e.currentUser?.id!==e.profile.id&&q(V)})}var Q=_(B,2),H=_(z,2),D=g(H),J=_(g(D),2);{var K=q=>{var ae=gf();U("click",ae,function(...ve){e.onEdit?.apply(this,ve)}),A(q,ae)};j(J,q=>{e.currentUser?.id===e.profile.id&&q(K)})}var W=_(D,2),Y=_(g(W),2),ue=_(g(Y),2),C=g(ue),ne=_(W,2),ke=_(g(ne),2),re=_(g(ke),2),vt=g(re),se=_(H,2),je=_(g(se),2),le=g(je);M((q,ae)=>{P(s,e.profile.display_name),Kt(u,`--hue: ${q??""}deg`),P(R,e.profile.display_name),P(C,ae),P(vt,e.profile.id),P(le,`Member of ${(e.workspaceName||"this workspace")??""}. Click Message to keep the conversation in your sidebar.`)},[()=>en(e.profile.id),()=>e.profile.handle?fn(e.profile.handle):"No handle set"]),U("click",c,function(...q){e.onClose?.apply(this,q)}),U("click",Q,function(...q){e.onSetStatus?.apply(this,q)}),A(t,n),Re()}Le(["click"]);var _f=O(''),bf=O("

    "),kf=O('');function yf(t,e){Ae(e,!0);var n=kf(),a=g(n),r=_(a,2),i=g(r),s=_(g(i),2),c=_(i,2),l=g(c),u=g(l),f=g(u);{var p=D=>{var J=_f();M(()=>F(J,"src",e.avatarURL)),A(D,J)},h=D=>{var J=Qe();M(K=>P(J,K),[()=>$t(e.displayName)]),A(D,J)};j(f,D=>{e.avatarURL?D(p):D(h,-1)})}var w=_(u,2),v=g(w),T=g(v),b=_(v,2),y=g(b),R=_(l,2),x=_(g(R),2),S=_(R,2),I=_(g(S),2),Z=_(S,2),z=_(g(Z),2),B=_(Z,2);{var V=D=>{var J=bf();let K;var W=g(J);M(()=>{K=it(J,1,"profile-status",null,K,{error:e.statusError}),P(W,e.status)}),A(D,J)};j(B,D=>{e.status&&D(V)})}var Q=_(B,2),H=g(Q);M((D,J)=>{Kt(u,`--hue: ${D??""}deg`),P(T,e.displayName||e.user.display_name),P(y,J),Vt(x,e.displayName),Vt(I,e.handle),Vt(z,e.avatarURL)},[()=>en(e.user.id),()=>e.handle||fn(e.user.handle)||"No handle set"]),U("click",a,function(...D){e.onClose?.apply(this,D)}),U("click",s,function(...D){e.onClose?.apply(this,D)}),Gt("submit",c,D=>{D.preventDefault(),e.onSave()}),U("input",x,D=>e.onDisplayName(D.currentTarget.value)),U("input",I,D=>e.onHandle(D.currentTarget.value)),U("input",z,D=>e.onAvatarURL(D.currentTarget.value)),U("click",H,function(...D){e.onClose?.apply(this,D)}),A(t,n),Re()}Le(["click","input"]);var wf=O(''),Tf=O(''),xf=O('
    ');function Sf(t,e){Ae(e,!0);var n=Dr(),a=Ht(n);{var r=i=>{var s=xf(),c=g(s),l=g(c),u=g(l),f=_(l,2),p=_(c,2);gt(p,17,()=>e.results,h=>h.message.id,(h,w)=>{var v=Tf(),T=g(v),b=g(T);{var y=H=>{var D=wf();M(()=>F(D,"src",o(w).message.author.avatar_url)),A(H,D)},R=H=>{var D=Qe();M(J=>P(D,J),[()=>$t(o(w).message.author?.display_name)]),A(H,D)};j(b,H=>{o(w).message.author?.avatar_url?H(y):H(R,-1)})}var x=_(T,2),S=g(x),I=g(S),Z=g(I),z=_(I,2),B=g(z),V=_(S,2),Q=g(V);M((H,D)=>{Kt(T,`--hue: ${H??""}deg`),P(Z,o(w).message.author?.display_name||"Local User"),P(B,D),P(Q,o(w).message.body)},[()=>en(o(w).message.author?.id||o(w).message.author_id||"x"),()=>Sr(o(w).message.created_at)]),U("click",v,()=>e.onOpenResult(o(w))),A(h,v)}),M(()=>P(u,`${e.results.length??""} ${e.results.length===1?"result":"results"}`)),U("click",f,function(...h){e.onClose?.apply(this,h)}),A(i,s)};j(a,i=>{e.results.length>0&&i(r)})}A(t,n),Re()}Le(["click"]);var Ef=O(''),Af=O(" "),Rf=O('
    '),Cf=O(''),If=O(" "),Df=O('
    '),Of=O('
    '),Lf=O('

    Thread

    ',1);function Mf(t,e){Ae(e,!0);var n=Lf(),a=Ht(n),r=g(a),i=_(g(r),2),s=g(i),c=_(r,2),l=_(a,2),u=g(l),f=g(u),p=g(f);{var h=W=>{var Y=Ef();M(()=>F(Y,"src",e.root.author.avatar_url)),A(W,Y)},w=W=>{var Y=Qe();M(ue=>P(Y,ue),[()=>$t(e.root.author?.display_name)]),A(W,Y)};j(p,W=>{e.root.author?.avatar_url?W(h):W(w,-1)})}var v=_(f,2),T=g(v),b=g(T),y=g(b),R=_(b,2);{var x=W=>{var Y=Af(),ue=g(Y);M(C=>P(ue,C),[()=>fn(e.root.author.handle)]),A(W,Y)};j(R,W=>{e.root.author?.handle&&W(x)})}var S=_(R,2),I=g(S),Z=_(S,2),z=_(T,2);xa(z,()=>Da(e.root.body),!0);var B=_(z,2);{var V=W=>{var Y=Rf();gt(Y,21,()=>e.root.attachments,ue=>ue.id,(ue,C)=>{{let ne=xt(()=>Vr(o(C)));Oa(ue,{get upload(){return o(C)},get url(){return o(ne)},get onOpenImage(){return e.onOpenImage}})}}),A(W,Y)};j(B,W=>{e.root.attachments?.length&&W(V)})}var Q=_(u,2),H=g(Q),D=g(H),J=_(Q,2);gt(J,21,()=>e.replies,W=>W.id,(W,Y)=>{var ue=Of(),C=g(ue),ne=g(C);{var ke=me=>{var Ce=Cf();M(()=>F(Ce,"src",o(Y).author.avatar_url)),A(me,Ce)},re=me=>{var Ce=Qe();M(lt=>P(Ce,lt),[()=>$t(o(Y).author?.display_name)]),A(me,Ce)};j(ne,me=>{o(Y).author?.avatar_url?me(ke):me(re,-1)})}var vt=_(C,2),se=g(vt),je=g(se),le=g(je),q=_(je,2);{var ae=me=>{var Ce=If(),lt=g(Ce);M(ot=>P(lt,ot),[()=>fn(o(Y).author.handle)]),A(me,Ce)};j(q,me=>{o(Y).author?.handle&&me(ae)})}var ve=_(q,2),st=g(ve),de=_(ve,2),Se=_(se,2);js(Se,{get message(){return o(Y)},get onJump(){return e.onJumpToQuote}});var qt=_(Se,2);xa(qt,()=>Da(o(Y).body),!0);var $e=_(qt,2);{var ye=me=>{var Ce=Df();gt(Ce,21,()=>o(Y).attachments,lt=>lt.id,(lt,ot)=>{{let tn=xt(()=>Vr(o(ot)));Oa(lt,{get upload(){return o(ot)},get url(){return o(tn)},get onOpenImage(){return e.onOpenImage}})}}),A(me,Ce)};j($e,me=>{o(Y).attachments?.length&&me(ye)})}M((me,Ce)=>{F(ue,"data-message-id",o(Y).id),Kt(C,`--hue: ${me??""}deg`),P(le,o(Y).author?.display_name||"Local User"),P(st,Ce)},[()=>en(o(Y).author?.id||o(Y).author_id||"x"),()=>Sr(o(Y).created_at)]),U("click",de,()=>e.onSetReplyTarget(o(Y),"thread")),A(W,ue)});var K=_(l,2);Is(K,{get value(){return e.replyBody},placeholder:"Reply in thread",ariaLabel:"Reply body",submitLabel:"Reply",formClass:"composer reply-composer",get replyTarget(){return e.replyTarget},get onValue(){return e.onReplyBody},get onSubmit(){return e.onSubmitReply},get onKeydown(){return e.onReplyKeydown},get onFocus(){return e.onReplyFocus},get onInputRef(){return e.onReplyInputRef},get onClearReply(){return e.onClearReply}}),M((W,Y)=>{P(s,`${e.threadState?.reply_count??e.replies.length??""} ${(e.threadState?.reply_count??e.replies.length)===1?"reply":"replies"}`),F(u,"data-message-id",e.root.id),Kt(f,`--hue: ${W??""}deg`),P(y,e.root.author?.display_name||"Local User"),P(I,Y),P(D,`${e.replies.length??""} ${e.replies.length===1?"reply":"replies"}`)},[()=>en(e.root.author?.id||e.root.author_id||"x"),()=>Sr(e.root.created_at)]),U("click",c,function(...W){e.onClose?.apply(this,W)}),U("pointerdown",l,function(...W){e.onActivateThreadComposer?.apply(this,W)}),U("pointerup",l,function(...W){e.onInlineImagePointerUp?.apply(this,W)}),U("click",Z,()=>e.onSetReplyTarget(e.root,"thread")),A(t,n),Re()}Le(["click","pointerdown","pointerup"]);var Nf=O('

    '),Pf=O('

    '),Uf=O('

    ClickClack

    '),zf=O(''),Ff=O('

    ');function Bf(t,e){Ae(e,!0);var n=Ff(),a=g(n),r=g(a);{var i=R=>{var x=Nf(),S=g(x);M(I=>P(S,I),[()=>`@${xr(e.selectedDirect,e.currentUserID)}`]),A(R,x)},s=R=>{var x=Pf(),S=g(x);M(()=>P(S,`#${e.selectedChannel.name}`)),A(R,x)},c=R=>{var x=Uf();A(R,x)};j(r,R=>{e.selectedDirect?R(i):e.selectedChannel?R(s,1):R(c,-1)})}var l=_(r,4),u=g(l),f=_(a,2),p=_(g(f),2),h=_(p,2);{var w=R=>{var x=zf();U("click",x,function(...S){e.onResetSearch?.apply(this,S)}),A(R,x)};j(h,R=>{e.searchQuery&&R(w)})}var v=_(f,2),T=g(v);let b;var y=_(T,2);M(()=>{P(u,e.workspaceName||"no workspace"),Vt(p,e.searchQuery),F(T,"title",e.threadOpen?"Close thread":"Open a message thread"),F(T,"aria-label",e.threadOpen?"Close thread":"Open a message thread"),b=it(T,1,"",null,b,{active:e.sidePanelOpen})}),Gt("submit",f,R=>{R.preventDefault(),e.onSearch()}),U("input",p,R=>e.onSearchQuery(R.currentTarget.value)),U("click",T,function(...R){e.onToggleThread?.apply(this,R)}),U("click",y,function(...R){e.onPinnedItems?.apply(this,R)}),A(t,n),Re()}Le(["input","click"]);var Hf=O(''),Gf=O(`
    cc
    ClickClack OpenClaw workspace chat

    Welcome back.

    Workspace chat for the OpenClaw crew. Sign in with the GitHub account that's a member of the org.

    Limited to active members of the OpenClaw org.

    `),Wf=O(''),qf=O('
    No thread open Hover any message and tap the bubble to keep side conversations tidy.
    '),jf=O('
    ',1);function Zf(t,e){Ae(e,!1);const n=X(),a=X(),r=X(),i=X(),s=X(),c=X();let l=X(null),u=X([]),f=X([]),p=X([]),h=X([]),w=X([]),v=X(""),T=X(""),b=X(""),y=X(null),R=X(null),x=X(null),S=X(null),I=X(""),Z=X(""),z=X(""),B=X(""),V=X(""),Q=X(""),H=X([]),D=X(null),J=X(!1),K=X(!1),W=X(""),Y=X(""),ue=X(""),C=X(""),ne=X(""),ke=X(!1),re=X("loading"),vt=X(!1),se=null,je=X(!1),le,q=X(null),ae=X(!1),ve=X(!1),st=X(!1),de=X(null),Se=X(null),qt=X(null),$e=X(null),ye=X("message");Rs(()=>{me()}),Do(()=>{const k=se;se=null,m(je,!1),k?.close(),le&&window.clearTimeout(le)});async function me(){try{const k=await Fe("/api/me");m(l,k.user),await ot(),m(re,"ready")}catch(k){if(k instanceof Cs&&(k.status===401||k.status===403)){m(vt,!0),m(re,"auth");return}m(re,k instanceof Error?k.message:"Could not load ClickClack")}}function Ce(){o(l)&&(m(Y,o(l).display_name),m(ue,o(l).handle?`@${o(l).handle}`:""),m(C,o(l).avatar_url),m(ne,""),m(ke,!1),m(K,!0))}async function lt(){m(ne,""),m(ke,!1);try{const k=await Fe("/api/me",{method:"PATCH",body:JSON.stringify({display_name:o(Y),handle:o(ue),avatar_url:o(C)})});m(l,k.user),m(h,o(h).map(L=>L.author?.id===o(l)?.id?{...L,author:k.user}:L)),m(w,o(w).map(L=>L.author?.id===o(l)?.id?{...L,author:k.user}:L)),o(y)?.author?.id===o(l).id&&m(y,{...o(y),author:k.user}),m(ne,"Saved"),m(K,!1)}catch(k){m(ne,k instanceof Error?k.message:"Could not save profile"),m(ke,!0)}}async function ot(){const k=await Fe("/api/workspaces");m(u,k.workspaces),m(v,o(v)||o(u)[0]?.id||""),await dn(),await pn(),o(u).length===0&&m(re,"create a workspace"),Mn()}async function tn(){if(!o(z).trim())return;const k=await Fe("/api/workspaces",{method:"POST",body:JSON.stringify({name:o(z)})});m(z,""),m(ae,!1),m(u,[...o(u),k.workspace]),m(v,k.workspace.id),await dn(),await pn(),Mn()}async function Dn(k){m(v,k),await dn(),await pn(),Mn()}async function dn(){if(!o(v))return;const k=await Fe(`/api/workspaces/${o(v)}/channels`);m(f,k.channels),m(T,o(f).find(L=>L.id===o(T))?.id||o(f)[0]?.id||""),m(y,null),m(x,null),m(ye,"message"),m(w,[]),await et()}async function Lr(){if(!o(v)||!o(B).trim())return;const k=await Fe(`/api/workspaces/${o(v)}/channels`,{method:"POST",body:JSON.stringify({name:o(B),kind:"public"})});m(B,""),m(f,[...o(f),k.channel]),m(T,k.channel.id),m(b,""),await et()}async function Mr(k){m(T,k),m(b,""),m(y,null),m(x,null),m(ye,"message"),m(st,!1),await et()}async function et(){if(o(b)){const L=await Fe(`/api/dms/${o(b)}/messages`);m(h,L.messages),await jt();return}if(!o(T)){m(h,[]);return}const k=await Fe(`/api/channels/${o(T)}/messages`);m(h,k.messages),await jt()}async function jt(){await si(),o(q)&&Ql(q,o(q).scrollTop=o(q).scrollHeight)}async function Zt(){const k=o(I).trim();if(!k)return;if(!o(T)&&!o(b)){m(re,"pick or create a channel");return}const L=o(b)?"dm":"channel",fe=o(de)&&o(Se)===L?o(de):null;m(I,"");const be=o(b)?`/api/dms/${o(b)}/messages`:`/api/channels/${o(T)}/messages`,We={body:k};fe&&(We.quoted_message_id=fe.id);const Rt=await Fe(be,{method:"POST",body:JSON.stringify(We)});let _t=Rt.message;if(fe&&tt(),o(D)){const bt=o(D);await Fe(`/api/messages/${Rt.message.id}/attachments`,{method:"POST",body:JSON.stringify({upload_id:bt.id})}),m(D,null),_t={..._t,attachments:[..._t.attachments||[],bt]}}o(h).some(bt=>bt.id===_t.id)?m(h,o(h).map(bt=>bt.id===_t.id?_t:bt)):m(h,[...o(h),_t]),await jt()}async function ct(k){m(x,null),m(y,k),m(ye,"thread");const L=await Fe(`/api/messages/${k.id}/thread`);m(y,L.root),m(w,L.replies),m(R,L.thread_state)}async function On(){const k=o(Z).trim();if(!k||!o(y))return;const L=o(de)&&o(Se)==="thread"?o(de):null;m(Z,"");const fe={body:k};L&&(fe.quoted_message_id=L.id);const be=await Fe(`/api/messages/${o(y).id}/thread/replies`,{method:"POST",body:JSON.stringify(fe)});L&&tt(),o(w).some(We=>We.id===be.message.id)||m(w,[...o(w),be.message]),m(R,be.thread_state)}function Kn(k,L){m(de,k),m(Se,L),m(ye,L==="thread"?"thread":"message")}function $n(){return o(S)!==null||o(K)}function er(){return o(ye)==="thread"&&o(y)&&o($e)?o($e):o(qt)}function tt(){m(de,null),m(Se,null)}async function hn(k){const L=k.quoted_message_id;if(!L)return;await si();const fe=document.querySelector(`[data-message-id="${CSS.escape(L)}"]`);fe&&(fe.scrollIntoView({behavior:"smooth",block:"center"}),fe.classList.add("highlight"),window.setTimeout(()=>fe.classList.remove("highlight"),1500))}async function Ln(){if(!o(v)||!o(Q).trim()){m(H,[]);return}const k=await Fe(`/api/search?workspace_id=${encodeURIComponent(o(v))}&q=${encodeURIComponent(o(Q).trim())}`);m(H,k.results)}function mt(){m(Q,""),m(H,[])}async function nn(k){m(H,[]),k.message.channel_id&&(m(T,k.message.channel_id),m(b,""),await et()),k.message.direct_conversation_id&&(m(b,k.message.direct_conversation_id),m(T,""),await et())}async function tr(k){const L=k.currentTarget,fe=L.files?.[0];if(!fe||!o(v))return;const be=new FormData;be.set("workspace_id",o(v)),be.set("file",fe);const We=await Fe("/api/uploads",{method:"POST",body:be});m(D,We.upload),L.value=""}async function pn(){if(!o(v))return;const k=await Fe(`/api/dms?workspace_id=${o(v)}`);m(p,k.conversations)}async function aa(){if(!o(v)||!o(V).trim())return;const k=await Fe("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:o(v),member_ids:[o(V).trim()]})});m(V,""),m(p,[...o(p),k.conversation]),m(b,k.conversation.id),m(T,""),m(y,null),m(x,null),m(ye,"message"),await et()}async function nr(k){m(b,k),m(T,""),m(y,null),m(x,null),m(ye,"message"),m(st,!1),await et()}async function rr(k){if(!o(v)||!k)return;const L=o(p).find(be=>be.members.some(We=>We.id===k));if(L){m(b,L.id),m(T,""),m(y,null),m(x,null),m(ye,"message"),await et();return}const fe=await Fe("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:o(v),member_ids:[k]})});m(p,[...o(p),fe.conversation]),m(b,fe.conversation.id),m(T,""),m(y,null),m(x,null),m(ye,"message"),await et()}function Mn(){le&&window.clearTimeout(le);const k=se;if(se=null,m(je,!1),k?.close(),!o(v))return;const L=localStorage.getItem(`clickclack:${o(v)}:cursor`)||"",fe=new URL("/api/realtime/ws",window.location.href);fe.protocol=window.location.protocol==="https:"?"wss:":"ws:",fe.searchParams.set("workspace_id",o(v)),L&&fe.searchParams.set("after_cursor",L);const be=new WebSocket(fe);se=be,be.addEventListener("open",()=>{se===be&&m(je,!0)}),be.addEventListener("message",We=>{const Rt=JSON.parse(String(We.data));Rt.cursor&&localStorage.setItem(`clickclack:${o(v)}:cursor`,Rt.cursor),gn(Rt)}),be.addEventListener("close",()=>{se===be&&(m(je,!1),le=window.setTimeout(Mn,1200))})}async function gn(k){if((k.type==="channel.created"||k.type==="channel.updated")&&k.workspace_id===o(v)){await dn();return}(k.channel_id===o(T)||k.payload.direct_conversation_id===o(b))&&(k.type==="message.created"||k.type==="message.updated"||k.type==="message.deleted")&&await et();const L=k.payload.root_message_id||k.payload.message_id;o(y)&&L===o(y).id&&await ct(o(y))}function Nr(k){k&&(m(y,null),m(x,k))}function ia(k){if(k.key==="Escape"&&o(de)&&o(Se)!=="thread"){k.preventDefault(),tt();return}k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),Zt())}function Ee(k){if(k.key==="Escape"&&o(de)&&o(Se)==="thread"){k.preventDefault(),tt();return}k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),On())}function Nt(k,L){m(S,{url:k,title:L})}function Pr(k){const L=k.target;L instanceof HTMLImageElement&&L.closest(".markdown")&&(k.preventDefault(),Nt(L.currentSrc||L.src,L.alt||"Image"))}function Nn(k){const L=o(I)&&!o(I).endsWith(` +`)?` +`:"";m(I,`${o(I)}${L}${k}`)}function ar(k,L=k){Nn(`${k}${k==="```"?` +code +`:"text"}${L}`)}function Ur(k,L){Nn(`![${L}](${k})`),m(J,!1),m(W,"")}function Pn(){o(Se)==="thread"&&tt(),m(y,null),m(x,null),m(ye,"message"),m(w,[])}function sa(){o(i)?Pn():m(re,"pick a message to open its thread")}function Ze(){m(S,null),m(K,!1)}Yt(()=>(o(u),o(v)),()=>{m(n,o(u).find(k=>k.id===o(v)))}),Yt(()=>(o(f),o(T)),()=>{m(a,o(f).find(k=>k.id===o(T)))}),Yt(()=>(o(p),o(b)),()=>{m(r,o(p).find(k=>k.id===o(b)))}),Yt(()=>(o(y),o(x)),()=>{m(i,o(y)!==null||o(x)!==null)}),Yt(()=>(o(h),o(p),o(l)),()=>{m(s,Uo(o(h),o(p),o(l)?.id||""))}),Yt(()=>(o(Se),o(de),o(h)),()=>{o(Se)==="channel"&&o(de)&&!o(h).some(k=>k.id===o(de)?.id)&&tt()}),Yt(()=>(o(Se),o(de),o(h)),()=>{o(Se)==="dm"&&o(de)&&!o(h).some(k=>k.id===o(de)?.id)&&tt()}),Yt(()=>(o(Se),o(de),o(y),o(w)),()=>{o(Se)==="thread"&&o(de)&&o(y)&&o(de).id!==o(y).id&&!o(w).some(k=>k.id===o(de)?.id)&&tt()}),Yt(()=>o(W),()=>{m(c,Mo.filter(k=>{const L=o(W).trim().toLowerCase();return!L||k.title.toLowerCase().includes(L)||k.tags.some(fe=>fe.includes(L))}))}),no(),As();var Pt=Dr();xs("1oa2eo8",k=>{var L=Hf();A(k,L)}),Gt("keydown",ba,k=>{if(k.key==="Escape"){if($n())Ze();else if(o(de)){k.preventDefault(),tt();return}}Zo(k,{authRequired:o(vt),isModalOpen:$n,messageInput:o(qt),replyInput:o($e),target:er})});var zr=Ht(Pt);{var Fr=k=>{var L=Gf();A(k,L)},ir=k=>{var L=jf(),fe=Ht(L);let be;var We=g(fe),Rt=g(We);{var _t=te=>{var pe=Qe("×");A(te,pe)},bt=te=>{var pe=Wf();A(te,pe)};j(Rt,te=>{o(st)?te(_t):te(bt,-1)})}var G=_(We,2);Yu(G,{get workspaces(){return o(u)},get selectedWorkspaceID(){return o(v)},get workspaceName(){return o(z)},get showWorkspaceCreate(){return o(ae)},onSelectWorkspace:te=>{Dn(te)},onToggleWorkspaceCreate:()=>m(ae,!o(ae)),onWorkspaceName:te=>m(z,te),onCreateWorkspace:()=>{tn()}});var d=_(G,2);{let te=dt(()=>(o(n),ze(()=>o(n)?.name)));uf(d,{get workspaceName(){return o(te)},get status(){return o(re)},get connected(){return o(je)},get sidebarCollapsed(){return o(ve)},get channels(){return o(f)},get directConversations(){return o(p)},get recentPeople(){return o(s)},get currentUser(){return o(l)},get selectedChannelID(){return o(T)},get selectedDirectID(){return o(b)},get selectedProfile(){return o(x)},get channelName(){return o(B)},get directMemberID(){return o(V)},onToggleCollapse:()=>m(ve,!o(ve)),onSelectChannel:pe=>{Mr(pe)},onChannelName:pe=>m(B,pe),onCreateChannel:()=>{Lr()},onSelectDirect:pe=>{nr(pe)},onDirectMemberID:pe=>m(V,pe),onCreateDirect:()=>{aa()},onOpenProfile:Nr,onOpenSettings:Ce})}var E=_(d,2),N=g(E);{let te=dt(()=>(o(n),ze(()=>o(n)?.name))),pe=dt(()=>(o(l),ze(()=>o(l)?.id))),Ne=dt(()=>o(y)!==null);Bf(N,{get selectedDirect(){return o(r)},get selectedChannel(){return o(a)},get workspaceName(){return o(te)},get currentUserID(){return o(pe)},get searchQuery(){return o(Q)},get sidePanelOpen(){return o(i)},get threadOpen(){return o(Ne)},onSearchQuery:Qs=>m(Q,Qs),onSearch:()=>{Ln()},onResetSearch:mt,onToggleThread:sa,onPinnedItems:()=>m(re,"no pinned items")})}var he=_(N,2);Sf(he,{get results(){return o(H)},onClose:()=>m(H,[]),onOpenResult:te=>{nn(te)}});var Me=_(he,2);{let te=dt(()=>(o(y),ze(()=>o(y)?.id))),pe=dt(()=>(o(l),ze(()=>o(l)?.id)));Wu(Me,{get messages(){return o(h)},get selectedDirect(){return o(r)},get selectedChannel(){return o(a)},get selectedThreadID(){return o(te)},get currentUserID(){return o(pe)},onListRef:Ne=>m(q,Ne),onActivateMessageComposer:()=>m(ye,"message"),onInlineImagePointerUp:Pr,onOpenProfile:Nr,onReply:Kn,onOpenThread:ct,onJumpToQuote:Ne=>{hn(Ne)},onOpenImage:Nt})}var we=_(Me,2);{let te=dt(()=>(o(r),qa(xr),o(l),o(a),ze(()=>o(r)?`Message ${xr(o(r),o(l)?.id)}`:o(a)?`Message #${o(a).name}`:"Pick a channel to start"))),pe=dt(()=>o(de)&&o(Se)===(o(b)?"dm":"channel")?o(de):null);Is(we,{get value(){return o(I)},get placeholder(){return o(te)},ariaLabel:"Message body",submitLabel:"Send",get pendingUpload(){return o(D)},get replyTarget(){return o(pe)},showUpload:!0,showToolbar:!0,get showGifPicker(){return o(J)},get gifQuery(){return o(W)},get filteredGifs(){return o(c)},onValue:Ne=>m(I,Ne),onSubmit:()=>{Zt()},onKeydown:ia,onFocus:()=>m(ye,"message"),onInputRef:Ne=>m(qt,Ne),onUploadFile:tr,onRemoveUpload:()=>m(D,null),onClearReply:tt,onApplyMarkdownWrap:ar,onAppendToComposer:Nn,onToggleGif:()=>m(J,!o(J)),onGifQuery:Ne=>m(W,Ne),onPickGif:Ur})}var Pe=_(E,2);let Ye;var ut=g(Pe);{var sr=te=>{{let pe=dt(()=>o(de)&&o(Se)==="thread"?o(de):null);Mf(te,{get root(){return o(y)},get replies(){return o(w)},get threadState(){return o(R)},get replyBody(){return o(Z)},get replyTarget(){return o(pe)},onClose:Pn,onReplyBody:Ne=>m(Z,Ne),onSubmitReply:()=>{On()},onReplyKeydown:Ee,onReplyFocus:()=>m(ye,"thread"),onReplyInputRef:Ne=>m($e,Ne),onSetReplyTarget:Kn,onClearReply:tt,onActivateThreadComposer:()=>m(ye,"thread"),onInlineImagePointerUp:Pr,onJumpToQuote:Ne=>{hn(Ne)},onOpenImage:Nt})}},Ie=te=>{{let pe=dt(()=>(o(n),ze(()=>o(n)?.name)));mf(te,{get profile(){return o(x)},get currentUser(){return o(l)},get workspaceName(){return o(pe)},onClose:Pn,onEdit:Ce,onMessage:Ne=>{rr(Ne)},onSetStatus:()=>m(re,"status messages are coming soon")})}},Br=te=>{var pe=qf();A(te,pe)};j(ut,te=>{o(y)?te(sr):o(x)?te(Ie,1):te(Br,-1)})}var lr=_(fe,2);{var Zs=te=>{yf(te,{get user(){return o(l)},get displayName(){return o(Y)},get handle(){return o(ue)},get avatarURL(){return o(C)},get status(){return o(ne)},get statusError(){return o(ke)},onDisplayName:pe=>m(Y,pe),onHandle:pe=>m(ue,pe),onAvatarURL:pe=>m(C,pe),onClose:Ze,onSave:()=>{lt()}})};j(lr,te=>{o(K)&&o(l)&&te(Zs)})}var Ys=_(lr,2);{var Xs=te=>{fc(te,{get url(){return o(S),ze(()=>o(S).url)},get title(){return o(S),ze(()=>o(S).title)},onClose:Ze})};j(Ys,te=>{o(S)&&te(Xs)})}M(()=>{be=it(fe,1,"shell",null,be,{"nav-open":o(st),"sidebar-collapsed":o(ve),"thread-open":o(i)}),Ye=it(Pe,1,"thread",null,Ye,{open:o(i)}),F(Pe,"aria-label",o(x)?"Profile pane":"Thread pane")}),U("click",We,()=>m(st,!o(st))),A(k,L)};j(zr,k=>{o(vt)?k(Fr):k(ir,-1)})}A(t,Pt),Re()}Le(["click"]);var Yf=O(' ',1),Xf=O("

    "),Qf=O(`

    Self-hostable chat. Serious tool. Mild brine.

    ClickClack

    A single-binary chat app for teams, communities, bots, and agents: + Slack-style threads, durable realtime, OpenAPI, SQLite, and a CLI that + can drive the whole thing from a shell.

    What it is

    Chat infrastructure that stays boring when the socket drops.

    WebSocket is the pipe. The database is the truth. Every durable message, + thread reply, reaction, and channel update can be recovered over HTTP with + a cursor, so clients and agents can reconnect without drama.

    Agent path

    A friendly CLI, no LLM baked in.

    External agents, CI jobs, and humans use the same public API as the web + app. Tokens and workspace defaults are scoped per server, so switching + hosts does not leak credentials or stale IDs.

     

    Destinations

    Product at the root. Docs and app where people expect them.

    `);function Vf(t,e){Ae(e,!1);const n="https://docs.clickclack.chat",a=["localhost","127.0.0.1","::1"].includes(window.location.hostname)?"/app":"https://app.clickclack.chat",r="https://github.com/openclaw/clickclack",i=[["Single binary","Go server, embedded Svelte app, embedded migrations, local SQLite and uploads."],["Threads that recover","Slack-style one-level threads with durable event replay after reconnects."],["Agent-friendly","A CLI, OpenAPI contract, TypeScript SDK, webhooks, and slash-command shapes."],["Self-host first","SQLite is the default, not the demo. Postgres can arrive behind the store layer."]],s=["clickclack serve --data ./data","clickclack login --magic-token mgt_...",'clickclack send --channel general "deploy started"',"clickclack threads reply msg_... --stdin {var J=Yf();Ba(()=>{ns.title="ClickClack - Self-hostable chat with claws"}),A(D,J)});var l=g(c),u=_(g(l),2),f=_(g(u),2),p=g(f);F(p,"href",n);var h=_(p,2),w=_(h,2);F(w,"href",r);var v=_(u,2),T=_(g(v),6),b=g(T),y=_(b,2);F(y,"href",n);var R=_(y,2);F(R,"href",r);var x=_(l,4);gt(x,5,()=>i,_o,(D,J)=>{var K=Xf(),W=g(K),Y=g(W),ue=_(W,2),C=g(ue);M(()=>{P(Y,o(J)[0]),P(C,o(J)[1])}),A(D,K)});var S=_(x,2),I=_(g(S),2),Z=g(I),z=_(S,2),B=_(g(z),2),V=_(g(B),2);F(V,"href",n);var Q=_(V,2),H=_(Q,2);F(H,"href",r),M(D=>{F(h,"href",a),F(b,"href",a),P(Z,D),F(Q,"href",a)},[()=>s.join(` +`)]),A(t,c),Re()}function Jf(t){const e=window.location.pathname,a=window.location.hostname.startsWith("app.")||e==="/app"||e.startsWith("/app/");var r=Dr(),i=Ht(r);{var s=l=>{Zf(l,{})},c=l=>{Vf(l,{})};j(i,l=>{a?l(s):l(c,-1)})}A(t,r)}po(Jf,{target:document.getElementById("app")}); diff --git a/apps/api/internal/webassets/dist/assets/index-C_U7opSQ.css b/apps/api/internal/webassets/dist/assets/index-DqdK3eqN.css similarity index 78% rename from apps/api/internal/webassets/dist/assets/index-C_U7opSQ.css rename to apps/api/internal/webassets/dist/assets/index-DqdK3eqN.css index 75eb637..eeea33f 100644 --- a/apps/api/internal/webassets/dist/assets/index-C_U7opSQ.css +++ b/apps/api/internal/webassets/dist/assets/index-DqdK3eqN.css @@ -1 +1 @@ -.product-site{min-height:100vh;background:#f7f3ea;color:#151716;font-family:Avenir Next,Segoe UI,ui-sans-serif,system-ui,sans-serif}.product-site a{color:inherit;text-decoration:none}.hero{position:relative;display:grid;min-height:clamp(680px,92vh,920px);overflow:hidden;isolation:isolate;background:linear-gradient(90deg,#0c1f23c7,#0c1f232e 62%,#0c1f23b3),#103033;color:#fff8ee}.hero:after{position:absolute;inset:auto 0 0;height:22vh;min-height:130px;background:linear-gradient(0deg,#f7f3ea 8%,#f7f3ea00);content:"";z-index:-1}.hero:before{position:absolute;inset:0 38% 0 0;background:linear-gradient(90deg,#081c1efa,#081c1e00);content:"";z-index:-1}.hero-bg{position:absolute;inset:0 0 0 clamp(260px,28vw,460px);display:grid;grid-template-columns:92px minmax(360px,1fr) minmax(260px,28vw);gap:18px;padding:102px clamp(18px,5vw,70px) 80px;opacity:.36;z-index:-2}.workspace-rail,.timeline-preview,.thread-preview{border:1px solid rgba(255,248,238,.24);background:#fff8ee1f;box-shadow:0 28px 90px #0000003d;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px)}.workspace-rail{display:grid;align-content:start;gap:14px;padding:16px}.workspace-rail span{display:grid;place-items:center;min-height:54px;border-radius:8px;background:#fff8ee2e;color:#fff8ee;font-weight:900;text-transform:uppercase}.timeline-preview{align-self:stretch;padding:clamp(18px,3vw,34px)}.preview-top{display:flex;justify-content:space-between;margin-bottom:48px;color:#b9ddd9;font-weight:800}.preview-top strong{color:#7ce0b5}.timeline-preview article,.thread-preview{max-width:720px;margin:0 0 18px;border-radius:8px;background:#fff8ee29;padding:18px}.timeline-preview b,.thread-preview span{color:#ff8a70}.timeline-preview p,.thread-preview p{margin:6px 0 0;color:#fff8ee;font-size:clamp(17px,1.8vw,24px)}.timeline-preview code{border-radius:5px;background:#0c1f2394;padding:2px 5px}.thread-line{margin-left:clamp(0px,8vw,130px)}.thread-preview{align-self:center;min-height:260px}.product-nav{position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px clamp(18px,5vw,70px);font-weight:800}.product-nav>div{display:flex;gap:clamp(14px,3vw,34px)}.brand-lockup{display:inline-flex;align-items:center;gap:10px}.brand-mark{display:grid;place-items:center;width:40px;height:40px;border-radius:8px;background:#ff6f55;color:#151716;font-weight:950;text-transform:uppercase}.hero-copy{position:relative;z-index:2;align-self:center;width:min(780px,calc(100vw - 36px));padding:0 clamp(18px,5vw,70px) 16vh}.eyebrow,.section-kicker{margin:0 0 14px;color:#ffb09f;font-size:13px;font-weight:950;letter-spacing:.08em;text-transform:uppercase}.hero h1,.product-band h2{margin:0;letter-spacing:0}.hero h1{font-family:Georgia,Times New Roman,serif;font-size:clamp(66px,13vw,152px);font-weight:900;line-height:.9}.lede{width:min(680px,100%);margin:26px 0 0;color:#fff3df;font-size:clamp(20px,2.2vw,31px);line-height:1.18}.hero-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:32px}.primary-action,.secondary-action{display:inline-flex;align-items:center;justify-content:center;min-height:48px;border-radius:8px;padding:0 18px;font-weight:950}.primary-action{background:#ff6f55;color:#151716}.secondary-action{border:1px solid rgba(255,248,238,.42);color:#fff8ee}.product-band{display:grid;grid-template-columns:minmax(260px,.9fr) minmax(280px,1.1fr);gap:clamp(28px,6vw,90px);padding:clamp(58px,8vw,112px) clamp(18px,5vw,70px)}.product-band h2{max-width:720px;font-size:clamp(34px,5vw,74px);line-height:.96}.product-band p{margin:0;color:#3f4743;font-size:clamp(18px,2.1vw,27px);line-height:1.34}.intro-band{padding-top:0}.intro-band .section-kicker,.cli-band .section-kicker,.docs-band .section-kicker{color:#b84632}.feature-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-block:1px solid #c8c0b2}.feature-grid article{min-height:250px;border-right:1px solid #c8c0b2;padding:clamp(22px,3vw,40px)}.feature-grid article:nth-child(2n){background:#e8f0e9}.feature-grid article:last-child{border-right:0}.feature-grid h3{margin:0 0 44px;font-size:24px}.feature-grid p{margin:0;color:#48504c;line-height:1.45}.cli-band{background:#162a2d;color:#fff8ee}.cli-band p{color:#c9d8d4}.cli-band pre{overflow:auto;align-self:start;margin:0;border:1px solid rgba(255,248,238,.18);border-radius:8px;background:#071314;color:#bdf1dc;padding:clamp(18px,3vw,32px);line-height:1.7}.docs-band{background:#fffaf0}.destination-list{display:grid;gap:12px}.destination-list a{display:flex;justify-content:space-between;gap:20px;border-top:1px solid #cbc2b3;padding:18px 0;font-size:clamp(21px,3vw,40px);font-weight:900}.destination-list span{color:#6f7772;font-size:15px;font-weight:700;text-align:right}@media(prefers-color-scheme:dark){.product-site{background:#101616;color:#fff8ee}.hero:after{background:linear-gradient(0deg,#101616 8%,#10161600)}.product-band p,.feature-grid p,.destination-list span{color:#bac7c3}.feature-grid{border-color:#34413e}.feature-grid article{border-color:#34413e}.feature-grid article:nth-child(2n),.docs-band{background:#182221}}@media(max-width:900px){.hero:before{inset-right:0}.hero-bg{inset:0;grid-template-columns:58px minmax(0,1fr);padding-top:90px;opacity:.38}.thread-preview{display:none}.product-band,.feature-grid{grid-template-columns:1fr}.feature-grid article,.feature-grid article:last-child{min-height:0;border-right:0;border-bottom:1px solid #c8c0b2}}@media(max-width:620px){.product-nav{align-items:flex-start;flex-direction:column}.hero{min-height:760px}.hero-bg{grid-template-columns:1fr;opacity:.42}.workspace-rail{display:none}.hero-copy{padding-bottom:90px}.destination-list a{flex-direction:column}.destination-list span{text-align:left}}:root{color-scheme:light dark;font-family:Inter,SF Pro Text,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-feature-settings:"ss01","cv11";--rail: #e9e1d7;--bg: #f7f3ed;--panel: #fffaf2;--panel-2: #efe7dc;--panel-3: #e4dbcf;--hover: rgba(16, 32, 39, .05);--hover-strong: rgba(16, 32, 39, .08);--line: rgba(16, 32, 39, .1);--line-strong: rgba(16, 32, 39, .16);--text: #22201d;--text-strong: #11100e;--muted: #6f675f;--muted-2: #958b80;--accent: #dd5d45;--accent-2: #006d77;--accent-soft: rgba(221, 93, 69, .16);--accent-glow: 0 0 0 1px rgba(221, 93, 69, .28), 0 8px 30px -12px rgba(221, 93, 69, .45);--success: #168b51;--warn: #f5b050;--danger: #c84343;--shadow: 0 24px 60px -24px rgba(16, 32, 39, .32);--radius-sm: 6px;--radius: 8px;--radius-lg: 14px;--radius-xl: 18px;background:var(--bg);color:var(--text)}@media(prefers-color-scheme:dark){:root{--rail: #0d0e12;--bg: #131419;--panel: #1a1b22;--panel-2: #20222b;--panel-3: #272a35;--hover: rgba(255, 255, 255, .04);--hover-strong: rgba(255, 255, 255, .07);--line: rgba(255, 255, 255, .07);--line-strong: rgba(255, 255, 255, .12);--text: #e7e9ee;--text-strong: #ffffff;--muted: #8a8f9c;--muted-2: #5d626d;--accent: #6f7eff;--accent-2: #5666ee;--accent-soft: rgba(111, 126, 255, .18);--accent-glow: 0 0 0 1px rgba(111, 126, 255, .4), 0 8px 30px -12px rgba(111, 126, 255, .6);--success: #2ecc71;--warn: #f5b050;--danger: #ff6b6b;--shadow: 0 24px 60px -20px rgba(0, 0, 0, .6)}}*{box-sizing:border-box}html,body{margin:0;padding:0;height:100%}body{background:radial-gradient(1000px 600px at 0% 0%,rgba(111,126,255,.08),transparent 60%),radial-gradient(900px 700px at 100% 100%,rgba(255,130,200,.05),transparent 60%),var(--bg);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}button,input,textarea{font:inherit;color:inherit}button{cursor:pointer}input,textarea{background:transparent;border:0;outline:0}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:#ffffff0f;border-radius:999px;border:2px solid transparent;background-clip:content-box}::-webkit-scrollbar-thumb:hover{background:#ffffff1f;background-clip:content-box}.auth-shell{display:grid;min-height:100vh;place-items:center;padding:32px;background:radial-gradient(700px 500px at 30% 20%,rgba(111,126,255,.18),transparent 60%),radial-gradient(700px 500px at 80% 90%,rgba(255,110,196,.12),transparent 60%),var(--bg)}.auth-panel{display:grid;gap:22px;width:min(100%,440px);border:1px solid var(--line-strong);border-radius:var(--radius-xl);background:linear-gradient(180deg,#ffffff0a,#fff0) var(--panel);box-shadow:var(--shadow);padding:36px}.auth-brand{display:flex;align-items:center;gap:12px}.auth-brand .mark{width:44px;height:44px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(135deg,var(--accent),#b46cff);color:#fff;font-weight:800;letter-spacing:-.02em;box-shadow:0 10px 24px -8px #6f7effb3}.auth-brand .brand-text strong{display:block;color:var(--text-strong);letter-spacing:-.01em}.auth-brand .brand-text span{display:block;color:var(--muted);font-size:12px}.auth-copy{display:grid;gap:8px;margin-top:8px}.auth-copy h1{margin:0;font-size:28px;letter-spacing:-.02em;color:var(--text-strong)}.auth-copy p{margin:0;color:var(--muted);line-height:1.5}.github-login{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:46px;border-radius:12px;background:#0d1117;color:#fff;font-weight:600;text-decoration:none;border:1px solid #2b2f36;transition:transform 80ms ease,background .12s ease,border-color .12s ease}.github-login:hover{background:#161b22;border-color:#3f4750;transform:translateY(-1px)}.auth-foot{margin:0;color:var(--muted-2);font-size:12px;text-align:center}.shell{display:grid;grid-template-columns:72px 260px minmax(0,1fr) 0;height:100vh;min-height:100vh;overflow:hidden;transition:grid-template-columns .22s cubic-bezier(.2,.8,.2,1)}.shell.thread-open{grid-template-columns:72px 260px minmax(0,1fr) minmax(340px,28vw)}.shell.sidebar-collapsed{grid-template-columns:72px 0 minmax(0,1fr) 0}.shell.sidebar-collapsed.thread-open{grid-template-columns:72px 0 minmax(0,1fr) minmax(340px,28vw)}.guild-rail{display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px 0;background:var(--rail);border-right:1px solid var(--line);overflow-y:auto;position:relative}.guild-rail .guild{width:48px;height:48px;border-radius:16px;display:grid;place-items:center;background:var(--panel-2);color:var(--text);border:0;font-weight:700;font-size:14px;letter-spacing:-.02em;position:relative;transition:border-radius .14s ease,background .12s ease,transform .12s ease;box-shadow:0 1px #ffffff0a inset}.guild-rail .guild:hover{border-radius:12px;background:var(--accent);color:#fff;box-shadow:0 8px 24px -10px #6f7eff99}.guild-rail .guild.home{background:linear-gradient(135deg,var(--accent),#b46cff);color:#fff;font-weight:800}.guild-rail .guild.home:hover{border-radius:12px;filter:brightness(1.1)}.guild-rail .guild.add{background:transparent;color:var(--success);border:1px dashed rgba(46,204,113,.4)}.guild-rail .guild.add:hover{background:#2ecc711f;color:#fff;border-style:solid;border-color:var(--success)}.guild-divider{width:36px;height:1px;background:var(--line-strong);margin:4px 0}.guild-list{display:flex;flex-direction:column;align-items:center;gap:8px}.guild-wrap{position:relative}.guild-wrap:before{content:"";position:absolute;left:-14px;top:50%;transform:translateY(-50%) scaleY(.2);width:4px;height:28px;border-radius:0 4px 4px 0;background:var(--text-strong);opacity:0;transition:opacity .14s ease,transform .14s ease}.guild-wrap:hover:before{opacity:.6;transform:translateY(-50%) scaleY(.5)}.guild-wrap.active:before{opacity:1;transform:translateY(-50%) scaleY(1)}.guild-wrap.active .guild{border-radius:14px;background:var(--accent);color:#fff}.guild-create{position:absolute;left:100%;top:14px;margin-left:8px;background:var(--panel);border:1px solid var(--line-strong);border-radius:var(--radius);padding:8px;box-shadow:var(--shadow);z-index:20}.guild-create input{height:32px;padding:0 10px;width:200px;border-radius:var(--radius-sm);background:var(--panel-2);color:var(--text)}.sidebar{display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:var(--panel);border-right:1px solid var(--line);overflow:hidden;min-width:0;transition:opacity .16s ease,transform .22s cubic-bezier(.2,.8,.2,1)}.sidebar-collapsed .sidebar{opacity:0;pointer-events:none;transform:translate(-14px)}.workspace-header{padding:14px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;min-height:60px}.sidebar-collapse{width:30px;height:30px;display:grid;place-items:center;border:0;border-radius:8px;background:var(--panel-2);color:var(--muted);transition:color .12s ease,background .12s ease,transform .12s ease}.sidebar-collapse:hover{background:var(--panel-3);color:var(--text-strong);transform:translate(-1px)}.workspace-name{display:flex;flex-direction:column;gap:2px;min-width:0}.workspace-name strong{color:var(--text-strong);letter-spacing:-.01em;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.workspace-name .presence{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:11px}.workspace-name .presence:before{content:"";width:7px;height:7px;border-radius:50%;background:var(--muted-2)}.workspace-name .presence.online{color:var(--success)}.workspace-name .presence.online:before{background:var(--success);box-shadow:0 0 0 3px #2ecc712e}.sidebar-scroll{overflow-y:auto;padding:12px 8px 16px}.nav-section+.nav-section{margin-top:12px}.section-title{display:flex;align-items:center;gap:6px;width:100%;border:0;background:transparent;color:var(--muted);text-transform:uppercase;font-size:11px;font-weight:700;letter-spacing:.04em;padding:6px 8px;border-radius:var(--radius-sm)}.section-title:hover{color:var(--text);background:var(--hover)}.section-title .caret{font-size:10px;opacity:.7}.section-title .label{flex:1;text-align:left}.section-title .add-button{width:18px;height:18px;border-radius:4px;display:grid;place-items:center;font-size:14px;font-weight:700;background:#ffffff0f;color:var(--text)}.section-title:hover .add-button{background:var(--accent);color:#fff}.nav-list{display:flex;flex-direction:column;gap:1px;margin-top:4px}.nav-item{display:flex;align-items:center;gap:8px;width:100%;border:0;border-radius:var(--radius-sm);background:transparent;color:var(--muted);text-align:left;padding:6px 10px;min-height:30px;transition:background .1s ease,color .1s ease}.nav-item:hover{background:var(--hover);color:var(--text)}.nav-item.active{background:var(--accent-soft);color:var(--text-strong)}.nav-item .hash{color:var(--muted);font-weight:600;width:14px;text-align:center}.nav-item.active .hash{color:var(--accent)}.nav-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}.nav-empty{margin:4px 8px;color:var(--muted-2);font-size:12px}.dm-avatar{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:11px;font-weight:700;color:#fff;background:linear-gradient(135deg,hsl(var(--hue, 220deg) 70% 55%),hsl(calc(var(--hue, 220deg) + 40deg) 70% 45%));flex-shrink:0;overflow:hidden}.dm-avatar img,.avatar img{width:100%;height:100%;display:block;object-fit:cover}.presence-dot{width:8px;height:8px;border-radius:50%;background:var(--muted-2);flex-shrink:0}.presence-dot.active{background:var(--success);box-shadow:0 0 0 2px var(--panel)}.inline-create{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;margin:6px 4px 2px}.inline-create input{width:100%;min-width:0;height:30px;padding:0 10px;border-radius:var(--radius-sm);background:var(--panel-2);color:var(--text);border:1px solid var(--line)}.inline-create input:focus{border-color:var(--accent);background:var(--panel-3)}.inline-create button.ghost,button.ghost{width:30px;height:30px;border:0;border-radius:var(--radius-sm);background:var(--panel-3);color:var(--muted);font-weight:600;padding:0;font-size:14px;display:grid;place-items:center}.inline-create button.ghost:hover{background:var(--accent);color:#fff}.user-card{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;background:var(--panel-2);border-top:1px solid var(--line);border-right:0;border-bottom:0;border-left:0;color:inherit;text-align:left;cursor:pointer;transition:background .12s ease}.user-card:hover{background:var(--panel-3)}.user-card .dm-avatar{width:28px;height:28px;font-size:12px}.user-card .user-meta{flex:1;min-width:0}.user-card .user-meta strong{display:block;color:var(--text-strong);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-card .user-meta span{display:block;color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.timeline{display:flex;flex-direction:column;min-width:0;background:var(--bg);overflow:hidden}.timeline>*{min-width:0;flex-shrink:0}.timeline>.messages{flex:1 1 0;min-height:0}.topbar{display:flex;align-items:center;gap:14px;padding:12px 20px;min-height:60px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,rgba(255,255,255,.02),transparent),var(--bg)}.topbar-title{display:flex;align-items:center;gap:10px;min-width:0;flex:1}.topbar-title h1{margin:0;font-size:16px;font-weight:700;letter-spacing:-.01em;color:var(--text-strong);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar-title h1.with-glyph:first-letter{color:var(--muted);margin-right:1px}.topbar-divider{width:1px;height:18px;background:var(--line-strong);margin:0 6px}.topbar-meta{margin:0;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search{display:flex;align-items:center;gap:8px;width:min(280px,30vw);height:34px;padding:0 10px;border-radius:var(--radius);background:var(--panel);border:1px solid var(--line);color:var(--muted);transition:border-color .12s ease,background .12s ease}.search:focus-within{border-color:var(--accent);background:var(--panel-2);color:var(--text)}.search input{flex:1;min-width:0;height:100%;color:var(--text)}.search input::placeholder{color:var(--muted)}.search-clear{width:18px;height:18px;border-radius:50%;border:0;background:var(--panel-3);color:var(--muted);display:grid;place-items:center;font-size:14px;line-height:1}.search-clear:hover{background:var(--accent);color:#fff}.search-submit{height:22px;padding:0 8px;border:0;border-radius:5px;background:var(--accent-soft);color:var(--accent);font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.search-submit:hover{background:var(--accent);color:#fff}.topbar-actions{display:inline-flex;align-items:center;gap:6px}.topbar-actions button{width:32px;height:32px;display:grid;place-items:center;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--muted);transition:background .12s ease,color .12s ease,border-color .12s ease,transform 80ms ease}.topbar-actions button:hover,.topbar-actions button.active{background:var(--accent-soft);border-color:color-mix(in srgb,var(--accent) 55%,transparent);color:var(--accent)}.topbar-actions button:active{transform:translateY(1px)}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.search-results{display:flex;flex-direction:column;gap:2px;padding:10px 14px 14px;border-bottom:1px solid var(--line);background:var(--panel);max-height:280px;overflow-y:auto}.search-results-head{display:flex;align-items:center;justify-content:space-between;padding:0 6px 8px}.search-results-head strong{color:var(--text-strong);font-size:13px}.search-results-head button{border:0;background:transparent;color:var(--muted);font-size:12px;padding:4px 8px;border-radius:var(--radius-sm)}.search-results-head button:hover{background:var(--hover);color:var(--text)}.search-result{display:flex;align-items:flex-start;gap:10px;border:0;background:transparent;color:var(--text);padding:8px;border-radius:var(--radius-sm);text-align:left}.search-result:hover{background:var(--hover)}.search-result .dm-avatar{width:30px;height:30px;font-size:13px}.search-result-body{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}.search-result-body>div{display:flex;align-items:baseline;gap:8px}.search-result-body strong{color:var(--text-strong);font-size:13px}.search-result-body time{color:var(--muted);font-size:11px}.search-result-body span{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.messages{overflow-y:auto;padding:16px 4px 24px;scroll-behavior:smooth}.empty{display:grid;place-items:center;align-content:center;text-align:center;gap:10px;min-height:50vh;padding:48px 24px}.empty-icon{width:64px;height:64px;border-radius:18px;background:linear-gradient(135deg,var(--accent),#b46cff);color:#fff;display:grid;place-items:center;font-size:26px;font-weight:800;box-shadow:0 18px 40px -16px #6f7effb3}.empty strong{color:var(--text-strong);font-size:18px;letter-spacing:-.01em}.empty span{color:var(--muted);max-width:380px;line-height:1.5}.day-divider{display:flex;align-items:center;gap:12px;margin:18px 18px 8px;position:sticky;top:0;z-index:1;pointer-events:none}.day-divider:before,.day-divider:after{content:"";flex:1;height:1px;background:var(--line)}.day-divider span{background:var(--bg);border:1px solid var(--line);border-radius:999px;padding:4px 12px;font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}.message-group{display:grid;grid-template-columns:56px minmax(0,1fr);padding:8px 18px;position:relative}.message-group:hover{background:var(--hover)}.avatar{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;color:#fff;font-weight:700;font-size:14px;background:linear-gradient(135deg,hsl(var(--hue, 220deg) 70% 55%),hsl(calc(var(--hue, 220deg) + 40deg) 70% 45%));box-shadow:0 6px 20px -10px #0009;margin-top:2px;overflow:hidden}.avatar-button{position:relative;z-index:2;border:0;padding:0;cursor:pointer;transition:transform .1s ease,box-shadow .12s ease,filter .12s ease}.avatar-button:hover{transform:translateY(-1px);filter:brightness(1.05);box-shadow:0 10px 24px -12px #000c}.avatar.small{width:30px;height:30px;font-size:12px;border-radius:10px}.avatar.large{width:56px;height:56px;border-radius:16px;font-size:18px;margin:0}.group-body{min-width:0}.group-body>header{display:flex;align-items:baseline;gap:8px;margin-bottom:2px}.group-body>header strong{color:var(--text-strong);font-size:14.5px;letter-spacing:-.005em;font-weight:700}.author-name{border:0;background:transparent;color:var(--text-strong);padding:0;border-radius:4px;font-size:14.5px;letter-spacing:0;font-weight:700}.author-name:hover{color:var(--accent);text-decoration:underline;text-underline-offset:2px}.group-body>header time{color:var(--muted);font-size:11px}.group-body>header span{color:var(--muted);font-size:12px}.message-row{margin-left:-56px;padding:1px 0 1px 56px;position:relative;border-radius:0;transition:background 80ms ease}.message-row:not(:first-child){margin-top:1px}.message-row:hover{background:var(--hover-strong)}.message-row.selected{background:var(--accent-soft)}.message-row.selected:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--accent)}.row-stamp{position:absolute;left:8px;top:4px;font-size:10px;color:var(--muted-2);opacity:0;font-variant-numeric:tabular-nums}.message-row:hover .row-stamp{opacity:1}.message-content{min-width:0}.message-actions{display:flex;align-items:flex-start;gap:4px;opacity:0;transform:translateY(-50%);position:absolute;right:8px;top:0;background:var(--panel);border:1px solid var(--line-strong);border-radius:8px;padding:2px;box-shadow:var(--shadow);transition:opacity .1s ease,transform .1s ease}.message-row:hover .message-actions,.message-row.selected .message-actions{opacity:1}.message-actions button{width:28px;height:28px;display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:var(--muted)}.message-actions button:hover{background:var(--hover-strong);color:var(--text-strong)}.markdown{line-height:1.5;color:var(--text);font-size:14.5px;overflow-wrap:anywhere;word-break:break-word}.markdown>:first-child{margin-top:0}.markdown>:last-child{margin-bottom:0}.markdown p{margin:0}.markdown p+p,.markdown ul,.markdown ol,.markdown blockquote,.markdown pre{margin-top:6px}.markdown a{color:var(--accent);text-decoration:none}.markdown a:hover{text-decoration:underline}.markdown code{background:var(--panel-2);border:1px solid var(--line);border-radius:4px;padding:1px 5px;font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.9em}.markdown pre{background:var(--panel-2);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;overflow-x:auto}.markdown pre code{background:transparent;border:0;padding:0}.markdown blockquote{border-left:3px solid var(--accent);margin:0;padding:4px 0 4px 12px;color:var(--muted)}.markdown ul,.markdown ol{padding-left:22px}.markdown img{max-width:100%;max-height:360px;border-radius:var(--radius);margin-top:6px;border:1px solid var(--line);object-fit:contain;background:var(--panel);cursor:zoom-in}.attachment-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px;margin-top:8px;max-width:560px}.attachment-grid.compact{grid-template-columns:minmax(0,1fr);max-width:420px}.media-tile{position:relative;display:block;width:100%;margin:0;padding:0;border:1px solid var(--line);border-radius:var(--radius-lg);background:#0a0c12;overflow:hidden;isolation:isolate;text-align:left;color:inherit;text-decoration:none;cursor:pointer;transition:border-color .14s ease,transform .14s ease,box-shadow .14s ease}.media-tile:hover{border-color:var(--line-strong);box-shadow:0 18px 40px -28px #000000e6}.media-tile:focus-visible{outline:none;border-color:var(--line-strong);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}.media-tile--image{cursor:zoom-in}.media-tile__open{display:block;width:100%;margin:0;padding:0;border:0;background:transparent;color:inherit;cursor:zoom-in}.media-tile__open:focus{outline:0}.media-tile__open:focus-visible+.media-tile__caption .media-tile__name{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}.media-tile--video{cursor:default}.media-tile img,.media-tile video{display:block;width:100%;max-height:360px;object-fit:contain;background:#05070d}.media-tile--image img{max-height:320px}.media-tile__caption{position:absolute;inset:auto 0 0;z-index:3;display:flex;align-items:center;gap:8px;padding:22px 10px 8px;background:linear-gradient(to top,#000000c7,#00000080 40%,#0000);opacity:0;pointer-events:auto;transition:opacity .14s ease}.media-tile:hover .media-tile__caption,.media-tile:focus-within .media-tile__caption{opacity:1}.media-tile--video.is-started .media-tile__caption{display:none}.media-tile__name{flex:1;min-width:0;color:#fff;font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 2px rgba(0,0,0,.6)}.media-tile__chip{position:relative;z-index:4;display:inline-grid;place-items:center;width:28px;height:28px;flex:none;border-radius:8px;background:#00000080;color:#fff;border:1px solid rgba(255,255,255,.18);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);text-decoration:none;transition:background .12s ease,border-color .12s ease,transform .12s ease}.media-tile__chip:hover{background:#000000b3;border-color:#ffffff52;transform:translateY(-1px)}.media-tile__play{position:absolute;inset:0 0 48px;display:grid;place-items:center;width:100%;height:auto;border:0;margin:0;padding:0;background:transparent;cursor:pointer;z-index:1}.media-tile__play:before{content:"";position:absolute;inset:0;background:radial-gradient(ellipse at center,#0000002e,#0000000d 45%,#0000 70%);opacity:.7;transition:opacity .16s ease;pointer-events:none}.media-tile__play:hover:before{opacity:.9}.media-tile__play-icon{position:relative;display:grid;place-items:center;width:46px;height:46px;border-radius:999px;background:#0000008c;color:#fff;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);box-shadow:0 6px 20px -8px #0000008c;padding-left:3px;transition:transform .2s cubic-bezier(.2,.8,.2,1),background .18s ease,box-shadow .2s ease}.media-tile__play-icon svg{filter:drop-shadow(0 1px 2px rgba(0,0,0,.4))}.media-tile__play:hover .media-tile__play-icon{transform:scale(1.06);background:#000000b3;box-shadow:0 10px 28px -10px #000000a6}.media-tile__play:active .media-tile__play-icon{transform:scale(.97);transition-duration:80ms}.media-tile__play:focus-visible{outline:none}.media-tile__play:focus-visible .media-tile__play-icon{box-shadow:0 0 0 2px #fff9,0 10px 28px -10px #000000a6}.media-tile__duration{position:absolute;left:8px;bottom:8px;z-index:2;padding:2px 6px;border-radius:4px;background:#000000b8;color:#fff;font-size:11px;font-variant-numeric:tabular-nums;font-weight:600;letter-spacing:.02em;pointer-events:none}.file-attachment{display:flex;align-items:center;gap:10px;max-width:360px;padding:10px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel)}.file-attachment:hover{border-color:var(--line-strong);background:var(--panel-2)}.file-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:8px;background:var(--accent-soft);color:var(--accent);font-weight:800}.file-attachment strong,.file-attachment small{display:block}.file-attachment strong{color:var(--text-strong);font-size:13px}.file-attachment small{color:var(--muted);font-size:11px}.composer{padding:18px 18px 10px;background:var(--bg);display:grid;gap:0;position:relative}.composer-card{display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line-strong);border-radius:var(--radius-lg);overflow:hidden;transition:border-color .12s ease,box-shadow .12s ease}.composer:focus-within .composer-card{border-color:color-mix(in srgb,var(--accent) 55%,var(--line-strong));box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}.composer-toolbar{display:inline-flex;align-items:center;gap:2px;width:100%;padding:4px 6px;margin:0;border:0;border-top:1px solid var(--line);border-radius:0;background:color-mix(in srgb,var(--panel-2) 35%,transparent);box-shadow:none}.composer-toolbar button{min-width:28px;height:26px;display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:var(--text);opacity:.78;font-size:11.5px;font-weight:700;transition:background .1s ease,color .1s ease,opacity .1s ease,transform 80ms ease}.composer-toolbar button:hover{background:var(--hover-strong);color:var(--text-strong);opacity:1}.composer-toolbar button.active{background:var(--accent-soft);color:var(--accent);opacity:1}.composer-toolbar button:active{transform:translateY(1px)}.gif-picker{margin-top:8px;margin-bottom:8px;width:min(520px,calc(100vw - 40px));border:1px solid var(--line-strong);border-radius:16px;background:color-mix(in srgb,var(--panel) 96%,transparent);box-shadow:var(--shadow);padding:10px;animation:picker-in .16s cubic-bezier(.2,.8,.2,1)}.gif-picker-head{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;padding:2px 2px 10px}.gif-picker-head strong{color:var(--text-strong);font-size:13px}.gif-picker-head input{min-width:0;height:32px;padding:0 10px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel-2)}.gif-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-height:240px;overflow-y:auto}.gif-grid button{position:relative;overflow:hidden;aspect-ratio:4 / 3;border:0;border-radius:12px;background:var(--panel-2);color:#fff;padding:0;box-shadow:inset 0 0 0 1px var(--line);transition:transform .12s ease,box-shadow .12s ease}.gif-grid button:hover{transform:translateY(-2px);box-shadow:inset 0 0 0 2px var(--accent),0 14px 30px -22px #000c}.gif-grid img{width:100%;height:100%;display:block;object-fit:cover}.gif-grid span{position:absolute;left:6px;right:6px;bottom:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:999px;background:#0000008f;padding:4px 7px;font-size:10.5px;font-weight:700;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}@keyframes picker-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.composer-row{--composer-control-size: 36px;--composer-line-height: 22px;--composer-text-padding-block: 7px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:4px;padding:8px 8px 4px 10px;background:transparent;border:0;border-radius:0}.composer:focus-within .composer-toolbar,.composer-row:focus-within{border-color:transparent}.composer-row:focus-within{box-shadow:none}.composer-icon{align-self:start;width:var(--composer-control-size);height:var(--composer-control-size);margin-top:calc(var(--composer-text-padding-block) + (var(--composer-line-height) - var(--composer-control-size)) / 2);display:grid;place-items:center;color:var(--muted);border-radius:10px;cursor:pointer;transition:background .12s ease,color .12s ease}.composer-icon:hover{background:var(--hover-strong);color:var(--text-strong)}.composer-icon input[type=file]{position:absolute;inline-size:1px;block-size:1px;opacity:0;pointer-events:none}.composer textarea,.reply-composer textarea{width:100%;height:auto;min-height:44px;max-height:50vh;padding:var(--composer-text-padding-block) 4px;resize:none;color:var(--text);line-height:var(--composer-line-height);font-size:14.5px;align-self:start;overflow-y:auto;box-sizing:border-box}.composer textarea::placeholder,.reply-composer textarea::placeholder{color:var(--muted)}.send{align-self:start;width:var(--composer-control-size);height:var(--composer-control-size);margin-top:calc(var(--composer-text-padding-block) + (var(--composer-line-height) - var(--composer-control-size)) / 2);display:grid;place-items:center;border:0;border-radius:10px;background:var(--accent);color:#fff;transition:background .12s ease,transform 80ms ease,opacity .12s ease}.send:hover:not(:disabled){background:var(--accent-2);transform:translateY(-1px)}.send:disabled{background:var(--panel-3);color:var(--muted-2);cursor:not-allowed}.composer-attachment{margin-top:8px;margin-bottom:8px;display:inline-flex;align-items:center;gap:8px;padding:6px 10px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);color:var(--text);font-size:13px;width:fit-content}.attachment-icon{display:grid;place-items:center;width:20px;height:20px;border-radius:6px;background:var(--accent-soft);color:var(--accent)}.pending-image{width:42px;height:32px;object-fit:cover;border-radius:7px;border:1px solid var(--line);background:var(--panel-2)}.attachment-name{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachment-remove{width:18px;height:18px;border:0;background:transparent;color:var(--muted);border-radius:50%;font-size:14px;line-height:1}.attachment-remove:hover{background:var(--danger);color:#fff}.composer-hint{color:var(--muted-2);font-size:11px;padding:7px 4px 0}.composer-hint kbd{display:inline-block;background:var(--panel-2);border:1px solid var(--line);border-radius:4px;padding:0 5px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:10.5px;color:var(--text)}.thread{display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:var(--panel);border-left:1px solid var(--line);min-width:0;overflow:hidden;opacity:0;transform:translate(28px);pointer-events:none;transition:opacity .18s ease,transform .22s cubic-bezier(.2,.8,.2,1)}.thread.open{opacity:1;transform:translate(0);pointer-events:auto}.thread>header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;min-height:60px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,rgba(255,255,255,.02),transparent),var(--panel)}.thread>header p,.thread>header strong{margin:0}.thread>header p{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.04em;font-weight:700}.thread>header strong{display:block;color:var(--text-strong);font-size:14px}.thread .close{width:28px;height:28px;border:0;border-radius:50%;background:var(--panel-2);color:var(--muted);font-size:18px;line-height:1}.thread .close:hover{background:var(--panel-3);color:var(--text-strong)}.thread-scroll{overflow-y:auto;padding:12px 16px}.thread-root{display:grid;grid-template-columns:38px minmax(0,1fr);gap:12px;padding-bottom:12px;border-bottom:1px solid var(--line)}.thread-divider{display:flex;align-items:center;gap:10px;margin:14px 0 10px}.thread-divider:before,.thread-divider:after{content:"";flex:1;height:1px;background:var(--line)}.thread-divider span{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-weight:700}.reply-list{display:flex;flex-direction:column;gap:10px}.reply{display:grid;grid-template-columns:30px minmax(0,1fr);gap:10px;padding:6px;border-radius:var(--radius-sm)}.reply:hover{background:var(--hover)}.reply-composer{padding:10px 14px 14px;background:var(--panel);border-top:1px solid var(--line)}.reply-composer .composer-row{border-radius:0}.thread-empty{display:grid;place-items:center;align-content:center;gap:8px;padding:32px 24px;text-align:center;grid-row:span 3}.thread-icon{width:56px;height:56px;border-radius:16px;background:var(--panel-2);color:var(--muted);display:grid;place-items:center}.thread-empty strong{color:var(--text-strong);font-size:15px}.thread-empty span{color:var(--muted);font-size:13px;max-width:260px;line-height:1.5}.profile-pane{overflow-y:auto}.profile-hero{min-height:210px;display:grid;place-items:end center;padding:28px 20px;background:linear-gradient(180deg,transparent,rgba(0,0,0,.24)),linear-gradient(135deg,hsl(var(--hue, 220deg) 76% 58%),hsl(calc(var(--hue, 220deg) + 54deg) 74% 38%));border-bottom:1px solid var(--line)}.profile-avatar{width:min(240px,70%);aspect-ratio:1;display:grid;place-items:center;overflow:hidden;border-radius:16px;background:#ffffff2e;color:#fff;font-size:clamp(48px,12vw,88px);font-weight:800;box-shadow:0 26px 60px -30px #000000e6}.profile-avatar img{width:100%;height:100%;object-fit:cover}.profile-pane-body{display:grid;gap:18px;padding:18px 16px 22px}.profile-pane-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.profile-pane-title h2{margin:0;color:var(--text-strong);font-size:22px;letter-spacing:0}.profile-pane-title span{display:block;margin-top:3px;color:var(--muted);font-size:13px}.text-action{border:0;border-radius:6px;background:transparent;color:var(--accent);font-size:13px;font-weight:700;padding:4px 6px}.text-action:hover{background:var(--accent-soft)}.profile-presence{display:inline-flex;align-items:center;gap:8px;color:var(--text);font-size:14px}.profile-actions-row{display:flex;gap:8px;flex-wrap:wrap}.profile-actions-row .primary-action,.profile-actions-row .ghost-action{min-width:110px}.profile-info{display:grid;gap:12px;padding-top:18px;border-top:1px solid var(--line)}.profile-info header{display:flex;align-items:center;justify-content:space-between;gap:10px}.profile-info header strong{color:var(--text-strong);font-size:14px}.profile-info-row{display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;align-items:center}.info-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;background:var(--panel-2);color:var(--muted);font-size:11px;font-weight:800}.profile-info-row small,.profile-info-row span{display:block}.profile-info-row small{color:var(--muted);font-size:11px}.profile-info-row span{color:var(--text);font-size:13px;overflow-wrap:anywhere}.profile-note{margin:0;color:var(--muted);line-height:1.5;font-size:13px}.modal-scrim{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:24px;background:#05080f8a;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}.modal-backdrop{position:absolute;inset:0;border:0;background:transparent}.modal-backdrop:focus{outline:0}.profile-modal{position:relative;z-index:1;width:min(480px,100%);border:1px solid var(--line-strong);border-radius:14px;background:var(--panel);color:var(--text);box-shadow:var(--shadow);overflow:hidden}.profile-modal>header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;border-bottom:1px solid var(--line);background:var(--panel-2)}.profile-modal p{margin:0 0 3px;color:var(--muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}.profile-modal h2{margin:0;color:var(--text-strong);font-size:20px;letter-spacing:0}.profile-modal>header button{width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:22px}.profile-modal>header button:hover{background:var(--hover);color:var(--text-strong)}.profile-form{display:grid;gap:14px;padding:20px}.profile-preview{display:flex;align-items:center;gap:14px;padding:14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel-2)}.profile-preview strong,.profile-preview span{display:block}.profile-preview strong{color:var(--text-strong);font-size:15px}.profile-preview span{color:var(--muted);font-size:13px}.field{display:grid;gap:6px}.field span{color:var(--muted);font-size:12px;font-weight:700}.field input{width:100%;height:38px;padding:0 12px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel-2);color:var(--text)}.field input:focus{border-color:var(--accent);outline:0;box-shadow:0 0 0 3px var(--accent-soft)}.profile-status{color:var(--success);font-size:12px}.profile-status.error{color:var(--danger)}.profile-actions{display:flex;justify-content:flex-end;gap:8px;padding-top:4px}.ghost-action,.primary-action{height:36px;padding:0 14px;border-radius:var(--radius-sm);font-weight:700}.ghost-action{border:1px solid var(--line);background:var(--panel);color:var(--text)}.primary-action{border:0;background:var(--accent);color:#fff}.ghost-action:hover{background:var(--hover)}.primary-action:hover{filter:brightness(1.04)}.image-viewer-scrim{padding:28px;background:#000000c7;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px)}.image-viewer{position:relative;z-index:1;display:grid;grid-template-rows:auto minmax(0,1fr);width:min(1120px,100%);max-height:min(86vh,900px);overflow:hidden;border-radius:14px;background:#07090f;color:#fff;box-shadow:0 34px 90px -34px #000000f2;animation:picker-in .15s cubic-bezier(.2,.8,.2,1)}.image-viewer>header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;padding:10px 12px 10px 16px;border-bottom:1px solid rgba(255,255,255,.1);background:#ffffff0a}.image-viewer>header strong{min-width:0;overflow:hidden;color:#fff;font-size:13px;text-overflow:ellipsis;white-space:nowrap}.image-viewer>header div{display:inline-flex;align-items:center;gap:8px;flex-shrink:0}.image-viewer>header a{height:30px;display:inline-flex;align-items:center;padding:0 10px;border-radius:7px;background:#ffffff14;color:#fff;font-size:12px;font-weight:700;text-decoration:none}.image-viewer>header a:hover{background:#ffffff24}.image-viewer>header button{width:30px;height:30px;display:grid;place-items:center;border:0;border-radius:7px;background:transparent;color:#ffffffc7;font-size:22px;line-height:1}.image-viewer>header button:hover{background:#ffffff1f;color:#fff}.image-viewer-stage{display:grid;place-items:center;min-height:0;padding:18px}.image-viewer-stage img{display:block;max-width:100%;max-height:calc(86vh - 96px);object-fit:contain;border-radius:8px;background:#ffffff0a}.mobile-nav-toggle{display:none;position:fixed;top:14px;left:14px;z-index:30;width:38px;height:38px;border-radius:10px;border:1px solid var(--line-strong);background:var(--panel);color:var(--text);font-size:22px;line-height:1}.mobile-nav-toggle .bars{display:grid;gap:3px}.mobile-nav-toggle .bars i{display:block;width:16px;height:2px;background:currentColor;border-radius:2px}@media(max-width:1180px){.shell{grid-template-columns:72px 240px minmax(0,1fr)}.shell.sidebar-collapsed,.shell.sidebar-collapsed.thread-open{grid-template-columns:72px 0 minmax(0,1fr)}.thread{position:fixed;inset:0 0 0 auto;width:min(420px,100vw);box-shadow:var(--shadow);transform:translate(100%);transition:transform .18s ease;z-index:4;border-left:1px solid var(--line-strong)}.thread.open{transform:translate(0)}}@media(max-width:820px){.mobile-nav-toggle{display:grid;place-items:center}.shell,.shell.thread-open,.shell.sidebar-collapsed,.shell.sidebar-collapsed.thread-open{grid-template-columns:1fr}.sidebar-collapsed .sidebar{opacity:1;pointer-events:auto;transform:translate(-100%)}.guild-rail,.sidebar{position:fixed;inset:0 auto 0 0;z-index:20;transform:translate(-100%);transition:transform .18s ease}.guild-rail{width:72px}.sidebar{left:72px;width:260px}.nav-open .guild-rail,.nav-open .sidebar{transform:translate(0)}.topbar{padding-left:64px}.search{width:180px}}@media(max-width:520px){.search,.topbar-meta,.topbar-divider{display:none}}.message-row.highlight,.thread-root.highlight,.reply.highlight{animation:quote-flash 1.4s ease-out}@keyframes quote-flash{0%{background:#6366f138}to{background:transparent}}.quote-block{display:inline-flex;align-items:stretch;gap:.5rem;margin:0 0 .35rem;padding:.25rem .5rem .25rem 0;background:transparent;border:0;border-radius:6px;color:inherit;cursor:pointer;text-align:left;max-width:100%;font:inherit}.quote-block:hover:not(:disabled){background:#6366f114}.quote-block:disabled{cursor:default;opacity:.75}.quote-block .quote-bar{width:3px;align-self:stretch;background:var(--accent, #6366f1);border-radius:2px;flex:0 0 3px}.quote-block .quote-content{display:flex;flex-direction:column;gap:.1rem;min-width:0}.quote-block .quote-author{font-size:.78rem;font-weight:600;color:var(--accent, #6366f1)}.quote-block .quote-snippet{font-size:.85rem;color:var(--text-muted, #6b7280);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:56ch}.quote-block .quote-snippet.muted{font-style:italic;opacity:.75}.quote-preview{display:flex;align-items:center;gap:.5rem;padding:6px 10px 6px 12px;margin:0;background:color-mix(in srgb,var(--accent) 5%,transparent);border:0;border-bottom:1px solid var(--line);border-radius:0;font-size:12.5px;color:var(--muted)}.quote-preview .quote-bar{display:none}.quote-preview-body{display:flex;align-items:baseline;gap:.4rem;flex:1;min-width:0;overflow:hidden}.quote-preview-label{font-size:12px;color:color-mix(in srgb,var(--accent) 85%,var(--text));white-space:nowrap}.quote-preview-label strong{color:var(--text-strong);font-weight:600}.quote-preview-snippet{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted);font-size:12px;flex:1;min-width:0}.quote-preview-clear{background:transparent;border:0;color:var(--muted);font-size:16px;line-height:1;cursor:pointer;padding:2px 6px;border-radius:6px;transition:background .1s ease,color .1s ease}.quote-preview-clear:hover{color:var(--text-strong);background:var(--hover-strong)}.reply-quote-btn{position:relative;margin-left:auto;background:transparent;border:0;color:var(--text-muted, #6b7280);cursor:pointer;font-size:.95rem;padding:0 .3rem;opacity:0;transition:opacity .15s}.reply:hover .reply-quote-btn,.thread-root:hover .reply-quote-btn,.reply-quote-btn:focus-visible{opacity:1}.reply-quote-btn:hover{color:var(--accent, #6366f1)}.tooltip{position:relative}.tooltip:before,.reply-quote-btn:before{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 12px);z-index:20;transform:translate(-50%,4px) scale(.96);padding:.42rem .62rem;border-radius:9px;background:#3a3a44;color:#f4f4f7;box-shadow:0 10px 28px #00000047;font-size:.78rem;font-weight:700;line-height:1;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease}.tooltip:after,.reply-quote-btn:after{content:"";position:absolute;left:50%;bottom:calc(100% + 5px);z-index:20;width:12px;height:12px;border-radius:2px;background:#3a3a44;transform:translate(-50%,4px) rotate(45deg) scale(.9);opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease}.tooltip:hover:before,.tooltip:focus-visible:before,.reply-quote-btn:hover:before,.reply-quote-btn:focus-visible:before,.tooltip:hover:after,.tooltip:focus-visible:after,.reply-quote-btn:hover:after,.reply-quote-btn:focus-visible:after{opacity:1;transform:translate(-50%) scale(1)}.tooltip:hover:after,.tooltip:focus-visible:after,.reply-quote-btn:hover:after,.reply-quote-btn:focus-visible:after{transform:translate(-50%) rotate(45deg) scale(1)} +.product-site{min-height:100vh;background:#f7f3ea;color:#151716;font-family:Avenir Next,Segoe UI,ui-sans-serif,system-ui,sans-serif}.product-site a{color:inherit;text-decoration:none}.hero{position:relative;display:grid;min-height:clamp(680px,92vh,920px);overflow:hidden;isolation:isolate;background:linear-gradient(90deg,#0c1f23c7,#0c1f232e 62%,#0c1f23b3),#103033;color:#fff8ee}.hero:after{position:absolute;inset:auto 0 0;height:22vh;min-height:130px;background:linear-gradient(0deg,#f7f3ea 8%,#f7f3ea00);content:"";z-index:-1}.hero:before{position:absolute;inset:0 38% 0 0;background:linear-gradient(90deg,#081c1efa,#081c1e00);content:"";z-index:-1}.hero-bg{position:absolute;inset:0 0 0 clamp(260px,28vw,460px);display:grid;grid-template-columns:92px minmax(360px,1fr) minmax(260px,28vw);gap:18px;padding:102px clamp(18px,5vw,70px) 80px;opacity:.36;z-index:-2}.workspace-rail,.timeline-preview,.thread-preview{border:1px solid rgba(255,248,238,.24);background:#fff8ee1f;box-shadow:0 28px 90px #0000003d;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px)}.workspace-rail{display:grid;align-content:start;gap:14px;padding:16px}.workspace-rail span{display:grid;place-items:center;min-height:54px;border-radius:8px;background:#fff8ee2e;color:#fff8ee;font-weight:900;text-transform:uppercase}.timeline-preview{align-self:stretch;padding:clamp(18px,3vw,34px)}.preview-top{display:flex;justify-content:space-between;margin-bottom:48px;color:#b9ddd9;font-weight:800}.preview-top strong{color:#7ce0b5}.timeline-preview article,.thread-preview{max-width:720px;margin:0 0 18px;border-radius:8px;background:#fff8ee29;padding:18px}.timeline-preview b,.thread-preview span{color:#ff8a70}.timeline-preview p,.thread-preview p{margin:6px 0 0;color:#fff8ee;font-size:clamp(17px,1.8vw,24px)}.timeline-preview code{border-radius:5px;background:#0c1f2394;padding:2px 5px}.thread-line{margin-left:clamp(0px,8vw,130px)}.thread-preview{align-self:center;min-height:260px}.product-nav{position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px clamp(18px,5vw,70px);font-weight:800}.product-nav>div{display:flex;gap:clamp(14px,3vw,34px)}.brand-lockup{display:inline-flex;align-items:center;gap:10px}.brand-mark{display:grid;place-items:center;width:40px;height:40px;border-radius:8px;background:#ff6f55;color:#151716;font-weight:950;text-transform:uppercase}.hero-copy{position:relative;z-index:2;align-self:center;width:min(780px,calc(100vw - 36px));padding:0 clamp(18px,5vw,70px) 16vh}.eyebrow,.section-kicker{margin:0 0 14px;color:#ffb09f;font-size:13px;font-weight:950;letter-spacing:.08em;text-transform:uppercase}.hero h1,.product-band h2{margin:0;letter-spacing:0}.hero h1{font-family:Georgia,Times New Roman,serif;font-size:clamp(66px,13vw,152px);font-weight:900;line-height:.9}.lede{width:min(680px,100%);margin:26px 0 0;color:#fff3df;font-size:clamp(20px,2.2vw,31px);line-height:1.18}.hero-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:32px}.primary-action,.secondary-action{display:inline-flex;align-items:center;justify-content:center;min-height:48px;border-radius:8px;padding:0 18px;font-weight:950}.primary-action{background:#ff6f55;color:#151716}.secondary-action{border:1px solid rgba(255,248,238,.42);color:#fff8ee}.product-band{display:grid;grid-template-columns:minmax(260px,.9fr) minmax(280px,1.1fr);gap:clamp(28px,6vw,90px);padding:clamp(58px,8vw,112px) clamp(18px,5vw,70px)}.product-band h2{max-width:720px;font-size:clamp(34px,5vw,74px);line-height:.96}.product-band p{margin:0;color:#3f4743;font-size:clamp(18px,2.1vw,27px);line-height:1.34}.intro-band{padding-top:0}.intro-band .section-kicker,.cli-band .section-kicker,.docs-band .section-kicker{color:#b84632}.feature-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-block:1px solid #c8c0b2}.feature-grid article{min-height:250px;border-right:1px solid #c8c0b2;padding:clamp(22px,3vw,40px)}.feature-grid article:nth-child(2n){background:#e8f0e9}.feature-grid article:last-child{border-right:0}.feature-grid h3{margin:0 0 44px;font-size:24px}.feature-grid p{margin:0;color:#48504c;line-height:1.45}.cli-band{background:#162a2d;color:#fff8ee}.cli-band p{color:#c9d8d4}.cli-band pre{overflow:auto;align-self:start;margin:0;border:1px solid rgba(255,248,238,.18);border-radius:8px;background:#071314;color:#bdf1dc;padding:clamp(18px,3vw,32px);line-height:1.7}.docs-band{background:#fffaf0}.destination-list{display:grid;gap:12px}.destination-list a{display:flex;justify-content:space-between;gap:20px;border-top:1px solid #cbc2b3;padding:18px 0;font-size:clamp(21px,3vw,40px);font-weight:900}.destination-list span{color:#6f7772;font-size:15px;font-weight:700;text-align:right}@media(prefers-color-scheme:dark){.product-site{background:#101616;color:#fff8ee}.hero:after{background:linear-gradient(0deg,#101616 8%,#10161600)}.product-band p,.feature-grid p,.destination-list span{color:#bac7c3}.feature-grid{border-color:#34413e}.feature-grid article{border-color:#34413e}.feature-grid article:nth-child(2n),.docs-band{background:#182221}}@media(max-width:900px){.hero:before{inset-right:0}.hero-bg{inset:0;grid-template-columns:58px minmax(0,1fr);padding-top:90px;opacity:.38}.thread-preview{display:none}.product-band,.feature-grid{grid-template-columns:1fr}.feature-grid article,.feature-grid article:last-child{min-height:0;border-right:0;border-bottom:1px solid #c8c0b2}}@media(max-width:620px){.product-nav{align-items:flex-start;flex-direction:column}.hero{min-height:760px}.hero-bg{grid-template-columns:1fr;opacity:.42}.workspace-rail{display:none}.hero-copy{padding-bottom:90px}.destination-list a{flex-direction:column}.destination-list span{text-align:left}}:root{color-scheme:light dark;font-family:Inter,SF Pro Text,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-feature-settings:"ss01","cv11";--rail: #e9e1d7;--bg: #f7f3ed;--panel: #fffaf2;--panel-2: #efe7dc;--panel-3: #e4dbcf;--hover: rgba(16, 32, 39, .05);--hover-strong: rgba(16, 32, 39, .08);--line: rgba(16, 32, 39, .1);--line-strong: rgba(16, 32, 39, .16);--text: #22201d;--text-strong: #11100e;--muted: #6f675f;--muted-2: #958b80;--accent: #dd5d45;--accent-2: #006d77;--accent-soft: rgba(221, 93, 69, .16);--accent-glow: 0 0 0 1px rgba(221, 93, 69, .28), 0 8px 30px -12px rgba(221, 93, 69, .45);--success: #168b51;--warn: #f5b050;--danger: #c84343;--shadow: 0 24px 60px -24px rgba(16, 32, 39, .32);--radius-sm: 6px;--radius: 8px;--radius-lg: 14px;--radius-xl: 18px;background:var(--bg);color:var(--text)}@media(prefers-color-scheme:dark){:root{--rail: #0d0e12;--bg: #131419;--panel: #1a1b22;--panel-2: #20222b;--panel-3: #272a35;--hover: rgba(255, 255, 255, .04);--hover-strong: rgba(255, 255, 255, .07);--line: rgba(255, 255, 255, .07);--line-strong: rgba(255, 255, 255, .12);--text: #e7e9ee;--text-strong: #ffffff;--muted: #8a8f9c;--muted-2: #5d626d;--accent: #6f7eff;--accent-2: #5666ee;--accent-soft: rgba(111, 126, 255, .18);--accent-glow: 0 0 0 1px rgba(111, 126, 255, .4), 0 8px 30px -12px rgba(111, 126, 255, .6);--success: #2ecc71;--warn: #f5b050;--danger: #ff6b6b;--shadow: 0 24px 60px -20px rgba(0, 0, 0, .6)}}*{box-sizing:border-box}html,body{margin:0;padding:0;height:100%}body{background:radial-gradient(1000px 600px at 0% 0%,rgba(111,126,255,.08),transparent 60%),radial-gradient(900px 700px at 100% 100%,rgba(255,130,200,.05),transparent 60%),var(--bg);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}button,input,textarea{font:inherit;color:inherit}button{cursor:pointer}input,textarea{background:transparent;border:0;outline:0}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:#ffffff0f;border-radius:999px;border:2px solid transparent;background-clip:content-box}::-webkit-scrollbar-thumb:hover{background:#ffffff1f;background-clip:content-box}.auth-shell{display:grid;min-height:100vh;place-items:center;padding:32px;background:radial-gradient(700px 500px at 30% 20%,rgba(111,126,255,.18),transparent 60%),radial-gradient(700px 500px at 80% 90%,rgba(255,110,196,.12),transparent 60%),var(--bg)}.auth-panel{display:grid;gap:22px;width:min(100%,440px);border:1px solid var(--line-strong);border-radius:var(--radius-xl);background:linear-gradient(180deg,#ffffff0a,#fff0) var(--panel);box-shadow:var(--shadow);padding:36px}.auth-brand{display:flex;align-items:center;gap:12px}.auth-brand .mark{width:44px;height:44px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(135deg,var(--accent),#b46cff);color:#fff;font-weight:800;letter-spacing:-.02em;box-shadow:0 10px 24px -8px #6f7effb3}.auth-brand .brand-text strong{display:block;color:var(--text-strong);letter-spacing:-.01em}.auth-brand .brand-text span{display:block;color:var(--muted);font-size:12px}.auth-copy{display:grid;gap:8px;margin-top:8px}.auth-copy h1{margin:0;font-size:28px;letter-spacing:-.02em;color:var(--text-strong)}.auth-copy p{margin:0;color:var(--muted);line-height:1.5}.github-login{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:46px;border-radius:12px;background:#0d1117;color:#fff;font-weight:600;text-decoration:none;border:1px solid #2b2f36;transition:transform 80ms ease,background .12s ease,border-color .12s ease}.github-login:hover{background:#161b22;border-color:#3f4750;transform:translateY(-1px)}.auth-foot{margin:0;color:var(--muted-2);font-size:12px;text-align:center}.shell{display:grid;grid-template-columns:72px 260px minmax(0,1fr) 0;height:100vh;min-height:100vh;overflow:hidden;transition:grid-template-columns .22s cubic-bezier(.2,.8,.2,1)}.shell.thread-open{grid-template-columns:72px 260px minmax(0,1fr) minmax(340px,28vw)}.shell.sidebar-collapsed{grid-template-columns:72px 0 minmax(0,1fr) 0}.shell.sidebar-collapsed.thread-open{grid-template-columns:72px 0 minmax(0,1fr) minmax(340px,28vw)}.timeline{display:flex;flex-direction:column;min-width:0;background:var(--bg);overflow:hidden}.timeline>*{min-width:0;flex-shrink:0}.timeline>.messages{flex:1 1 0;min-height:0}.topbar{display:flex;align-items:center;gap:14px;padding:12px 20px;min-height:60px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,rgba(255,255,255,.02),transparent),var(--bg)}.topbar-title{display:flex;align-items:center;gap:10px;min-width:0;flex:1}.topbar-title h1{margin:0;font-size:16px;font-weight:700;letter-spacing:-.01em;color:var(--text-strong);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar-title h1.with-glyph:first-letter{color:var(--muted);margin-right:1px}.topbar-divider{width:1px;height:18px;background:var(--line-strong);margin:0 6px}.topbar-meta{margin:0;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search{display:flex;align-items:center;gap:8px;width:min(280px,30vw);height:34px;padding:0 10px;border-radius:var(--radius);background:var(--panel);border:1px solid var(--line);color:var(--muted);transition:border-color .12s ease,background .12s ease}.search:focus-within{border-color:var(--accent);background:var(--panel-2);color:var(--text)}.search input{flex:1;min-width:0;height:100%;color:var(--text)}.search input::placeholder{color:var(--muted)}.search-clear{width:18px;height:18px;border-radius:50%;border:0;background:var(--panel-3);color:var(--muted);display:grid;place-items:center;font-size:14px;line-height:1}.search-clear:hover{background:var(--accent);color:#fff}.search-submit{height:22px;padding:0 8px;border:0;border-radius:5px;background:var(--accent-soft);color:var(--accent);font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.search-submit:hover{background:var(--accent);color:#fff}.topbar-actions{display:inline-flex;align-items:center;gap:6px}.topbar-actions button{width:32px;height:32px;display:grid;place-items:center;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--muted);transition:background .12s ease,color .12s ease,border-color .12s ease,transform 80ms ease}.topbar-actions button:hover,.topbar-actions button.active{background:var(--accent-soft);border-color:color-mix(in srgb,var(--accent) 55%,transparent);color:var(--accent)}.topbar-actions button:active{transform:translateY(1px)}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.search-results{display:flex;flex-direction:column;gap:2px;padding:10px 14px 14px;border-bottom:1px solid var(--line);background:var(--panel);max-height:280px;overflow-y:auto}.search-results-head{display:flex;align-items:center;justify-content:space-between;padding:0 6px 8px}.search-results-head strong{color:var(--text-strong);font-size:13px}.search-results-head button{border:0;background:transparent;color:var(--muted);font-size:12px;padding:4px 8px;border-radius:var(--radius-sm)}.search-results-head button:hover{background:var(--hover);color:var(--text)}.search-result{display:flex;align-items:flex-start;gap:10px;border:0;background:transparent;color:var(--text);padding:8px;border-radius:var(--radius-sm);text-align:left}.search-result:hover{background:var(--hover)}.search-result .dm-avatar{width:30px;height:30px;font-size:13px}.search-result-body{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}.search-result-body>div{display:flex;align-items:baseline;gap:8px}.search-result-body strong{color:var(--text-strong);font-size:13px}.search-result-body time{color:var(--muted);font-size:11px}.search-result-body span{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.guild-rail{display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px 0;background:var(--rail);border-right:1px solid var(--line);overflow-y:auto;position:relative}.guild-rail .guild{width:48px;height:48px;border-radius:16px;display:grid;place-items:center;background:var(--panel-2);color:var(--text);border:0;font-weight:700;font-size:14px;letter-spacing:-.02em;position:relative;transition:border-radius .14s ease,background .12s ease,transform .12s ease;box-shadow:0 1px #ffffff0a inset}.guild-rail .guild:hover{border-radius:12px;background:var(--accent);color:#fff;box-shadow:0 8px 24px -10px #6f7eff99}.guild-rail .guild.home{background:linear-gradient(135deg,var(--accent),#b46cff);color:#fff;font-weight:800}.guild-rail .guild.home:hover{border-radius:12px;filter:brightness(1.1)}.guild-rail .guild.add{background:transparent;color:var(--success);border:1px dashed rgba(46,204,113,.4)}.guild-rail .guild.add:hover{background:#2ecc711f;color:#fff;border-style:solid;border-color:var(--success)}.guild-divider{width:36px;height:1px;background:var(--line-strong);margin:4px 0}.guild-list{display:flex;flex-direction:column;align-items:center;gap:8px}.guild-wrap{position:relative}.guild-wrap:before{content:"";position:absolute;left:-14px;top:50%;transform:translateY(-50%) scaleY(.2);width:4px;height:28px;border-radius:0 4px 4px 0;background:var(--text-strong);opacity:0;transition:opacity .14s ease,transform .14s ease}.guild-wrap:hover:before{opacity:.6;transform:translateY(-50%) scaleY(.5)}.guild-wrap.active:before{opacity:1;transform:translateY(-50%) scaleY(1)}.guild-wrap.active .guild{border-radius:14px;background:var(--accent);color:#fff}.guild-create{position:absolute;left:100%;top:14px;margin-left:8px;background:var(--panel);border:1px solid var(--line-strong);border-radius:var(--radius);padding:8px;box-shadow:var(--shadow);z-index:20}.guild-create input{height:32px;padding:0 10px;width:200px;border-radius:var(--radius-sm);background:var(--panel-2);color:var(--text)}.sidebar{display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:var(--panel);border-right:1px solid var(--line);overflow:hidden;min-width:0;transition:opacity .16s ease,transform .22s cubic-bezier(.2,.8,.2,1)}.sidebar-collapsed .sidebar{opacity:0;pointer-events:none;transform:translate(-14px)}.workspace-header{padding:14px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;min-height:60px}.sidebar-collapse{width:30px;height:30px;display:grid;place-items:center;border:0;border-radius:8px;background:var(--panel-2);color:var(--muted);transition:color .12s ease,background .12s ease,transform .12s ease}.sidebar-collapse:hover{background:var(--panel-3);color:var(--text-strong);transform:translate(-1px)}.workspace-name{display:flex;flex-direction:column;gap:2px;min-width:0}.workspace-name strong{color:var(--text-strong);letter-spacing:-.01em;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.workspace-name .presence{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:11px}.workspace-name .presence:before{content:"";width:7px;height:7px;border-radius:50%;background:var(--muted-2)}.workspace-name .presence.online{color:var(--success)}.workspace-name .presence.online:before{background:var(--success);box-shadow:0 0 0 3px #2ecc712e}.sidebar-scroll{overflow-y:auto;padding:12px 8px 16px}.nav-section+.nav-section{margin-top:12px}.section-title{display:flex;align-items:center;gap:6px;width:100%;border:0;background:transparent;color:var(--muted);text-transform:uppercase;font-size:11px;font-weight:700;letter-spacing:.04em;padding:6px 8px;border-radius:var(--radius-sm)}.section-title:hover{color:var(--text);background:var(--hover)}.section-title .caret{font-size:10px;opacity:.7}.section-title .label{flex:1;text-align:left}.section-title .add-button{width:18px;height:18px;border-radius:4px;display:grid;place-items:center;font-size:14px;font-weight:700;background:#ffffff0f;color:var(--text)}.section-title:hover .add-button{background:var(--accent);color:#fff}.nav-list{display:flex;flex-direction:column;gap:1px;margin-top:4px}.nav-item{display:flex;align-items:center;gap:8px;width:100%;border:0;border-radius:var(--radius-sm);background:transparent;color:var(--muted);text-align:left;padding:6px 10px;min-height:30px;transition:background .1s ease,color .1s ease}.nav-item:hover{background:var(--hover);color:var(--text)}.nav-item.active{background:var(--accent-soft);color:var(--text-strong)}.nav-item .hash{color:var(--muted);font-weight:600;width:14px;text-align:center}.nav-item.active .hash{color:var(--accent)}.nav-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}.nav-empty{margin:4px 8px;color:var(--muted-2);font-size:12px}.dm-avatar{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:11px;font-weight:700;color:#fff;background:linear-gradient(135deg,hsl(var(--hue, 220deg) 70% 55%),hsl(calc(var(--hue, 220deg) + 40deg) 70% 45%));flex-shrink:0;overflow:hidden}.dm-avatar img,.avatar img{width:100%;height:100%;display:block;object-fit:cover}.presence-dot{width:8px;height:8px;border-radius:50%;background:var(--muted-2);flex-shrink:0}.presence-dot.active{background:var(--success);box-shadow:0 0 0 2px var(--panel)}.inline-create{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;margin:6px 4px 2px}.inline-create input{width:100%;min-width:0;height:30px;padding:0 10px;border-radius:var(--radius-sm);background:var(--panel-2);color:var(--text);border:1px solid var(--line)}.inline-create input:focus{border-color:var(--accent);background:var(--panel-3)}.inline-create button.ghost,button.ghost{width:30px;height:30px;border:0;border-radius:var(--radius-sm);background:var(--panel-3);color:var(--muted);font-weight:600;padding:0;font-size:14px;display:grid;place-items:center}.inline-create button.ghost:hover{background:var(--accent);color:#fff}.user-card{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;background:var(--panel-2);border-top:1px solid var(--line);border-right:0;border-bottom:0;border-left:0;color:inherit;text-align:left;cursor:pointer;transition:background .12s ease}.user-card:hover{background:var(--panel-3)}.user-card .dm-avatar{width:28px;height:28px;font-size:12px}.user-card .user-meta{flex:1;min-width:0}.user-card .user-meta strong{display:block;color:var(--text-strong);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-card .user-meta span{display:block;color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.messages{overflow-y:auto;padding:16px 4px 24px;scroll-behavior:smooth}.empty{display:grid;place-items:center;align-content:center;text-align:center;gap:10px;min-height:50vh;padding:48px 24px}.empty-icon{width:64px;height:64px;border-radius:18px;background:linear-gradient(135deg,var(--accent),#b46cff);color:#fff;display:grid;place-items:center;font-size:26px;font-weight:800;box-shadow:0 18px 40px -16px #6f7effb3}.empty strong{color:var(--text-strong);font-size:18px;letter-spacing:-.01em}.empty span{color:var(--muted);max-width:380px;line-height:1.5}.day-divider{display:flex;align-items:center;gap:12px;margin:18px 18px 8px;position:sticky;top:0;z-index:1;pointer-events:none}.day-divider:before,.day-divider:after{content:"";flex:1;height:1px;background:var(--line)}.day-divider span{background:var(--bg);border:1px solid var(--line);border-radius:999px;padding:4px 12px;font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}.message-group{display:grid;grid-template-columns:56px minmax(0,1fr);padding:8px 18px;position:relative}.message-group:hover{background:var(--hover)}.avatar{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;color:#fff;font-weight:700;font-size:14px;background:linear-gradient(135deg,hsl(var(--hue, 220deg) 70% 55%),hsl(calc(var(--hue, 220deg) + 40deg) 70% 45%));box-shadow:0 6px 20px -10px #0009;margin-top:2px;overflow:hidden}.avatar-button{position:relative;z-index:2;border:0;padding:0;cursor:pointer;transition:transform .1s ease,box-shadow .12s ease,filter .12s ease}.avatar-button:hover{transform:translateY(-1px);filter:brightness(1.05);box-shadow:0 10px 24px -12px #000c}.avatar.small{width:30px;height:30px;font-size:12px;border-radius:10px}.avatar.large{width:56px;height:56px;border-radius:16px;font-size:18px;margin:0}.group-body{min-width:0}.group-body>header{display:flex;align-items:baseline;gap:8px;margin-bottom:2px}.group-body>header strong{color:var(--text-strong);font-size:14.5px;letter-spacing:-.005em;font-weight:700}.author-name{border:0;background:transparent;color:var(--text-strong);padding:0;border-radius:4px;font-size:14.5px;letter-spacing:0;font-weight:700}.author-name:hover{color:var(--accent);text-decoration:underline;text-underline-offset:2px}.group-body>header time{color:var(--muted);font-size:11px}.group-body>header span{color:var(--muted);font-size:12px}.message-row{margin-left:-56px;padding:1px 0 1px 56px;position:relative;border-radius:0;transition:background 80ms ease}.message-row:not(:first-child){margin-top:1px}.message-row:hover{background:var(--hover-strong)}.message-row.selected{background:var(--accent-soft)}.message-row.selected:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--accent)}.row-stamp{position:absolute;left:8px;top:4px;font-size:10px;color:var(--muted-2);opacity:0;font-variant-numeric:tabular-nums}.message-row:hover .row-stamp{opacity:1}.message-content{min-width:0}.message-actions{display:flex;align-items:flex-start;gap:4px;opacity:0;transform:translateY(-50%);position:absolute;right:8px;top:0;background:var(--panel);border:1px solid var(--line-strong);border-radius:8px;padding:2px;box-shadow:var(--shadow);transition:opacity .1s ease,transform .1s ease}.message-row:hover .message-actions,.message-row.selected .message-actions{opacity:1}.message-actions button{width:28px;height:28px;display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:var(--muted)}.message-actions button:hover{background:var(--hover-strong);color:var(--text-strong)}.markdown{line-height:1.5;color:var(--text);font-size:14.5px;overflow-wrap:anywhere;word-break:break-word}.markdown>:first-child{margin-top:0}.markdown>:last-child{margin-bottom:0}.markdown p{margin:0}.markdown p+p,.markdown ul,.markdown ol,.markdown blockquote,.markdown pre{margin-top:6px}.markdown a{color:var(--accent);text-decoration:none}.markdown a:hover{text-decoration:underline}.markdown code{background:var(--panel-2);border:1px solid var(--line);border-radius:4px;padding:1px 5px;font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.9em}.markdown pre{background:var(--panel-2);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;overflow-x:auto}.markdown pre code{background:transparent;border:0;padding:0}.markdown blockquote{border-left:3px solid var(--accent);margin:0;padding:4px 0 4px 12px;color:var(--muted)}.markdown ul,.markdown ol{padding-left:22px}.markdown img{max-width:100%;max-height:360px;border-radius:var(--radius);margin-top:6px;border:1px solid var(--line);object-fit:contain;background:var(--panel);cursor:zoom-in}.attachment-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px;margin-top:8px;max-width:560px}.attachment-grid.compact{grid-template-columns:minmax(0,1fr);max-width:420px}.media-tile{position:relative;display:block;width:100%;margin:0;padding:0;border:1px solid var(--line);border-radius:var(--radius-lg);background:#0a0c12;overflow:hidden;isolation:isolate;text-align:left;color:inherit;text-decoration:none;cursor:pointer;transition:border-color .14s ease,transform .14s ease,box-shadow .14s ease}.media-tile:hover{border-color:var(--line-strong);box-shadow:0 18px 40px -28px #000000e6}.media-tile:focus-visible{outline:none;border-color:var(--line-strong);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}.media-tile--image{cursor:zoom-in}.media-tile__open{display:block;width:100%;margin:0;padding:0;border:0;background:transparent;color:inherit;cursor:zoom-in}.media-tile__open:focus{outline:0}.media-tile__open:focus-visible+.media-tile__caption .media-tile__name{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}.media-tile--video{cursor:default}.media-tile img,.media-tile video{display:block;width:100%;max-height:360px;object-fit:contain;background:#05070d}.media-tile--image img{max-height:320px}.media-tile__caption{position:absolute;inset:auto 0 0;z-index:3;display:flex;align-items:center;gap:8px;padding:22px 10px 8px;background:linear-gradient(to top,#000000c7,#00000080 40%,#0000);opacity:0;pointer-events:auto;transition:opacity .14s ease}.media-tile:hover .media-tile__caption,.media-tile:focus-within .media-tile__caption{opacity:1}.media-tile--video.is-started .media-tile__caption{display:none}.media-tile__name{flex:1;min-width:0;color:#fff;font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 2px rgba(0,0,0,.6)}.media-tile__chip{position:relative;z-index:4;display:inline-grid;place-items:center;width:28px;height:28px;flex:none;border-radius:8px;background:#00000080;color:#fff;border:1px solid rgba(255,255,255,.18);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);text-decoration:none;transition:background .12s ease,border-color .12s ease,transform .12s ease}.media-tile__chip:hover{background:#000000b3;border-color:#ffffff52;transform:translateY(-1px)}.media-tile__play{position:absolute;inset:0 0 48px;display:grid;place-items:center;width:100%;height:auto;border:0;margin:0;padding:0;background:transparent;cursor:pointer;z-index:1}.media-tile__play:before{content:"";position:absolute;inset:0;background:radial-gradient(ellipse at center,#0000002e,#0000000d 45%,#0000 70%);opacity:.7;transition:opacity .16s ease;pointer-events:none}.media-tile__play:hover:before{opacity:.9}.media-tile__play-icon{position:relative;display:grid;place-items:center;width:46px;height:46px;border-radius:999px;background:#0000008c;color:#fff;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);box-shadow:0 6px 20px -8px #0000008c;padding-left:3px;transition:transform .2s cubic-bezier(.2,.8,.2,1),background .18s ease,box-shadow .2s ease}.media-tile__play-icon svg{filter:drop-shadow(0 1px 2px rgba(0,0,0,.4))}.media-tile__play:hover .media-tile__play-icon{transform:scale(1.06);background:#000000b3;box-shadow:0 10px 28px -10px #000000a6}.media-tile__play:active .media-tile__play-icon{transform:scale(.97);transition-duration:80ms}.media-tile__play:focus-visible{outline:none}.media-tile__play:focus-visible .media-tile__play-icon{box-shadow:0 0 0 2px #fff9,0 10px 28px -10px #000000a6}.media-tile__duration{position:absolute;left:8px;bottom:8px;z-index:2;padding:2px 6px;border-radius:4px;background:#000000b8;color:#fff;font-size:11px;font-variant-numeric:tabular-nums;font-weight:600;letter-spacing:.02em;pointer-events:none}.file-attachment{display:flex;align-items:center;gap:10px;max-width:360px;padding:10px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel)}.file-attachment:hover{border-color:var(--line-strong);background:var(--panel-2)}.file-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:8px;background:var(--accent-soft);color:var(--accent);font-weight:800}.file-attachment strong,.file-attachment small{display:block}.file-attachment strong{color:var(--text-strong);font-size:13px}.file-attachment small{color:var(--muted);font-size:11px}.composer{padding:18px 18px 10px;background:var(--bg);display:grid;gap:0;position:relative}.composer-card{display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line-strong);border-radius:var(--radius-lg);overflow:hidden;transition:border-color .12s ease,box-shadow .12s ease}.composer:focus-within .composer-card{border-color:color-mix(in srgb,var(--accent) 55%,var(--line-strong));box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}.composer-toolbar{display:inline-flex;align-items:center;gap:2px;width:100%;padding:4px 6px;margin:0;border:0;border-top:1px solid var(--line);border-radius:0;background:color-mix(in srgb,var(--panel-2) 35%,transparent);box-shadow:none}.composer-toolbar button{min-width:28px;height:26px;display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:var(--text);opacity:.78;font-size:11.5px;font-weight:700;transition:background .1s ease,color .1s ease,opacity .1s ease,transform 80ms ease}.composer-toolbar button:hover{background:var(--hover-strong);color:var(--text-strong);opacity:1}.composer-toolbar button.active{background:var(--accent-soft);color:var(--accent);opacity:1}.composer-toolbar button:active{transform:translateY(1px)}.gif-picker{margin-top:8px;margin-bottom:8px;width:min(520px,calc(100vw - 40px));border:1px solid var(--line-strong);border-radius:16px;background:color-mix(in srgb,var(--panel) 96%,transparent);box-shadow:var(--shadow);padding:10px;animation:picker-in .16s cubic-bezier(.2,.8,.2,1)}.gif-picker-head{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;padding:2px 2px 10px}.gif-picker-head strong{color:var(--text-strong);font-size:13px}.gif-picker-head input{min-width:0;height:32px;padding:0 10px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel-2)}.gif-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-height:240px;overflow-y:auto}.gif-grid button{position:relative;overflow:hidden;aspect-ratio:4 / 3;border:0;border-radius:12px;background:var(--panel-2);color:#fff;padding:0;box-shadow:inset 0 0 0 1px var(--line);transition:transform .12s ease,box-shadow .12s ease}.gif-grid button:hover{transform:translateY(-2px);box-shadow:inset 0 0 0 2px var(--accent),0 14px 30px -22px #000c}.gif-grid img{width:100%;height:100%;display:block;object-fit:cover}.gif-grid span{position:absolute;left:6px;right:6px;bottom:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:999px;background:#0000008f;padding:4px 7px;font-size:10.5px;font-weight:700;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}@keyframes picker-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.composer-row{--composer-control-size: 36px;--composer-line-height: 22px;--composer-text-padding-block: 7px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:4px;padding:8px 8px 4px 10px;background:transparent;border:0;border-radius:0}.composer:focus-within .composer-toolbar,.composer-row:focus-within{border-color:transparent}.composer-row:focus-within{box-shadow:none}.composer-icon{align-self:start;width:var(--composer-control-size);height:var(--composer-control-size);margin-top:calc(var(--composer-text-padding-block) + (var(--composer-line-height) - var(--composer-control-size)) / 2);display:grid;place-items:center;color:var(--muted);border-radius:10px;cursor:pointer;transition:background .12s ease,color .12s ease}.composer-icon:hover{background:var(--hover-strong);color:var(--text-strong)}.composer-icon input[type=file]{position:absolute;inline-size:1px;block-size:1px;opacity:0;pointer-events:none}.composer textarea,.reply-composer textarea{width:100%;height:auto;min-height:44px;max-height:50vh;padding:var(--composer-text-padding-block) 4px;resize:none;color:var(--text);line-height:var(--composer-line-height);font-size:14.5px;align-self:start;overflow-y:auto;box-sizing:border-box}.composer textarea::placeholder,.reply-composer textarea::placeholder{color:var(--muted)}.send{align-self:start;width:var(--composer-control-size);height:var(--composer-control-size);margin-top:calc(var(--composer-text-padding-block) + (var(--composer-line-height) - var(--composer-control-size)) / 2);display:grid;place-items:center;border:0;border-radius:10px;background:var(--accent);color:#fff;transition:background .12s ease,transform 80ms ease,opacity .12s ease}.send:hover:not(:disabled){background:var(--accent-2);transform:translateY(-1px)}.send:disabled{background:var(--panel-3);color:var(--muted-2);cursor:not-allowed}.composer-attachment{margin-top:8px;margin-bottom:8px;display:inline-flex;align-items:center;gap:8px;padding:6px 10px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);color:var(--text);font-size:13px;width:fit-content}.attachment-icon{display:grid;place-items:center;width:20px;height:20px;border-radius:6px;background:var(--accent-soft);color:var(--accent)}.pending-image{width:42px;height:32px;object-fit:cover;border-radius:7px;border:1px solid var(--line);background:var(--panel-2)}.attachment-name{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachment-remove{width:18px;height:18px;border:0;background:transparent;color:var(--muted);border-radius:50%;font-size:14px;line-height:1}.attachment-remove:hover{background:var(--danger);color:#fff}.composer-hint{color:var(--muted-2);font-size:11px;padding:7px 4px 0}.composer-hint kbd{display:inline-block;background:var(--panel-2);border:1px solid var(--line);border-radius:4px;padding:0 5px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:10.5px;color:var(--text)}.thread{display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:var(--panel);border-left:1px solid var(--line);min-width:0;overflow:hidden;opacity:0;transform:translate(28px);pointer-events:none;transition:opacity .18s ease,transform .22s cubic-bezier(.2,.8,.2,1)}.thread.open{opacity:1;transform:translate(0);pointer-events:auto}.thread>header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;min-height:60px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,rgba(255,255,255,.02),transparent),var(--panel)}.thread>header p,.thread>header strong{margin:0}.thread>header p{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.04em;font-weight:700}.thread>header strong{display:block;color:var(--text-strong);font-size:14px}.thread .close{width:28px;height:28px;border:0;border-radius:50%;background:var(--panel-2);color:var(--muted);font-size:18px;line-height:1}.thread .close:hover{background:var(--panel-3);color:var(--text-strong)}.thread-scroll{overflow-y:auto;padding:12px 16px}.thread-root{display:grid;grid-template-columns:38px minmax(0,1fr);gap:12px;padding-bottom:12px;border-bottom:1px solid var(--line)}.thread-divider{display:flex;align-items:center;gap:10px;margin:14px 0 10px}.thread-divider:before,.thread-divider:after{content:"";flex:1;height:1px;background:var(--line)}.thread-divider span{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-weight:700}.reply-list{display:flex;flex-direction:column;gap:10px}.reply{display:grid;grid-template-columns:30px minmax(0,1fr);gap:10px;padding:6px;border-radius:var(--radius-sm)}.reply:hover{background:var(--hover)}.reply-composer{padding:10px 14px 14px;background:var(--panel);border-top:1px solid var(--line)}.reply-composer .composer-row{border-radius:0}.thread-empty{display:grid;place-items:center;align-content:center;gap:8px;padding:32px 24px;text-align:center;grid-row:span 3}.thread-icon{width:56px;height:56px;border-radius:16px;background:var(--panel-2);color:var(--muted);display:grid;place-items:center}.thread-empty strong{color:var(--text-strong);font-size:15px}.thread-empty span{color:var(--muted);font-size:13px;max-width:260px;line-height:1.5}.profile-pane{overflow-y:auto}.profile-hero{min-height:210px;display:grid;place-items:end center;padding:28px 20px;background:linear-gradient(180deg,transparent,rgba(0,0,0,.24)),linear-gradient(135deg,hsl(var(--hue, 220deg) 76% 58%),hsl(calc(var(--hue, 220deg) + 54deg) 74% 38%));border-bottom:1px solid var(--line)}.profile-avatar{width:min(240px,70%);aspect-ratio:1;display:grid;place-items:center;overflow:hidden;border-radius:16px;background:#ffffff2e;color:#fff;font-size:clamp(48px,12vw,88px);font-weight:800;box-shadow:0 26px 60px -30px #000000e6}.profile-avatar img{width:100%;height:100%;object-fit:cover}.profile-pane-body{display:grid;gap:18px;padding:18px 16px 22px}.profile-pane-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.profile-pane-title h2{margin:0;color:var(--text-strong);font-size:22px;letter-spacing:0}.profile-pane-title span{display:block;margin-top:3px;color:var(--muted);font-size:13px}.text-action{border:0;border-radius:6px;background:transparent;color:var(--accent);font-size:13px;font-weight:700;padding:4px 6px}.text-action:hover{background:var(--accent-soft)}.profile-presence{display:inline-flex;align-items:center;gap:8px;color:var(--text);font-size:14px}.profile-actions-row{display:flex;gap:8px;flex-wrap:wrap}.profile-actions-row .primary-action,.profile-actions-row .ghost-action{min-width:110px}.profile-info{display:grid;gap:12px;padding-top:18px;border-top:1px solid var(--line)}.profile-info header{display:flex;align-items:center;justify-content:space-between;gap:10px}.profile-info header strong{color:var(--text-strong);font-size:14px}.profile-info-row{display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;align-items:center}.info-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;background:var(--panel-2);color:var(--muted);font-size:11px;font-weight:800}.profile-info-row small,.profile-info-row span{display:block}.profile-info-row small{color:var(--muted);font-size:11px}.profile-info-row span{color:var(--text);font-size:13px;overflow-wrap:anywhere}.profile-note{margin:0;color:var(--muted);line-height:1.5;font-size:13px}.modal-scrim{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:24px;background:#05080f8a;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}.modal-backdrop{position:absolute;inset:0;border:0;background:transparent}.modal-backdrop:focus{outline:0}.profile-modal{position:relative;z-index:1;width:min(480px,100%);border:1px solid var(--line-strong);border-radius:14px;background:var(--panel);color:var(--text);box-shadow:var(--shadow);overflow:hidden}.profile-modal>header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;border-bottom:1px solid var(--line);background:var(--panel-2)}.profile-modal p{margin:0 0 3px;color:var(--muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}.profile-modal h2{margin:0;color:var(--text-strong);font-size:20px;letter-spacing:0}.profile-modal>header button{width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:22px}.profile-modal>header button:hover{background:var(--hover);color:var(--text-strong)}.profile-form{display:grid;gap:14px;padding:20px}.profile-preview{display:flex;align-items:center;gap:14px;padding:14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel-2)}.profile-preview strong,.profile-preview span{display:block}.profile-preview strong{color:var(--text-strong);font-size:15px}.profile-preview span{color:var(--muted);font-size:13px}.field{display:grid;gap:6px}.field span{color:var(--muted);font-size:12px;font-weight:700}.field input{width:100%;height:38px;padding:0 12px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel-2);color:var(--text)}.field input:focus{border-color:var(--accent);outline:0;box-shadow:0 0 0 3px var(--accent-soft)}.profile-status{color:var(--success);font-size:12px}.profile-status.error{color:var(--danger)}.profile-actions{display:flex;justify-content:flex-end;gap:8px;padding-top:4px}.ghost-action,.primary-action{height:36px;padding:0 14px;border-radius:var(--radius-sm);font-weight:700}.ghost-action{border:1px solid var(--line);background:var(--panel);color:var(--text)}.primary-action{border:0;background:var(--accent);color:#fff}.ghost-action:hover{background:var(--hover)}.primary-action:hover{filter:brightness(1.04)}.image-viewer-scrim{padding:28px;background:#000000c7;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px)}.image-viewer{position:relative;z-index:1;display:grid;grid-template-rows:auto minmax(0,1fr);width:min(1120px,100%);max-height:min(86vh,900px);overflow:hidden;border-radius:14px;background:#07090f;color:#fff;box-shadow:0 34px 90px -34px #000000f2;animation:picker-in .15s cubic-bezier(.2,.8,.2,1)}.image-viewer>header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;padding:10px 12px 10px 16px;border-bottom:1px solid rgba(255,255,255,.1);background:#ffffff0a}.image-viewer>header strong{min-width:0;overflow:hidden;color:#fff;font-size:13px;text-overflow:ellipsis;white-space:nowrap}.image-viewer>header div{display:inline-flex;align-items:center;gap:8px;flex-shrink:0}.image-viewer>header a{height:30px;display:inline-flex;align-items:center;padding:0 10px;border-radius:7px;background:#ffffff14;color:#fff;font-size:12px;font-weight:700;text-decoration:none}.image-viewer>header a:hover{background:#ffffff24}.image-viewer>header button{width:30px;height:30px;display:grid;place-items:center;border:0;border-radius:7px;background:transparent;color:#ffffffc7;font-size:22px;line-height:1}.image-viewer>header button:hover{background:#ffffff1f;color:#fff}.image-viewer-stage{display:grid;place-items:center;min-height:0;padding:18px}.image-viewer-stage img{display:block;max-width:100%;max-height:calc(86vh - 96px);object-fit:contain;border-radius:8px;background:#ffffff0a}.mobile-nav-toggle{display:none;position:fixed;top:14px;left:14px;z-index:30;width:38px;height:38px;border-radius:10px;border:1px solid var(--line-strong);background:var(--panel);color:var(--text);font-size:22px;line-height:1}.mobile-nav-toggle .bars{display:grid;gap:3px}.mobile-nav-toggle .bars i{display:block;width:16px;height:2px;background:currentColor;border-radius:2px}@media(max-width:1180px){.shell{grid-template-columns:72px 240px minmax(0,1fr)}.shell.sidebar-collapsed,.shell.sidebar-collapsed.thread-open{grid-template-columns:72px 0 minmax(0,1fr)}.thread{position:fixed;inset:0 0 0 auto;width:min(420px,100vw);box-shadow:var(--shadow);transform:translate(100%);transition:transform .18s ease;z-index:4;border-left:1px solid var(--line-strong)}.thread.open{transform:translate(0)}}@media(max-width:820px){.mobile-nav-toggle{display:grid;place-items:center}.shell,.shell.thread-open,.shell.sidebar-collapsed,.shell.sidebar-collapsed.thread-open{grid-template-columns:1fr}.sidebar-collapsed .sidebar{opacity:1;pointer-events:auto;transform:translate(-100%)}.guild-rail,.sidebar{position:fixed;inset:0 auto 0 0;z-index:20;transform:translate(-100%);transition:transform .18s ease}.guild-rail{width:72px}.sidebar{left:72px;width:260px}.nav-open .guild-rail,.nav-open .sidebar{transform:translate(0)}.topbar{padding-left:64px}.search{width:180px}}@media(max-width:520px){.search,.topbar-meta,.topbar-divider{display:none}}.message-row.highlight,.thread-root.highlight,.reply.highlight{animation:quote-flash 1.4s ease-out}@keyframes quote-flash{0%{background:#6366f138}to{background:transparent}}.quote-block{display:inline-flex;align-items:stretch;gap:.5rem;margin:0 0 .35rem;padding:.25rem .5rem .25rem 0;background:transparent;border:0;border-radius:6px;color:inherit;cursor:pointer;text-align:left;max-width:100%;font:inherit}.quote-block:hover:not(:disabled){background:#6366f114}.quote-block:disabled{cursor:default;opacity:.75}.quote-block .quote-bar{width:3px;align-self:stretch;background:var(--accent, #6366f1);border-radius:2px;flex:0 0 3px}.quote-block .quote-content{display:flex;flex-direction:column;gap:.1rem;min-width:0}.quote-block .quote-author{font-size:.78rem;font-weight:600;color:var(--accent, #6366f1)}.quote-block .quote-snippet{font-size:.85rem;color:var(--text-muted, #6b7280);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:56ch}.quote-block .quote-snippet.muted{font-style:italic;opacity:.75}.quote-preview{display:flex;align-items:center;gap:.5rem;padding:6px 10px 6px 12px;margin:0;background:color-mix(in srgb,var(--accent) 5%,transparent);border:0;border-bottom:1px solid var(--line);border-radius:0;font-size:12.5px;color:var(--muted)}.quote-preview .quote-bar{display:none}.quote-preview-body{display:flex;align-items:baseline;gap:.4rem;flex:1;min-width:0;overflow:hidden}.quote-preview-label{font-size:12px;color:color-mix(in srgb,var(--accent) 85%,var(--text));white-space:nowrap}.quote-preview-label strong{color:var(--text-strong);font-weight:600}.quote-preview-snippet{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted);font-size:12px;flex:1;min-width:0}.quote-preview-clear{background:transparent;border:0;color:var(--muted);font-size:16px;line-height:1;cursor:pointer;padding:2px 6px;border-radius:6px;transition:background .1s ease,color .1s ease}.quote-preview-clear:hover{color:var(--text-strong);background:var(--hover-strong)}.reply-quote-btn{position:relative;margin-left:auto;background:transparent;border:0;color:var(--text-muted, #6b7280);cursor:pointer;font-size:.95rem;padding:0 .3rem;opacity:0;transition:opacity .15s}.reply:hover .reply-quote-btn,.thread-root:hover .reply-quote-btn,.reply-quote-btn:focus-visible{opacity:1}.reply-quote-btn:hover{color:var(--accent, #6366f1)}.tooltip{position:relative}.tooltip:before,.reply-quote-btn:before{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 12px);z-index:20;transform:translate(-50%,4px) scale(.96);padding:.42rem .62rem;border-radius:9px;background:#3a3a44;color:#f4f4f7;box-shadow:0 10px 28px #00000047;font-size:.78rem;font-weight:700;line-height:1;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease}.tooltip:after,.reply-quote-btn:after{content:"";position:absolute;left:50%;bottom:calc(100% + 5px);z-index:20;width:12px;height:12px;border-radius:2px;background:#3a3a44;transform:translate(-50%,4px) rotate(45deg) scale(.9);opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease}.tooltip:hover:before,.tooltip:focus-visible:before,.reply-quote-btn:hover:before,.reply-quote-btn:focus-visible:before,.tooltip:hover:after,.tooltip:focus-visible:after,.reply-quote-btn:hover:after,.reply-quote-btn:focus-visible:after{opacity:1;transform:translate(-50%) scale(1)}.tooltip:hover:after,.tooltip:focus-visible:after,.reply-quote-btn:hover:after,.reply-quote-btn:focus-visible:after{transform:translate(-50%) rotate(45deg) scale(1)} diff --git a/apps/api/internal/webassets/dist/index.html b/apps/api/internal/webassets/dist/index.html index 1e83b0f..f80ba2a 100644 --- a/apps/api/internal/webassets/dist/index.html +++ b/apps/api/internal/webassets/dist/index.html @@ -4,8 +4,8 @@ ClickClack - - + +