From 0cedf8e14b21895264fbc9eb56f2510e7cabe59f Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 8 May 2026 14:41:54 +0100 Subject: [PATCH] fix: refine media attachment previews --- .../webassets/dist/assets/index-DimLK6Kw.js | 72 +++++ ...{index-BddjDjB3.css => index-u1LjbixA.css} | 2 +- .../webassets/dist/assets/index-vInMpaH9.js | 72 ----- apps/api/internal/webassets/dist/index.html | 4 +- apps/web/src/ChatApp.svelte | 94 ++----- .../web/src/components/MediaAttachment.svelte | 137 +++++++++ apps/web/src/styles.css | 266 ++++++++++++++---- tests/e2e/chat.spec.ts | 31 +- 8 files changed, 470 insertions(+), 208 deletions(-) create mode 100644 apps/api/internal/webassets/dist/assets/index-DimLK6Kw.js rename apps/api/internal/webassets/dist/assets/{index-BddjDjB3.css => index-u1LjbixA.css} (52%) delete mode 100644 apps/api/internal/webassets/dist/assets/index-vInMpaH9.js create mode 100644 apps/web/src/components/MediaAttachment.svelte diff --git a/apps/api/internal/webassets/dist/assets/index-DimLK6Kw.js b/apps/api/internal/webassets/dist/assets/index-DimLK6Kw.js new file mode 100644 index 0000000..20c767b --- /dev/null +++ b/apps/api/internal/webassets/dist/assets/index-DimLK6Kw.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 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('

    Enter to send · Shift+Enter for newline · Markdown supported
    ',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-BddjDjB3.css b/apps/api/internal/webassets/dist/assets/index-u1LjbixA.css similarity index 52% rename from apps/api/internal/webassets/dist/assets/index-BddjDjB3.css rename to apps/api/internal/webassets/dist/assets/index-u1LjbixA.css index 1d54edd..2298a8a 100644 --- a/apps/api/internal/webassets/dist/assets/index-BddjDjB3.css +++ b/apps/api/internal/webassets/dist/assets/index-u1LjbixA.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(180px,280px));gap:8px;margin-top:8px}.attachment-grid.compact{grid-template-columns:minmax(0,1fr)}.image-attachment,.video-attachment,.file-attachment{color:inherit;text-decoration:none}.image-attachment,.video-attachment{position:relative;display:block;width:100%;overflow:hidden;padding:0;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel);box-shadow:0 12px 30px -24px #000c;text-align:left;cursor:zoom-in;transition:border-color .12s ease,transform .12s ease,box-shadow .12s ease}.image-attachment:hover{border-color:color-mix(in srgb,var(--accent) 42%,var(--line));transform:translateY(-1px);box-shadow:0 16px 36px -26px #000000e6}.video-attachment{cursor:default}.image-attachment img{display:block;width:100%;max-height:320px;object-fit:cover}.video-attachment video{display:block;width:100%;max-height:360px;background:#05070d}.image-attachment span{position:absolute;left:8px;bottom:8px;max-width:calc(100% - 16px);padding:4px 8px;border-radius:999px;background:#00000094;color:#fff;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.video-attachment a{display:block;padding:8px 10px;color:var(--muted);font-size:12px;text-decoration:none;background:var(--panel-2)}.video-attachment a:hover{color:var(--text-strong)}.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:10px 18px 18px;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{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:end;gap:6px;padding:6px 8px 6px 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{width:36px;height:36px;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:36px;max-height:50vh;padding:8px 4px;resize:none;color:var(--text);line-height:1.45;font-size:14.5px;align-self:end;overflow-y:auto;box-sizing:border-box}.composer textarea::placeholder,.reply-composer textarea::placeholder{color:var(--muted)}.send{width:36px;height:36px;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}.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:1px solid rgba(255,255,255,.14);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)}.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:10px 18px 18px;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{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:end;gap:6px;padding:6px 8px 6px 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{width:36px;height:36px;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:36px;max-height:50vh;padding:8px 4px;resize:none;color:var(--text);line-height:1.45;font-size:14.5px;align-self:end;overflow-y:auto;box-sizing:border-box}.composer textarea::placeholder,.reply-composer textarea::placeholder{color:var(--muted)}.send{width:36px;height:36px;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/assets/index-vInMpaH9.js b/apps/api/internal/webassets/dist/assets/index-vInMpaH9.js deleted file mode 100644 index 1258b37..0000000 --- a/apps/api/internal/webassets/dist/assets/index-vInMpaH9.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"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();const Kc=!1;var jl=Array.isArray,Jc=Array.prototype.indexOf,Jr=Array.prototype.includes,vs=Array.from,Qc=Object.defineProperty,Da=Object.getOwnPropertyDescriptor,Zl=Object.getOwnPropertyDescriptors,eu=Object.prototype,tu=Array.prototype,fi=Object.getPrototypeOf,vl=Object.isExtensible;const nu=()=>{};function ru(e){return e()}function Zs(e){for(var t=0;t{e=s,t=a});return{promise:n,resolve:e,reject:t}}const ht=2,Qr=4,$a=8,Xl=1<<24,Mn=16,bn=32,fr=64,Ys=128,Vt=512,Ye=1024,ct=2048,kn=4096,wt=8192,Kt=16384,Lr=32768,Xs=1<<25,ea=65536,Vs=1<<17,Vl=1<<18,Dr=1<<19,Kl=1<<20,On=1<<25,Ar=65536,us=1<<21,Na=1<<22,cr=1<<23,Kr=Symbol("$state"),au=Symbol(""),Vn=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function Jl(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function su(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function iu(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function lu(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function ou(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function cu(e){throw new Error("https://svelte.dev/e/effect_orphan")}function uu(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function fu(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function du(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function pu(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function hu(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const vu=1,_u=2,Ql=4,gu=8,mu=16,bu=1,ku=2,tt=Symbol(),eo="http://www.w3.org/1999/xhtml",wu="http://www.w3.org/2000/svg",yu="http://www.w3.org/1998/Math/MathML";function xu(){console.warn("https://svelte.dev/e/derived_inert")}function Tu(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function to(e){return e===this.v}function no(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function ro(e){return!no(e,this.v)}let Fa=!1,Eu=!1;function Su(){Fa=!0}let Le=null;function ta(e){Le=e}function di(e,t=!1,n){Le={p:Le,i:!1,c:null,e:null,s:e,x:null,r:re,l:Fa&&!t?{s:null,u:null,$:[]}:null}}function pi(e){var t=Le,n=t.e;if(n!==null){t.e=null;for(var s of n)Eo(s)}return t.i=!0,Le=t.p,{}}function Ua(){return!Fa||Le!==null&&Le.l===null}let yr=[];function ao(){var e=yr;yr=[],Zs(e)}function ur(e){if(yr.length===0&&!Oa){var t=yr;queueMicrotask(()=>{t===yr&&ao()})}yr.push(e)}function Au(){for(;yr.length>0;)ao()}function so(e){var t=re;if(t===null)return de.f|=cr,e;if((t.f&Lr)===0&&(t.f&Qr)===0)throw e;lr(e,t)}function lr(e,t){for(;t!==null;){if((t.f&Ys)!==0){if((t.f&Lr)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const Ru=-7169;function $e(e,t){e.f=e.f&Ru|t}function hi(e){(e.f&Vt)!==0||e.deps===null?$e(e,Ye):$e(e,kn)}function io(e){if(e!==null)for(const t of e)(t.f&ht)===0||(t.f&Ar)===0||(t.f^=Ar,io(t.deps))}function lo(e,t,n){(e.f&ct)!==0?t.add(e):(e.f&kn)!==0&&n.add(e),io(e.deps),$e(e,Ye)}const kr=new Set;let ne=null,gn=null,Ks=null,Oa=!1,zs=!1,Vr=null,os=null;var _l=0;let Cu=1;class dr{id=Cu++;current=new Map;previous=new Map;#n=new Set;#o=new Set;#e=new Set;#a=new Map;#r=new Map;#s=null;#t=[];#i=[];#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}#g(){for(const s of this.#p)for(const a of s.#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=s=>this.schedule(s)){var s=this.#l.get(t);if(s){this.#l.delete(t);for(var a of s.d)$e(a,ct),n(a);for(a of s.m)$e(a,kn),n(a)}this.#d.add(t)}#v(){if(_l++>1e3&&(kr.delete(this),Lu()),!this.#f()){for(const c of this.#c)this.#u.delete(c),$e(c,ct),this.schedule(c);for(const c of this.#u)$e(c,kn),this.schedule(c)}const t=this.#t;this.#t=[],this.apply();var n=Vr=[],s=[],a=os=[];for(const c of t)try{this.#m(c,n,s)}catch(o){throw uo(c),o}if(ne=null,a.length>0){var i=dr.ensure();for(const c of a)i.schedule(c)}if(Vr=null,os=null,this.#f()||this.#g()){this.#_(s),this.#_(n);for(const[c,o]of this.#l)co(c,o)}else{this.#a.size===0&&kr.delete(this),this.#c.clear(),this.#u.clear();for(const c of this.#n)c(this);this.#n.clear(),gl(s),gl(n),this.#s?.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&&(kr.add(l),l.#v())}#m(t,n,s){t.f^=Ye;for(var a=t.first;a!==null;){var i=a.f,l=(i&(bn|fr))!==0,c=l&&(i&Ye)!==0,o=c||(i&wt)!==0||this.#l.has(a);if(!o&&a.fn!==null){l?a.f^=Ye:(i&Qr)!==0?n.push(a):sa(a)&&((i&Mn)!==0&&this.#u.add(a),Cr(a));var f=a.first;if(f!==null){a=f;continue}}for(;a!==null;){var h=a.next;if(h!==null){a=h;break}a=a.parent}}}#_(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&(Mn|Na))!==0?h.schedule(m):h.#_([m])});h.activate();var i=new Set,l=new Map;for(var c of n)oo(c,a,i,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.#i)(w.f&(Kt|wt|Vs))===0&&vi(w,o,l)&&((w.f&(Na|Mn))!==0?($e(w,ct),h.schedule(w)):h.#c.add(w));if(h.#t.length>0){h.apply();for(var f of h.#t)h.#m(f,[],[]);h.#t=[]}h.deactivate()}}for(const h of kr)h.#p.has(this)&&(h.#p.delete(this),h.#p.size===0&&!h.#f()&&(h.activate(),h.#v()))}increment(t,n){let s=this.#a.get(n)??0;if(this.#a.set(n,s+1),t){let a=this.#r.get(n)??0;this.#r.set(n,a+1)}}decrement(t,n,s){let a=this.#a.get(n)??0;if(a===1?this.#a.delete(n):this.#a.set(n,a-1),t){let i=this.#r.get(n)??0;i===1?this.#r.delete(n):this.#r.set(n,i-1)}this.#h||s||(this.#h=!0,ur(()=>{this.#h=!1,this.flush()}))}transfer_effects(t,n){for(const s of t)this.#c.add(s);for(const s of n)this.#u.add(s);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.#s??=Yl()).promise}static ensure(){if(ne===null){const t=ne=new dr;zs||(kr.add(ne),Oa||ur(()=>{ne===t&&t.flush()}))}return ne}apply(){{gn=null;return}}schedule(t){if(Ks=t,t.b?.is_pending&&(t.f&(Qr|$a|Xl))!==0&&(t.f&Lr)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var s=n.f;if(Vr!==null&&n===re&&(de===null||(de.f&ht)===0))return;if((s&(fr|bn))!==0){if((s&Ye)===0)return;n.f^=Ye}}this.#t.push(n)}}function Iu(e){var t=Oa;Oa=!0;try{for(var n;;){if(Au(),ne===null)return n;ne.flush()}}finally{Oa=t}}function Lu(){try{uu()}catch(e){lr(e,Ks)}}let Xn=null;function gl(e){var t=e.length;if(t!==0){for(var n=0;n0)){Tr.clear();for(const a of Xn){if((a.f&(Kt|wt))!==0)continue;const i=[a];let l=a.parent;for(;l!==null;)Xn.has(l)&&(Xn.delete(l),i.push(l)),l=l.parent;for(let c=i.length-1;c>=0;c--){const o=i[c];(o.f&(Kt|wt))===0&&Cr(o)}}Xn.clear()}}Xn=null}}function oo(e,t,n,s){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const a of e.reactions){const i=a.f;(i&ht)!==0?oo(a,t,n,s):(i&(Na|Mn))!==0&&(i&ct)===0&&vi(a,t,s)&&($e(a,ct),_i(a))}}function vi(e,t,n){const s=n.get(e);if(s!==void 0)return s;if(e.deps!==null)for(const a of e.deps){if(Jr.call(t,a))return!0;if((a.f&ht)!==0&&vi(a,t,n))return n.set(a,!0),!0}return n.set(e,!1),!1}function _i(e){ne.schedule(e)}function co(e,t){if(!((e.f&bn)!==0&&(e.f&Ye)!==0)){(e.f&ct)!==0?t.d.push(e):(e.f&kn)!==0&&t.m.push(e),$e(e,Ye);for(var n=e.first;n!==null;)co(n,t),n=n.next}}function uo(e){$e(e,Ye);for(var t=e.first;t!==null;)uo(t),t=t.next}function Du(e){let t=0,n=Rr(0),s;return()=>{bi()&&(r(n),aa(()=>(t===0&&(s=v(()=>e(()=>Ma(n)))),t+=1,()=>{ur(()=>{t-=1,t===0&&(s?.(),s=void 0,Ma(n))})})))}}var Ou=ea|Dr;function Mu(e,t,n,s){new Nu(e,t,n,s)}class Nu{parent;is_pending=!1;transform_error;#n;#o=null;#e;#a;#r;#s=null;#t=null;#i=null;#c=null;#u=0;#l=0;#d=!1;#h=new Set;#p=new Set;#f=null;#g=Du(()=>(this.#f=Rr(this.#u),()=>{this.#f=null}));constructor(t,n,s,a){this.#n=t,this.#e=n,this.#a=i=>{var l=re;l.b=this,l.f|=Ys,s(i)},this.parent=re.b,this.transform_error=a??this.parent?.transform_error??(i=>i),this.#r=ms(()=>{this.#b()},Ou)}#v(){try{this.#s=Xt(()=>this.#a(this.#n))}catch(t){this.error(t)}}#m(t){const n=this.#e.failed;n&&(this.#i=Xt(()=>{n(this.#n,()=>t,()=>()=>{})}))}#_(){const t=this.#e.pending;t&&(this.is_pending=!0,this.#t=Xt(()=>t(this.#n)),ur(()=>{var n=this.#c=document.createDocumentFragment(),s=Nn();n.append(s),this.#s=this.#w(()=>Xt(()=>this.#a(s))),this.#l===0&&(this.#n.before(n),this.#c=null,Er(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.#s=Xt(()=>{this.#a(this.#n)}),this.#l>0){var t=this.#c=document.createDocumentFragment();yi(this.#s,t);const n=this.#e.pending;this.#t=Xt(()=>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){lo(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,s=de,a=Le;en(this.#r),Qt(this.#r),ta(this.#r.ctx);try{return dr.ensure(),t()}catch(i){return so(i),null}finally{en(n),Qt(s),ta(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&&Er(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,ur(()=>{this.#d=!1,this.#f&&na(this.#f,this.#u)}))}get_effect_pending(){return this.#g(),r(this.#f)}error(t){if(!this.#e.onerror&&!this.#e.failed)throw t;ne?.is_fork?(this.#s&&ne.skip_effect(this.#s),this.#t&&ne.skip_effect(this.#t),this.#i&&ne.skip_effect(this.#i),ne.on_fork_commit(()=>{this.#x(t)})):this.#x(t)}#x(t){this.#s&&(St(this.#s),this.#s=null),this.#t&&(St(this.#t),this.#t=null),this.#i&&(St(this.#i),this.#i=null);var n=this.#e.onerror;let s=this.#e.failed;var a=!1,i=!1;const l=()=>{if(a){Tu();return}a=!0,i&&hu(),this.#i!==null&&Er(this.#i,()=>{this.#i=null}),this.#w(()=>{this.#b()})},c=o=>{try{i=!0,n?.(o,l),i=!1}catch(f){lr(f,this.#r&&this.#r.parent)}s&&(this.#i=this.#w(()=>{try{return Xt(()=>{var f=re;f.b=this,f.f|=Ys,s(this.#n,()=>o,()=>l)})}catch(f){return lr(f,this.#r.parent),null}}))};ur(()=>{var o;try{o=this.transform_error(t)}catch(f){lr(f,this.#r&&this.#r.parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(c,f=>lr(f,this.#r&&this.#r.parent)):c(o)})}}function Pu(e,t,n,s){const a=Ua()?_s:gi;var i=e.filter(m=>!m.settled);if(n.length===0&&i.length===0){s(t.map(a));return}var l=re,c=zu(),o=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(m=>m.promise)):null;function f(m){c();try{s(m)}catch(E){(l.f&Kt)===0&&lr(E,l)}fs()}if(n.length===0){o.then(()=>f(t.map(a)));return}var h=fo();function w(){Promise.all(n.map(m=>$u(m))).then(m=>f([...t.map(a),...m])).catch(m=>lr(m,l)).finally(()=>h())}o?o.then(()=>{c(),w(),fs()}):w()}function zu(){var e=re,t=de,n=Le,s=ne;return function(i=!0){en(e),Qt(t),ta(n),i&&(e.f&Kt)===0&&(s?.activate(),s?.apply())}}function fs(e=!0){en(null),Qt(null),ta(null),e&&ne?.deactivate()}function fo(){var e=re,t=e.b,n=ne,s=t.is_rendered();return t.update_pending_count(1,n),n.increment(s,e),(a=!1)=>{t.update_pending_count(-1,n),n.decrement(s,e,a)}}function _s(e){var t=ht|ct;return re!==null&&(re.f|=Dr),{ctx:Le,deps:null,effects:null,equals:to,f:t,fn:e,reactions:null,rv:0,v:tt,wv:0,parent:re,ac:null}}function $u(e,t,n){let s=re;s===null&&su();var a=void 0,i=Rr(tt),l=!de,c=new Map;return Ku(()=>{var o=re,f=Yl();a=f.promise;try{Promise.resolve(e()).then(f.resolve,f.reject).finally(fs)}catch(E){f.reject(E),fs()}var h=ne;if(l){if((o.f&Lr)!==0)var w=fo();if(s.b.is_rendered())c.get(h)?.reject(Vn),c.delete(h);else{for(const E of c.values())E.reject(Vn);c.clear()}c.set(h,f)}const m=(E,T=void 0)=>{if(w){var L=T===Vn;w(L)}if(!(T===Vn||(o.f&Kt)!==0)){if(h.activate(),T)i.f|=cr,na(i,T);else{(i.f&cr)!==0&&(i.f^=cr),na(i,E);for(const[S,z]of c){if(c.delete(S),S===h)break;z.reject(Vn)}}h.deactivate()}};f.promise.then(m,E=>m(null,E||"unknown"))}),To(()=>{for(const o of c.values())o.reject(Vn)}),new Promise(o=>{function f(h){function w(){h===a?o(i):f(a)}h.then(w,w)}f(a)})}function ar(e){const t=_s(e);return Lo(t),t}function gi(e){const t=_s(e);return t.equals=ro,t}function Fu(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;nr(e))),t}function g(e,t,n=!1){de!==null&&(!mn||(de.f&Vs)!==0)&&Ua()&&(de.f&(ht|Mn|Na|Vs))!==0&&(Jt===null||!Jr.call(Jt,e))&&pu();let s=n?Sa(t):t;return na(e,s,os)}function na(e,t,n=null){if(!e.equals(t)){Tr.set(e,pr?t:e.v);var s=dr.ensure();if(s.capture(e,t),(e.f&ht)!==0){const a=e;(e.f&ct)!==0&&mi(a),gn===null&&hi(a)}e.wv=Oo(),_o(e,ct,n),Ua()&&re!==null&&(re.f&Ye)!==0&&(re.f&(bn|fr))===0&&(Yt===null?Qu([e]):Yt.push(e)),!s.is_fork&&Js.size>0&&!vo&&Bu()}return t}function Bu(){vo=!1;for(const e of Js)(e.f&Ye)!==0&&$e(e,kn),sa(e)&&Cr(e);Js.clear()}function Ma(e){g(e,e.v+1)}function _o(e,t,n){var s=e.reactions;if(s!==null)for(var a=Ua(),i=s.length,l=0;l{if(Sr===i)return c();var o=de,f=Sr;Qt(null),kl(i);var h=c();return Qt(o),kl(f),h};return s&&n.set("length",sr(e.length)),new Proxy(e,{defineProperty(c,o,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&fu();var h=n.get(o);return h===void 0?l(()=>{var w=sr(f.value);return n.set(o,w),w}):g(h,f.value,!0),!0},deleteProperty(c,o){var f=n.get(o);if(f===void 0){if(o in c){const h=l(()=>sr(tt));n.set(o,h),Ma(a)}}else g(f,tt),Ma(a);return!0},get(c,o,f){if(o===Kr)return e;var h=n.get(o),w=o in c;if(h===void 0&&(!w||Da(c,o)?.writable)&&(h=l(()=>{var E=Sa(w?c[o]:tt),T=sr(E);return T}),n.set(o,h)),h!==void 0){var m=r(h);return m===tt?void 0:m}return Reflect.get(c,o,f)},getOwnPropertyDescriptor(c,o){var f=Reflect.getOwnPropertyDescriptor(c,o);if(f&&"value"in f){var h=n.get(o);h&&(f.value=r(h))}else if(f===void 0){var w=n.get(o),m=w?.v;if(w!==void 0&&m!==tt)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return f},has(c,o){if(o===Kr)return!0;var f=n.get(o),h=f!==void 0&&f.v!==tt||Reflect.has(c,o);if(f!==void 0||re!==null&&(!h||Da(c,o)?.writable)){f===void 0&&(f=l(()=>{var m=h?Sa(c[o]):tt,E=sr(m);return E}),n.set(o,f));var w=r(f);if(w===tt)return!1}return h},set(c,o,f,h){var w=n.get(o),m=o in c;if(s&&o==="length")for(var E=f;Esr(tt)),n.set(E+"",T))}if(w===void 0)(!m||Da(c,o)?.writable)&&(w=l(()=>sr(void 0)),g(w,Sa(f)),n.set(o,w));else{m=w.v!==tt;var L=l(()=>Sa(f));g(w,L)}var S=Reflect.getOwnPropertyDescriptor(c,o);if(S?.set&&S.set.call(h,f),!m){if(s&&typeof o=="string"){var z=n.get("length"),R=Number(o);Number.isInteger(R)&&R>=z.v&&g(z,R+1)}Ma(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!==tt});for(var[f,h]of n)h.v!==tt&&!(f in c)&&o.push(f);return o},setPrototypeOf(){du()}})}var Qs,go,mo,bo,ko;function qu(){if(Qs===void 0){Qs=window,go=document,mo=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;bo=Da(t,"firstChild").get,ko=Da(t,"nextSibling").get,vl(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),vl(n)&&(n.__t=void 0)}}function Nn(e=""){return document.createTextNode(e)}function or(e){return bo.call(e)}function Ha(e){return ko.call(e)}function p(e,t){return or(e)}function Yn(e,t=!1){{var n=or(e);return n instanceof Comment&&n.data===""?Ha(n):n}}function _(e,t=1,n=!1){let s=e;for(;t--;)s=Ha(s);return s}function Gu(e){e.textContent=""}function wo(){return!1}function yo(e,t,n){return document.createElementNS(t??eo,e,void 0)}let ml=!1;function Wu(){ml||(ml=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function gs(e){var t=de,n=re;Qt(null),en(null);try{return e()}finally{Qt(t),en(n)}}function ju(e,t,n,s=n){e.addEventListener(t,()=>gs(n));const a=e.__on_r;a?e.__on_r=()=>{a(),s(!0)}:e.__on_r=()=>s(!0),Wu()}function xo(e){re===null&&(de===null&&cu(),ou()),pr&&lu()}function Zu(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Pn(e,t){var n=re;n!==null&&(n.f&wt)!==0&&(e|=wt);var s={ctx:Le,deps:null,nodes:null,f:e|ct|Vt,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(s);var a=s;if((e&Qr)!==0)Vr!==null?Vr.push(s):dr.ensure().schedule(s);else if(t!==null){try{Cr(s)}catch(l){throw St(s),l}a.deps===null&&a.teardown===null&&a.nodes===null&&a.first===a.last&&(a.f&Dr)===0&&(a=a.first,(e&Mn)!==0&&(e&ea)!==0&&a!==null&&(a.f|=ea))}if(a!==null&&(a.parent=n,n!==null&&Zu(a,n),de!==null&&(de.f&ht)!==0&&(e&fr)===0)){var i=de;(i.effects??=[]).push(a)}return s}function bi(){return de!==null&&!mn}function To(e){const t=Pn($a,null);return $e(t,Ye),t.teardown=e,t}function ei(e){xo();var t=re.f,n=!de&&(t&bn)!==0&&(t&Lr)===0;if(n){var s=Le;(s.e??=[]).push(e)}else return Eo(e)}function Eo(e){return Pn(Qr|Kl,e)}function Yu(e){return xo(),Pn($a|Kl,e)}function Xu(e){dr.ensure();const t=Pn(fr|Dr,e);return(n={})=>new Promise(s=>{n.outro?Er(t,()=>{St(t),s(void 0)}):(St(t),s(void 0))})}function Pa(e){return Pn(Qr,e)}function Rn(e,t){var n=Le,s={effect:null,ran:!1,deps:e};n.l.$.push(s),s.effect=aa(()=>{if(e(),!s.ran){s.ran=!0;var a=re;try{en(a.parent),v(t)}finally{en(a)}}})}function Vu(){var e=Le;aa(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&Ye)!==0&&n.deps!==null&&$e(n,kn),sa(n)&&Cr(n),t.ran=!1}})}function Ku(e){return Pn(Na|Dr,e)}function aa(e,t=0){return Pn($a|t,e)}function P(e,t=[],n=[],s=[]){Pu(s,t,n,a=>{Pn($a,()=>e(...a.map(r)))})}function ms(e,t=0){var n=Pn(Mn|t,e);return n}function Xt(e){return Pn(bn|Dr,e)}function So(e){var t=e.teardown;if(t!==null){const n=pr,s=de;bl(!0),Qt(null);try{t.call(null)}finally{bl(n),Qt(s)}}}function ki(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const a=n.ac;a!==null&&gs(()=>{a.abort(Vn)});var s=n.next;(n.f&fr)!==0?n.parent=null:St(n,t),n=s}}function Ju(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&bn)===0&&St(t),t=n}}function St(e,t=!0){var n=!1;(t||(e.f&Vl)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Ao(e.nodes.start,e.nodes.end),n=!0),$e(e,Xs),ki(e,t&&!n),za(e,0);var s=e.nodes&&e.nodes.t;if(s!==null)for(const i of s)i.stop();So(e),e.f^=Xs,e.f|=Kt;var a=e.parent;a!==null&&a.first!==null&&Ro(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Ao(e,t){for(;e!==null;){var n=e===t?null:Ha(e);e.remove(),e=n}}function Ro(e){var t=e.parent,n=e.prev,s=e.next;n!==null&&(n.next=s),s!==null&&(s.prev=n),t!==null&&(t.first===e&&(t.first=s),t.last===e&&(t.last=n))}function Er(e,t,n=!0){var s=[];Co(e,s,!0);var a=()=>{n&&St(e),t&&t()},i=s.length;if(i>0){var l=()=>--i||a();for(var c of s)c.out(l)}else a()}function Co(e,t,n){if((e.f&wt)===0){e.f^=wt;var s=e.nodes&&e.nodes.t;if(s!==null)for(const c of s)(c.is_global||n)&&t.push(c);for(var a=e.first;a!==null;){var i=a.next;if((a.f&fr)===0){var l=(a.f&ea)!==0||(a.f&bn)!==0&&(e.f&Mn)!==0;Co(a,t,l?n:!1)}a=i}}}function wi(e){Io(e,!0)}function Io(e,t){if((e.f&wt)!==0){e.f^=wt,(e.f&Ye)===0&&($e(e,ct),dr.ensure().schedule(e));for(var n=e.first;n!==null;){var s=n.next,a=(n.f&ea)!==0||(n.f&bn)!==0;Io(n,a?t:!1),n=s}var i=e.nodes&&e.nodes.t;if(i!==null)for(const l of i)(l.is_global||t)&&l.in()}}function yi(e,t){if(e.nodes)for(var n=e.nodes.start,s=e.nodes.end;n!==null;){var a=n===s?null:Ha(n);t.append(n),n=a}}let cs=!1,pr=!1;function bl(e){pr=e}let de=null,mn=!1;function Qt(e){de=e}let re=null;function en(e){re=e}let Jt=null;function Lo(e){de!==null&&(Jt===null?Jt=[e]:Jt.push(e))}let Et=null,Pt=0,Yt=null;function Qu(e){Yt=e}let Do=1,xr=0,Sr=xr;function kl(e){Sr=e}function Oo(){return++Do}function sa(e){var t=e.f;if((t&ct)!==0)return!0;if(t&ht&&(e.f&=~Ar),(t&kn)!==0){for(var n=e.deps,s=n.length,a=0;ae.wv)return!0}(t&Vt)!==0&&gn===null&&$e(e,Ye)}return!1}function Mo(e,t,n=!0){var s=e.reactions;if(s!==null&&!(Jt!==null&&Jr.call(Jt,e)))for(var a=0;a{e.ac.abort(Vn)}),e.ac=null);try{e.f|=us;var h=e.fn,w=h();e.f|=Lr;var m=e.deps,E=ne?.is_fork;if(Et!==null){var T;if(E||za(e,Pt),m!==null&&Pt>0)for(m.length=Pt+Et.length,T=0;Tn?.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?ur(()=>{t.addEventListener(e,a,s)}):t.addEventListener(e,a,s),a}function Cn(e,t,n,s,a){var i={capture:s,passive:a},l=rf(e,t,n,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&To(()=>{t.removeEventListener(e,l,i)})}function G(e,t,n){(t[Aa]??={})[e]=n}function af(e){for(var t=0;t{throw S});throw m}}finally{e[Aa]=t,delete e.currentTarget,Qt(h),en(w)}}}const sf=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function lf(e){return sf?.createHTML(e)??e}function of(e){var t=yo("template");return t.innerHTML=lf(e.replaceAll("","")),t.content}function ra(e,t){var n=re;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function D(e,t){var n=(t&bu)!==0,s=(t&ku)!==0,a,i=!e.startsWith("");return()=>{a===void 0&&(a=of(i?e:""+e),n||(a=or(a)));var l=s||mo?document.importNode(a,!0):a.cloneNode(!0);if(n){var c=or(l),o=l.lastChild;ra(c,o)}else ra(l,l);return l}}function mt(e=""){{var t=Nn(e+"");return ra(t,t),t}}function Ra(){var e=document.createDocumentFragment(),t=document.createComment(""),n=Nn();return e.append(t,n),ra(t,n),e}function A(e,t){e!==null&&e.before(t)}function I(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function cf(e,t){return uf(e,t)}const as=new Map;function uf(e,{target:t,anchor:n,props:s={},events:a,context:i,intro:l=!0,transformError:c}){qu();var o=void 0,f=Xu(()=>{var h=n??t.appendChild(Nn());Mu(h,{pending:()=>{}},E=>{di({});var T=Le;i&&(T.c=i),a&&(s.$$events=a),o=e(E,s)||{},pi()},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=as.get(S),L=T.get(E);--L==0?(S.removeEventListener(E,ai),T.delete(E),T.size===0&&as.delete(S)):T.set(E,L)}ri.delete(m),h!==n&&h.parentNode?.removeChild(h)}});return ff.set(o,f),o}let ff=new WeakMap;class df{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}#s=t=>{if(this.#n.has(t)){var n=this.#n.get(t),s=this.#o.get(n);if(s)wi(s),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),s=a.effect)}for(const[i,l]of this.#n){if(this.#n.delete(i),i===t)break;const c=this.#e.get(l);c&&(St(c.effect),this.#e.delete(l))}for(const[i,l]of this.#o){if(i===n||this.#a.has(i))continue;const c=()=>{if(Array.from(this.#n.values()).includes(i)){var f=document.createDocumentFragment();yi(l,f),f.append(Nn()),this.#e.set(i,{effect:l,fragment:f})}else St(l);this.#a.delete(i),this.#o.delete(i)};this.#r||!s?(this.#a.add(i),Er(l,c,!1)):c()}}};#t=t=>{this.#n.delete(t);const n=Array.from(this.#n.values());for(const[s,a]of this.#e)n.includes(s)||(St(a.effect),this.#e.delete(s))};ensure(t,n){var s=ne,a=wo();if(n&&!this.#o.has(t)&&!this.#e.has(t))if(a){var i=document.createDocumentFragment(),l=Nn();i.append(l),this.#e.set(t,{effect:Xt(()=>n(l)),fragment:i})}else this.#o.set(t,Xt(()=>n(this.anchor)));if(this.#n.set(s,t),a){for(const[c,o]of this.#o)c===t?s.unskip_effect(o):s.skip_effect(o);for(const[c,o]of this.#e)c===t?s.unskip_effect(o.effect):s.skip_effect(o.effect);s.oncommit(this.#s),s.ondiscard(this.#t)}else this.#s(s)}}function j(e,t,n=!1){var s=new df(e),a=n?ea:0;function i(l,c){s.ensure(l,c)}ms(()=>{var l=!1;t((c,o=0)=>{l=!0,i(o,c)}),l||i(-1,null)},a)}function pf(e,t){return t}function hf(e,t,n){for(var s=[],a=t.length,i,l=t.length,c=0;c{if(i){if(i.pending.delete(w),i.done.add(w),i.pending.size===0){var m=e.outrogroups;si(e,vs(i.done)),m.delete(i),m.size===0&&(e.outrogroups=null)}}else l-=1},!1)}if(l===0){var o=s.length===0&&n!==null;if(o){var f=n,h=f.parentNode;Gu(h),h.append(f),e.items.clear()}si(e,t,!o)}else i={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(i)}function si(e,t,n=!0){var s;if(e.pending.size>0){s=new Set;for(const l of e.pending.values())for(const c of l)s.add(e.items.get(c).e)}for(var a=0;a{var te=n();return jl(te)?te:te==null?[]:vs(te)}),m,E=new Map,T=!0;function L(te){(R.effect.f&Kt)===0&&(R.pending.delete(te),R.fallback=h,vf(R,m,l,t,s),h!==null&&(m.length===0?(h.f&On)===0?wi(h):(h.f^=On,Ca(h,null,l)):Er(h,()=>{h=null})))}function S(te){R.pending.delete(te)}var z=ms(()=>{m=r(w);for(var te=m.length,C=new Set,oe=ne,ve=wo(),Ae=0;Aei(l)):(h=Xt(()=>i(yl??=Nn())),h.f|=On)),te>C.size&&iu(),!T)if(E.set(oe,C),ve){for(const[Ee,Re]of c)C.has(Ee)||oe.skip_effect(Re.e);oe.oncommit(L),oe.ondiscard(S)}else L(oe);r(w)}),R={effect:z,items:c,pending:E,outrogroups:null,fallback:h};T=!1}function ba(e){for(;e!==null&&(e.f&bn)===0;)e=e.next;return e}function vf(e,t,n,s,a){var i=(s&gu)!==0,l=t.length,c=e.items,o=ba(e.effect.first),f,h=null,w,m=[],E=[],T,L,S,z;if(i)for(z=0;z0){var rt=(s&Ql)!==0&&l===0?n:null;if(i){for(z=0;z{if(w!==void 0)for(S of w)S.nodes?.a?.apply()})}function _f(e,t,n,s,a,i,l,c){var o=(l&vu)!==0?(l&mu)===0?Z(n,!1,!1):Rr(n):null,f=(l&_u)!==0?Rr(a):null;return{v:o,i:f,e:Xt(()=>(i(t,o??n,f??a,c),()=>{e.delete(s)}))}}function Ca(e,t,n){if(e.nodes)for(var s=e.nodes.start,a=e.nodes.end,i=t&&(t.f&On)===0?t.nodes.start:n;s!==null;){var l=Ha(s);if(i.before(s),s===a)return;s=l}}function ir(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function $s(e,t,n=!1,s=!1,a=!1,i=!1){var l=e,c="";if(n)var o=e;P(()=>{var f=re;if(c!==(c=t()??"")){if(n){f.nodes=null,o.innerHTML=c,c!==""&&ra(or(o),o.lastChild);return}if(f.nodes!==null&&(Ao(f.nodes.start,f.nodes.end),f.nodes=null),c!==""){var h=s?wu:a?yu:void 0,w=yo(s?"svg":a?"math":"template",h);w.innerHTML=c;var m=s||a?w:w.content;if(ra(or(m),m.lastChild),s||a)for(;or(m);)l.before(or(m));else l.before(m)}}})}function Fo(e,t){var n;n=document.head.appendChild(Nn()),ms(()=>t(n),Vl|Dr)}function xl(e,t,n){Pa(()=>{var s=v(()=>t(e,n?.())||{});if(n&&s?.update){var a=!1,i={};aa(()=>{var l=n();hn(l),a&&no(i,l)&&(i=l,s.update(l))}),a=!0}if(s?.destroy)return()=>s.destroy()})}const Tl=[...` -\r\f \v\uFEFF`];function gf(e,t,n){var s=e==null?"":""+e;if(n){for(var a of Object.keys(n))if(n[a])s=s?s+" "+a:a;else if(s.length)for(var i=a.length,l=0;(l=s.indexOf(a,l))>=0;){var c=l+i;(l===0||Tl.includes(s[l-1]))&&(c===s.length||Tl.includes(s[c]))?s=(l===0?"":s.substring(0,l))+s.substring(c+1):l=c}}return s===""?null:s}function mf(e,t){return e==null?null:String(e)}function Mt(e,t,n,s,a,i){var l=e.__className;if(l!==n||l===void 0){var c=gf(n,s,i);c==null?e.removeAttribute("class"):e.className=c,e.__className=n}else if(i&&a!==i)for(var o in i){var f=!!i[o];(a==null||f!==!!a[o])&&e.classList.toggle(o,f)}return i}function Zn(e,t,n,s){var a=e.__style;if(a!==t){var i=mf(t);i==null?e.removeAttribute("style"):e.style.cssText=i,e.__style=t}return s}const bf=Symbol("is custom element"),kf=Symbol("is html");function $(e,t,n,s){var a=wf(e);a[t]!==(a[t]=n)&&(t==="loading"&&(e[au]=n),n==null?e.removeAttribute(t):typeof n!="string"&&yf(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function wf(e){return e.__attributes??={[bf]:e.nodeName.includes("-"),[kf]:e.namespaceURI===eo}}var El=new Map;function yf(e){var t=e.getAttribute("is")||e.nodeName,n=El.get(t);if(n)return n;El.set(t,n=[]);for(var s,a=e,i=Element.prototype;i!==a;){s=Zl(a);for(var l in s)s[l].set&&n.push(l);a=fi(a)}return n}function In(e,t,n=t){var s=new WeakSet;ju(e,"input",async a=>{var i=a?e.defaultValue:e.value;if(i=Fs(e)?Us(i):i,n(i),ne!==null&&s.add(ne),await ti(),i!==(i=t())){var l=e.selectionStart,c=e.selectionEnd,o=e.value.length;if(e.value=i??"",c!==null){var f=e.value.length;l===c&&c===o&&f>o?(e.selectionStart=f,e.selectionEnd=f):(e.selectionStart=l,e.selectionEnd=Math.min(c,f))}}}),v(t)==null&&e.value&&(n(Fs(e)?Us(e.value):e.value),ne!==null&&s.add(ne)),aa(()=>{var a=t();if(e===document.activeElement){var i=ne;if(s.has(i))return}Fs(e)&&a===Us(e.value)||e.type==="date"&&!a&&!e.value||a!==e.value&&(e.value=a??"")})}function Fs(e){var t=e.type;return t==="number"||t==="range"}function Us(e){return e===""?null:+e}function Sl(e,t){return e===t||e?.[Kr]===t}function Hs(e={},t,n,s){var a=Le.r,i=re;return Pa(()=>{var l,c;return aa(()=>{l=c,c=[],v(()=>{e!==n(...c)&&(t(e,...c),l&&Sl(n(...l),e)&&t(null,...l))})}),()=>{let o=i;for(;o!==a&&o.parent!==null&&o.parent.f&Xs;)o=o.parent;const f=()=>{c&&Sl(n(...c),e)&&t(null,...c)},h=o.teardown;o.teardown=()=>{f(),h?.()}}}),e}function Uo(e=!1){const t=Le,n=t.l.u;if(!n)return;let s=()=>hn(t.s);if(e){let a=0,i={};const l=_s(()=>{let c=!1;const o=t.s;for(const f in o)o[f]!==i[f]&&(i[f]=o[f],c=!0);return c&&a++,a});s=()=>r(l)}n.b.length&&Yu(()=>{Al(t,s),Zs(n.b)}),ei(()=>{const a=v(()=>n.m.map(ru));return()=>{for(const i of a)typeof i=="function"&&i()}}),n.a.length&&ei(()=>{Al(t,s),Zs(n.a)})}function Al(e,t){if(e.l.s)for(const n of e.l.s)r(n);t()}function Ho(e){Le===null&&Jl(),Fa&&Le.l!==null?Tf(Le).m.push(e):ei(()=>{const t=v(e);if(typeof t=="function")return t})}function xf(e){Le===null&&Jl(),Ho(()=>()=>v(e))}function Tf(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}const Ef="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Ef);Su();class Bo extends Error{constructor(t,n){super(n),this.status=t}status}async function lt(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 s=await fetch(e,{...t,headers:n});if(!s.ok)throw new Bo(s.status,await s.text());return s.json()}const{entries:qo,setPrototypeOf:Rl,isFrozen:Sf,getPrototypeOf:Af,getOwnPropertyDescriptor:Rf}=Object;let{freeze:yt,seal:tn,create:Yr}=Object,{apply:ii,construct:li}=typeof Reflect<"u"&&Reflect;yt||(yt=function(t){return t});tn||(tn=function(t){return t});ii||(ii=function(t,n){for(var s=arguments.length,a=new Array(s>2?s-2:0),i=2;i1?n-1:0),a=1;a"u"?null:Xe(BigInt.prototype.toString),Ol=typeof Symbol>"u"?null:Xe(Symbol.prototype.toString),ze=Xe(Object.prototype.hasOwnProperty),ya=Xe(Object.prototype.toString),ot=Xe(RegExp.prototype.test),ss=Mf(TypeError);function Xe(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a2&&arguments[2]!==void 0?arguments[2]:Ia;if(Rl&&Rl(e,null),!bt(t))return e;let s=t.length;for(;s--;){let a=t[s];if(typeof a=="string"){const i=n(a);i!==a&&(Sf(t)||(t[s]=i),a=i)}e[a]=!0}return e}function Nf(e){for(let t=0;t/gm),Bf=tn(/\$\{[\w\W]*/gm),qf=tn(/^data-[\-\w.\u00B7-\uFFFF]+$/),Gf=tn(/^aria-[\-\w]+$/),Go=tn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Wf=tn(/^(?:\w+script|data):/i),jf=tn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Wo=tn(/^html$/i),Zf=tn(/^[a-z][.\w]*(-[.\w]+)+$/i);var $l=Object.freeze({__proto__:null,ARIA_ATTR:Gf,ATTR_WHITESPACE:jf,CUSTOM_ELEMENT:Zf,DATA_ATTR:qf,DOCTYPE_NAME:Wo,ERB_EXPR:Hf,IS_ALLOWED_URI:Go,IS_SCRIPT_OR_DATA:Wf,MUSTACHE_EXPR:Uf,TMPLIT_EXPR:Bf});const xa={element:1,text:3,progressingInstruction:7,comment:8,document:9},Yf=function(){return typeof window>"u"?null:window},Xf=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let s=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(s=n.getAttribute(a));const i="dompurify"+(s?"#"+s:"");try{return t.createPolicy(i,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Fl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function jo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yf();const t=B=>jo(B);if(t.version="3.4.2",t.removed=[],!e||!e.document||e.document.nodeType!==xa.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const s=n,a=s.currentScript,{DocumentFragment:i,HTMLTemplateElement:l,Node:c,Element:o,NodeFilter:f,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:w,DOMParser:m,trustedTypes:E}=e,T=o.prototype,L=Xr(T,"cloneNode"),S=Xr(T,"remove"),z=Xr(T,"nextSibling"),R=Xr(T,"childNodes"),te=Xr(T,"parentNode");if(typeof l=="function"){const B=n.createElement("template");B.content&&B.content.ownerDocument&&(n=B.content.ownerDocument)}let C,oe="";const{implementation:ve,createNodeIterator:Ae,createDocumentFragment:nt,getElementsByTagName:rt}=n,{importNode:Te}=s;let Ee=Fl();t.isSupported=typeof qo=="function"&&typeof te=="function"&&ve&&ve.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Re,ERB_EXPR:Se,TMPLIT_EXPR:At,DATA_ATTR:wn,ARIA_ATTR:zn,IS_SCRIPT_OR_DATA:zt,ATTR_WHITESPACE:nn,CUSTOM_ELEMENT:Kn}=$l;let{IS_ALLOWED_URI:$n}=$l,De=null;const $t=J({},[...Ml,...qs,...Gs,...Ws,...Nl]);let Fe=null;const yn=J({},[...Pl,...js,...zl,...is]);let _e=Object.seal(Yr(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}})),rn=null,an=null;const Rt=Object.seal(Yr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Fn=!0,sn=!0,pe=!1,Je=!0,Ft=!1,ln=!0,Oe=!1,la=!1,oa=!1,on=!1,Mr=!1,Nr=!1,qa=!0,hr=!1;const Ga="user-content-";let vt=!0,Un=!1,Hn={},Ct=null;const Pr=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 Wa=J({},["audio","video","img","source","image","track"]);let ca=null;const ua=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$r="http://www.w3.org/1998/Math/MathML",Fr="http://www.w3.org/2000/svg",Ut="http://www.w3.org/1999/xhtml";let Jn=Ut,fa=!1,da=null;const ws=J({},[$r,Fr,Ut],Bs);let _t=J({},["mi","mo","mn","ms","mtext"]),Ur=J({},["annotation-xml"]);const Qn=J({},["title","style","font","a","script"]);let xn=null;const ja=["application/xhtml+xml","text/html"],ys="text/html";let Ue=null,Tn=null;const xs=n.createElement("form"),Za=function(u){return u instanceof RegExp||u instanceof Function},er=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Tn&&Tn===u)return;(!u||typeof u!="object")&&(u={}),u=Tt(u),xn=ja.indexOf(u.PARSER_MEDIA_TYPE)===-1?ys:u.PARSER_MEDIA_TYPE,Ue=xn==="application/xhtml+xml"?Bs:Ia,De=ze(u,"ALLOWED_TAGS")&&bt(u.ALLOWED_TAGS)?J({},u.ALLOWED_TAGS,Ue):$t,Fe=ze(u,"ALLOWED_ATTR")&&bt(u.ALLOWED_ATTR)?J({},u.ALLOWED_ATTR,Ue):yn,da=ze(u,"ALLOWED_NAMESPACES")&&bt(u.ALLOWED_NAMESPACES)?J({},u.ALLOWED_NAMESPACES,Bs):ws,ca=ze(u,"ADD_URI_SAFE_ATTR")&&bt(u.ADD_URI_SAFE_ATTR)?J(Tt(ua),u.ADD_URI_SAFE_ATTR,Ue):ua,zr=ze(u,"ADD_DATA_URI_TAGS")&&bt(u.ADD_DATA_URI_TAGS)?J(Tt(Wa),u.ADD_DATA_URI_TAGS,Ue):Wa,Ct=ze(u,"FORBID_CONTENTS")&&bt(u.FORBID_CONTENTS)?J({},u.FORBID_CONTENTS,Ue):Pr,rn=ze(u,"FORBID_TAGS")&&bt(u.FORBID_TAGS)?J({},u.FORBID_TAGS,Ue):Tt({}),an=ze(u,"FORBID_ATTR")&&bt(u.FORBID_ATTR)?J({},u.FORBID_ATTR,Ue):Tt({}),Hn=ze(u,"USE_PROFILES")?u.USE_PROFILES&&typeof u.USE_PROFILES=="object"?Tt(u.USE_PROFILES):u.USE_PROFILES:!1,Fn=u.ALLOW_ARIA_ATTR!==!1,sn=u.ALLOW_DATA_ATTR!==!1,pe=u.ALLOW_UNKNOWN_PROTOCOLS||!1,Je=u.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ft=u.SAFE_FOR_TEMPLATES||!1,ln=u.SAFE_FOR_XML!==!1,Oe=u.WHOLE_DOCUMENT||!1,on=u.RETURN_DOM||!1,Mr=u.RETURN_DOM_FRAGMENT||!1,Nr=u.RETURN_TRUSTED_TYPE||!1,oa=u.FORCE_BODY||!1,qa=u.SANITIZE_DOM!==!1,hr=u.SANITIZE_NAMED_PROPS||!1,vt=u.KEEP_CONTENT!==!1,Un=u.IN_PLACE||!1,$n=zf(u.ALLOWED_URI_REGEXP)?u.ALLOWED_URI_REGEXP:Go,Jn=typeof u.NAMESPACE=="string"?u.NAMESPACE:Ut,_t=ze(u,"MATHML_TEXT_INTEGRATION_POINTS")&&u.MATHML_TEXT_INTEGRATION_POINTS&&typeof u.MATHML_TEXT_INTEGRATION_POINTS=="object"?Tt(u.MATHML_TEXT_INTEGRATION_POINTS):J({},["mi","mo","mn","ms","mtext"]),Ur=ze(u,"HTML_INTEGRATION_POINTS")&&u.HTML_INTEGRATION_POINTS&&typeof u.HTML_INTEGRATION_POINTS=="object"?Tt(u.HTML_INTEGRATION_POINTS):J({},["annotation-xml"]);const x=ze(u,"CUSTOM_ELEMENT_HANDLING")&&u.CUSTOM_ELEMENT_HANDLING&&typeof u.CUSTOM_ELEMENT_HANDLING=="object"?Tt(u.CUSTOM_ELEMENT_HANDLING):Yr(null);if(_e=Yr(null),ze(x,"tagNameCheck")&&Za(x.tagNameCheck)&&(_e.tagNameCheck=x.tagNameCheck),ze(x,"attributeNameCheck")&&Za(x.attributeNameCheck)&&(_e.attributeNameCheck=x.attributeNameCheck),ze(x,"allowCustomizedBuiltInElements")&&typeof x.allowCustomizedBuiltInElements=="boolean"&&(_e.allowCustomizedBuiltInElements=x.allowCustomizedBuiltInElements),Ft&&(sn=!1),Mr&&(on=!0),Hn&&(De=J({},Nl),Fe=Yr(null),Hn.html===!0&&(J(De,Ml),J(Fe,Pl)),Hn.svg===!0&&(J(De,qs),J(Fe,js),J(Fe,is)),Hn.svgFilters===!0&&(J(De,Gs),J(Fe,js),J(Fe,is)),Hn.mathMl===!0&&(J(De,Ws),J(Fe,zl),J(Fe,is))),Rt.tagCheck=null,Rt.attributeCheck=null,ze(u,"ADD_TAGS")&&(typeof u.ADD_TAGS=="function"?Rt.tagCheck=u.ADD_TAGS:bt(u.ADD_TAGS)&&(De===$t&&(De=Tt(De)),J(De,u.ADD_TAGS,Ue))),ze(u,"ADD_ATTR")&&(typeof u.ADD_ATTR=="function"?Rt.attributeCheck=u.ADD_ATTR:bt(u.ADD_ATTR)&&(Fe===yn&&(Fe=Tt(Fe)),J(Fe,u.ADD_ATTR,Ue))),ze(u,"ADD_URI_SAFE_ATTR")&&bt(u.ADD_URI_SAFE_ATTR)&&J(ca,u.ADD_URI_SAFE_ATTR,Ue),ze(u,"FORBID_CONTENTS")&&bt(u.FORBID_CONTENTS)&&(Ct===Pr&&(Ct=Tt(Ct)),J(Ct,u.FORBID_CONTENTS,Ue)),ze(u,"ADD_FORBID_CONTENTS")&&bt(u.ADD_FORBID_CONTENTS)&&(Ct===Pr&&(Ct=Tt(Ct)),J(Ct,u.ADD_FORBID_CONTENTS,Ue)),vt&&(De["#text"]=!0),Oe&&J(De,["html","head","body"]),De.table&&(J(De,["tbody"]),delete rn.tbody),u.TRUSTED_TYPES_POLICY){if(typeof u.TRUSTED_TYPES_POLICY.createHTML!="function")throw ss('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof u.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ss('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=u.TRUSTED_TYPES_POLICY,oe=C.createHTML("")}else C===void 0&&(C=Xf(E,a)),C!==null&&typeof oe=="string"&&(oe=C.createHTML(""));yt&&yt(u),Tn=u},Ya=J({},[...qs,...Gs,...$f]),Xa=J({},[...Ws,...Ff]),cn=function(u){let x=te(u);(!x||!x.tagName)&&(x={namespaceURI:Jn,tagName:"template"});const M=Ia(u.tagName),ge=Ia(x.tagName);return da[u.namespaceURI]?u.namespaceURI===Fr?x.namespaceURI===Ut?M==="svg":x.namespaceURI===$r?M==="svg"&&(ge==="annotation-xml"||_t[ge]):!!Ya[M]:u.namespaceURI===$r?x.namespaceURI===Ut?M==="math":x.namespaceURI===Fr?M==="math"&&Ur[ge]:!!Xa[M]:u.namespaceURI===Ut?x.namespaceURI===Fr&&!Ur[ge]||x.namespaceURI===$r&&!_t[ge]?!1:!Xa[M]&&(Qn[M]||!Ya[M]):!!(xn==="application/xhtml+xml"&&da[u.namespaceURI]):!1},Be=function(u){wa(t.removed,{element:u});try{te(u).removeChild(u)}catch{S(u)}},Ht=function(u,x){try{wa(t.removed,{attribute:x.getAttributeNode(u),from:x})}catch{wa(t.removed,{attribute:null,from:x})}if(x.removeAttribute(u),u==="is")if(on||Mr)try{Be(x)}catch{}else try{x.setAttribute(u,"")}catch{}},Va=function(u){let x=null,M=null;if(oa)u=""+u;else{const Ne=Il(u,/^[\r\n\t ]+/);M=Ne&&Ne[0]}xn==="application/xhtml+xml"&&Jn===Ut&&(u=''+u+"");const ge=C?C.createHTML(u):u;if(Jn===Ut)try{x=new m().parseFromString(ge,xn)}catch{}if(!x||!x.documentElement){x=ve.createDocument(Jn,"template",null);try{x.documentElement.innerHTML=fa?oe:ge}catch{}}const He=x.body||x.documentElement;return u&&M&&He.insertBefore(n.createTextNode(M),He.childNodes[0]||null),Jn===Ut?rt.call(x,Oe?"html":"body")[0]:Oe?x.documentElement:He},Ka=function(u){return Ae.call(u.ownerDocument||u,u,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},vr=function(u){return u instanceof w&&(typeof u.nodeName!="string"||typeof u.textContent!="string"||typeof u.removeChild!="function"||!(u.attributes instanceof h)||typeof u.removeAttribute!="function"||typeof u.setAttribute!="function"||typeof u.namespaceURI!="string"||typeof u.insertBefore!="function"||typeof u.hasChildNodes!="function")},It=function(u){return typeof c=="function"&&u instanceof c};function un(B,u,x){ka(B,M=>{M.call(t,u,x,Tn)})}const Ja=function(u){let x=null;if(un(Ee.beforeSanitizeElements,u,null),vr(u))return Be(u),!0;const M=Ue(u.nodeName);if(un(Ee.uponSanitizeElement,u,{tagName:M,allowedTags:De}),ln&&u.hasChildNodes()&&!It(u.firstElementChild)&&ot(/<[/\w!]/g,u.innerHTML)&&ot(/<[/\w!]/g,u.textContent)||ln&&u.namespaceURI===Ut&&M==="style"&&It(u.firstElementChild)||u.nodeType===xa.progressingInstruction||ln&&u.nodeType===xa.comment&&ot(/<[/\w]/g,u.data))return Be(u),!0;if(rn[M]||!(Rt.tagCheck instanceof Function&&Rt.tagCheck(M))&&!De[M]){if(!rn[M]&&Qa(M)&&(_e.tagNameCheck instanceof RegExp&&ot(_e.tagNameCheck,M)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(M)))return!1;if(vt&&!Ct[M]){const ge=te(u)||u.parentNode,He=R(u)||u.childNodes;if(He&&ge){const Ne=He.length;for(let ut=Ne-1;ut>=0;--ut){const ft=L(He[ut],!0);ge.insertBefore(ft,z(u))}}}return Be(u),!0}return u instanceof o&&!cn(u)||(M==="noscript"||M==="noembed"||M==="noframes")&&ot(/<\/no(script|embed|frames)/i,u.innerHTML)?(Be(u),!0):(Ft&&u.nodeType===xa.text&&(x=u.textContent,ka([Re,Se,At],ge=>{x=jr(x,ge," ")}),u.textContent!==x&&(wa(t.removed,{element:u.cloneNode()}),u.textContent=x)),un(Ee.afterSanitizeElements,u,null),!1)},_r=function(u,x,M){if(an[x]||qa&&(x==="id"||x==="name")&&(M in n||M in xs))return!1;const ge=Fe[x]||Rt.attributeCheck instanceof Function&&Rt.attributeCheck(x,u);if(!(sn&&!an[x]&&ot(wn,x))){if(!(Fn&&ot(zn,x))){if(!ge||an[x]){if(!(Qa(u)&&(_e.tagNameCheck instanceof RegExp&&ot(_e.tagNameCheck,u)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(u))&&(_e.attributeNameCheck instanceof RegExp&&ot(_e.attributeNameCheck,x)||_e.attributeNameCheck instanceof Function&&_e.attributeNameCheck(x,u))||x==="is"&&_e.allowCustomizedBuiltInElements&&(_e.tagNameCheck instanceof RegExp&&ot(_e.tagNameCheck,M)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(M))))return!1}else if(!ca[x]){if(!ot($n,jr(M,nn,""))){if(!((x==="src"||x==="xlink:href"||x==="href")&&u!=="script"&&Ll(M,"data:")===0&&zr[u])){if(!(pe&&!ot(zt,jr(M,nn,"")))){if(M)return!1}}}}}}return!0},Ts=J({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Qa=function(u){return!Ts[Ia(u)]&&ot(Kn,u)},Ve=function(u){un(Ee.beforeSanitizeAttributes,u,null);const{attributes:x}=u;if(!x||vr(u))return;const M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Fe,forceKeepAttr:void 0};let ge=x.length;for(;ge--;){const He=x[ge],{name:Ne,namespaceURI:ut,value:ft}=He,Qe=Ue(Ne),Hr=ft;let qe=Ne==="value"?Hr:Lf(Hr);if(M.attrName=Qe,M.attrValue=qe,M.keepAttr=!0,M.forceKeepAttr=void 0,un(Ee.uponSanitizeAttribute,u,M),qe=M.attrValue,hr&&(Qe==="id"||Qe==="name")&&Ll(qe,Ga)!==0&&(Ht(Ne,u),qe=Ga+qe),ln&&ot(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,qe)){Ht(Ne,u);continue}if(Qe==="attributename"&&Il(qe,"href")){Ht(Ne,u);continue}if(M.forceKeepAttr)continue;if(!M.keepAttr){Ht(Ne,u);continue}if(!Je&&ot(/\/>/i,qe)){Ht(Ne,u);continue}Ft&&ka([Re,Se,At],ts=>{qe=jr(qe,ts," ")});const es=Ue(u.nodeName);if(!_r(es,Qe,qe)){Ht(Ne,u);continue}if(C&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!ut)switch(E.getAttributeType(es,Qe)){case"TrustedHTML":{qe=C.createHTML(qe);break}case"TrustedScriptURL":{qe=C.createScriptURL(qe);break}}if(qe!==Hr)try{ut?u.setAttributeNS(ut,Ne,qe):u.setAttribute(Ne,qe),vr(u)?Be(u):Cl(t.removed)}catch{Ht(Ne,u)}}un(Ee.afterSanitizeAttributes,u,null)},gr=function(u){let x=null;const M=Ka(u);for(un(Ee.beforeSanitizeShadowDOM,u,null);x=M.nextNode();)un(Ee.uponSanitizeShadowNode,x,null),Ja(x),Ve(x),x.content instanceof i&&gr(x.content);un(Ee.afterSanitizeShadowDOM,u,null)};return t.sanitize=function(B){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=null,M=null,ge=null,He=null;if(fa=!B,fa&&(B=""),typeof B!="string"&&!It(B)&&(B=Pf(B),typeof B!="string"))throw ss("dirty is not a string, aborting");if(!t.isSupported)return B;if(la||er(u),t.removed=[],typeof B=="string"&&(Un=!1),Un){const ft=B.nodeName;if(typeof ft=="string"){const Qe=Ue(ft);if(!De[Qe]||rn[Qe])throw ss("root node is forbidden and cannot be sanitized in-place")}}else if(B instanceof c)x=Va(""),M=x.ownerDocument.importNode(B,!0),M.nodeType===xa.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?x=M:x.appendChild(M);else{if(!on&&!Ft&&!Oe&&B.indexOf("<")===-1)return C&&Nr?C.createHTML(B):B;if(x=Va(B),!x)return on?null:Nr?oe:""}x&&oa&&Be(x.firstChild);const Ne=Ka(Un?B:x);for(;ge=Ne.nextNode();)Ja(ge),Ve(ge),ge.content instanceof i&&gr(ge.content);if(Un)return B;if(on){if(Ft){x.normalize();let ft=x.innerHTML;ka([Re,Se,At],Qe=>{ft=jr(ft,Qe," ")}),x.innerHTML=ft}if(Mr)for(He=nt.call(x.ownerDocument);x.firstChild;)He.appendChild(x.firstChild);else He=x;return(Fe.shadowroot||Fe.shadowrootmode)&&(He=Te.call(s,He,!0)),He}let ut=Oe?x.outerHTML:x.innerHTML;return Oe&&De["!doctype"]&&x.ownerDocument&&x.ownerDocument.doctype&&x.ownerDocument.doctype.name&&ot(Wo,x.ownerDocument.doctype.name)&&(ut=" -`+ut),Ft&&ka([Re,Se,At],ft=>{ut=jr(ut,ft," ")}),C&&Nr?C.createHTML(ut):ut},t.setConfig=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};er(B),la=!0},t.clearConfig=function(){Tn=null,la=!1},t.isValidAttribute=function(B,u,x){Tn||er({});const M=Ue(B),ge=Ue(u);return _r(M,ge,x)},t.addHook=function(B,u){typeof u=="function"&&wa(Ee[B],u)},t.removeHook=function(B,u){if(u!==void 0){const x=Cf(Ee[B],u);return x===-1?void 0:If(Ee[B],x,1)[0]}return Cl(Ee[B])},t.removeHooks=function(B){Ee[B]=[]},t.removeAllHooks=function(){Ee=Fl()},t}var Vf=jo();function xi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Or=xi();function Zo(e){Or=e}var wr={exec:()=>null};function fe(e,t=""){let n=typeof e=="string"?e:e.source,s={replace:(a,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(kt.caret,"$1"),n=n.replace(a,l),s},getRegex:()=>new RegExp(n,t)};return s}var Kf=(()=>{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|$))+/,Qf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ed=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ba=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,td=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ti=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Yo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xo=fe(Yo).replace(/bull/g,Ti).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(),nd=fe(Yo).replace(/bull/g,Ti).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(),Ei=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rd=/^[^\n]+/,Si=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ad=fe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Si).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sd=fe(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ti).getRegex(),bs="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",Ai=/|$))/,id=fe("^ {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",Ai).replace("tag",bs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vo=fe(Ei).replace("hr",Ba).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",bs).getRegex(),ld=fe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Vo).getRegex(),Ri={blockquote:ld,code:Qf,def:ad,fences:ed,heading:td,hr:Ba,html:id,lheading:Xo,list:sd,newline:Jf,paragraph:Vo,table:wr,text:rd},Ul=fe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ba).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",bs).getRegex(),od={...Ri,lheading:nd,table:Ul,paragraph:fe(Ei).replace("hr",Ba).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ul).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",bs).getRegex()},cd={...Ri,html:fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ai).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:wr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:fe(Ei).replace("hr",Ba).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",Xo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ud=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fd=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ko=/^( {2,}|\\)\n(?!\s*$)/,dd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Kf?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Qo=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,gd=fe(Qo,"u").replace(/punct/g,ia).getRegex(),md=fe(Qo,"u").replace(/punct/g,Jo).getRegex(),ec="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bd=fe(ec,"gu").replace(/notPunctSpace/g,Ci).replace(/punctSpace/g,ks).replace(/punct/g,ia).getRegex(),kd=fe(ec,"gu").replace(/notPunctSpace/g,vd).replace(/punctSpace/g,hd).replace(/punct/g,Jo).getRegex(),wd=fe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ci).replace(/punctSpace/g,ks).replace(/punct/g,ia).getRegex(),yd=fe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ia).getRegex(),xd="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Td=fe(xd,"gu").replace(/notPunctSpace/g,Ci).replace(/punctSpace/g,ks).replace(/punct/g,ia).getRegex(),Ed=fe(/\\(punct)/,"gu").replace(/punct/g,ia).getRegex(),Sd=fe(/^<(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(),Ad=fe(Ai).replace("(?:-->|$)","-->").getRegex(),Rd=fe("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Ad).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ds=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Cd=fe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ds).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tc=fe(/^!?\[(label)\]\[(ref)\]/).replace("label",ds).replace("ref",Si).getRegex(),nc=fe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Si).getRegex(),Id=fe("reflink|nolink(?!\\()","g").replace("reflink",tc).replace("nolink",nc).getRegex(),Hl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ii={_backpedal:wr,anyPunctuation:Ed,autolink:Sd,blockSkip:_d,br:Ko,code:fd,del:wr,delLDelim:wr,delRDelim:wr,emStrongLDelim:gd,emStrongRDelimAst:bd,emStrongRDelimUnd:wd,escape:ud,link:Cd,nolink:nc,punctuation:pd,reflink:tc,reflinkSearch:Id,tag:Rd,text:dd,url:wr},Ld={...Ii,link:fe(/^!?\[(label)\]\((.*?)\)/).replace("label",ds).getRegex(),reflink:fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ds).getRegex()},oi={...Ii,emStrongRDelimAst:kd,emStrongLDelim:md,delLDelim:yd,delRDelim:Td,url:fe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Hl).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:fe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Bl=e=>Od[e];function Dn(e,t){if(t){if(kt.escapeTest.test(e))return e.replace(kt.escapeReplace,Bl)}else if(kt.escapeTestNoEncode.test(e))return e.replace(kt.escapeReplaceNoEncode,Bl);return e}function ql(e){try{e=encodeURI(e).replace(kt.percentDecode,"%")}catch{return null}return e}function Gl(e,t){let n=e.replace(kt.findPipe,(i,l,c)=>{let o=!1,f=l;for(;--f>=0&&c[f]==="\\";)o=!o;return o?"|":" |"}),s=n.split(kt.splitPipe),a=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length0?-2:-1}function Nd(e,t=0){let n=t,s="";for(let a of e)if(a===" "){let i=4-n%4;s+=" ".repeat(i),n+=i}else s+=a,n++;return s}function Wl(e,t,n,s,a){let i=t.href,l=t.title||null,c=e[1].replace(a.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:l,text:c,tokens:s.inlineTokens(c)};return s.state.inLink=!1,o}function Pd(e,t,n){let s=e.match(n.other.indentCodeCompensation);if(s===null)return t;let a=s[1];return t.split(` -`).map(i=>{let l=i.match(n.other.beginningSpace);if(l===null)return i;let[c]=l;return c.length>=a.length?i.slice(a.length):i}).join(` -`)}var ps=class{options;rules;lexer;constructor(e){this.options=e||Or}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:Ea(n,` -`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],s=Pd(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:s}}}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 s=Ea(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.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:Ea(t[0],` -`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Ea(t[0],` -`).split(` -`),s="",a="",i=[];for(;n.length>0;){let l=!1,c=[],o;for(o=0;o1,a={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let i=this.rules.other.listItemRegex(n),l=!1;for(;e;){let o=!1,f="",h="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;f=t[0],e=e.substring(f.length);let w=Nd(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)&&(f+=m+` -`,e=e.substring(m.length+1),o=!0),!o){let L=this.rules.other.nextBulletRegex(T),S=this.rules.other.hrRegex(T),z=this.rules.other.fencesBeginRegex(T),R=this.rules.other.headingBeginRegex(T),te=this.rules.other.htmlBeginRegex(T),C=this.rules.other.blockquoteBeginRegex(T);for(;e;){let oe=e.split(` -`,1)[0],ve;if(m=oe,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),ve=m):ve=m.replace(this.rules.other.tabCharGlobal," "),z.test(m)||R.test(m)||te.test(m)||C.test(m)||L.test(m)||S.test(m))break;if(ve.search(this.rules.other.nonSpaceChar)>=T||!m.trim())h+=` -`+ve.slice(T);else{if(E||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||z.test(w)||R.test(w)||S.test(w))break;h+=` -`+m}E=!m.trim(),f+=oe+` -`,e=e.substring(oe.length+1),w=ve.slice(T)}}a.loose||(l?a.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(l=!0)),a.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),a.raw+=f}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 f=this.rules.other.listTaskCheckbox.exec(o.raw);if(f){let h={type:"checkbox",raw:f[0]+" ",checked:f[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 f=o.tokens.filter(w=>w.type==="space"),h=f.length>0&&f.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 f of o.tokens)f.type==="text"&&(f.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," "),s=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:s,title:a}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Gl(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(` -`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l({text:c,tokens:this.lexer.inline(c),header:!1,align:i.align[o]})));return i}}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 i=Ea(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=Md(t[2],"()");if(i===-2)return;if(i>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let s=t[2],a="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],a=i[3])}else a=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),Wl(t,{href:s&&s.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 s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=t[s.toLowerCase()];if(!a){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Wl(n,a,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...s[0]].length-1,i,l,c=a,o=0,f=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+a);(s=f.exec(t))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(l=[...i].length,s[3]||s[4]){c+=l;continue}else if((s[5]||s[6])&&a%3&&!((a+l)%3)){o+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+o);let h=[...s[0]][0].length,w=e.slice(0,a+s.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," "),s=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&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 s=this.rules.inline.delLDelim.exec(e);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...s[0]].length-1,i,l,c=a,o=this.rules.inline.delRDelim;for(o.lastIndex=0,t=t.slice(-1*e.length+a);(s=o.exec(t))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(l=[...i].length,l!==a))continue;if(s[3]||s[4]){c+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c);let f=[...s[0]][0].length,h=e.slice(0,a+s.index+f+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,s;return t[2]==="@"?(n=t[1],s="mailto:"+n):(n=t[1],s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,s;if(t[2]==="@")n=t[0],s="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."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:n,href:s,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}}}},vn=class ci{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Or,this.options.tokenizer=this.options.tokenizer||new ps,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:ls.normal,inline:Ta.normal};this.options.pedantic?(n.block=ls.pedantic,n.inline=Ta.pedantic):this.options.gfm&&(n.block=ls.gfm,this.options.breaks?n.inline=Ta.breaks:n.inline=Ta.gfm),this.tokenizer.rules=n}static get rules(){return{block:ls,inline:Ta}}static lex(t,n){return new ci(n).lex(t)}static lexInline(t,n){return new ci(n).inlineTokens(t)}lex(t){t=t.replace(kt.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 i=t;if(this.options.extensions?.startBlock){let l=1/0,c=t.slice(1),o;this.options.extensions.startBlock.forEach(f=>{o=f.call({lexer:this},c),typeof o=="number"&&o>=0&&(l=Math.min(l,o))}),l<1/0&&l>=0&&(i=t.substring(0,l+1))}if(this.state.top&&(a=this.tokenizer.paragraph(i))){let l=n.at(-1);s&&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),s=i.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 s=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(s))!==null;)o.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)i=a[2]?a[2].length:0,s=s.slice(0,a.index+i)+"["+"a".repeat(a[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;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,s,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,s,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 f=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&&(f=t.substring(0,h+1))}if(o=this.tokenizer.inlineText(f)){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}},hs=class{options;parser;constructor(e){this.options=e||Or}space(e){return""}code({text:e,lang:t,escaped:n}){let s=(t||"").match(kt.notSpaceStart)?.[0],a=e.replace(kt.endingNewline,"")+` -`;return s?'
    '+(n?a:Dn(a,!0))+`
    -`:"
    "+(n?a:Dn(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,s="";for(let l=0;l -`+s+" -`}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${s}`),` - -`+t+` -`+s+`
    -`}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`${Dn(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let s=this.parser.parseInline(n),a=ql(e);if(a===null)return s;e=a;let i='
    ",i}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let a=ql(e);if(a===null)return Dn(n);e=a;let i=`${Dn(n)}{let l=a[i].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 s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let i=t.renderers[a.name];i?t.renderers[a.name]=function(...l){let c=a.renderer.apply(this,l);return c===!1&&(c=i.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 i=t[a.level];i?i.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)}),s.extensions=t),n.renderer){let a=this.defaults.renderer||new hs(this.defaults);for(let i in n.renderer){if(!(i in a))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,c=n.renderer[l],o=a[l];a[l]=(...f)=>{let h=c.apply(a,f);return h===!1&&(h=o.apply(a,f)),h||""}}s.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new ps(this.defaults);for(let i in n.tokenizer){if(!(i in a))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,c=n.tokenizer[l],o=a[l];a[l]=(...f)=>{let h=c.apply(a,f);return h===!1&&(h=o.apply(a,f)),h}}s.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new La;for(let i in n.hooks){if(!(i in a))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,c=n.hooks[l],o=a[l];La.passThroughHooks.has(i)?a[l]=f=>{if(this.defaults.async&&La.passThroughHooksRespectAsync.has(i))return(async()=>{let w=await c.call(a,f);return o.call(a,w)})();let h=c.call(a,f);return o.call(a,h)}:a[l]=(...f)=>{if(this.defaults.async)return(async()=>{let w=await c.apply(a,f);return w===!1&&(w=await o.apply(a,f)),w})();let h=c.apply(a,f);return h===!1&&(h=o.apply(a,f)),h}}s.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(l){let c=[];return c.push(i.call(this,l)),a&&(c=c.concat(a.call(this,l))),c}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return vn.lex(e,t??this.defaults)}parser(e,t){return _n.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let s={...n},a={...this.defaults,...s},i=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&s.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 t>"u"||t===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return i(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?vn.lex:vn.lexInline)(l,a),o=a.hooks?await a.hooks.processAllTokens(c):c;a.walkTokens&&await Promise.all(this.walkTokens(o,a.walkTokens));let f=await(a.hooks?await a.hooks.provideParser(e):e?_n.parse:_n.parseInline)(o,a);return a.hooks?await a.hooks.postprocess(f):f})().catch(i);try{a.hooks&&(t=a.hooks.preprocess(t));let l=(a.hooks?a.hooks.provideLexer(e):e?vn.lex:vn.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?_n.parse:_n.parseInline)(l,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(l){return i(l)}}}onError(e,t){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let s="

    An error occurred:

    "+Dn(n.message+"",!0)+"
    ";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},Ir=new zd;function we(e,t){return Ir.parse(e,t)}we.options=we.setOptions=function(e){return Ir.setOptions(e),we.defaults=Ir.defaults,Zo(we.defaults),we};we.getDefaults=xi;we.defaults=Or;we.use=function(...e){return Ir.use(...e),we.defaults=Ir.defaults,Zo(we.defaults),we};we.walkTokens=function(e,t){return Ir.walkTokens(e,t)};we.parseInline=Ir.parseInline;we.Parser=_n;we.parser=_n.parse;we.Renderer=hs;we.TextRenderer=Li;we.Lexer=vn;we.lexer=vn.lex;we.Tokenizer=ps;we.Hooks=La;we.parse=we;we.options;we.setOptions;we.use;we.walkTokens;we.parseInline;_n.parse;vn.lex;function Zr(e){return Vf.sanitize(we.parse(e,{async:!1,breaks:!0,gfm:!0}))}function Ln(e){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}var $d=D(''),Fd=D(`
    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=D(''),Hd=D('
    '),Bd=D('
    '),qd=D(''),Gd=D(''),Wd=D(''),jd=D(''),Zd=D(''),Yd=D(''),Xd=D(''),Vd=D(''),Kd=D(''),Jd=D(''),Qd=D('

    '),ep=D('

    '),tp=D('

    ClickClack

    '),np=D(''),rp=D(''),ap=D(''),sp=D('
    '),ip=D('
    Send a message in Markdown — code fences, lists, links all work. Threads open from any message.
    '),lp=D('
    '),op=D(''),cp=D(" "),up=D(' '),fp=D(' '),dp=D(''),pp=D(''),hp=D('',2),vp=D(' '),_p=D('
    '),gp=D('
    '),mp=D('
    ',1),bp=D(''),kp=D('
    GIFs
    '),wp=D(''),yp=D('
    '),xp=D('
    Replying to
    '),Tp=D(''),Ep=D(" "),Sp=D(''),Ap=D('',2),Rp=D(' '),Cp=D('
    '),Ip=D(''),Lp=D(" "),Dp=D(' '),Op=D(' '),Mp=D(''),Np=D(''),Pp=D('',2),zp=D(' '),$p=D('
    '),Fp=D('
    '),Up=D('
    Replying to
    '),Hp=D('

    Thread

    ',1),Bp=D(''),qp=D(" "),Gp=D(''),Wp=D(''),jp=D(''),Zp=D('

    Profile

    Active
    Contact information
    Handle
    User ID
    About

    ',1),Yp=D('
    No thread open Hover any message and tap the bubble to keep side conversations tidy.
    '),Xp=D(''),Vp=D("

    "),Kp=D(''),Jp=D(''),Qp=D('

    Enter to send · Shift+Enter for newline · Markdown supported
    ',1);function eh(e,t){di(t,!1);const n=Z(),s=Z(),a=Z(),i=Z(),l=Z(),c=Z(),o=Z();let f=Z(null),h=Z([]),w=Z([]),m=Z([]),E=Z([]),T=Z([]),L=Z(""),S=Z(""),z=Z(""),R=Z(null),te=Z(null),C=Z(null),oe=Z(null),ve=Z(""),Ae=Z(""),nt=Z(""),rt=Z(""),Te=Z(""),Ee=Z(""),Re=Z([]),Se=Z(null),At=Z(!1),wn=Z(!1),zn=Z(""),zt=Z(""),nn=Z(""),Kn=Z(""),$n=Z(""),De=Z(!1),$t=Z("loading"),Fe=Z(!1),yn=null,_e=Z(!1),rn,an=Z(null),Rt=Z(!1),Fn=Z(!1),sn=Z(!1),pe=Z(null),Je=Z(null),Ft=Z(null),ln=Z(null),Oe=Z("message");const la=[{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"]}];Ho(()=>{oa()}),xf(()=>{const d=yn;yn=null,g(_e,!1),d?.close(),rn&&window.clearTimeout(rn)});async function oa(){try{const d=await lt("/api/me");g(f,d.user),await Nr(),g($t,"ready")}catch(d){if(d instanceof Bo&&(d.status===401||d.status===403)){g(Fe,!0),g($t,"auth");return}g($t,d instanceof Error?d.message:"Could not load ClickClack")}}function on(){r(f)&&(g(zt,r(f).display_name),g(nn,r(f).handle?`@${r(f).handle}`:""),g(Kn,r(f).avatar_url),g($n,""),g(De,!1),g(wn,!0))}async function Mr(){g($n,""),g(De,!1);try{const d=await lt("/api/me",{method:"PATCH",body:JSON.stringify({display_name:r(zt),handle:r(nn),avatar_url:r(Kn)})});g(f,d.user),g(E,r(E).map(b=>b.author?.id===r(f)?.id?{...b,author:d.user}:b)),g(T,r(T).map(b=>b.author?.id===r(f)?.id?{...b,author:d.user}:b)),r(R)?.author?.id===r(f).id&&g(R,{...r(R),author:d.user}),g($n,"Saved"),g(wn,!1)}catch(d){g($n,d instanceof Error?d.message:"Could not save profile"),g(De,!0)}}async function Nr(){const d=await lt("/api/workspaces");g(h,d.workspaces),g(L,r(L)||r(h)[0]?.id||""),await hr(),await Tn(),r(h).length===0&&g($t,"create a workspace"),er()}async function qa(){if(!r(nt).trim())return;const d=await lt("/api/workspaces",{method:"POST",body:JSON.stringify({name:r(nt)})});g(nt,""),g(Rt,!1),g(h,[...r(h),d.workspace]),g(L,d.workspace.id),await hr(),await Tn(),er()}async function hr(){if(!r(L))return;const d=await lt(`/api/workspaces/${r(L)}/channels`);g(w,d.channels),g(S,r(w).find(b=>b.id===r(S))?.id||r(w)[0]?.id||""),g(R,null),g(C,null),g(Oe,"message"),g(T,[]),await vt()}async function Ga(){if(!r(L)||!r(rt).trim())return;const d=await lt(`/api/workspaces/${r(L)}/channels`,{method:"POST",body:JSON.stringify({name:r(rt),kind:"public"})});g(rt,""),g(w,[...r(w),d.channel]),g(S,d.channel.id),g(z,""),await vt()}async function vt(){if(r(z)){const b=await lt(`/api/dms/${r(z)}/messages`);g(E,b.messages),await Un();return}if(!r(S)){g(E,[]);return}const d=await lt(`/api/channels/${r(S)}/messages`);g(E,d.messages),await Un()}async function Un(){await ti(),r(an)&&Hu(an,r(an).scrollTop=r(an).scrollHeight)}async function Hn(){const d=r(ve).trim();if(!d)return;if(!r(S)&&!r(z)){g($t,"pick or create a channel");return}const b=r(z)?"dm":"channel",N=r(pe)&&r(Je)===b?r(pe):null;g(ve,"");const Q=r(z)?`/api/dms/${r(z)}/messages`:`/api/channels/${r(S)}/messages`,be={body:d};N&&(be.quoted_message_id=N.id);const ae=await lt(Q,{method:"POST",body:JSON.stringify(be)});let Ge=ae.message;if(N&&_t(),r(Se)){const Bt=r(Se);await lt(`/api/messages/${ae.message.id}/attachments`,{method:"POST",body:JSON.stringify({upload_id:Bt.id})}),g(Se,null),Ge={...Ge,attachments:[...Ge.attachments||[],Bt]}}r(E).some(Bt=>Bt.id===Ge.id)?g(E,r(E).map(Bt=>Bt.id===Ge.id?Ge:Bt)):g(E,[...r(E),Ge]),await Un()}async function Ct(d){g(C,null),g(R,d),g(Oe,"thread");const b=await lt(`/api/messages/${d.id}/thread`);g(R,b.root),g(T,b.replies),g(te,b.thread_state)}async function Pr(){const d=r(Ae).trim();if(!d||!r(R))return;const b=r(pe)&&r(Je)==="thread"?r(pe):null;g(Ae,"");const N={body:d};b&&(N.quoted_message_id=b.id);const Q=await lt(`/api/messages/${r(R).id}/thread/replies`,{method:"POST",body:JSON.stringify(N)});b&&_t(),r(T).some(be=>be.id===Q.message.id)||g(T,[...r(T),Q.message]),g(te,Q.thread_state)}function zr(d,b){g(pe,d),g(Je,b),g(Oe,b==="thread"?"thread":"message")}const Wa=new Set(["button","checkbox","combobox","link","listbox","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","option","radio","radiogroup","slider","spinbutton","switch","tab","tablist","textbox","tree","treeitem"]),ca=new Set(["INPUT","TEXTAREA","SELECT","BUTTON","A","DETAILS","SUMMARY","VIDEO","AUDIO"]);function ua(){return r(oe)!==null||r(wn)}function $r(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 Fr(d){if(!d||Ut(d))return!1;if(ca.has(d.tagName))return!0;const b=d.getAttribute("role");if(b&&Wa.has(b))return!0;const N=d.getAttribute("tabindex");return!!(N!==null&&N!=="-1"&&d.hasAttribute("aria-keyshortcuts"))}function Ut(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 Jn(){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 fa(d){if(r(Fe)||ua()||d.defaultPrevented||d.isComposing||d.keyCode===229||d.ctrlKey||d.metaKey||d.altKey||d.key.length!==1||Jn())return!1;const b=document.activeElement;return!(b===r(Ft)||b===r(ln)||$r(b)||Fr(b))}function da(d){if(!fa(d))return;const b=ws();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,be=b.selectionEnd??N;b.setRangeText(" ",Q,be,"end"),b.dispatchEvent(new Event("input",{bubbles:!0}))}}function ws(){return r(Oe)==="thread"&&r(R)&&r(ln)?r(ln):r(Ft)}function _t(){g(pe,null),g(Je,null)}function Ur(d,b){const N=()=>{const ae=d.style.height;d.style.height="auto";const Ge=`${d.scrollHeight}px`;ae!==Ge?d.style.height=Ge:d.style.height=ae},Q=()=>N(),be=()=>N();return requestAnimationFrame(N),d.addEventListener("input",Q),window.addEventListener("resize",be),{update(){requestAnimationFrame(N)},destroy(){d.removeEventListener("input",Q),window.removeEventListener("resize",be)}}}function Qn(d,b=120){if(!d)return"";const N=d.replace(/\s+/g," ").trim();return N.length>b?N.slice(0,b-1)+"…":N}function xn(d){return d.quoted_author?.display_name||"Unknown"}async function ja(d){const b=d.quoted_message_id;if(!b)return;await ti();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 ys(){if(!r(L)||!r(Ee).trim()){g(Re,[]);return}const d=await lt(`/api/search?workspace_id=${encodeURIComponent(r(L))}&q=${encodeURIComponent(r(Ee).trim())}`);g(Re,d.results)}async function Ue(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 be=await lt("/api/uploads",{method:"POST",body:Q});g(Se,be.upload),b.value=""}async function Tn(){if(!r(L))return;const d=await lt(`/api/dms?workspace_id=${r(L)}`);g(m,d.conversations)}async function xs(){if(!r(L)||!r(Te).trim())return;const d=await lt("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:r(L),member_ids:[r(Te).trim()]})});g(Te,""),g(m,[...r(m),d.conversation]),g(z,d.conversation.id),g(S,""),g(R,null),g(C,null),g(Oe,"message"),await vt()}async function Za(d){if(!r(L)||!d)return;const b=r(m).find(Q=>Q.members.some(be=>be.id===d));if(b){g(z,b.id),g(S,""),g(R,null),g(C,null),g(Oe,"message"),await vt();return}const N=await lt("/api/dms",{method:"POST",body:JSON.stringify({workspace_id:r(L),member_ids:[d]})});g(m,[...r(m),N.conversation]),g(z,N.conversation.id),g(S,""),g(R,null),g(C,null),g(Oe,"message"),await vt()}function er(){rn&&window.clearTimeout(rn);const d=yn;if(yn=null,g(_e,!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);yn=Q,Q.addEventListener("open",()=>{yn===Q&&g(_e,!0)}),Q.addEventListener("message",be=>{const ae=JSON.parse(String(be.data));ae.cursor&&localStorage.setItem(`clickclack:${r(L)}:cursor`,ae.cursor),Ya(ae)}),Q.addEventListener("close",()=>{yn===Q&&(g(_e,!1),rn=window.setTimeout(er,1200))})}async function Ya(d){if((d.type==="channel.created"||d.type==="channel.updated")&&d.workspace_id===r(L)){await hr();return}(d.channel_id===r(S)||d.payload.direct_conversation_id===r(z))&&(d.type==="message.created"||d.type==="message.updated"||d.type==="message.deleted")&&await vt();const b=d.payload.root_message_id||d.payload.message_id;r(R)&&b===r(R).id&&await Ct(r(R))}function Xa(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 cn(d){if(!d)return"?";const b=d.trim();return b?b[0].toUpperCase():"?"}function Be(d){return d?`@${d}`:""}function Ht(d){return d.members.find(b=>b.id!==r(f)?.id)||d.members[0]}function Va(d,b,N){const Q=new Map;for(const be of b)for(const ae of be.members)ae.id&&ae.id!==N&&Q.set(ae.id,ae);for(const be of[...d].reverse()){const ae=be.author;ae?.id&&ae.id!==N&&Q.set(ae.id,ae)}return[...Q.values()].slice(0,12)}function Ka(d){return r(m).find(b=>b.members.some(N=>N.id===d))}function vr(d){d&&(g(R,null),g(C,d))}function It(d){let b=0;for(let N=0;N>>0;return b%360}function un(d){const b=new Date(d),N=new Date,Q=new Date;Q.setDate(N.getDate()-1);const be=(ae,Ge)=>ae.getFullYear()===Ge.getFullYear()&&ae.getMonth()===Ge.getMonth()&&ae.getDate()===Ge.getDate();return be(b,N)?"Today":be(b,Q)?"Yesterday":new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric"}).format(b)}function Ja(d){const b=[];let N="",Q="",be=0;for(const ae of d){const Ge=new Date(ae.created_at),Bt=Ge.toDateString(),Br=ae.author?.id||ae.author_id||"local",pa=Bt!==N,ns=Br!==Q,Es=Ge.getTime()-be>300*1e3;pa||ns||Es||b.length===0?b.push({key:ae.id,dayLabel:pa?un(ae.created_at):null,messages:[ae],authorName:ae.author?.display_name||"Local User",authorHandle:ae.author?.handle||"",authorAvatarURL:ae.author?.avatar_url||"",authorID:Br,timestamp:ae.created_at}):b[b.length-1].messages.push(ae),N=Bt,Q=Br,be=Ge.getTime()}return b}function _r(d){const b=d.members.filter(Q=>Q.id!==r(f)?.id);return(b.length>0?b:d.members).map(Q=>Q.display_name).join(", ")}function Ts(d){if(d.key==="Escape"&&r(pe)&&r(Je)!=="thread"){d.preventDefault(),_t();return}d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),Hn())}function Qa(d){if(d.key==="Escape"&&r(pe)&&r(Je)==="thread"){d.preventDefault(),_t();return}d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),Pr())}function Ve(d){return`/api/uploads/${encodeURIComponent(d.id)}`}function gr(d,b){g(oe,{url:d,title:b})}function B(d){const b=d.target;b instanceof HTMLImageElement&&b.closest(".markdown")&&(d.preventDefault(),gr(b.currentSrc||b.src,b.alt||"Image"))}function u(d){return d.content_type.startsWith("image/")}function x(d){return d.content_type.startsWith("video/")}function M(d){return d<1024?`${d} B`:d<1024*1024?`${Math.round(d/1024)} KB`:`${(d/(1024*1024)).toFixed(1)} MB`}function ge(d){const b=r(ve)&&!r(ve).endsWith(` -`)?` -`:"";g(ve,`${r(ve)}${b}${d}`)}function He(d,b=d){ge(`${d}${d==="```"?` -code -`:"text"}${b}`)}function Ne(d,b){ge(`![${b}](${d})`),g(At,!1),g(zn,"")}function ut(d){return r(R)?.id===d.id?"Open":"Thread"}function ft(){r(Je)==="thread"&&_t(),g(R,null),g(C,null),g(Oe,"message"),g(T,[])}function Qe(){g(oe,null),g(wn,!1)}Rn(()=>(r(h),r(L)),()=>{g(n,r(h).find(d=>d.id===r(L)))}),Rn(()=>(r(w),r(S)),()=>{g(s,r(w).find(d=>d.id===r(S)))}),Rn(()=>(r(m),r(z)),()=>{g(a,r(m).find(d=>d.id===r(z)))}),Rn(()=>(r(R),r(C)),()=>{g(i,r(R)!==null||r(C)!==null)}),Rn(()=>r(E),()=>{g(l,Ja(r(E)))}),Rn(()=>(r(E),r(m),r(f)),()=>{g(c,Va(r(E),r(m),r(f)?.id||""))}),Rn(()=>(r(Je),r(pe),r(E)),()=>{r(Je)==="channel"&&r(pe)&&!r(E).some(d=>d.id===r(pe)?.id)&&_t()}),Rn(()=>(r(Je),r(pe),r(E)),()=>{r(Je)==="dm"&&r(pe)&&!r(E).some(d=>d.id===r(pe)?.id)&&_t()}),Rn(()=>(r(Je),r(pe),r(R),r(T)),()=>{r(Je)==="thread"&&r(pe)&&r(R)&&r(pe).id!==r(R).id&&!r(T).some(d=>d.id===r(pe)?.id)&&_t()}),Rn(()=>r(zn),()=>{g(o,la.filter(d=>{const b=r(zn).trim().toLowerCase();return!b||d.title.toLowerCase().includes(b)||d.tags.some(N=>N.includes(b))}))}),Vu(),Uo();var Hr=Ra();Fo("1oa2eo8",d=>{var b=$d();A(d,b)}),Cn("keydown",Qs,d=>{if(d.key==="Escape"){if(ua())Qe();else if(r(pe)){d.preventDefault(),_t();return}}da(d)});var qe=Yn(Hr);{var es=d=>{var b=Fd();A(d,b)},ts=d=>{var b=Qp(),N=Yn(b);let Q;var be=p(N),ae=p(be);{var Ge=y=>{var k=mt("×");A(y,k)},Bt=y=>{var k=Ud();A(y,k)};j(ae,y=>{r(sn)?y(Ge):y(Bt,-1)})}var Br=_(be,2),pa=_(p(Br),4),ns=p(pa);Nt(ns,1,()=>r(h),y=>y.id,(y,k)=>{var U=Hd();let X;var ie=p(U),se=p(ie),ee=p(se);P(le=>{X=Mt(U,1,"guild-wrap",null,X,{active:r(k).id===r(L)}),$(ie,"title",(r(k),v(()=>r(k).name))),I(ee,le)},[()=>(r(k),v(()=>Xa(r(k).name)))]),G("click",ie,async()=>{g(L,r(k).id),await hr(),await Tn(),er()}),A(y,U)});var Es=_(ns,2),rc=_(pa,2);{var ac=y=>{var k=Bd(),U=p(k);Cn("submit",k,X=>{X.preventDefault(),qa()}),In(U,()=>r(nt),X=>g(nt,X)),A(y,k)};j(rc,y=>{r(Rt)&&y(ac)})}var Di=_(Br,2),Oi=p(Di),Mi=p(Oi),Ni=p(Mi),sc=p(Ni),Pi=_(Ni,2);let zi;var ic=p(Pi),rs=_(Mi,2),lc=p(rs),oc=p(lc),$i=_(Oi,2),Fi=p($i),Ui=_(p(Fi),2),Hi=p(Ui);Nt(Hi,1,()=>r(w),y=>y.id,(y,k)=>{var U=qd();let X;var ie=_(p(U),2),se=p(ie);P(()=>{X=Mt(U,1,"nav-item channel",null,X,{active:r(k).id===r(S)&&!r(z)}),I(se,(r(k),v(()=>r(k).name)))}),G("click",U,async()=>{g(S,r(k).id),g(z,""),g(R,null),g(C,null),g(Oe,"message"),g(sn,!1),await vt()}),A(y,U)});var cc=_(Hi,2);{var uc=y=>{var k=Gd();A(y,k)};j(cc,y=>{r(w),v(()=>r(w).length===0)&&y(uc)})}var Bi=_(Ui,2),fc=p(Bi),qi=_(Fi,2),Gi=_(p(qi),2),Wi=p(Gi);Nt(Wi,1,()=>r(m),y=>y.id,(y,k)=>{var U=jd();let X;var ie=p(U),se=p(ie);{var ee=F=>{var K=Wd();P(Pe=>$(K,"src",Pe),[()=>(r(k),v(()=>Ht(r(k))?.avatar_url))]),A(F,K)},le=ar(()=>(r(k),v(()=>Ht(r(k))?.avatar_url))),H=F=>{var K=mt();P(Pe=>I(K,Pe),[()=>(r(k),v(()=>cn(Ht(r(k))?.display_name)))]),A(F,K)};j(se,F=>{r(le)?F(ee):F(H,-1)})}var he=_(ie,2),Ce=p(he);P((F,K)=>{X=Mt(U,1,"nav-item dm",null,X,{active:r(k).id===r(z)}),Zn(ie,`--hue: ${F??""}deg`),I(Ce,K)},[()=>(r(k),v(()=>It(Ht(r(k))?.id||r(k).id))),()=>(r(k),v(()=>_r(r(k))))]),G("click",U,async()=>{g(z,r(k).id),g(S,""),g(R,null),g(C,null),g(Oe,"message"),g(sn,!1),await vt()}),A(y,U)});var dc=_(Wi,2);{var pc=y=>{var k=Zd();A(y,k)};j(dc,y=>{r(m),v(()=>r(m).length===0)&&y(pc)})}var ji=_(Gi,2),hc=p(ji),vc=_(qi,2),_c=_(p(vc),2),Zi=p(_c);Nt(Zi,1,()=>r(c),y=>y.id,(y,k)=>{const U=gi(()=>(r(k),v(()=>Ka(r(k).id))));var X=Xd();let ie;var se=p(X),ee=p(se);{var le=F=>{var K=Yd();P(()=>$(K,"src",(r(k),v(()=>r(k).avatar_url)))),A(F,K)},H=F=>{var K=mt();P(Pe=>I(K,Pe),[()=>(r(k),v(()=>cn(r(k).display_name)))]),A(F,K)};j(ee,F=>{r(k),v(()=>r(k).avatar_url)?F(le):F(H,-1)})}var he=_(se,2),Ce=p(he);P(F=>{ie=Mt(X,1,"nav-item dm",null,ie,{active:r(U)?.id===r(z)||r(C)?.id===r(k).id}),Zn(se,`--hue: ${F??""}deg`),I(Ce,(r(k),v(()=>r(k).display_name)))},[()=>(r(k),v(()=>It(r(k).id)))]),G("click",X,async()=>{r(U)?(g(z,r(U).id),g(S,""),g(R,null),g(C,null),g(Oe,"message"),g(sn,!1),await vt()):vr(r(k))}),A(y,X)});var gc=_(Zi,2);{var mc=y=>{var k=Vd();A(y,k)};j(gc,y=>{r(c),v(()=>r(c).length===0)&&y(mc)})}var bc=_($i,2);{var kc=y=>{var k=Jd(),U=p(k),X=p(U);{var ie=F=>{var K=Kd();P(()=>$(K,"src",(r(f),v(()=>r(f).avatar_url)))),A(F,K)},se=F=>{var K=mt();P(Pe=>I(K,Pe),[()=>(r(f),v(()=>cn(r(f).display_name)))]),A(F,K)};j(X,F=>{r(f),v(()=>r(f).avatar_url)?F(ie):F(se,-1)})}var ee=_(U,2),le=p(ee),H=p(le),he=_(le,2),Ce=p(he);P((F,K,Pe)=>{$(k,"aria-label",F),Zn(U,`--hue: ${K??""}deg`),I(H,(r(f),v(()=>r(f).display_name))),I(Ce,Pe)},[()=>(r(f),v(()=>`Account settings for ${r(f).display_name} ${Be(r(f).handle)}`)),()=>(r(f),v(()=>It(r(f).id))),()=>(r(f),r(_e),v(()=>r(f).handle?Be(r(f).handle):r(_e)?"Active":"Reconnecting…"))]),G("click",k,on),G("contextmenu",k,F=>{F.preventDefault(),on()}),A(y,k)};j(bc,y=>{r(f)&&y(kc)})}var Yi=_(Di,2),Xi=p(Yi),Vi=p(Xi),Ki=p(Vi);{var wc=y=>{var k=Qd(),U=p(k);P(X=>I(U,X),[()=>(r(a),v(()=>`@${_r(r(a))}`))]),A(y,k)},yc=y=>{var k=ep(),U=p(k);P(()=>I(U,(r(s),v(()=>`#${r(s).name}`)))),A(y,k)},xc=y=>{var k=tp();A(y,k)};j(Ki,y=>{r(a)?y(wc):r(s)?y(yc,1):y(xc,-1)})}var Tc=_(Ki,4),Ec=p(Tc),Ss=_(Vi,2),Ji=_(p(Ss),2),Sc=_(Ji,2);{var Ac=y=>{var k=np();G("click",k,()=>{g(Ee,""),g(Re,[])}),A(y,k)};j(Sc,y=>{r(Ee)&&y(Ac)})}var Rc=_(Ss,2),ha=p(Rc);let Qi;var Cc=_(ha,2),el=_(Xi,2);{var Ic=y=>{var k=sp(),U=p(k),X=p(U),ie=p(X),se=_(X,2),ee=_(U,2);Nt(ee,1,()=>r(Re),le=>le.message.id,(le,H)=>{var he=ap(),Ce=p(he),F=p(Ce);{var K=Ie=>{var et=rp();P(()=>$(et,"src",(r(H),v(()=>r(H).message.author.avatar_url)))),A(Ie,et)},Pe=Ie=>{var et=mt();P(En=>I(et,En),[()=>(r(H),v(()=>cn(r(H).message.author?.display_name)))]),A(Ie,et)};j(F,Ie=>{r(H),v(()=>r(H).message.author?.avatar_url)?Ie(K):Ie(Pe,-1)})}var qt=_(Ce,2),Gt=p(qt),fn=p(Gt),dn=p(fn),Bn=_(fn,2),me=p(Bn),q=_(Gt,2),at=p(q);P((Ie,et)=>{Zn(Ce,`--hue: ${Ie??""}deg`),I(dn,(r(H),v(()=>r(H).message.author?.display_name||"Local User"))),I(me,et),I(at,(r(H),v(()=>r(H).message.body)))},[()=>(r(H),v(()=>It(r(H).message.author?.id||r(H).message.author_id||"x"))),()=>(hn(Ln),r(H),v(()=>Ln(r(H).message.created_at)))]),G("click",he,async()=>{g(Re,[]),r(H).message.channel_id&&(g(S,r(H).message.channel_id),g(z,""),await vt()),r(H).message.direct_conversation_id&&(g(z,r(H).message.direct_conversation_id),g(S,""),await vt())}),A(le,he)}),P(()=>I(ie,`${r(Re),v(()=>r(Re).length)??""} ${r(Re),v(()=>r(Re).length===1?"result":"results")??""}`)),G("click",se,()=>{g(Re,[])}),A(y,k)};j(el,y=>{r(Re),v(()=>r(Re).length>0)&&y(Ic)})}var va=_(el,2),tl=p(va);{var Lc=y=>{var k=ip(),U=p(k),X=p(U);{var ie=F=>{var K=mt("@");A(F,K)},se=F=>{var K=mt("#");A(F,K)};j(X,F=>{r(a)?F(ie):F(se,-1)})}var ee=_(U,2),le=p(ee);{var H=F=>{var K=mt();P(Pe=>I(K,`This is the start of your conversation with ${Pe??""}.`),[()=>(r(a),v(()=>_r(r(a))))]),A(F,K)},he=F=>{var K=mt();P(()=>I(K,`Welcome to #${r(s),v(()=>r(s).name)??""}!`)),A(F,K)},Ce=F=>{var K=mt("Pick a channel to get started.");A(F,K)};j(le,F=>{r(a)?F(H):r(s)?F(he,1):F(Ce,-1)})}A(y,k)};j(tl,y=>{r(E),v(()=>r(E).length===0)&&y(Lc)})}var Dc=_(tl,2);Nt(Dc,1,()=>r(l),y=>y.key,(y,k)=>{var U=mp(),X=Yn(U);{var ie=me=>{var q=lp(),at=p(q),Ie=p(at);P(()=>I(Ie,(r(k),v(()=>r(k).dayLabel)))),A(me,q)};j(X,me=>{r(k),v(()=>r(k).dayLabel)&&me(ie)})}var se=_(X,2),ee=p(se),le=p(ee);{var H=me=>{var q=op();P(()=>$(q,"src",(r(k),v(()=>r(k).authorAvatarURL)))),A(me,q)},he=me=>{var q=mt();P(at=>I(q,at),[()=>(r(k),v(()=>cn(r(k).authorName)))]),A(me,q)};j(le,me=>{r(k),v(()=>r(k).authorAvatarURL)?me(H):me(he,-1)})}var Ce=_(ee,2),F=p(Ce),K=p(F),Pe=p(K),qt=_(K,2);{var Gt=me=>{var q=cp(),at=p(q);P(Ie=>I(at,Ie),[()=>(r(k),v(()=>Be(r(k).authorHandle)))]),A(me,q)};j(qt,me=>{r(k),v(()=>r(k).authorHandle)&&me(Gt)})}var fn=_(qt,2),dn=p(fn),Bn=_(F,2);Nt(Bn,3,()=>(r(k),v(()=>r(k).messages)),me=>me.id,(me,q,at)=>{var Ie=gp();let et;var En=p(Ie),tr=p(En),qn=_(En,2),ye=p(qn);{var st=Lt=>{var V=dp();let O;var W=_(p(V),2),Y=p(W),jt=p(Y),ce=_(Y,2);{var ke=Ke=>{var dt=up(),it=p(dt);P(xe=>I(it,xe),[()=>(r(q),v(()=>Qn(r(q).quoted_body_snapshot)))]),A(Ke,dt)},Dt=Ke=>{var dt=fp(),it=p(dt);P(xe=>I(it,`[original deleted] ${xe??""}`),[()=>(r(q),v(()=>Qn(r(q).quoted_body_snapshot)))]),A(Ke,dt)};j(ce,Ke=>{r(q),v(()=>r(q).quoted_message_id)?Ke(ke):Ke(Dt,-1)})}P((Ke,dt)=>{O=Mt(V,1,"quote-block",null,O,{dangling:!r(q).quoted_message_id}),V.disabled=(r(q),v(()=>!r(q).quoted_message_id)),$(V,"aria-label",Ke),I(jt,dt)},[()=>(r(q),v(()=>r(q).quoted_message_id?`Jump to quoted message from ${xn(r(q))}`:"Original message was deleted")),()=>(r(q),v(()=>xn(r(q))))]),G("click",V,()=>ja(r(q))),A(Lt,V)};j(ye,Lt=>{r(q),v(()=>r(q).quoted_message_id||r(q).quoted_body_snapshot)&&Lt(st)})}var Wt=_(ye,2);$s(Wt,()=>(hn(Zr),r(q),v(()=>Zr(r(q).body))),!0);var nr=_(Wt,2);{var qr=Lt=>{var V=_p();Nt(V,5,()=>(r(q),v(()=>r(q).attachments)),O=>O.id,(O,W)=>{var Y=Ra(),jt=Yn(Y);{var ce=it=>{var xe=pp(),Me=p(xe),We=_(Me,2),pt=p(We);P(xt=>{$(xe,"aria-label",(r(W),v(()=>`Open image ${r(W).filename}`))),$(Me,"src",xt),$(Me,"alt",(r(W),v(()=>r(W).filename))),I(pt,(r(W),v(()=>r(W).filename)))},[()=>(r(W),v(()=>Ve(r(W))))]),G("click",xe,()=>gr(Ve(r(W)),r(W).filename)),A(it,xe)},ke=ar(()=>(r(W),v(()=>u(r(W))))),Dt=it=>{var xe=hp(),Me=p(xe),We=p(Me),pt=_(Me,2),xt=p(pt);P((Zt,Gn)=>{$(Me,"aria-label",(r(W),v(()=>r(W).filename))),$(We,"src",Zt),$(We,"type",(r(W),v(()=>r(W).content_type))),$(pt,"href",Gn),I(xt,(r(W),v(()=>r(W).filename)))},[()=>(r(W),v(()=>Ve(r(W)))),()=>(r(W),v(()=>Ve(r(W))))]),A(it,xe)},Ke=ar(()=>(r(W),v(()=>x(r(W))))),dt=it=>{var xe=vp(),Me=_(p(xe),2),We=p(Me),pt=p(We),xt=_(We,2),Zt=p(xt);P((Gn,rr)=>{$(xe,"href",Gn),I(pt,(r(W),v(()=>r(W).filename))),I(Zt,rr)},[()=>(r(W),v(()=>Ve(r(W)))),()=>(r(W),v(()=>M(r(W).byte_size)))]),A(it,xe)};j(jt,it=>{r(ke)?it(ce):r(Ke)?it(Dt,1):it(dt,-1)})}A(O,Y)}),A(Lt,V)};j(nr,Lt=>{r(q),v(()=>r(q).attachments?.length)&&Lt(qr)})}var _a=_(qn,2),Gr=p(_a),pn=_(Gr,2);P((Lt,V)=>{et=Mt(Ie,1,"message-row",null,et,{selected:r(R)?.id===r(q).id}),$(Ie,"data-message-id",(r(q),v(()=>r(q).id))),I(tr,Lt),$(pn,"data-tooltip",V)},[()=>(hn(r(at)),hn(Ln),r(q),v(()=>r(at)===0?"":Ln(r(q).created_at))),()=>(r(q),v(()=>ut(r(q))))]),G("click",Gr,()=>zr(r(q),r(z)?"dm":"channel")),G("click",pn,()=>Ct(r(q))),A(me,Ie)}),P((me,q)=>{Zn(ee,`--hue: ${me??""}deg`),$(ee,"aria-label",(r(k),v(()=>`View profile for ${r(k).authorName}`))),I(Pe,(r(k),v(()=>r(k).authorName))),I(dn,q)},[()=>(r(k),v(()=>It(r(k).authorID))),()=>(hn(Ln),r(k),v(()=>Ln(r(k).timestamp)))]),G("click",ee,()=>vr(r(k).messages[0]?.author)),G("click",K,()=>vr(r(k).messages[0]?.author)),A(y,U)}),Hs(va,y=>g(an,y),()=>r(an));var nl=_(va,2),rl=p(nl);{var Oc=y=>{var k=kp(),U=p(k),X=_(p(U),2),ie=_(U,2);Nt(ie,5,()=>r(o),se=>se.url,(se,ee)=>{var le=bp(),H=p(le),he=_(H,2),Ce=p(he);P(()=>{$(H,"src",(r(ee),v(()=>r(ee).url))),$(H,"alt",(r(ee),v(()=>r(ee).title))),I(Ce,(r(ee),v(()=>r(ee).title)))}),G("click",le,()=>Ne(r(ee).url,r(ee).title)),A(se,le)}),In(X,()=>r(zn),se=>g(zn,se)),A(y,k)};j(rl,y=>{r(At)&&y(Oc)})}var Mc=_(rl,2),al=p(Mc);{var Nc=y=>{var k=yp(),U=_(p(k),2);{var X=H=>{var he=wp();P(Ce=>{$(he,"src",Ce),$(he,"alt",(r(Se),v(()=>r(Se).filename)))},[()=>(r(Se),v(()=>Ve(r(Se))))]),A(H,he)},ie=ar(()=>(r(Se),v(()=>u(r(Se)))));j(U,H=>{r(ie)&&H(X)})}var se=_(U,2),ee=p(se),le=_(se,2);P(H=>I(ee,`${r(Se),v(()=>r(Se).filename)??""} · ${H??""}`),[()=>(r(Se),v(()=>M(r(Se).byte_size)))]),G("click",le,()=>g(Se,null)),A(y,k)};j(al,y=>{r(Se)&&y(Nc)})}var sl=_(al,2);{var Pc=y=>{var k=xp(),U=_(p(k),2),X=p(U),ie=_(p(X)),se=p(ie),ee=_(X,2),le=p(ee),H=_(U,2);P(he=>{I(se,(r(pe),v(()=>r(pe).author?.display_name||"Local User"))),I(le,he)},[()=>(r(pe),v(()=>Qn(r(pe).body)))]),G("click",H,_t),A(y,k)};j(sl,y=>{r(pe)&&r(Je)===(r(z)?"dm":"channel")&&y(Pc)})}var il=_(sl,2),ll=p(il),zc=p(ll),mr=_(ll,2);Hs(mr,y=>g(Ft,y),()=>r(Ft)),Pa(()=>In(mr,()=>r(ve),y=>g(ve,y))),xl(mr,(y,k)=>Ur?.(y),()=>r(ve));var $c=_(mr,2),Fc=_(il,2),ol=p(Fc),cl=_(ol,2),As=_(cl,2),Uc=p(As);Uc.textContent="<>";var Rs=_(As,2),Hc=p(Rs);Hc.textContent="{}";var ul=_(Rs,2),fl=_(ul,2);let dl;var Cs=_(Yi,2);let pl;var Bc=p(Cs);{var qc=y=>{var k=Hp(),U=Yn(k),X=p(U),ie=_(p(X),2),se=p(ie),ee=_(X,2),le=_(U,2),H=p(le),he=p(H),Ce=p(he);{var F=V=>{var O=Tp();P(()=>$(O,"src",(r(R),v(()=>r(R).author.avatar_url)))),A(V,O)},K=V=>{var O=mt();P(W=>I(O,W),[()=>(r(R),v(()=>cn(r(R).author?.display_name)))]),A(V,O)};j(Ce,V=>{r(R),v(()=>r(R).author?.avatar_url)?V(F):V(K,-1)})}var Pe=_(he,2),qt=p(Pe),Gt=p(qt),fn=p(Gt),dn=_(Gt,2);{var Bn=V=>{var O=Ep(),W=p(O);P(Y=>I(W,Y),[()=>(r(R),v(()=>Be(r(R).author.handle)))]),A(V,O)};j(dn,V=>{r(R),v(()=>r(R).author?.handle)&&V(Bn)})}var me=_(dn,2),q=p(me),at=_(me,2),Ie=_(qt,2);$s(Ie,()=>(hn(Zr),r(R),v(()=>Zr(r(R).body))),!0);var et=_(Ie,2);{var En=V=>{var O=Cp();Nt(O,5,()=>(r(R),v(()=>r(R).attachments)),W=>W.id,(W,Y)=>{var jt=Ra(),ce=Yn(jt);{var ke=xe=>{var Me=Sp(),We=p(Me),pt=_(We,2),xt=p(pt);P(Zt=>{$(Me,"aria-label",(r(Y),v(()=>`Open image ${r(Y).filename}`))),$(We,"src",Zt),$(We,"alt",(r(Y),v(()=>r(Y).filename))),I(xt,(r(Y),v(()=>r(Y).filename)))},[()=>(r(Y),v(()=>Ve(r(Y))))]),G("click",Me,()=>gr(Ve(r(Y)),r(Y).filename)),A(xe,Me)},Dt=ar(()=>(r(Y),v(()=>u(r(Y))))),Ke=xe=>{var Me=Ap(),We=p(Me),pt=p(We),xt=_(We,2),Zt=p(xt);P((Gn,rr)=>{$(We,"aria-label",(r(Y),v(()=>r(Y).filename))),$(pt,"src",Gn),$(pt,"type",(r(Y),v(()=>r(Y).content_type))),$(xt,"href",rr),I(Zt,(r(Y),v(()=>r(Y).filename)))},[()=>(r(Y),v(()=>Ve(r(Y)))),()=>(r(Y),v(()=>Ve(r(Y))))]),A(xe,Me)},dt=ar(()=>(r(Y),v(()=>x(r(Y))))),it=xe=>{var Me=Rp(),We=_(p(Me),2),pt=p(We),xt=p(pt),Zt=_(pt,2),Gn=p(Zt);P((rr,Is)=>{$(Me,"href",rr),I(xt,(r(Y),v(()=>r(Y).filename))),I(Gn,Is)},[()=>(r(Y),v(()=>Ve(r(Y)))),()=>(r(Y),v(()=>M(r(Y).byte_size)))]),A(xe,Me)};j(ce,xe=>{r(Dt)?xe(ke):r(dt)?xe(Ke,1):xe(it,-1)})}A(W,jt)}),A(V,O)};j(et,V=>{r(R),v(()=>r(R).attachments?.length)&&V(En)})}var tr=_(H,2),qn=p(tr),ye=p(qn),st=_(tr,2);Nt(st,5,()=>r(T),V=>V.id,(V,O)=>{var W=Fp(),Y=p(W),jt=p(Y);{var ce=je=>{var Ze=Ip();P(()=>$(Ze,"src",(r(O),v(()=>r(O).author.avatar_url)))),A(je,Ze)},ke=je=>{var Ze=mt();P(Sn=>I(Ze,Sn),[()=>(r(O),v(()=>cn(r(O).author?.display_name)))]),A(je,Ze)};j(jt,je=>{r(O),v(()=>r(O).author?.avatar_url)?je(ce):je(ke,-1)})}var Dt=_(Y,2),Ke=p(Dt),dt=p(Ke),it=p(dt),xe=_(dt,2);{var Me=je=>{var Ze=Lp(),Sn=p(Ze);P(ue=>I(Sn,ue),[()=>(r(O),v(()=>Be(r(O).author.handle)))]),A(je,Ze)};j(xe,je=>{r(O),v(()=>r(O).author?.handle)&&je(Me)})}var We=_(xe,2),pt=p(We),xt=_(We,2),Zt=_(Ke,2);{var Gn=je=>{var Ze=Mp();let Sn;var ue=_(p(Ze),2),ga=p(ue),Ls=p(ga),Ds=_(ga,2);{var Os=An=>{var Wn=Dp(),Ot=p(Wn);P(gt=>I(Ot,gt),[()=>(r(O),v(()=>Qn(r(O).quoted_body_snapshot)))]),A(An,Wn)},Ms=An=>{var Wn=Op(),Ot=p(Wn);P(gt=>I(Ot,`[original deleted] ${gt??""}`),[()=>(r(O),v(()=>Qn(r(O).quoted_body_snapshot)))]),A(An,Wn)};j(Ds,An=>{r(O),v(()=>r(O).quoted_message_id)?An(Os):An(Ms,-1)})}P((An,Wn)=>{Sn=Mt(Ze,1,"quote-block",null,Sn,{dangling:!r(O).quoted_message_id}),Ze.disabled=(r(O),v(()=>!r(O).quoted_message_id)),$(Ze,"aria-label",An),I(Ls,Wn)},[()=>(r(O),v(()=>r(O).quoted_message_id?`Jump to quoted message from ${xn(r(O))}`:"Original message was deleted")),()=>(r(O),v(()=>xn(r(O))))]),G("click",Ze,()=>ja(r(O))),A(je,Ze)};j(Zt,je=>{r(O),v(()=>r(O).quoted_message_id||r(O).quoted_body_snapshot)&&je(Gn)})}var rr=_(Zt,2);$s(rr,()=>(hn(Zr),r(O),v(()=>Zr(r(O).body))),!0);var Is=_(rr,2);{var Xc=je=>{var Ze=$p();Nt(Ze,5,()=>(r(O),v(()=>r(O).attachments)),Sn=>Sn.id,(Sn,ue)=>{var ga=Ra(),Ls=Yn(ga);{var Ds=Ot=>{var gt=Np(),jn=p(gt),br=_(jn,2),Wr=p(br);P(ma=>{$(gt,"aria-label",(r(ue),v(()=>`Open image ${r(ue).filename}`))),$(jn,"src",ma),$(jn,"alt",(r(ue),v(()=>r(ue).filename))),I(Wr,(r(ue),v(()=>r(ue).filename)))},[()=>(r(ue),v(()=>Ve(r(ue))))]),G("click",gt,()=>gr(Ve(r(ue)),r(ue).filename)),A(Ot,gt)},Os=ar(()=>(r(ue),v(()=>u(r(ue))))),Ms=Ot=>{var gt=Pp(),jn=p(gt),br=p(jn),Wr=_(jn,2),ma=p(Wr);P((Ns,Ps)=>{$(jn,"aria-label",(r(ue),v(()=>r(ue).filename))),$(br,"src",Ns),$(br,"type",(r(ue),v(()=>r(ue).content_type))),$(Wr,"href",Ps),I(ma,(r(ue),v(()=>r(ue).filename)))},[()=>(r(ue),v(()=>Ve(r(ue)))),()=>(r(ue),v(()=>Ve(r(ue))))]),A(Ot,gt)},An=ar(()=>(r(ue),v(()=>x(r(ue))))),Wn=Ot=>{var gt=zp(),jn=_(p(gt),2),br=p(jn),Wr=p(br),ma=_(br,2),Ns=p(ma);P((Ps,Vc)=>{$(gt,"href",Ps),I(Wr,(r(ue),v(()=>r(ue).filename))),I(Ns,Vc)},[()=>(r(ue),v(()=>Ve(r(ue)))),()=>(r(ue),v(()=>M(r(ue).byte_size)))]),A(Ot,gt)};j(Ls,Ot=>{r(Os)?Ot(Ds):r(An)?Ot(Ms,1):Ot(Wn,-1)})}A(Sn,ga)}),A(je,Ze)};j(Is,je=>{r(O),v(()=>r(O).attachments?.length)&&je(Xc)})}P((je,Ze)=>{$(W,"data-message-id",(r(O),v(()=>r(O).id))),Zn(Y,`--hue: ${je??""}deg`),I(it,(r(O),v(()=>r(O).author?.display_name||"Local User"))),I(pt,Ze)},[()=>(r(O),v(()=>It(r(O).author?.id||r(O).author_id||"x"))),()=>(hn(Ln),r(O),v(()=>Ln(r(O).created_at)))]),G("click",xt,()=>zr(r(O),"thread")),A(V,W)});var Wt=_(le,2),nr=p(Wt),qr=p(nr);{var _a=V=>{var O=Up(),W=_(p(O),2),Y=p(W),jt=_(p(Y)),ce=p(jt),ke=_(Y,2),Dt=p(ke),Ke=_(W,2);P(dt=>{I(ce,(r(pe),v(()=>r(pe).author?.display_name||"Local User"))),I(Dt,dt)},[()=>(r(pe),v(()=>Qn(r(pe).body)))]),G("click",Ke,_t),A(V,O)};j(qr,V=>{r(pe)&&r(Je)==="thread"&&V(_a)})}var Gr=_(qr,2),pn=p(Gr);Hs(pn,V=>g(ln,V),()=>r(ln)),Pa(()=>In(pn,()=>r(Ae),V=>g(Ae,V))),xl(pn,(V,O)=>Ur?.(V),()=>r(Ae));var Lt=_(pn,2);P((V,O,W)=>{I(se,`${r(te),r(T),v(()=>r(te)?.reply_count??r(T).length)??""} ${r(te),r(T),v(()=>(r(te)?.reply_count??r(T).length)===1?"reply":"replies")??""}`),$(H,"data-message-id",(r(R),v(()=>r(R).id))),Zn(he,`--hue: ${V??""}deg`),I(fn,(r(R),v(()=>r(R).author?.display_name||"Local User"))),I(q,O),I(ye,`${r(T),v(()=>r(T).length)??""} ${r(T),v(()=>r(T).length===1?"reply":"replies")??""}`),Lt.disabled=W},[()=>(r(R),v(()=>It(r(R).author?.id||r(R).author_id||"x"))),()=>(hn(Ln),r(R),v(()=>Ln(r(R).created_at))),()=>(r(Ae),v(()=>!r(Ae).trim()))]),G("click",ee,()=>{ft()}),G("pointerdown",le,()=>g(Oe,"thread")),G("pointerup",le,B),G("click",at,()=>r(R)&&zr(r(R),"thread")),Cn("submit",Wt,V=>{V.preventDefault(),Pr()}),Cn("focus",pn,()=>g(Oe,"thread")),G("keydown",pn,Qa),A(y,k)},Gc=y=>{var k=Zp(),U=Yn(k),X=p(U),ie=_(p(X),2),se=p(ie),ee=_(X,2),le=_(U,2),H=p(le),he=p(H),Ce=p(he);{var F=ce=>{var ke=Bp();P(()=>$(ke,"src",(r(C),v(()=>r(C).avatar_url)))),A(ce,ke)},K=ce=>{var ke=mt();P(Dt=>I(ke,Dt),[()=>(r(C),v(()=>cn(r(C).display_name)))]),A(ce,ke)};j(Ce,ce=>{r(C),v(()=>r(C).avatar_url)?ce(F):ce(K,-1)})}var Pe=_(H,2),qt=p(Pe),Gt=p(qt),fn=p(Gt),dn=p(fn),Bn=_(fn,2);{var me=ce=>{var ke=qp(),Dt=p(ke);P(Ke=>I(Dt,Ke),[()=>(r(C),v(()=>Be(r(C).handle)))]),A(ce,ke)};j(Bn,ce=>{r(C),v(()=>r(C).handle)&&ce(me)})}var q=_(Gt,2);{var at=ce=>{var ke=Gp();G("click",ke,on),A(ce,ke)};j(q,ce=>{r(f),r(C),v(()=>r(f)?.id===r(C).id)&&ce(at)})}var Ie=_(qt,4),et=p(Ie);{var En=ce=>{var ke=Wp();G("click",ke,()=>Za(r(C)?.id||"")),A(ce,ke)};j(et,ce=>{r(f),r(C),v(()=>r(f)?.id!==r(C).id)&&ce(En)})}var tr=_(et,2),qn=_(Ie,2),ye=p(qn),st=_(p(ye),2);{var Wt=ce=>{var ke=jp();G("click",ke,on),A(ce,ke)};j(st,ce=>{r(f),r(C),v(()=>r(f)?.id===r(C).id)&&ce(Wt)})}var nr=_(ye,2),qr=_(p(nr),2),_a=_(p(qr),2),Gr=p(_a),pn=_(nr,2),Lt=_(p(pn),2),V=_(p(Lt),2),O=p(V),W=_(qn,2),Y=_(p(W),2),jt=p(Y);P((ce,ke)=>{I(se,(r(C),v(()=>r(C).display_name))),Zn(H,`--hue: ${ce??""}deg`),I(dn,(r(C),v(()=>r(C).display_name))),I(Gr,ke),I(O,(r(C),v(()=>r(C).id))),I(jt,`Member of ${r(n),v(()=>r(n)?.name||"this workspace")??""}. Click Message to keep the conversation in your sidebar.`)},[()=>(r(C),v(()=>It(r(C).id))),()=>(r(C),v(()=>r(C).handle?Be(r(C).handle):"No handle set"))]),G("click",ee,ft),G("click",tr,()=>g($t,"status messages are coming soon")),A(y,k)},Wc=y=>{var k=Yp();A(y,k)};j(Bc,y=>{r(R)?y(qc):r(C)?y(Gc,1):y(Wc,-1)})}var hl=_(N,2);{var jc=y=>{var k=Kp(),U=p(k),X=_(U,2),ie=p(X),se=_(p(ie),2),ee=_(ie,2),le=p(ee),H=p(le),he=p(H);{var Ce=ye=>{var st=Xp();P(()=>$(st,"src",r(Kn))),A(ye,st)},F=ye=>{var st=mt();P(Wt=>I(st,Wt),[()=>(r(zt),v(()=>cn(r(zt))))]),A(ye,st)};j(he,ye=>{r(Kn)?ye(Ce):ye(F,-1)})}var K=_(H,2),Pe=p(K),qt=p(Pe),Gt=_(Pe,2),fn=p(Gt),dn=_(le,2),Bn=_(p(dn),2),me=_(dn,2),q=_(p(me),2),at=_(me,2),Ie=_(p(at),2),et=_(at,2);{var En=ye=>{var st=Vp();let Wt;var nr=p(st);P(()=>{Wt=Mt(st,1,"profile-status",null,Wt,{error:r(De)}),I(nr,r($n))}),A(ye,st)};j(et,ye=>{r($n)&&ye(En)})}var tr=_(et,2),qn=p(tr);P((ye,st)=>{Zn(H,`--hue: ${ye??""}deg`),I(qt,(r(zt),r(f),v(()=>r(zt)||r(f).display_name))),I(fn,st)},[()=>(r(f),v(()=>It(r(f).id))),()=>(r(nn),r(f),v(()=>r(nn)||Be(r(f).handle)||"No handle set"))]),G("click",U,Qe),G("click",se,Qe),Cn("submit",ee,ye=>{ye.preventDefault(),Mr()}),In(Bn,()=>r(zt),ye=>g(zt,ye)),In(q,()=>r(nn),ye=>g(nn,ye)),In(Ie,()=>r(Kn),ye=>g(Kn,ye)),G("click",qn,Qe),A(y,k)};j(hl,y=>{r(wn)&&r(f)&&y(jc)})}var Zc=_(hl,2);{var Yc=y=>{var k=Jp(),U=p(k),X=_(U,2),ie=p(X),se=p(ie),ee=p(se),le=_(se,2),H=p(le),he=_(H,2),Ce=_(ie,2),F=p(Ce);P(()=>{I(ee,(r(oe),v(()=>r(oe).title))),$(H,"href",(r(oe),v(()=>r(oe).url))),$(F,"src",(r(oe),v(()=>r(oe).url))),$(F,"alt",(r(oe),v(()=>r(oe).title)))}),G("click",U,Qe),G("click",he,Qe),A(y,k)};j(Zc,y=>{r(oe)&&y(Yc)})}P((y,k)=>{Q=Mt(N,1,"shell",null,Q,{"nav-open":r(sn),"sidebar-collapsed":r(Fn),"thread-open":r(i)}),I(sc,(r(n),v(()=>r(n)?.name||"Pick a workspace"))),zi=Mt(Pi,1,"presence",null,zi,{online:r(_e)}),I(ic,r(_e)?"Connected":r($t)),$(rs,"aria-label",r(Fn)?"Expand sidebar":"Collapse sidebar"),$(rs,"title",r(Fn)?"Expand sidebar":"Collapse sidebar"),$(oc,"d",r(Fn)?"m9 6 6 6-6 6":"m15 6-6 6 6 6"),I(Ec,(r(n),v(()=>r(n)?.name||"no workspace"))),$(ha,"title",r(R)?"Close thread":"Open a message thread"),$(ha,"aria-label",r(R)?"Close thread":"Open a message thread"),Qi=Mt(ha,1,"",null,Qi,{active:r(i)}),$(mr,"placeholder",y),$c.disabled=k,dl=Mt(fl,1,"",null,dl,{active:r(At)}),pl=Mt(Cs,1,"thread",null,pl,{open:r(i)}),$(Cs,"aria-label",r(C)?"Profile pane":"Thread pane")},[()=>(r(a),r(s),v(()=>r(a)?`Message ${_r(r(a))}`:r(s)?`Message #${r(s).name}`:"Pick a channel to start")),()=>(r(ve),v(()=>!r(ve).trim()))]),G("click",be,()=>g(sn,!r(sn))),G("click",Es,()=>g(Rt,!r(Rt))),G("click",rs,()=>g(Fn,!r(Fn))),Cn("submit",Bi,y=>{y.preventDefault(),Ga()}),In(fc,()=>r(rt),y=>g(rt,y)),Cn("submit",ji,y=>{y.preventDefault(),xs()}),In(hc,()=>r(Te),y=>g(Te,y)),Cn("submit",Ss,y=>{y.preventDefault(),ys()}),In(Ji,()=>r(Ee),y=>g(Ee,y)),G("click",ha,()=>{r(i)?ft():g($t,"pick a message to open its thread")}),G("click",Cc,()=>g($t,"no pinned items")),G("pointerdown",va,()=>g(Oe,"message")),G("pointerup",va,B),Cn("submit",nl,y=>{y.preventDefault(),Hn()}),G("change",zc,Ue),Cn("focus",mr,()=>g(Oe,"message")),G("keydown",mr,Ts),G("click",ol,()=>He("**")),G("click",cl,()=>He("_")),G("click",As,()=>He("`")),G("click",Rs,()=>He("```","\n```")),G("click",ul,()=>ge("[label](https://)")),G("click",fl,()=>g(At,!r(At))),A(d,b)};j(qe,d=>{r(Fe)?d(es):d(ts,-1)})}A(e,Hr),pi()}af(["click","contextmenu","pointerdown","pointerup","change","keydown"]);var th=D(' ',1),nh=D("

    "),rh=D(`

    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 ah(e,t){di(t,!1);const n="https://docs.clickclack.chat",s=["localhost","127.0.0.1","::1"].includes(window.location.hostname)?"/app":"https://app.clickclack.chat",a="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."]],l=["clickclack serve --data ./data","clickclack login --magic-token mgt_...",'clickclack send --channel general "deploy started"',"clickclack threads reply msg_... --stdin {var Se=th();Pa(()=>{go.title="ClickClack - Self-hostable chat with claws"}),A(Re,Se)});var o=p(c),f=_(p(o),2),h=_(p(f),2),w=p(h);$(w,"href",n);var m=_(w,2),E=_(m,2);$(E,"href",a);var T=_(f,2),L=_(p(T),6),S=p(L),z=_(S,2);$(z,"href",n);var R=_(z,2);$(R,"href",a);var te=_(o,4);Nt(te,5,()=>i,pf,(Re,Se)=>{var At=nh(),wn=p(At),zn=p(wn),zt=_(wn,2),nn=p(zt);P(()=>{I(zn,r(Se)[0]),I(nn,r(Se)[1])}),A(Re,At)});var C=_(te,2),oe=_(p(C),2),ve=p(oe),Ae=_(C,2),nt=_(p(Ae),2),rt=_(p(nt),2);$(rt,"href",n);var Te=_(rt,2),Ee=_(Te,2);$(Ee,"href",a),P(Re=>{$(m,"href",s),$(S,"href",s),I(ve,Re),$(Te,"href",s)},[()=>l.join(` -`)]),A(e,c),pi()}function sh(e){const t=window.location.pathname,s=window.location.hostname.startsWith("app.")||t==="/app"||t.startsWith("/app/");var a=Ra(),i=Yn(a);{var l=o=>{eh(o,{})},c=o=>{ah(o,{})};j(i,o=>{s?o(l):o(c,-1)})}A(e,a)}cf(sh,{target:document.getElementById("app")}); diff --git a/apps/api/internal/webassets/dist/index.html b/apps/api/internal/webassets/dist/index.html index b25c37d..605a38f 100644 --- a/apps/api/internal/webassets/dist/index.html +++ b/apps/api/internal/webassets/dist/index.html @@ -4,8 +4,8 @@ ClickClack - - + +
    diff --git a/apps/web/src/ChatApp.svelte b/apps/web/src/ChatApp.svelte index b1ca501..89e132a 100644 --- a/apps/web/src/ChatApp.svelte +++ b/apps/web/src/ChatApp.svelte @@ -2,6 +2,7 @@ import { onDestroy, onMount, tick } from "svelte"; import { APIError, api } from "./lib/api"; import { markdown, time } from "./lib/format"; + import MediaAttachment from "./components/MediaAttachment.svelte"; import type { Channel, DirectConversation, Message, RealtimeEvent, SearchResult, ThreadState, Upload, User, Workspace } from "./lib/types"; let user: User | null = null; @@ -1254,32 +1255,11 @@ {#if message.attachments?.length}
    {#each message.attachments as attachment (attachment.id)} - {#if isImageUpload(attachment)} - - {:else if isVideoUpload(attachment)} - - {:else} - - - - {attachment.filename} - {formatBytes(attachment.byte_size)} - - - {/if} + {/each}
    {/if} @@ -1466,32 +1446,11 @@ {#if selectedThread.attachments?.length}
    {#each selectedThread.attachments as attachment (attachment.id)} - {#if isImageUpload(attachment)} - - {:else if isVideoUpload(attachment)} - - {:else} - - - - {attachment.filename} - {formatBytes(attachment.byte_size)} - - - {/if} + {/each}
    {/if} @@ -1545,32 +1504,11 @@ {#if reply.attachments?.length}
    {#each reply.attachments as attachment (attachment.id)} - {#if isImageUpload(attachment)} - - {:else if isVideoUpload(attachment)} - - {:else} - - - - {attachment.filename} - {formatBytes(attachment.byte_size)} - - - {/if} + {/each}
    {/if} diff --git a/apps/web/src/components/MediaAttachment.svelte b/apps/web/src/components/MediaAttachment.svelte new file mode 100644 index 0000000..3d8a799 --- /dev/null +++ b/apps/web/src/components/MediaAttachment.svelte @@ -0,0 +1,137 @@ + + +{#if isImage} +
    + + +
    +{:else if isVideo} +
    + + {#if !started} + + {#if durationLabel} + + {/if} + {/if} + +
    +{:else} + + + + {upload.filename} + {formatBytes(upload.byte_size)} + + +{/if} diff --git a/apps/web/src/styles.css b/apps/web/src/styles.css index a06aefa..c391072 100644 --- a/apps/web/src/styles.css +++ b/apps/web/src/styles.css @@ -1353,92 +1353,249 @@ button.ghost { .attachment-grid { display: grid; - grid-template-columns: repeat(auto-fit, minmax(180px, 280px)); + 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; } -.image-attachment, -.video-attachment, -.file-attachment { - color: inherit; - text-decoration: none; -} - -.image-attachment, -.video-attachment { +.media-tile { position: relative; display: block; width: 100%; - overflow: hidden; + margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); - background: var(--panel); - box-shadow: 0 12px 30px -24px rgba(0, 0, 0, 0.8); + background: #0a0c12; + overflow: hidden; + isolation: isolate; text-align: left; - cursor: zoom-in; + color: inherit; + text-decoration: none; + cursor: pointer; transition: - border-color 120ms ease, - transform 120ms ease, - box-shadow 120ms ease; + border-color 140ms ease, + transform 140ms ease, + box-shadow 140ms ease; } -.image-attachment:hover { - border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); - transform: translateY(-1px); - box-shadow: 0 16px 36px -26px rgba(0, 0, 0, 0.9); +.media-tile:hover { + border-color: var(--line-strong); + box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.9); } -.video-attachment { +.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; } -.image-attachment img { - display: block; - width: 100%; - max-height: 320px; - object-fit: cover; -} - -.video-attachment video { +.media-tile img, +.media-tile video { display: block; width: 100%; max-height: 360px; + object-fit: contain; background: #05070d; } -.image-attachment span { +.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; - max-width: calc(100% - 16px); - padding: 4px 8px; - border-radius: 999px; - background: rgba(0, 0, 0, 0.58); + z-index: 2; + padding: 2px 6px; + border-radius: 4px; + background: rgba(0, 0, 0, 0.72); color: white; font-size: 11px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - backdrop-filter: blur(10px); -} - -.video-attachment a { - display: block; - padding: 8px 10px; - color: var(--muted); - font-size: 12px; - text-decoration: none; - background: var(--panel-2); -} - -.video-attachment a:hover { - color: var(--text-strong); + font-variant-numeric: tabular-nums; + font-weight: 600; + letter-spacing: 0.02em; + pointer-events: none; } .file-attachment { @@ -2170,6 +2327,10 @@ button.ghost { background: transparent; } +.modal-backdrop:focus { + outline: 0; +} + .profile-modal { position: relative; z-index: 1; @@ -2341,7 +2502,6 @@ button.ghost { width: min(1120px, 100%); max-height: min(86vh, 900px); overflow: hidden; - border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px; background: #07090f; color: white; diff --git a/tests/e2e/chat.spec.ts b/tests/e2e/chat.spec.ts index 1eca105..3a9dd94 100644 --- a/tests/e2e/chat.spec.ts +++ b/tests/e2e/chat.spec.ts @@ -135,7 +135,9 @@ test("sends messages, searches, uploads, opens a thread, and creates a DM", asyn await expect(page.getByText("pixel.png")).toBeVisible(); await page.getByLabel("Message body").fill("inline image upload"); await page.getByRole("button", { name: "Send" }).click(); - await expect(page.locator(".image-attachment").filter({ hasText: "pixel.png" })).toBeVisible(); + const imageAttachment = page.locator(".media-tile--image").filter({ hasText: "pixel.png" }); + await expect(imageAttachment).toBeVisible(); + await expect(imageAttachment.getByRole("link", { name: "Download pixel.png" })).toBeAttached(); await page.getByRole("button", { name: "Open image pixel.png" }).click(); await expect( page.getByLabel("Image viewer").getByRole("img", { name: "pixel.png" }), @@ -153,7 +155,32 @@ test("sends messages, searches, uploads, opens a thread, and creates a DM", asyn await expect(page.getByText("clip.mp4")).toBeVisible(); await page.getByLabel("Message body").fill("inline video upload"); await page.getByRole("button", { name: "Send" }).click(); - await expect(page.locator('.video-attachment video[aria-label="clip.mp4"]')).toBeVisible(); + const videoAttachment = page.locator(".media-tile--video").filter({ hasText: "clip.mp4" }); + const inlineVideo = videoAttachment.locator('video[aria-label="clip.mp4"]'); + const videoDownload = videoAttachment.getByRole("link", { name: "Download clip.mp4" }); + await expect(inlineVideo).toBeVisible(); + await page.evaluate(() => { + (window as unknown as { __videoDownloadClicked: boolean }).__videoDownloadClicked = false; + }); + await videoDownload.evaluate((node) => { + node.addEventListener( + "click", + (event) => { + event.preventDefault(); + (window as unknown as { __videoDownloadClicked: boolean }).__videoDownloadClicked = true; + }, + { once: true }, + ); + }); + await videoDownload.click(); + await expect + .poll(() => + page.evaluate( + () => (window as unknown as { __videoDownloadClicked: boolean }).__videoDownloadClicked, + ), + ) + .toBe(true); + await expect(inlineVideo).not.toHaveAttribute("controls", ""); await page.getByRole("button", { name: "GIF picker" }).click(); await page.getByLabel("Search GIFs").fill("ship");