@jefuriiij/synthra 0.15.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/README.md +226 -226
- package/dist/cli/index.js +258 -27
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/index.js +3 -2
- package/dist/dashboard/index.js.map +1 -1
- package/dist/server/index.js +443 -33
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var init_package = __esm({
|
|
|
18
18
|
"package.json"() {
|
|
19
19
|
package_default = {
|
|
20
20
|
name: "@jefuriiij/synthra",
|
|
21
|
-
version: "0.
|
|
21
|
+
version: "0.16.1",
|
|
22
22
|
publishConfig: {
|
|
23
23
|
access: "public"
|
|
24
24
|
},
|
|
@@ -517,6 +517,7 @@ function resolvePaths(projectRoot) {
|
|
|
517
517
|
tokenLog: join2(graphDir, "token_log.jsonl"),
|
|
518
518
|
gateLog: join2(graphDir, "gate_log.jsonl"),
|
|
519
519
|
bashLog: join2(graphDir, "bash_log.jsonl"),
|
|
520
|
+
routeLog: join2(graphDir, "route_log.jsonl"),
|
|
520
521
|
toolLog: join2(graphDir, "tool_log.jsonl"),
|
|
521
522
|
accessLog: join2(graphDir, "access_log.jsonl"),
|
|
522
523
|
learnStore: join2(graphDir, "learn_store.json"),
|
|
@@ -877,7 +878,7 @@ async function computeDashboardData(activePaths, recentN = 500) {
|
|
|
877
878
|
}
|
|
878
879
|
|
|
879
880
|
// src/dashboard/built/index.html
|
|
880
|
-
var built_default = '<!doctype html>\n<html lang="en" class="dark">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>Synthra \xB7 Dashboard</title>\n <link rel="icon" href="/favicon.svg" type="image/svg+xml" />\n <link rel="preconnect" href="https://fonts.googleapis.com" />\n <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />\n <link\n href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap"\n rel="stylesheet"\n />\n <script type="module" crossorigin>(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible;function d(e){return typeof e==`function`}var f=()=>{};function p(e){for(var t=0;t<e.length;t++)e[t]()}function m(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function h(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var g=1<<24,_=1024,v=2048,y=4096,b=8192,x=16384,S=32768,ee=1<<25,te=65536,ne=1<<19,re=1<<20,ie=1<<25,ae=65536,oe=1<<21,se=1<<22,ce=1<<23,le=Symbol(`$state`),ue=Symbol(`legacy props`),de=Symbol(``),fe=Symbol(`attributes`),pe=Symbol(`class`),me=Symbol(`style`),he=Symbol(`text`),ge=Symbol(`form reset`),_e=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ve=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function ye(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function be(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function xe(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Se(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ce(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function we(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Te(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ee(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function De(){throw Error(`https://svelte.dev/e/set_context_after_init`)}function Oe(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function ke(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Ae(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function je(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Me={},C=Symbol(`uninitialized`),Ne=`http://www.w3.org/1999/xhtml`,Pe=`http://www.w3.org/2000/svg`,Fe=`@attach`;function Ie(){console.warn(`https://svelte.dev/e/derived_inert`)}function Le(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Re(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function ze(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var w=!1;function Be(e){w=e}var T;function Ve(e){if(e===null)throw Le(),Me;return T=e}function He(){return Ve(Cn(T))}function E(e){if(w){if(Cn(T)!==null)throw Le(),Me;T=e}}function Ue(e=1){if(w){for(var t=e,n=T;t--;)n=Cn(n);T=n}}function We(e=!0){for(var t=0,n=T;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Cn(n);e&&n.remove(),n=i}}function Ge(e){if(!e||e.nodeType!==8)throw Le(),Me;return e.data}function Ke(e){return e===this.v}function qe(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Je(e){return!qe(e,this.v)}var Ye=!1,Xe=!1;function Ze(){Xe=!0}var D=null;function Qe(e){D=e}function $e(e){return it(`getContext`).get(e)}function et(e,t){let n=it(`setContext`);if(Ye){var r=V.f;!B&&r&32&&!D.i||De()}return n.set(e,t),t}function tt(e){return it(`hasContext`).has(e)}function nt(){return it(`getAllContexts`)}function O(e,t=!1,n){D={p:D,i:!1,c:null,e:null,s:e,x:null,r:V,l:Xe&&!t?{s:null,u:null,$:[]}:null}}function k(e){var t=D,n=t.e;if(n!==null){t.e=null;for(var r of n)zn(r)}return e!==void 0&&(t.x=e),t.i=!0,D=t.p,e??{}}function rt(){return!Xe||D!==null&&D.l===null}function it(e){return D===null&&ye(e),D.c??=new Map(at(D)||void 0)}function at(e){let t=e.p;for(;t!==null;){let e=t.c;if(e!==null)return e;t=t.p}return null}var ot=[];function st(){var e=ot;ot=[],p(e)}function ct(e){if(ot.length===0&&!Vt){var t=ot;queueMicrotask(()=>{t===ot&&st()})}ot.push(e)}function lt(){for(;ot.length>0;)st()}function ut(e){var t=V;if(t===null)return B.f|=ce,e;if(!(t.f&32768)&&!(t.f&4))throw e;dt(e,t)}function dt(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}var ft=~(v|y|_);function A(e,t){e.f=e.f&ft|t}function pt(e){e.f&512||e.deps===null?A(e,_):A(e,y)}function mt(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=ae,mt(t.deps))}function ht(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),mt(e.deps),A(e,_)}var gt=!1,_t=!1;function vt(e){var t=_t;try{return _t=!1,[e(),_t]}finally{_t=t}}function yt(e){let t=0,n=sn(0),r;return()=>{In()&&(H(n),Gn(()=>(t===0&&(r=Mr(()=>e(()=>dn(n)))),t+=1,()=>{ct(()=>{--t,t===0&&(r?.(),r=void 0,dn(n))})})))}}var bt=te|ne;function xt(e,t,n,r){new St(e,t,n,r)}var St=class{parent;is_pending=!1;transform_error;#e;#t=w?T:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=yt(()=>(this.#m=sn(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=V;t.b=this,t.f|=128,n(e)},this.parent=V.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Kn(()=>{if(w){let e=this.#t;He();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},bt),w&&(this.#e=T)}#g(){try{this.#a=Jn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=Jn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Jn(()=>e(this.#e)),ct(()=>{var e=this.#c=document.createDocumentFragment(),t=xn();e.append(t),this.#a=this.#x(()=>Jn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,er(this.#o,()=>{this.#o=null}),this.#b(M))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Jn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();ir(this.#a,e);let t=this.#n.pending;this.#o=Jn(()=>t(this.#e))}else this.#b(M)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){ht(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=V,n=B,r=D;dr(this.#i),ur(this.#i),Qe(this.#i.ctx);try{return qt.ensure(),e()}catch(e){return ut(e),null}finally{dr(t),ur(n),Qe(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&er(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,ct(()=>{this.#d=!1,this.#m&&ln(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),H(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;M?.is_fork?(this.#a&&M.skip_effect(this.#a),this.#o&&M.skip_effect(this.#o),this.#s&&M.skip_effect(this.#s),M.oncommit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(z(this.#a),null),this.#o&&=(z(this.#o),null),this.#s&&=(z(this.#s),null),w&&(Ve(this.#t),Ue(),Ve(We()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){ze();return}r=!0,i&&je(),this.#s!==null&&er(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){dt(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return Jn(()=>{var t=V;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return dt(e,this.#i.parent),null}}))};ct(()=>{var t;try{t=this.transform_error(e)}catch(e){dt(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>dt(e,this.#i&&this.#i.parent)):o(t)})}};function Ct(e,t,n,r){let i=rt()?Dt:At;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=V,c=wt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){dt(e,s)}Tt()}}var d=Et();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>kt(e))).then(u).catch(e=>dt(e,s)).finally(d)}l?l.then(()=>{c(),f(),Tt()}):f()}function wt(){var e=V,t=B,n=D,r=M;return function(i=!0){dr(e),ur(t),Qe(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Tt(e=!0){dr(null),ur(null),Qe(null),e&&M?.deactivate()}function Et(){var e=V,t=e.b,n=M,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Dt(e){var t=2|v;return V!==null&&(V.f|=ne),{ctx:D,deps:null,effects:null,equals:Ke,f:t,fn:e,reactions:null,rv:0,v:C,wv:0,parent:V,ac:null}}var Ot=Symbol(`obsolete`);function kt(e,t,n){let r=V;r===null&&be();var i=void 0,a=sn(C),o=!B,s=new Set;return Wn(()=>{var t=V,n=m();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==_e&&n.reject(e)}).finally(Tt)}catch(e){n.reject(e),Tt()}var c=M;if(o){if(t.f&32768)var l=Et();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Ot);else for(let e of s.values())e.reject(Ot);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Ot&&(c.activate(),t?(a.f|=ce,ln(a,t)):(a.f&8388608&&(a.f^=ce),ln(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),Ln(()=>{for(let e of s)e.reject(Ot)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function j(e){let t=Dt(e);return Ye||pr(t),t}function At(e){let t=Dt(e);return t.equals=Je,t}function jt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)z(t[n])}}function Mt(e){var t,n=V,r=e.parent;if(!sr&&r!==null&&e.v!==C&&r.f&24576)return Ie(),e.v;dr(r);try{e.f&=~ae,jt(e),t=Tr(e)}finally{dr(n)}return t}function Nt(e){var t=Mt(e);if(!e.equals(t)&&(e.wv=Sr(),(!M?.is_fork||e.deps===null)&&(M===null?e.v=t:(M.capture(e,t,!0),Rt?.capture(e,t,!0)),e.deps===null))){A(e,_);return}sr||(zt===null?pt(e):(In()||M?.is_fork)&&zt.set(e,t))}function Pt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(_e),t.fn!==null&&(t.teardown=f),t.ac=null,Dr(t,0),Xn(t))}function Ft(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&Or(t)}var It=null,Lt=null,M=null,Rt=null,zt=null,Bt=null,Vt=!1,Ht=!1,Ut=null,Wt=null,Gt=0,Kt=1,qt=class e{id=Kt++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){Lt===null?It=Lt=this:(Lt.#n=this,this.#t=Lt),Lt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)A(r,v),t(r);for(r of n.m)A(r,y),t(r)}this.#p.add(e)}#g(){this.#e=!0,Gt++>1e3&&(this.#S(),Yt());for(let e of this.#u)this.#d.delete(e),A(e,v),this.schedule(e);for(let e of this.#d)A(e,y),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=Ut=[],r=[],i=Wt=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw nn(e),this.#h()||this.discard(),t}if(M=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(Ut=null,Wt=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)tn(e,t);i.length>0&&M.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),Rt=this,Zt(r),Zt(n),Rt=null,this.#s?.resolve();var s=M;if(this.#a===0&&(this.#c.length===0||s!==null)&&(this.#S(),Ye&&(this.#x(),M=s)),this.#c.length>0)if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this;s!==null&&s.#g()}#_(e,t,n){e.f^=_;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=_:i&4?t.push(r):Ye&&i&16777224?n.push(r):Cr(r)&&(i&16&&this.#d.add(r),Or(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#y(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),A(i,v),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),M=this,this.#g()}#b(e){for(var t=0;t<e.length;t+=1)ht(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==C&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),zt?.set(e,t)),this.is_fork||(e.v=t)}activate(){M=this}deactivate(){M=null,zt=null}flush(){try{Ht=!0,M=this,this.#g()}finally{Gt=0,Bt=null,Ut=null,Wt=null,Ht=!1,M=null,zt=null,an.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(Ot);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}#x(){for(let u=It;u!==null;u=u.#n){var e=u.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(u.current.has(r)){var n=u.current.get(r)[0];if(e&&i!==n)u.current.set(r,[i,a]);else continue}t.push(r)}if(e)for(let[e,t]of this.async_deriveds){let n=u.async_deriveds.get(e);n&&t.promise.then(n.resolve).catch(n.reject)}var r=[...u.current.keys()].filter(e=>!u.current.get(e)[1]);if(!(!u.#e||r.length===0)){var i=r.filter(e=>!this.current.has(e));if(i.length===0)e&&u.discard();else if(t.length>0){if(e)for(let e of this.#p)u.unskip_effect(e,e=>{e.f&4194320?u.schedule(e):u.#b([e])});u.activate();var a=new Set,o=new Map;for(var s of t)Qt(s,i,a,o);o=new Map;var c=[...u.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(c.length>0)for(let e of this.#l)!(e.f&155648)&&$t(e,c,o)&&(e.f&4194320?(A(e,v),u.schedule(e)):u.#u.add(e));if(u.#c.length>0&&!u.#m){u.apply();for(var l of u.#c)u.#_(l,[],[]);u.#c=[]}u.deactivate()}}}}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,ct(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=m()).promise}static ensure(){if(M===null){let t=M=new e;!Ht&&!Vt&&ct(()=>{t.#e||t.flush()})}return M}apply(){if(!Ye||!this.is_fork&&this.#t===null&&this.#n===null){zt=null;return}zt=new Map;for(let[e,[t]]of this.current)zt.set(e,t);for(let t=It;t!==null;t=t.#n)if(!(t===this||t.is_fork)){var e=!1;if(t.id<this.id){for(let[n,[,r]]of t.current)if(!r&&this.current.has(n)){e=!0;break}}if(!e)for(let[e,n]of t.previous)zt.has(e)||zt.set(e,n)}}schedule(e){if(Bt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(Ut!==null&&t===V&&(Ye||(B===null||!(B.f&2))&&!gt))return;if(n&96){if(!(n&1024))return;t.f^=_}}this.#c.push(t)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null?It=t:e.#n=t,t===null?Lt=e:t.#t=e,this.linked=!1}}};function Jt(e){var t=Vt;Vt=!0;try{var n;for(e&&(M!==null&&!M.is_fork&&M.flush(),n=e());;){if(lt(),M===null)return n;M.flush()}}finally{Vt=t}}function Yt(){try{Te()}catch(e){dt(e,Bt)}}var Xt=null;function Zt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Cr(r)&&(Xt=new Set,Or(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&$n(r),Xt?.size>0)){an.clear();for(let e of Xt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Xt.has(n)&&(Xt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Or(n)}}Xt.clear()}}Xt=null}}function Qt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?Qt(i,t,n,r):e&4194320&&!(e&2048)&&$t(i,t,r)&&(A(i,v),en(i))}}function $t(e,t,r){let i=r.get(e);if(i!==void 0)return i;if(e.deps!==null)for(let i of e.deps){if(n.call(t,i))return!0;if(i.f&2&&$t(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function en(e){M.schedule(e)}function tn(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),A(e,_);for(var n=e.first;n!==null;)tn(n,t),n=n.next}}function nn(e){A(e,_);for(var t=e.first;t!==null;)nn(t),t=t.next}var rn=new Set,an=new Map,on=!1;function sn(e,t){return{f:0,v:e,reactions:null,equals:Ke,rv:0,wv:0}}function N(e,t){let n=sn(e,t);return pr(n),n}function cn(e,t=!1,n=!0){let r=sn(e);return t||(r.equals=Je),Xe&&n&&D!==null&&D.l!==null&&(D.l.s??=[]).push(r),r}function P(e,t,n=!1){return B!==null&&(!lr||B.f&131072)&&rt()&&B.f&4325394&&(fr===null||!fr.has(e))&&Ae(),ln(e,n?pn(t):t,Wt)}function ln(e,t,n=null){if(!e.equals(t)){an.set(e,sr?t:e.v);var r=qt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&Mt(t),zt===null&&pt(t)}e.wv=Sr(),fn(e,v,n),rt()&&V!==null&&V.f&1024&&!(V.f&96)&&(gr===null?_r([e]):gr.push(e)),!r.is_fork&&rn.size>0&&!on&&un()}return t}function un(){on=!1;for(let e of rn){e.f&1024&&A(e,y);let t;try{t=Cr(e)}catch{t=!0}t&&Or(e)}rn.clear()}function dn(e){P(e,e.v+1)}function fn(e,t,n){var r=e.reactions;if(r!==null)for(var i=rt(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===V)){var l=(c&v)===0;if(l&&A(s,t),c&131072)rn.add(s);else if(c&2){var u=s;zt?.delete(u),c&65536||(c&512&&(V===null||!(V.f&2097152))&&(s.f|=ae),fn(u,y,n))}else if(l){var d=s;c&16&&Xt!==null&&Xt.add(d),n===null?en(d):n.push(d)}}}}function pn(t){if(typeof t!=`object`||!t||le in t)return t;let n=l(t);if(n!==s&&n!==c)return t;var r=new Map,i=e(t),o=N(0),u=null,d=br,f=e=>{if(br===d)return e();var t=B,n=br;ur(null),xr(d);var r=e();return ur(t),xr(n),r};return i&&r.set(`length`,N(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&Oe();var i=r.get(t);return i===void 0?f(()=>{var e=N(n.value,u);return r.set(t,e),e}):P(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>N(C,u));r.set(t,e),dn(o)}}else P(n,C),dn(o);return!0},get(e,n,i){if(n===le)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>N(pn(s?e[n]:C),u)),r.set(n,o)),o!==void 0){var c=H(o);return c===C?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=H(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==C)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===le)return!0;var n=r.get(t),i=n!==void 0&&n.v!==C||Reflect.has(e,t);return(n!==void 0||V!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>N(i?pn(e[t]):C,u)),r.set(t,n)),H(n)===C)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;d<c.v;d+=1){var p=r.get(d+``);p===void 0?d in e&&(p=f(()=>N(C,u)),r.set(d+``,p)):P(p,C)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>N(void 0,u)),P(c,pn(n)),r.set(t,c));else{l=c.v!==C;var m=f(()=>pn(n));P(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&P(g,_+1)}dn(o)}return!0},ownKeys(e){H(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==C});for(var[n,i]of r)i.v!==C&&!(n in e)&&t.push(n);return t},setPrototypeOf(){ke()}})}function mn(e){try{if(typeof e==`object`&&e&&le in e)return e[le]}catch{}return e}function hn(e,t){return Object.is(mn(e),mn(t))}new Set([`copyWithin`,`fill`,`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`]);var gn,_n,vn,yn;function bn(){if(gn===void 0){gn=window,_n=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;vn=a(t,`firstChild`).get,yn=a(t,`nextSibling`).get,u(e)&&(e[pe]=void 0,e[fe]=null,e[me]=void 0,e.__e=void 0),u(n)&&(n[he]=void 0)}}function xn(e=``){return document.createTextNode(e)}function Sn(e){return vn.call(e)}function Cn(e){return yn.call(e)}function F(e,t){if(!w)return Sn(e);var n=Sn(T);if(n===null)n=T.appendChild(xn());else if(t&&n.nodeType!==3){var r=xn();return n?.before(r),Ve(r),r}return t&&Dn(n),Ve(n),n}function I(e,t=!1){if(!w){var n=Sn(e);return n instanceof Comment&&n.data===``?Cn(n):n}if(t){if(T?.nodeType!==3){var r=xn();return T?.before(r),Ve(r),r}Dn(T)}return T}function L(e,t=1,n=!1){let r=w?T:e;for(var i;t--;)i=r,r=Cn(r);if(!w)return r;if(n){if(r?.nodeType!==3){var a=xn();return r===null?i?.after(a):r.before(a),Ve(a),a}Dn(r)}return Ve(r),r}function wn(e){e.textContent=``}function Tn(){return!Ye||Xt!==null?!1:(V.f&S)!==0}function En(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function Dn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function On(e,t){if(t){let t=document.body;e.autofocus=!0,ct(()=>{document.activeElement===t&&e.focus()})}}var kn=!1;function An(){kn||(kn=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[ge]?.()})},{capture:!0}))}function jn(e){var t=B,n=V;ur(null),dr(null);try{return e()}finally{ur(t),dr(n)}}function Mn(e,t,n,r=n){e.addEventListener(t,()=>jn(n));let i=e[ge];i?e[ge]=()=>{i(),r(!0)}:e[ge]=()=>r(!0),An()}function Nn(e){V===null&&(B===null&&we(e),Ce()),sr&&Se(e)}function Pn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Fn(e,t){var n=V;n!==null&&n.f&8192&&(e|=b);var r={ctx:D,deps:null,nodes:null,f:e|v|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};M?.register_created_effect(r);var i=r;if(e&4)Ut===null?qt.ensure().schedule(r):Ut.push(r);else if(t!==null){try{Or(r)}catch(e){throw z(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=te))}if(i!==null&&(i.parent=n,n!==null&&Pn(i,n),B!==null&&B.f&2&&!(e&64))){var a=B;(a.effects??=[]).push(i)}return r}function In(){return B!==null&&!lr}function Ln(e){let t=Fn(8,null);return A(t,_),t.teardown=e,t}function Rn(e){Nn(`$effect`);var t=V.f;if(!B&&t&32&&D!==null&&!D.i){var n=D;(n.e??=[]).push(e)}else return zn(e)}function zn(e){return Fn(4|re,e)}function Bn(e){return Nn(`$effect.pre`),Fn(8|re,e)}function Vn(e){qt.ensure();let t=Fn(64|ne,e);return()=>{z(t)}}function Hn(e){qt.ensure();let t=Fn(64|ne,e);return(e={})=>new Promise(n=>{e.outro?er(t,()=>{z(t),n(void 0)}):(z(t),n(void 0))})}function Un(e){return Fn(4,e)}function Wn(e){return Fn(se|ne,e)}function Gn(e,t=0){return Fn(8|t,e)}function R(e,t=[],n=[],r=[]){Ct(r,t,n,t=>{Fn(8,()=>{e(...t.map(H))})})}function Kn(e,t=0){return Fn(16|t,e)}function qn(e,t=0){return Fn(g|t,e)}function Jn(e){return Fn(32|ne,e)}function Yn(e){var t=e.teardown;if(t!==null){let e=sr,n=B;cr(!0),ur(null);try{t.call(null)}finally{cr(e),ur(n)}}}function Xn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&jn(()=>{e.abort(_e)});var r=n.next;n.f&64?n.parent=null:z(n,t),n=r}}function Zn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||z(t),t=n}}function z(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Qn(e.nodes.start,e.nodes.end),n=!0),e.f|=ee,Xn(e,t&&!n),Dr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Yn(e),e.f^=ee,e.f|=x;var i=e.parent;i!==null&&i.first!==null&&$n(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Qn(e,t){for(;e!==null;){var n=e===t?null:Cn(e);e.remove(),e=n}}function $n(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function er(e,t,n=!0){var r=[];tr(e,r,!0);var i=()=>{n&&z(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function tr(e,t,n){if(!(e.f&8192)){e.f^=b;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;tr(i,t,o?n:!1)}i=a}}}function nr(e){rr(e,!0)}function rr(e,t){if(e.f&8192){e.f^=b,e.f&1024||(A(e,v),qt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;rr(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function ir(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Cn(n);t.append(n),n=i}}var ar=null,or=!1,sr=!1;function cr(e){sr=e}var B=null,lr=!1;function ur(e){B=e}var V=null;function dr(e){V=e}var fr=null;function pr(e){B!==null&&(!Ye||B.f&2)&&(fr??=new Set).add(e)}var mr=null,hr=0,gr=null;function _r(e){gr=e}var vr=1,yr=0,br=yr;function xr(e){br=e}function Sr(){return++vr}function Cr(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~ae),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Cr(a)&&Nt(a),a.wv>e.wv)return!0}t&512&&zt===null&&A(e,_)}return!1}function wr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Ye&&fr!==null&&fr.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?wr(a,t,!1):t===a&&(n?A(a,v):a.f&1024&&A(a,y),en(a))}}function Tr(e){var t=mr,n=hr,r=gr,i=B,a=fr,o=D,s=lr,c=br,l=e.f;mr=null,hr=0,gr=null,B=l&96?null:e,fr=null,Qe(e.ctx),lr=!1,br=++yr,e.ac!==null&&(jn(()=>{e.ac.abort(_e)}),e.ac=null);try{e.f|=oe;var u=e.fn,d=u();e.f|=S;var f=e.deps,p=M?.is_fork;if(mr!==null){var m;if(p||Dr(e,hr),f!==null&&hr>0)for(f.length=hr+mr.length,m=0;m<mr.length;m++)f[hr+m]=mr[m];else e.deps=f=mr;if(In()&&e.f&512)for(m=hr;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&hr<f.length&&(Dr(e,hr),f.length=hr);if(rt()&&gr!==null&&!lr&&f!==null&&!(e.f&6146))for(m=0;m<gr.length;m++)wr(gr[m],e);if(i!==null&&i!==e){if(yr++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=yr;if(t!==null)for(let e of t)e.rv=yr;gr!==null&&(r===null?r=gr:r.push(...gr))}return e.f&8388608&&(e.f^=ce),d}catch(e){return ut(e)}finally{e.f^=oe,mr=t,hr=n,gr=r,B=i,fr=a,Qe(o),lr=s,br=c}}function Er(e,r){let i=r.reactions;if(i!==null){var a=t.call(i,e);if(a!==-1){var o=i.length-1;o===0?i=r.reactions=null:(i[a]=i[o],i.pop())}}if(i===null&&r.f&2&&(mr===null||!n.call(mr,r))){var s=r;s.f&512&&(s.f^=512,s.f&=~ae),s.v!==C&&pt(s),Pt(s),Dr(s,0)}}function Dr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Er(e,n[r])}function Or(e){var t=e.f;if(!(t&16384)){A(e,_);var n=V,r=or;V=e,or=!0;try{t&16777232?Zn(e):Xn(e),Yn(e);var i=Tr(e);e.teardown=typeof i==`function`?i:null,e.wv=vr}finally{or=r,V=n}}}async function kr(){if(Ye)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),Jt()}function H(e){var t=(e.f&2)!=0;if(ar?.add(e),B!==null&&!lr&&!(V!==null&&V.f&16384)&&(fr===null||!fr.has(e))){var r=B.deps;if(B.f&2097152)e.rv<yr&&(e.rv=yr,mr===null&&r!==null&&r[hr]===e?hr++:mr===null?mr=[e]:mr.push(e));else{B.deps??=[],n.call(B.deps,e)||B.deps.push(e);var i=e.reactions;i===null?e.reactions=[B]:n.call(i,B)||i.push(B)}}if(sr&&an.has(e))return an.get(e);if(t){var a=e;if(sr){var o=a.v;return(!(a.f&1024)&&a.reactions!==null||jr(a))&&(o=Mt(a)),an.set(a,o),o}var s=(a.f&512)==0&&!lr&&B!==null&&(or||(B.f&512)!=0),c=(a.f&S)===0;Cr(a)&&(s&&(a.f|=512),Nt(a)),s&&!c&&(Ft(a),Ar(a))}if(zt?.has(e))return zt.get(e);if(e.f&8388608)throw e.v;return e.v}function Ar(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Ft(t),Ar(t))}function jr(e){if(e.v===C)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(an.has(t)||t.f&2&&jr(t))return!0;return!1}function Mr(e){var t=lr;try{return lr=!0,e()}finally{lr=t}}function Nr(){return Symbol(Fe)}function Pr(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var Fr=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function Ir(e){return Fr.includes(e)}var Lr=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),Rr={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function zr(e){return e=e.toLowerCase(),Rr[e]??e}[...Lr];var Br=[`touchstart`,`touchmove`];function Vr(e){return Br.includes(e)}var Hr=[`textarea`,`script`,`style`,`title`];function Ur(e){return Hr.includes(e)}var Wr=Symbol(`events`),Gr=new Set,Kr=new Set;function qr(e,t,n,r={}){function i(e){if(r.capture||Qr.call(t,e),!e.cancelBubble)return jn(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?ct(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Jr(e,t,n,r={}){var i=qr(t,e,n,r);return()=>{e.removeEventListener(t,i,r)}}function Yr(e,t,n){(t[Wr]??={})[e]=n}function Xr(e){for(var t=0;t<e.length;t++)Gr.add(e[t]);for(var n of Kr)n(e)}var Zr=null;function Qr(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],o=a[0]||e.target;Zr=e;var s=0,c=Zr===e&&e[Wr];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[Wr]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=B,f=V;ur(null),dr(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[Wr]?.[r];h!=null&&(!o.disabled||e.target===o)&&h.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;s++,o=s<a.length?a[s]:null}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Wr]=t,delete e.currentTarget,ur(d),dr(f)}}}var $r=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function ei(e){return $r?.createHTML(e)??e}function ti(e){var t=En(`template`);return t.innerHTML=ei(e.replaceAll(`<!>`,`\\x3C!---->`)),t.content}function ni(e,t){var n=V;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function U(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(w)return ni(T,null),T;i===void 0&&(i=ti(a?e:`<!>`+e),n||(i=Sn(i)));var t=r||_n?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Sn(t),s=t.lastChild;ni(o,s)}else ni(t,t);return t}}function ri(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(w)return ni(T,null),T;if(!o){var e=Sn(ti(a));if(i)for(o=document.createDocumentFragment();Sn(e);)o.appendChild(Sn(e));else o=Sn(e)}var t=o.cloneNode(!0);if(i){var n=Sn(t),r=t.lastChild;ni(n,r)}else ni(t,t);return t}}function ii(e,t){return ri(e,t,`svg`)}function ai(e=``){if(!w){var t=xn(e+``);return ni(t,t),t}var n=T;return n.nodeType===3?Dn(n):(n.before(n=xn()),Ve(n)),ni(n,n),n}function W(){if(w)return ni(T,null),T;var e=document.createDocumentFragment(),t=document.createComment(``),n=xn();return e.append(t,n),ni(t,n),e}function G(e,t){if(w){var n=V;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=T),He();return}e!==null&&e.before(t)}function oi(){if(w&&T&&T.nodeType===8&&T.textContent?.startsWith(`$`)){let e=T.textContent.substring(1);return He(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function K(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[he]??=e.nodeValue)&&(e[he]=n,e.nodeValue=`${n}`)}function si(e,t){return li(e,t)}var ci=new Map;function li(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){bn();var l=void 0,u=Hn(()=>{var s=n??t.appendChild(xn());xt(s,{pending:()=>{}},t=>{O({});var n=D;if(o&&(n.c=o),a&&(i.$$events=a),w&&ni(t,null),l=e(t,i)||{},w&&(V.nodes.end=T,T===null||T.nodeType!==8||T.data!==`]`))throw Le(),Me;k()},c);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=Vr(r);for(let e of[t,document]){var a=ci.get(e);a===void 0&&(a=new Map,ci.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Qr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(r(Gr)),Kr.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=ci.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Qr),r.delete(e),r.size===0&&ci.delete(n)):r.set(e,i)}Kr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return ui.set(l,u),l}var ui=new WeakMap;function di(e,t){let n=ui.get(e);return n?(ui.delete(e),n(t)):Promise.resolve()}var fi=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)nr(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(nr(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(z(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();ir(r,t),t.append(xn()),this.#n.set(e,{effect:r,fragment:t})}else z(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),er(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(z(n.effect),this.#n.delete(e))};ensure(e,t){var n=M,r=Tn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=xn();i.append(a),this.#n.set(e,{effect:Jn(()=>t(a)),fragment:i})}else this.#t.set(e,Jn(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else w&&(this.anchor=T),this.#a(n)}};function q(e,t,n=!1){var r;w&&(r=T,He());var i=new fi(e),a=n?te:0;function o(e,t){if(w){var n=Ge(r);if(e!==parseInt(n.substring(1))){var a=We();Ve(a),i.anchor=a,Be(!1),i.ensure(e,t),Be(!0);return}}i.ensure(e,t)}Kn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var pi=Symbol(`NaN`);function mi(e,t,n){w&&He();var r=new fi(e),i=!rt();Kn(()=>{var e=t();e!==e&&(e=pi),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function hi(e,t){return t}function gi(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c<a;c++){let n=t[c];er(n,()=>{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;_i(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else --s},!1)}if(s===0){var l=i.length===0&&n!==null;if(l){var u=n,d=u.parentNode;wn(d),d.append(u),e.items.clear()}_i(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function _i(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ie,ir(a,document.createDocumentFragment())):z(t[i],n)}}var vi;function yi(t,n,i,a,o,s=null){var c=t,l=new Map;if(n&4){var u=t;c=w?Ve(Sn(u)):u.appendChild(xn())}w&&He();var d=null,f=At(()=>{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,xi(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=ie,Ci(d,null,c)):nr(d):er(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:Kn(()=>{p=H(f);var e=p.length;let t=!1;w&&Ge(c)===`[!`!=(e===0)&&(c=We(),Ve(c),Be(!1),t=!0);for(var r=new Set,u=M,v=Tn(),y=0;y<e;y+=1){w&&T.nodeType===8&&T.data===`]`&&(c=T,t=!0,Be(!1));var b=p[y],x=a(b,y),S=h?null:l.get(x);S?(S.v&&ln(S.v,b),S.i&&ln(S.i,y),v&&u.unskip_effect(S.e)):(S=Si(l,h?c:vi??=xn(),b,x,y,o,n,i),h||(S.e.f|=ie),l.set(x,S)),r.add(x)}if(e===0&&s&&!d&&(h?d=Jn(()=>s(c)):(d=Jn(()=>s(vi??=xn())),d.f|=ie)),e>r.size&&xe(``,``,``),w&&e>0&&Ve(We()),!h)if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);t&&Be(!0),H(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,w&&(c=T)}function bi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function xi(e,t,n,i,a){var o=(i&8)!=0,s=t.length,c=e.items,l=bi(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v<s;v+=1)h=t[v],g=a(h,v),_=c.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<s;v+=1){if(h=t[v],g=a(h,v),_=c.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(nr(_),o&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=ie,_===l)Ci(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),wi(e,d,_),wi(e,_,y),Ci(_,y,n),d=_,p=[],m=[],l=bi(d.next);continue}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],ee=p[p.length-1];for(x=0;x<p.length;x+=1)Ci(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);wi(e,S.prev,ee.next),wi(e,d,S),wi(e,ee,b),l=b,d=ee,--v,p=[],m=[]}else u.delete(_),Ci(_,l,n),wi(e,_.prev,_.next),wi(e,_,d===null?e.effect.first:d.next),wi(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=bi(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=bi(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(_i(e,r(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var te=[];if(u!==void 0)for(_ of u)_.f&8192||te.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&te.push(l),l=bi(l.next);var ne=te.length;if(ne>0){var re=i&4&&s===0?n:null;if(o){for(v=0;v<ne;v+=1)te[v].nodes?.a?.measure();for(v=0;v<ne;v+=1)te[v].nodes?.a?.fix()}gi(e,te,re)}}o&&ct(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Si(e,t,n,r,i,a,o,s){var c=o&1?o&16?sn(n):cn(n,!1,!1):null,l=o&2?sn(i):null;return{v:c,i:l,e:Jn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Ci(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=Cn(r);if(a.before(r),r===i)return;r=o}}function wi(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function J(e,t,...n){var r=new fi(e);Kn(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},te)}function Ti(e,t,n){var r;w&&(r=T,He());var i=new fi(e);Kn(()=>{var e=t()??null;if(w&&Ge(r)===`[`!=(e!==null)){var a=We();Ve(a),i.anchor=a,Be(!1),i.ensure(e,e&&(t=>n(t,e))),Be(!0);return}i.ensure(e,e&&(t=>n(t,e)))},te)}function Ei(e,t,n,r,i,a){let o=w;w&&He();var s=null;w&&T.nodeType===1&&(s=T,He());var c=w?T:e,l=new fi(c,!1);Kn(()=>{let e=t()||null;var a=i?i():n||e===`svg`?Pe:void 0;if(e===null){l.ensure(null,null);return}return l.ensure(e,t=>{if(e){if(s=w?s:En(e,a),ni(s,s),r){var n=null;w&&Ur(e)&&s.append(n=document.createComment(``));var i=w?Sn(s):s.appendChild(xn());w&&(i===null?Be(!1):Ve(i)),r(s,i),n?.remove()}V.nodes.end=s,t.before(s)}w&&Ve(t)}),()=>{}},te),Ln(()=>{}),o&&(Be(!0),Ve(c))}function Di(e,t){var n=void 0,r;qn(()=>{n!==(n=t())&&(r&&=(z(r),null),n&&(r=Jn(()=>{Un(()=>n(e))})))})}function Oi(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Oi(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function ki(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Oi(e))&&(r&&(r+=` `),r+=t);return r}function Ai(e){return typeof e==`object`?ki(e):e??``}var ji=[...` \n\\r\\f\\xA0\\v\uFEFF`];function Mi(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||ji.includes(r[o-1]))&&(s===r.length||ji.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Ni(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Pi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Fi(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Pi)),i&&c.push(...Object.keys(i).map(Pi));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`\'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Pi(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Ni(r)),i&&(n+=Ni(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Ii(e,t,n,r,i,a){var o=e[pe];if(w||o!==n||o===void 0){var s=Mi(n,r,a);(!w||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[pe]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function Li(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Ri(e,t,n,r){var i=e[me];if(w||i!==t){var a=Fi(t,r);(!w||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[me]=t}else r&&(Array.isArray(r)?(Li(e,n?.[0],r[0]),Li(e,n?.[1],r[1],`important`)):Li(e,n,r));return r}function zi(t,n,r=!1){if(t.multiple){if(n==null)return;if(!e(n))return Re();for(var i of t.options)i.selected=n.includes(Vi(i));return}for(i of t.options)if(hn(Vi(i),n)){i.selected=!0;return}(!r||n!==void 0)&&(t.selectedIndex=-1)}function Bi(e){var t=new MutationObserver(()=>{zi(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),Ln(()=>{t.disconnect()})}function Vi(e){return`__value`in e?e.__value:e.value}var Hi=Symbol(`class`),Ui=Symbol(`style`),Wi=Symbol(`is custom element`),Gi=Symbol(`is html`),Ki=ve?`link`:`LINK`,qi=ve?`input`:`INPUT`,Ji=ve?`option`:`OPTION`,Yi=ve?`select`:`SELECT`;function Xi(e){if(w){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Qi(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Qi(e,`checked`,null),e.checked=r}}};e[ge]=n,ct(n),An()}}function Zi(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function Qi(e,t,n,r){var i=ta(e);w&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Ki)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[de]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ra(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function $i(e,t,n,r,i=!1,a=!1){if(w&&i&&e.nodeName===qi){var o=e;(o.type===`checkbox`?`defaultChecked`:`defaultValue`)in n||Xi(o)}var s=ta(e),c=s[Wi],l=!s[Gi];let u=w&&c;u&&Be(!1);var d=t||{},f=e.nodeName===Ji;for(var p in t)p in n||(n[p]=null);n.class?n.class=Ai(n.class):(r||n[Hi])&&(n.class=null),n[Ui]&&(n.style??=null);var m=ra(e);if(e.nodeName===qi&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==d.type||h===void 0&&e.hasAttribute(`type`))&&(d.type=h,Qi(e,`type`,h,a))}for(let i in n){let o=n[i];if(f&&i===`value`&&o==null){e.value=e.__value=``,d[i]=o;continue}if(i===`class`){Ii(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,o,r,t?.[Hi],n[Hi]),d[i]=o,d[Hi]=n[Hi];continue}if(i===`style`){Ri(e,o,t?.[Ui],n[Ui]),d[i]=o,d[Ui]=n[Ui];continue}var g=d[i];if(!(o===g&&!(o===void 0&&e.hasAttribute(i)))){d[i]=o;var _=i[0]+i[1];if(_!==`$$`)if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=Ir(r);if(Pr(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(o!=null)continue;e.removeEventListener(r,d[n],t),d[n]=null}if(v)Yr(r,e,o),Xr([r]);else if(o!=null){function a(e){d[i].call(this,e)}d[n]=qr(r,e,a,t)}}else if(i===`style`)Qi(e,i,o);else if(i===`autofocus`)On(e,!!o);else if(!c&&(i===`__value`||i===`value`&&o!=null))e.value=e.__value=o;else if(i===`selected`&&f)Zi(e,o);else{var y=i;l||(y=zr(y));var b=y===`defaultValue`||y===`defaultChecked`;if(o==null&&!c&&!b)if(s[i]=null,y===`value`||y===`checked`){let n=e,r=t===void 0;if(y===`value`){let e=n.defaultValue;n.removeAttribute(y),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(y),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i);else b||m.includes(y)&&(c||typeof o!=`string`)?(e[y]=o,y in s&&(s[y]=C)):typeof o!=`function`&&Qi(e,y,o,a)}}}return u&&Be(!0),d}function ea(e,t,n=[],r=[],i=[],a,o=!1,s=!1){Ct(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===Yi,l=!1;if(qn(()=>{var u=t(...n.map(H)),d=$i(e,r,u,a,o,s);l&&c&&`value`in u&&zi(e,u.value);for(let e of Object.getOwnPropertySymbols(i))u[e]||z(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var f=u[t];t.description===`@attach`&&(!r||f!==r[t])&&(i[t]&&z(i[t]),i[t]=Jn(()=>Di(e,()=>f))),d[t]=f}r=d}),c){var u=e;Un(()=>{zi(u,r.value,!0),Bi(u)})}l=!0})}function ta(e){return e[fe]??={[Wi]:e.nodeName.includes(`-`),[Gi]:e.namespaceURI===Ne}}var na=new Map;function ra(e){var t=e.getAttribute(`is`)||e.nodeName,n=na.get(t);if(n)return n;na.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&s!==`innerHTML`&&s!==`textContent`&&s!==`innerText`&&n.push(s);i=l(i)}return n}function ia(e,t,n=t){var r=new WeakSet;Mn(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=aa(e)?oa(a):a,n(a),M!==null&&r.add(M),await kr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(w&&e.defaultValue!==e.value||Mr(t)==null&&e.value)&&(n(aa(e)?oa(e.value):e.value),M!==null&&r.add(M)),Gn(()=>{var n=t();if(e===document.activeElement){var i=Ye?Rt:M;if(r.has(i))return}aa(e)&&n===oa(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function aa(e){var t=e.type;return t===`number`||t===`range`}function oa(e){return e===``?null:+e}var sa={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.has(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function ca(e,t,n){return new Proxy({props:e,exclude:t},sa)}var la={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(d(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];d(i)&&(i=i());let o=a(i,t);if(o&&o.set)return o.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(d(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=a(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===le||t===ue)return!1;for(let n of e.props)if(d(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(d(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function ua(...e){return new Proxy({props:e},la)}function Y(e,t,n,r){var i=!Xe||(n&2)!=0,o=(n&8)!=0,s=(n&16)!=0,c=r,l=!0,u=void 0,d=()=>s&&i?(u??=Dt(r),H(u)):(l&&(l=!1,c=s?Mr(r):r),c);let f;if(o){var p=le in e||ue in e;f=a(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;o?[m,h]=vt(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&Ee(t),f(m)));var g=i?()=>{var n=e[t];return n===void 0?d():(l=!0,n)}:()=>{var n=e[t];return n!==void 0&&(c=void 0),n===void 0?c:n};if(i&&!(n&4))return g;if(f){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&f(t?g():e),e):g()})}var v=!1,y=(n&1?Dt:At)(()=>(v=!1,g()));o&&H(y);var b=V;return(function(e,t){if(arguments.length>0){let n=t?H(y):i&&o?pn(e):e;return P(y,n),v=!0,c!==void 0&&(c=n),e}return sr&&v||b.f&16384?y.v:H(y)})}function da(e){D===null&&ye(`onMount`),Xe&&D.l!==null?fa(D).m.push(e):Rn(()=>{let t=Mr(e);if(typeof t==`function`)return t})}function fa(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var X=new class{#e=N(null);get data(){return H(this.#e)}set data(e){P(this.#e,e,!0)}#t=N(null);get arsenal(){return H(this.#t)}set arsenal(e){P(this.#t,e,!0)}#n=N(`connecting`);get status(){return H(this.#n)}set status(e){P(this.#n,e,!0)}#r=N(``);get clock(){return H(this.#r)}set clock(e){P(this.#r,e,!0)}#i=N(`overview`);get view(){return H(this.#i)}set view(e){P(this.#i,e,!0)}#a=N(!1);get arsenalLoading(){return H(this.#a)}set arsenalLoading(e){P(this.#a,e,!0)}#o=!1;#s=null;async tick(){try{let e=await fetch(`/data`);if(!e.ok)throw Error(`HTTP ${e.status}`);this.data=await e.json(),this.status=`live`,this.clock=new Date().toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}catch{this.status=`offline`}}start(){this.tick(),this.#s=setInterval(()=>void this.tick(),1e4)}stop(){this.#s&&clearInterval(this.#s)}async loadArsenal(e=!1){if(!(this.#o&&!e)){this.arsenalLoading=!0;try{let e=await fetch(`/arsenal`);e.ok&&(this.arsenal=await e.json(),this.#o=!0)}catch{}finally{this.arsenalLoading=!1}}}go(e){this.view=e,e===`arsenal`&&this.loadArsenal()}};function Z(e){return typeof e!=`number`||!Number.isFinite(e)?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function pa(e){return typeof e!=`number`||!Number.isFinite(e)?`$0.00`:`$${e.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function ma(e){if(!e)return`\u2014`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`\u2014`;let n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()?t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):t.toLocaleDateString([],{month:`short`,day:`numeric`})}function ha(e){if(!e)return`unknown`;let t=e.toLowerCase();return t===`<synthetic>`?`unknown`:t.includes(`fable`)?`fable`:t.includes(`opus`)?`opus`:t.includes(`sonnet`)?`sonnet`:t.includes(`haiku`)?`haiku`:`unknown`}function ga(e){return!e||e===`<synthetic>`?`synthetic`:e.replace(/^claude-/,``)}function _a(e){if(!e)return``;let t=e.split(/[/\\\\]/).filter(Boolean);return t.length<=2?t.join(`/`):`\u2026/${t.slice(-2).join(`/`)}`}var va=[220,75,20,155,285,330,250,45];function ya(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return`oklch(72% 0.15 ${va[t%va.length]})`}var ba={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},xa=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Sa=Symbol(`lucide-context`),Ca=()=>$e(Sa),wa=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),Ta=ii(`<svg><!><!></svg>`);function Ea(e,t){O(t,!0);let n=Ca()??{},r=Y(t,`color`,19,()=>n.color??`currentColor`),i=Y(t,`size`,19,()=>n.size??24),a=Y(t,`strokeWidth`,19,()=>n.strokeWidth??2),o=Y(t,`absoluteStrokeWidth`,19,()=>n.absoluteStrokeWidth??!1),s=Y(t,`iconNode`,19,()=>[]),c=ca(t,wa),l=j(()=>o()?Number(a())*24/Number(i()):a());var u=Ta();ea(u,e=>({...ba,...e,...c,width:i(),height:i(),stroke:r(),"stroke-width":H(l),class:[`lucide-icon lucide`,n.class,t.name&&`lucide-${t.name}`,t.class]}),[()=>!t.children&&!xa(c)&&{"aria-hidden":`true`}]);var d=F(u);yi(d,17,s,hi,(e,t)=>{var n=j(()=>h(H(t),2));let r=()=>H(n)[0],i=()=>H(n)[1];var a=W();Ei(I(a),r,!0,(e,t)=>{ea(e,()=>({...i()}))}),G(e,a)}),J(L(d),()=>t.children??f),E(u),G(e,u),k()}var Da=new Set([`$$slots`,`$$events`,`$$legacy`]);function Oa(e,t){let n=ca(t,Da),r=[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`}]];Ea(e,ua({name:`layout-dashboard`},()=>n,{get iconNode(){return r}}))}var ka=new Set([`$$slots`,`$$events`,`$$legacy`]);function Aa(e,t){let n=ca(t,ka),r=[[`polyline`,{points:`14.5 17.5 3 6 3 3 6 3 17.5 14.5`}],[`line`,{x1:`13`,x2:`19`,y1:`19`,y2:`13`}],[`line`,{x1:`16`,x2:`20`,y1:`16`,y2:`20`}],[`line`,{x1:`19`,x2:`21`,y1:`21`,y2:`19`}],[`polyline`,{points:`14.5 6.5 18 3 21 3 21 6 17.5 9.5`}],[`line`,{x1:`5`,x2:`9`,y1:`14`,y2:`18`}],[`line`,{x1:`7`,x2:`4`,y1:`17`,y2:`20`}],[`line`,{x1:`3`,x2:`5`,y1:`19`,y2:`21`}]];Ea(e,ua({name:`swords`},()=>n,{get iconNode(){return r}}))}var ja=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ma(e,t){let n=ca(t,ja),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}],[`path`,{d:`M12 17h.01`}]];Ea(e,ua({name:`circle-question-mark`},()=>n,{get iconNode(){return r}}))}var Na=new Set([`$$slots`,`$$events`,`$$legacy`]);function Pa(e,t){let n=ca(t,Na),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}]];Ea(e,ua({name:`panel-left`},()=>n,{get iconNode(){return r}}))}var Fa=U(`<div class="min-w-0"><div class="font-serif text-lg leading-none text-foreground">Synth<em>ra</em></div> <div class="font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground">Dashboard</div></div>`),Ia=U(`<span class="font-mono text-sm text-muted-foreground"> </span>`),La=U(`<span> </span>`),Ra=U(`<button><!> <!></button>`),za=U(`<span>FAQ</span>`),Ba=U(`<div class="flex flex-col gap-1 rounded-lg bg-sidebar-accent/40 p-2.5"><div class="font-mono text-[10px] uppercase tracking-[0.14em] text-muted-foreground">Active</div> <div class="truncate font-mono text-sm text-sidebar-foreground"> </div> <div class="mt-1 flex items-center justify-between font-mono text-[10px] text-muted-foreground"><span> </span> <span>v__SYN_VERSION__</span></div></div>`),Va=U(`<span class="text-xs">Collapse</span>`),Ha=U(`<aside><div class="flex items-center gap-2.5 px-1 py-2"><div class="grid size-8 shrink-0 place-items-center rounded-lg bg-primary/90 font-serif text-lg italic text-primary-foreground">S</div> <!></div> <div><span></span> <!></div> <div class="my-1 h-px bg-sidebar-border"></div> <nav class="flex flex-col gap-1"><!> <button title="FAQ"><!> <!></button></nav> <div class="flex-1"></div> <!> <button title="Toggle sidebar"><!> <!></button></aside>`);function Ua(e,t){O(t,!0);let n=N(!1),r=typeof window<`u`&&window.location.port||`8901`,i=[{id:`overview`,label:`Overview`,icon:Oa},{id:`arsenal`,label:`Arsenal`,icon:Aa}];var a=Ha(),o=F(a),s=L(F(o),2),c=e=>{G(e,Fa())};q(s,e=>{H(n)||e(c)}),E(o);var l=L(o,2),u=F(l);let d;var f=L(u,2),p=e=>{var t=Ia(),n=F(t,!0);E(t),R(()=>K(n,X.status===`live`?`live \xB7 ${X.clock}`:X.status)),G(e,t)};q(f,e=>{H(n)||e(p)}),E(l);var m=L(l,4),h=F(m);yi(h,17,()=>i,e=>e.id,(e,t)=>{var r=Ra(),i=F(r);Ti(i,()=>H(t).icon,(e,t)=>{t(e,{class:`size-4 shrink-0`})});var a=L(i,2),o=e=>{var n=La(),r=F(n,!0);E(n),R(()=>K(r,H(t).label)),G(e,n)};q(a,e=>{H(n)||e(o)}),E(r),R(()=>{Qi(r,`title`,H(t).label),Ii(r,1,`flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm transition-colors `+(X.view===H(t).id?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-sidebar-foreground/75 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground`)+(H(n)?` justify-center`:``))}),Yr(`click`,r,()=>X.go(H(t).id)),G(e,r)});var g=L(h,2),_=F(g);Ma(_,{class:`size-4 shrink-0`});var v=L(_,2),y=e=>{G(e,za())};q(v,e=>{H(n)||e(y)}),E(g),E(m);var b=L(m,4),x=e=>{var t=Ba(),n=L(F(t),2),i=F(n,!0);E(n);var a=L(n,2),o=F(a),s=F(o);E(o),Ue(2),E(a),E(t),R(()=>{Qi(n,`title`,X.data?.active?.project_root??`\u2014`),K(i,X.data?.active?.project_name??`\u2014`),K(s,`port ${r??``}`)}),G(e,t)};q(b,e=>{H(n)||e(x)});var S=L(b,2),ee=F(S);Pa(ee,{class:`size-4 shrink-0`});var te=L(ee,2),ne=e=>{G(e,Va())};q(te,e=>{H(n)||e(ne)}),E(S),E(a),R(()=>{Ii(a,1,`flex h-screen shrink-0 flex-col gap-1 border-r border-sidebar-border bg-sidebar p-3 transition-[width] duration-200 `+(H(n)?`w-[64px] items-center`:`w-[248px]`)),Ii(l,1,`flex items-center gap-2 rounded-md px-2 py-1.5 `+(H(n)?`justify-center`:``)),d=Ii(u,1,`size-2 shrink-0 rounded-full `+(X.status===`live`?`bg-[var(--c-fable)]`:X.status===`offline`?`bg-destructive`:`bg-muted-foreground`),null,d,{"animate-pulse":X.status===`live`}),Ii(g,1,`flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm text-sidebar-foreground/75 transition-colors hover:bg-sidebar-accent/50 hover:text-sidebar-foreground `+(H(n)?`justify-center`:``)),Ii(S,1,`mt-1 flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent/50 hover:text-sidebar-foreground `+(H(n)?`justify-center`:``))}),Yr(`click`,g,function(...e){t.onFaq?.apply(this,e)}),Yr(`click`,S,()=>P(n,!H(n))),G(e,a),k()}Xr([`click`]),Ze();var Wa=U(`<div class="flex flex-col gap-1 bg-card/70 p-4"><span class="font-mono text-xs uppercase tracking-[0.12em] text-muted-foreground"> </span> <span class="font-mono text-2xl tabular-nums text-foreground"> </span></div>`),Ga=U(`<div class="grid grid-cols-2 gap-px overflow-hidden rounded-xl border bg-border sm:grid-cols-3 lg:grid-cols-5"></div>`);function Ka(e,t){O(t,!0);let n=j(()=>{let e=X.data?.global;return[{label:`Turns`,v:e?.total_turns??0},{label:`\u2193 Input`,v:e?.total_input_tokens??0},{label:`\u2191 Output`,v:e?.total_output_tokens??0},{label:`\u27F2 Cache R`,v:e?.total_cache_read??0},{label:`\uFF0B Cache W`,v:e?.total_cache_create??0}]});var r=Ga();yi(r,21,()=>H(n),e=>e.label,(e,t)=>{var n=Wa(),r=F(n),i=F(r,!0);E(r);var a=L(r,2),o=F(a,!0);E(a),E(n),R(e=>{K(i,H(t).label),K(o,e)},[()=>Z(H(t).v)]),G(e,n)}),E(r),G(e,r),k()}var qa=U(`<span class="font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground"> </span>`),Ja=U(`<header class="flex items-baseline justify-between gap-3"><span class="font-mono text-xs uppercase tracking-[0.14em] text-muted-foreground"> </span> <!></header>`),Ya=U(`<section><!> <!></section>`);function Xa(e,t){let n=Y(t,`class`,3,``);var r=Ya(),i=F(r),a=e=>{var n=Ja(),r=F(n),i=F(r,!0);E(r);var a=L(r,2),o=e=>{var n=qa(),r=F(n,!0);E(n),R(()=>K(r,t.meta)),G(e,n)};q(a,e=>{t.meta&&e(o)}),E(n),R(()=>K(i,t.title)),G(e,n)};q(i,e=>{t.title&&e(a)}),J(L(i,2),()=>t.children??f),E(r),R(()=>Ii(r,1,`flex h-full min-h-0 flex-col gap-3 rounded-xl border bg-card/55 p-4 transition-colors hover:bg-card/80 `+n())),G(e,r)}var Za=U(`<div class="flex flex-col gap-3"><div><div class="font-mono text-3xl text-[var(--money)]"> </div> <div class="font-mono text-sm text-muted-foreground"> </div></div> <div class="flex h-2 overflow-hidden rounded-full bg-border"><div class="h-full bg-muted-foreground/40"></div> <div class="h-full bg-[var(--money)]"></div></div> <div class="flex justify-between font-mono text-xs text-muted-foreground"><span>you paid <b class="text-foreground"> </b></span> <span>baseline <b class="text-foreground"> </b></span></div> <div class="rounded-md border border-dashed border-border px-3 py-2 text-center font-mono text-xs text-muted-foreground"><b class="text-foreground"> </b> blocks \xD7 <b class="text-foreground">500</b> tokens \xD7 <b class="text-foreground">$3</b>/M = <b class="text-[var(--money)]"> </b></div></div>`);function Qa(e,t){O(t,!0);let n=j(()=>{let e=X.data?.global,t=e?.blocked_count??0,n=t*500*3/1e6,r=e?.estimated_cost_usd??0,i=r+n;return{blocks:t,money:n,paid:r,baseline:i,pct:i>0?n/i*100:0,tokens:e?.estimated_tokens_saved??0,paidWidth:i>0?r/i*100:100}});{let t=j(()=>`${H(n).pct.toFixed(1)}% off \xB7 floor`);Xa(e,{title:`Synthra savings`,get meta(){return H(t)},children:(e,t)=>{var r=Za(),i=F(r),a=F(i),o=F(a,!0);E(a);var s=L(a,2),c=F(s);E(s),E(i);var l=L(i,2),u=F(l),d=L(u,2);E(l);var f=L(l,2),p=F(f),m=L(F(p)),h=F(m,!0);E(m),E(p);var g=L(p,2),_=L(F(g)),v=F(_,!0);E(_),E(g),E(f);var y=L(f,2),b=F(y),x=F(b,!0);E(b);var S=L(b,6),ee=F(S,!0);E(S),E(y),E(r),R((e,t,r,i,a)=>{K(o,e),K(c,`${t??``} tokens avoided`),Ri(u,`width:${H(n).paidWidth}%`),Ri(d,`width:${100-H(n).paidWidth}%`),K(h,r),K(v,i),K(x,H(n).blocks),K(ee,a)},[()=>pa(H(n).money),()=>Z(H(n).tokens),()=>pa(H(n).paid),()=>pa(H(n).baseline),()=>pa(H(n).money)]),G(e,r)},$$slots:{default:!0}})}k()}var $a=U(`<div class="font-mono text-3xl text-[var(--money)]"> </div> <div class="mt-1 flex flex-col gap-1 font-mono text-sm text-muted-foreground"><div class="flex justify-between"><span>Tokens (in+out)</span><span class="text-foreground"> </span></div> <div class="flex justify-between"><span>Avg / turn</span><span class="text-foreground"> </span></div></div>`,1);function eo(e,t){O(t,!0);let n=j(()=>{let e=X.data?.global,t=e?.total_turns??0,n=e?.estimated_cost_usd??0;return{cost:n,tokens:(e?.total_input_tokens??0)+(e?.total_output_tokens??0),avg:t>0?n/t:0}});Xa(e,{title:`Total spend`,meta:`all time`,children:(e,t)=>{var r=$a(),i=I(r),a=F(i,!0);E(i);var o=L(i,2),s=F(o),c=L(F(s)),l=F(c,!0);E(c),E(s);var u=L(s,2),d=L(F(u)),f=F(d,!0);E(d),E(u),E(o),R((e,t,n)=>{K(a,e),K(l,t),K(f,n)},[()=>pa(H(n).cost),()=>Z(H(n).tokens),()=>pa(H(n).avg)]),G(e,r)},$$slots:{default:!0}}),k()}var to=ii(`<circle cx="70" cy="70" r="52" fill="none" stroke-width="14"></circle>`),no=U(`<div class="flex items-center gap-2 font-mono text-sm"><span class="size-2 rounded-sm"></span> <span class="flex-1 text-muted-foreground"> </span> <span class="tabular-nums text-foreground"> </span> <span class="w-9 text-right tabular-nums text-muted-foreground"> </span></div>`),ro=U(`<div class="text-sm text-muted-foreground">No turns yet.</div>`),io=U(`<div class="flex items-center gap-4"><div class="relative size-[116px] shrink-0"><svg viewBox="0 0 140 140" class="size-full -rotate-90"><circle cx="70" cy="70" r="52" fill="none" stroke="var(--border)" stroke-width="14"></circle><!></svg> <div class="absolute inset-0 grid place-items-center"><div class="text-center"><div class="font-mono text-2xl text-foreground"> </div> <div class="font-mono text-[10px] uppercase text-muted-foreground">turns</div></div></div></div> <div class="flex min-w-0 flex-1 flex-col gap-1.5"></div></div>`);function ao(e,t){O(t,!0);let n=[{fam:`fable`,label:`Fable`,color:`var(--c-fable)`},{fam:`opus`,label:`Opus`,color:`var(--c-opus)`},{fam:`sonnet`,label:`Sonnet`,color:`var(--c-sonnet)`},{fam:`haiku`,label:`Haiku`,color:`var(--c-haiku)`},{fam:`unknown`,label:`Other`,color:`var(--c-unknown)`}],r=2*Math.PI*52,i=j(()=>{let e={fable:0,opus:0,sonnet:0,haiku:0,unknown:0};for(let t of X.data?.projects??[])for(let[n,r]of Object.entries(t.models??{}))e[ha(n)]+=r;let t=n.reduce((t,n)=>t+e[n.fam],0),i=0;return{arcs:n.filter(t=>e[t.fam]>0).map(n=>{let a=e[n.fam],o=t>0?a/t*r:0,s={...n,n:a,len:o,offset:i,pct:t>0?Math.round(a/t*100):0};return i+=o,s}),total:t}});Xa(e,{title:`Model usage`,meta:`by turns`,children:(e,t)=>{var n=io(),a=F(n),o=F(a);yi(L(F(o)),17,()=>H(i).arcs,e=>e.fam,(e,t)=>{var n=to();R(()=>{Qi(n,`stroke`,H(t).color),Qi(n,`stroke-dasharray`,`${H(t).len} ${r}`),Qi(n,`stroke-dashoffset`,-H(t).offset),Qi(n,`stroke-linecap`,H(i).arcs.length===1?`round`:`butt`)}),G(e,n)}),E(o);var s=L(o,2),c=F(s),l=F(c),u=F(l,!0);E(l),Ue(2),E(c),E(s),E(a);var d=L(a,2);yi(d,21,()=>H(i).arcs,e=>e.fam,(e,t)=>{var n=no(),r=F(n),i=L(r,2),a=F(i,!0);E(i);var o=L(i,2),s=F(o,!0);E(o);var c=L(o,2),l=F(c);E(c),E(n),R(()=>{Ri(r,`background:${H(t).color}`),K(a,H(t).label),K(s,H(t).n),K(l,`${H(t).pct??``}%`)}),G(e,n)},e=>{G(e,ro())}),E(d),E(n),R(()=>K(u,H(i).total)),G(e,n)},$$slots:{default:!0}}),k()}function oo(e){return typeof e==`object`&&!!e}var so=[`string`,`number`,`bigint`,`boolean`];function co(e){return e==null||so.includes(typeof e)?!0:Array.isArray(e)?e.every(e=>co(e)):typeof e==`object`?Object.getPrototypeOf(e)===Object.prototype:!1}var lo=Symbol(`box`),uo=Symbol(`is-writable`);function Q(e,t){let n=j(e);return t?{[lo]:!0,[uo]:!0,get current(){return H(n)},set current(e){t(e)}}:{[lo]:!0,get current(){return e()}}}function fo(e){return oo(e)&&lo in e}function po(e){let t=N(pn(e));return{[lo]:!0,[uo]:!0,get current(){return H(t)},set current(e){P(t,e,!0)}}}function mo(...e){return function(t){for(let n of e)if(n){if(t.defaultPrevented)return;typeof n==`function`?n.call(this,t):n.current?.call(this,t)}}}var ho=/\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g,go=/\\n/g,_o=/^\\s*/,vo=/^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/,yo=/^:\\s*/,bo=/^((?:\'(?:\\\\\'|.)*?\'|"(?:\\\\"|.)*?"|\\([^)]*?\\)|[^};])+)/,xo=/^[;\\s]*/,So=/^\\s+|\\s+$/g,Co=`\n`,wo=`/`,To=`*`,Eo=``,Do=`comment`,Oo=`declaration`;function ko(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(go);t&&(n+=t.length);var i=e.lastIndexOf(Co);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(_o)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(!(wo!=e.charAt(0)||To!=e.charAt(1))){for(var n=2;Eo!=e.charAt(n)&&(To!=e.charAt(n)||wo!=e.charAt(n+1));)++n;if(n+=2,Eo===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Do,comment:o})}}function f(){var e=a(),t=c(vo);if(t){if(d(),!c(yo))return s(`property missing \':\'`);var n=c(bo),r=e({type:Oo,property:Ao(t[0].replace(ho,Eo)),value:n?Ao(n[0].replace(ho,Eo)):Eo});return c(xo),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Ao(e){return e?e.replace(So,Eo):Eo}function jo(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=ko(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var Mo=/\\d/,No=[`-`,`_`,`/`,`.`];function Po(e=``){if(!Mo.test(e))return e!==e.toLowerCase()}function Fo(e){let t=[],n=``,r,i;for(let a of e){let e=No.includes(a);if(e===!0){t.push(n),n=``,r=void 0;continue}let o=Po(a);if(i===!1){if(r===!1&&o===!0){t.push(n),n=a,r=o;continue}if(r===!0&&o===!1&&n.length>1){let e=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=e+a,r=o;continue}}n+=a,r=o,i=e}return t.push(n),t}function Io(e){return e?Fo(e).map(e=>Ro(e)).join(``):``}function Lo(e){return zo(Io(e||``))}function Ro(e){return e?e[0].toUpperCase()+e.slice(1):``}function zo(e){return e?e[0].toLowerCase()+e.slice(1):``}function Bo(e){if(!e)return{};let t={};function n(e,n){if(e.startsWith(`-moz-`)||e.startsWith(`-webkit-`)||e.startsWith(`-ms-`)||e.startsWith(`-o-`)){t[Io(e)]=n;return}if(e.startsWith(`--`)){t[e]=n;return}t[Lo(e)]=n}return jo(e,n),t}function Vo(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function Ho(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var Uo=Ho(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Wo(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${Uo(t)}: ${e[t]};`).join(`\n`)}function Go(e={}){return Wo(e).replace(`\n`,` `)}var Ko=new Set(`onabort.onanimationcancel.onanimationend.onanimationiteration.onanimationstart.onauxclick.onbeforeinput.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncompositionend.oncompositionstart.oncompositionupdate.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onfocusin.onfocusout.onformdata.ongotpointercapture.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onload.onloadeddata.onloadedmetadata.onloadstart.onlostpointercapture.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onpaste.onpause.onplay.onplaying.onpointercancel.onpointerdown.onpointerenter.onpointerleave.onpointermove.onpointerout.onpointerover.onpointerup.onprogress.onratechange.onreset.onresize.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onselectionchange.onselectstart.onslotchange.onstalled.onsubmit.onsuspend.ontimeupdate.ontoggle.ontouchcancel.ontouchend.ontouchmove.ontouchstart.ontransitioncancel.ontransitionend.ontransitionrun.ontransitionstart.onvolumechange.onwaiting.onwebkitanimationend.onwebkitanimationiteration.onwebkitanimationstart.onwebkittransitionend.onwheel`.split(`.`));function qo(e){return Ko.has(e)}function Jo(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];if(r){for(let e of Object.keys(r)){let n=t[e],i=r[e],a=typeof n==`function`,o=typeof i==`function`;if(a&&typeof o&&qo(e))t[e]=mo(n,i);else if(a&&o)t[e]=Vo(n,i);else if(e===`class`){let r=co(n),a=co(i);r&&a?t[e]=ki(n,i):r?t[e]=ki(n):a&&(t[e]=ki(i))}else if(e===`style`){let r=typeof n==`object`,a=typeof i==`object`,o=typeof n==`string`,s=typeof i==`string`;if(r&&a)t[e]={...n,...i};else if(r&&s){let r=Bo(i);t[e]={...n,...r}}else if(o&&a)t[e]={...Bo(n),...i};else if(o&&s){let r=Bo(n),a=Bo(i);t[e]={...r,...a}}else r?t[e]=n:a?t[e]=i:o?t[e]=n:s&&(t[e]=i)}else t[e]=i===void 0?n:i}for(let e of Object.getOwnPropertySymbols(r)){let n=t[e],i=r[e];t[e]=i===void 0?n:i}}}return typeof t.style==`object`&&(t.style=Go(t.style).replaceAll(`\n`,` `)),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}var Yo=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function Xo(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var Zo=class extends Map{#e=new Map;#t=N(0);#n=N(0);#r=br||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return br===this.#r?N(e):sn(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else return H(this.#t),!1;return H(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else{H(this.#t);return}return H(n),super.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),P(this.#n,super.size),dn(o);else if(i!==t){dn(r);var s=o.reactions===null?null:new Set(o.reactions);(s===null||!r.reactions?.every(e=>s.has(e)))&&dn(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),P(n,-1)),r&&(P(this.#n,super.size),dn(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;P(this.#n,0);for(var t of e.values())P(t,-1);dn(this.#t),e.clear()}}#a(){H(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)H(n)}keys(){return H(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return H(this.#n),super.size}};new class{#e;#t;constructor(e={}){let{window:t=Yo,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=yt(e=>{let n=Jr(t,`focusin`,e),r=Jr(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?Xo(this.#e):null}};var Qo=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return tt(this.#t)}get(){let e=$e(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=$e(this.#t);return t===void 0?e:t}set(e){return et(this.#t,e)}};function $o(e,t){switch(e){case`post`:Rn(t);break;case`pre`:Bn(t);break}}function es(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;$o(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=Mr(()=>n(t,o));return o=t,r})}function ts(e,t,n){let r=Vn(()=>{let i=!1;es(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});Rn(()=>r)}function ns(e,t,n){es(e,`post`,t,n)}function rs(e,t,n){es(e,`pre`,t,n)}ns.pre=rs;function is(e,t){ts(e,`post`,t)}function as(e,t){ts(e,`pre`,t)}is.pre=as;function os(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function ss(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function cs(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=N(pn(o)),u=N(!1),d=N(void 0),f=N(pn([])),p=()=>{H(f).forEach(e=>e()),P(f,[],!0)},m=e=>{P(f,[...H(f),e],!0)},h=async(e,n,r=!1)=>{try{P(u,!0),P(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:H(l),refetching:r,onCleanup:m,signal:i.signal});return P(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||P(d,e,!0);return}finally{P(u,!1)}},g=s?os(h,s):c?ss(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return H(l)},get loading(){return H(u)},get error(){return H(d)},mutate:e=>{P(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function ls(e,t,n){return cs(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];ns(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function us(e,t,n){return cs(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];ns.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}ls.pre=us;function ds(e){Rn(()=>()=>{e()})}function fs(e,t){return setTimeout(t,e)}function ps(e){kr().then(e)}var ms=1,hs=9,gs=11;function _s(e){return oo(e)&&e.nodeType===ms&&typeof e.nodeName==`string`}function vs(e){return oo(e)&&e.nodeType===hs}function ys(e){return oo(e)&&e.constructor?.name===`VisualViewport`}function bs(e){return oo(e)&&e.nodeType!==void 0}function xs(e){return bs(e)&&e.nodeType===gs&&`host`in e}function Ss(e,t){if(!e||!t||!_s(e)||!_s(t))return!1;let n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&xs(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Cs(e){return vs(e)?e:ys(e)?e.document:e?.ownerDocument??document}function ws(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var Ts=class{element;#e=j(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return H(this.#e)}set root(e){P(this.#e,e)}constructor(e){typeof e==`function`?this.element=Q(e):this.element=e}getDocument=()=>Cs(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>ws(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function Es(e,t){return{[Nr()]:n=>fo(e)?(e.current=n,Mr(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),Mr(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e(null),t?.(null))})}}function Ds(e){return e?``:void 0}function Os(e){return e?`open`:`closed`}function ks(e){return e===`starting`?{"data-starting-style":``}:e===`ending`?{"data-ending-style":``}:{}}var As=class{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(e=>[e,this.getAttr(e)]))}getAttr(e,t){return t?`data-${t}-${e}`:`${this.#t}${e}`}selector(e,t){return`[${this.getAttr(e,t)}]`}};function js(e){let t=new As(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}var Ms=typeof document<`u`,Ns=Ps();function Ps(){return Ms&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Fs(e){return e instanceof HTMLElement}function Is(e){return e instanceof Element||e instanceof SVGElement}var Ls=class{#e;#t=null;#n=null;#r=0;constructor(e){this.#e=e,ds(()=>this.#i())}#i(){this.#t!==null&&(window.cancelAnimationFrame(this.#t),this.#t=null),this.#n?.disconnect(),this.#n=null,this.#r++}run(e){this.#i();let t=this.#e.ref.current;if(!t)return;if(typeof t.getAnimations!=`function`){this.#a(e);return}let n=this.#r,r=()=>{n===this.#r&&this.#a(e)},i=()=>{if(n!==this.#r)return;let e=t.getAnimations();if(e.length===0){r();return}Promise.all(e.map(e=>e.finished)).then(()=>{r()}).catch(()=>{if(n===this.#r){if(t.getAnimations().some(e=>e.pending||e.playState!==`finished`)){i();return}r()}})},a=()=>{this.#t=window.requestAnimationFrame(()=>{this.#t=null,i()})};if(!this.#e.afterTick.current){a();return}this.#t=window.requestAnimationFrame(()=>{this.#t=null;let e=`data-starting-style`;if(!t.hasAttribute(e)){a();return}this.#n=new MutationObserver(()=>{n===this.#r&&(t.hasAttribute(e)||(this.#n?.disconnect(),this.#n=null,a()))}),this.#n.observe(t,{attributes:!0,attributeFilter:[e]})})}#a(e){let t=()=>{e()};this.#e.afterTick?ps(t):t()}},Rs=class{#e;#t;#n;#r=N(!1);#i=N(void 0);#a=!1;#o=null;constructor(e){this.#e=e,P(this.#r,e.open.current,!0),this.#t=e.enabled??!0,this.#n=new Ls({ref:this.#e.ref,afterTick:this.#e.open}),ds(()=>this.#s()),ns(()=>this.#e.open.current,e=>{if(!this.#a){this.#a=!0;return}if(this.#s(),!e&&this.#e.shouldSkipExitAnimation?.()){P(this.#r,!1),P(this.#i,void 0),this.#e.onComplete?.();return}if(e&&P(this.#r,!0),P(this.#i,e?`starting`:`ending`,!0),e&&(this.#o=window.requestAnimationFrame(()=>{this.#o=null,this.#e.open.current&&P(this.#i,void 0)})),!this.#t){e||P(this.#r,!1),P(this.#i,void 0),this.#e.onComplete?.();return}this.#n.run(()=>{e===this.#e.open.current&&(this.#e.open.current||P(this.#r,!1),P(this.#i,void 0),this.#e.onComplete?.())})})}get shouldRender(){return H(this.#r)}get transitionStatus(){return H(this.#i)}#s(){this.#o!==null&&(window.cancelAnimationFrame(this.#o),this.#o=null)}};function $(){}function zs(e,t){return t===void 0?`bits-${e}`:`bits-${e}-${t}`}var Bs=js({component:`dialog`,parts:[`content`,`trigger`,`overlay`,`title`,`description`,`close`,`cancel`,`action`]}),Vs=new Qo(`Dialog.Root | AlertDialog.Root`),Hs=class e{static create(t){let n=Vs.getOr(null);return Vs.set(new e(t,n))}opts;#e=N(null);get triggerNode(){return H(this.#e)}set triggerNode(e){P(this.#e,e,!0)}#t=N(null);get contentNode(){return H(this.#t)}set contentNode(e){P(this.#t,e,!0)}#n=N(null);get overlayNode(){return H(this.#n)}set overlayNode(e){P(this.#n,e,!0)}#r=N(null);get descriptionNode(){return H(this.#r)}set descriptionNode(e){P(this.#r,e,!0)}#i=N(void 0);get contentId(){return H(this.#i)}set contentId(e){P(this.#i,e,!0)}#a=N(void 0);get titleId(){return H(this.#a)}set titleId(e){P(this.#a,e,!0)}#o=N(void 0);get triggerId(){return H(this.#o)}set triggerId(e){P(this.#o,e,!0)}#s=N(void 0);get descriptionId(){return H(this.#s)}set descriptionId(e){P(this.#s,e,!0)}#c=N(null);get cancelNode(){return H(this.#c)}set cancelNode(e){P(this.#c,e,!0)}#l=N(0);get nestedOpenCount(){return H(this.#l)}set nestedOpenCount(e){P(this.#l,e,!0)}depth;parent;contentPresence;overlayPresence;constructor(e,t){this.opts=e,this.parent=t,this.depth=t?t.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new Rs({ref:Q(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Rs({ref:Q(()=>this.overlayNode),open:this.opts.open,enabled:!0}),ns(()=>this.opts.open.current,e=>{this.parent&&(e?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),ds(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=e=>Bs.getAttr(e,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#u=j(()=>({"data-state":Os(this.opts.open.current)}));get sharedProps(){return H(this.#u)}set sharedProps(e){P(this.#u,e)}},Us=class e{static create(t){return new e(t,Vs.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Es(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),this.root.handleClose())}#e=j(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:``,onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return H(this.#e)}set props(e){P(this.#e,e)}},Ws=class e{static create(t){return new e(t,Vs.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.titleId=this.opts.id.current,this.attachment=Es(this.opts.ref),ns.pre(()=>this.opts.id.current,e=>{this.root.titleId=e})}#e=j(()=>({id:this.opts.id.current,role:`heading`,"aria-level":this.opts.level.current,[this.root.getBitsAttr(`title`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return H(this.#e)}set props(e){P(this.#e,e)}},Gs=class e{static create(t){return new e(t,Vs.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.descriptionId=this.opts.id.current,this.attachment=Es(this.opts.ref,e=>{this.root.descriptionNode=e}),ns.pre(()=>this.opts.id.current,e=>{this.root.descriptionId=e})}#e=j(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`description`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return H(this.#e)}set props(e){P(this.#e,e)}},Ks=class e{static create(t){return new e(t,Vs.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Es(this.opts.ref,e=>{this.root.contentNode=e,this.root.contentId=e?.id})}#e=j(()=>({open:this.root.opts.open.current}));get snippetProps(){return H(this.#e)}set snippetProps(e){P(this.#e,e)}#t=j(()=>({id:this.opts.id.current,role:this.root.opts.variant.current===`alert-dialog`?`alertdialog`:`dialog`,"aria-modal":`true`,"aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr(`content`)]:``,style:{pointerEvents:`auto`,outline:this.root.opts.variant.current===`alert-dialog`?`none`:void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:`layout style`},tabindex:this.root.opts.variant.current===`alert-dialog`?-1:void 0,"data-nested-open":Ds(this.root.nestedOpenCount>0),"data-nested":Ds(this.root.parent!==null),...ks(this.root.contentPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return H(this.#t)}set props(e){P(this.#t,e)}get shouldRender(){return this.root.contentPresence.shouldRender}},qs=class e{static create(t){return new e(t,Vs.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Es(this.opts.ref,e=>this.root.overlayNode=e)}#e=j(()=>({open:this.root.opts.open.current}));get snippetProps(){return H(this.#e)}set snippetProps(e){P(this.#e,e)}#t=j(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`overlay`)]:``,style:{pointerEvents:`auto`,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":Ds(this.root.nestedOpenCount>0),"data-nested":Ds(this.root.parent!==null),...ks(this.root.overlayPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return H(this.#t)}set props(e){P(this.#t,e)}get shouldRender(){return this.root.overlayPresence.shouldRender}},Js=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`level`]),Ys=U(`<div><!></div>`);function Xs(e,t){let n=oi();O(t,!0);let r=Y(t,`id`,19,()=>zs(n)),i=Y(t,`ref`,15,null),a=Y(t,`level`,3,2),o=ca(t,Js),s=Ws.create({id:Q(()=>r()),level:Q(()=>a()),ref:Q(()=>i(),e=>i(e))}),c=j(()=>Jo(o,s.props));var l=W(),u=I(l),d=e=>{var n=W();J(I(n),()=>t.child,()=>({props:H(c)})),G(e,n)},p=e=>{var n=Ys();ea(n,()=>({...H(c)})),J(F(n),()=>t.children??f),E(n),G(e,n)};q(u,e=>{t.child?e(d):e(p,-1)}),G(e,l),k()}function Zs(e,t){var n=W();mi(I(n),()=>t.children,e=>{var n=W();J(I(n),()=>t.children??f),G(e,n)}),G(e,n)}var Qs=new Qo(`BitsConfig`);function $s(){let e=new ec(null,{});return Qs.getOr(e).opts}var ec=class{opts;constructor(e,t){let n=tc(e,t);this.opts={defaultPortalTo:n(e=>e.defaultPortalTo),defaultLocale:n(e=>e.defaultLocale)}}};function tc(e,t){return n=>Q(()=>{let r=n(t)?.current;if(r!==void 0)return r;if(e!==null)return n(e.opts)?.current})}function nc(e,t){return n=>{let r=$s();return Q(()=>{let i=n();if(i!==void 0)return i;let a=e(r).current;return a===void 0?t:a})}}var rc=nc(e=>e.defaultPortalTo,`body`);function ic(e,t){O(t,!0);let n=rc(()=>t.to),r=nt(),i=j(a);function a(){if(!Ms||t.disabled)return null;let e=null;return e=typeof n.current==`string`?document.querySelector(n.current):n.current,e}let o;function s(){o&&=(di(o),null)}ns([()=>H(i),()=>t.disabled],([e,n])=>{if(!e||n){s();return}return o=si(Zs,{target:e,props:{children:t.children},context:r}),()=>{s()}});var c=W(),l=I(c),u=e=>{var n=W();J(I(n),()=>t.children??f),G(e,n)};q(l,e=>{t.disabled&&e(u)}),G(e,c),k()}var ac=class{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){let n=this.createEvent(t);return e.dispatchEvent(n),n}listen(e,t,n){return Jr(e,this.eventName,e=>{t(e)},n)}};function oc(e,t=500){let n=null,r=(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function sc(e,t){return e===t||e.contains(t)}function cc(e){return e?.ownerDocument??document}function lc(e,t){let{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}var uc=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],dc=uc.join(`,`),fc=typeof Element>`u`,pc=fc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,mc=!fc&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},hc=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):hc(e.parentNode))},gc=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},_c=function(e,t,n){if(hc(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(dc));return t&&pc.call(e,dc)&&r.unshift(e),r=r.filter(n),r},vc=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!hc(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=vc(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{pc.call(a,dc)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!hc(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=vc(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},yc=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},bc=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||gc(e))&&!yc(e)?0:e.tabIndex},xc=function(e,t){var n=bc(e);return n<0&&t&&!yc(e)?0:n},Sc=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Cc=function(e){return e.tagName===`INPUT`},wc=function(e){return Cc(e)&&e.type===`hidden`},Tc=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Ec=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Dc=function(e){if(!e.name)return!0;var t=e.form||mc(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Ec(r,e.form);return!i||i===e},Oc=function(e){return Cc(e)&&e.type===`radio`},kc=function(e){return Oc(e)&&!Dc(e)},Ac=function(e){var t=e&&mc(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=mc(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},jc=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Mc=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=pc.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(pc.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=mc(e);if(o&&!o.shadowRoot&&r(o)===!0)return jc(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Ac(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return jc(e);return!1},Nc=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return pc.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Pc=function(e,t){return!(t.disabled||wc(t)||Mc(t,e)||Tc(t)||Nc(t))},Fc=function(e,t){return!(kc(t)||bc(t)<0||!Pc(e,t))},Ic=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Lc=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=xc(a,i),s=i?Lc(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Sc).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Rc=function(e,t){return t||={},Lc(t.getShadowRoot?vc([e],t.includeContainer,{filter:Fc.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ic}):_c(e,t.includeContainer,Fc.bind(null,t)))},zc=function(e,t){return t||={},t.getShadowRoot?vc([e],t.includeContainer,{filter:Pc.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):_c(e,t.includeContainer,Pc.bind(null,t))},Bc=uc.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),Vc=function(e,t){if(t||={},!e)throw Error(`No node provided`);return pc.call(e,Bc)===!1?!1:Pc(t,e)},Hc=`data-context-menu-trigger`,Uc=`data-context-menu-content`;new Qo(`Menu.Root`),new Qo(`Menu.Root | Menu.Sub`),new Qo(`Menu.Content`),new Qo(`Menu.Group | Menu.RadioGroup`),new Qo(`Menu.RadioGroup`),new Qo(`Menu.CheckboxGroup`),new ac(`bitsmenuopen`,{bubbles:!1,cancelable:!0}),js({component:`menu`,parts:[`trigger`,`content`,`sub-trigger`,`item`,`group`,`group-heading`,`checkbox-group`,`checkbox-item`,`radio-group`,`radio-item`,`separator`,`sub-content`,`arrow`]}),globalThis.bitsDismissableLayers??=new Map;var Wc=class e{static create(t){return new e(t)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#i=!1;#a=void 0;#o;#s=$;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#o=e.onFocusOutside,Rn(()=>{this.#a=cc(this.opts.ref.current)});let t=$,n=()=>{this.#g(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),t()};ns([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return fs(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),t(),t=this.#l())}),n}),ds(()=>{this.#g.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),t()})}#c=e=>{e.defaultPrevented||this.opts.ref.current&&ps(()=>{!this.opts.ref.current||this.#h(e.target)||e.target&&!this.#i&&this.#o.current?.(e)})};#l(){return Vo(Jr(this.#a,`pointerdown`,Vo(this.#f,this.#m),{capture:!0}),Jr(this.#a,`pointerdown`,Vo(this.#p,this.#d)),Jr(this.#a,`focusin`,this.#c))}#u=e=>{let t=e;t.defaultPrevented&&(t=Jc(e)),this.#e.current(e)};#d=oc(e=>{if(!this.opts.ref.current){this.#s();return}let t=this.opts.isValidEvent.current(e,this.opts.ref.current)||qc(e,this.opts.ref.current);if(!this.#r||this.#_()||!t){this.#s();return}let n=e;if(n.defaultPrevented&&(n=Jc(n)),this.#t.current!==`close`&&this.#t.current!==`defer-otherwise-close`){this.#s();return}e.pointerType===`touch`?(this.#s(),this.#s=Jr(this.#a,`click`,this.#u,{once:!0})):this.#e.current(n)},10);#f=e=>{this.#n[e.type]=!0};#p=e=>{this.#n[e.type]=!1};#m=()=>{this.opts.ref.current&&(this.#r=Kc(this.opts.ref.current))};#h=e=>this.opts.ref.current?sc(this.opts.ref.current,e):!1;#g=oc(()=>{for(let e in this.#n)this.#n[e]=!1;this.#r=!1},20);#_(){return Object.values(this.#n).some(Boolean)}#v=()=>{this.#i=!0};#y=()=>{this.#i=!1};props={onfocuscapture:this.#v,onblurcapture:this.#y}};function Gc(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([e,{current:t}])=>t===`close`||t===`ignore`)}function Kc(e){let t=[...globalThis.bitsDismissableLayers],n=Gc(t);if(n)return n[0].opts.ref.current===e;let[r]=t[0];return r.opts.ref.current===e}function qc(e,t){let n=e.target;if(!Is(n))return!1;let r=!!n.closest(`[${Hc}]`),i=!!t.closest(`[${Uc}]`);return`button`in e&&e.button>0&&!r?!1:`button`in e&&e.button===0&&r&&i?!0:r&&i?!1:cc(n).documentElement.contains(n)&&!sc(t,n)&&lc(e,t)}function Jc(e){let t=e.currentTarget,n=e.target,r;r=e instanceof PointerEvent?new PointerEvent(e.type,e):new PointerEvent(`pointerdown`,e);let i=!1;return new Proxy(r,{get:(r,a)=>a===`currentTarget`?t:a===`target`?n:a===`preventDefault`?()=>{i=!0,typeof r.preventDefault==`function`&&r.preventDefault()}:a===`defaultPrevented`?i:a in r?r[a]:e[a]})}function Yc(e,t){O(t,!0);let n=Y(t,`interactOutsideBehavior`,3,`close`),r=Y(t,`onInteractOutside`,3,$),i=Y(t,`onFocusOutside`,3,$),a=Y(t,`isValidEvent`,3,()=>!1),o=Wc.create({id:Q(()=>t.id),interactOutsideBehavior:Q(()=>n()),onInteractOutside:Q(()=>r()),enabled:Q(()=>t.enabled),onFocusOutside:Q(()=>i()),isValidEvent:Q(()=>a()),ref:t.ref});var s=W();J(I(s),()=>t.children??f,()=>({props:o.props})),G(e,s),k()}globalThis.bitsEscapeLayers??=new Map;var Xc=class e{static create(t){return new e(t)}opts;domContext;constructor(e){this.opts=e,this.domContext=new Ts(this.opts.ref);let t=$;ns(()=>e.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>Jr(this.domContext.getDocument(),`keydown`,this.#t,{passive:!1});#t=e=>{if(e.key!==`Escape`||!Zc(this))return;let t=new KeyboardEvent(e.type,e);e.preventDefault();let n=this.opts.escapeKeydownBehavior.current;n!==`close`&&n!==`defer-otherwise-close`||this.opts.onEscapeKeydown.current(t)}};function Zc(e){let t=[...globalThis.bitsEscapeLayers],n=t.findLast(([e,{current:t}])=>t===`close`||t===`ignore`);if(n)return n[0]===e;let[r]=t[0];return r===e}function Qc(e,t){O(t,!0);let n=Y(t,`escapeKeydownBehavior`,3,`close`),r=Y(t,`onEscapeKeydown`,3,$);Xc.create({escapeKeydownBehavior:Q(()=>n()),onEscapeKeydown:Q(()=>r()),enabled:Q(()=>t.enabled),ref:t.ref});var i=W();J(I(i),()=>t.children??f),G(e,i),k()}var $c=class e{static instance;#e=po([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||=new e,this.instance}register(e){let t=this.getActive();t&&t!==e&&t.pause();let n=document.activeElement;n&&n!==document.body&&this.#n.set(e,n),this.#e.current=this.#e.current.filter(t=>t!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(t=>t!==e);let t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,t){this.#n.set(e,t)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}},el=class e{#e=!1;#t=null;#n=$c.getInstance();#r=[];#i;constructor(e){this.#i=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#a(){for(let e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#c(),this.#o()}unmount(){this.#t&&=(this.#a(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),null)}#o(){if(!this.#t)return;let e=new CustomEvent(`focusScope.onOpenAutoFocus`,{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;let e=this.#u();e?(e.focus(),this.#n.setFocusMemory(this,e)):this.#t.focus()})}#s(){let e=new CustomEvent(`focusScope.onCloseAutoFocus`,{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(e),!e.defaultPrevented){let e=this.#n.getPreFocusMemory(this);if(e&&document.contains(e))try{e.focus()}catch{document.body.focus()}}}#c(){if(!this.#t||!this.#i.trap.current)return;let e=this.#t,t=e.ownerDocument;this.#r.push(Jr(t,`focusin`,t=>{if(this.#e||!this.#n.isActiveScope(this))return;let n=t.target;if(n)if(e.contains(n))this.#n.setFocusMemory(this,n);else{let n=this.#n.getFocusMemory(this);if(n&&e.contains(n)&&Vc(n))t.preventDefault(),n.focus();else{let t=this.#u(),n=this.#d()[0];(t||n||e).focus()}}},{capture:!0}),Jr(e,`keydown`,e=>{if(!this.#i.loop||this.#e||e.key!==`Tab`||!this.#n.isActiveScope(this))return;let n=this.#l();if(n.length===0)return;let r=n[0],i=n[n.length-1];!e.shiftKey&&t.activeElement===i?(e.preventDefault(),r.focus()):e.shiftKey&&t.activeElement===r&&(e.preventDefault(),i.focus())}));let n=new MutationObserver(()=>{let t=this.#n.getFocusMemory(this);if(t&&!e.contains(t)){let t=this.#u(),n=this.#d()[0],r=t||n;r?(r.focus(),this.#n.setFocusMemory(this,r)):e.focus()}});n.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>n.disconnect())}#l(){return this.#t?Rc(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#l()[0]||null}#d(){return this.#t?zc(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return ns([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||=new e(t),n.mount(r)):n&&=(n.unmount(),null)}),ds(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}};function tl(e,t){O(t,!0);let n=Y(t,`enabled`,3,!1),r=Y(t,`trapFocus`,3,!1),i=Y(t,`loop`,3,!1),a=Y(t,`onCloseAutoFocus`,3,$),o=Y(t,`onOpenAutoFocus`,3,$),s=el.use({enabled:Q(()=>n()),trap:Q(()=>r()),loop:i(),onCloseAutoFocus:Q(()=>a()),onOpenAutoFocus:Q(()=>o()),ref:t.ref});var c=W();J(I(c),()=>t.focusScope??f,()=>({props:s.props})),G(e,c),k()}var nl=()=>{};globalThis.bitsTextSelectionLayers??=new Map;var rl=class e{static create(t){return new e(t)}opts;domContext;#e=$;#t=!1;#n=nl;#r=nl;constructor(e){this.opts=e,this.domContext=new Ts(e.ref);let t=$;ns(()=>[this.opts.enabled.current,this.opts.onPointerDown.current,this.opts.onPointerUp.current],([e,n,r])=>(this.#t=e,this.#n=n,this.#r=r,e&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#i()),()=>{this.#t=!1,t(),this.#s(),globalThis.bitsTextSelectionLayers.delete(this)}))}#i(){return Vo(Jr(this.domContext.getDocument(),`pointerdown`,this.#o),Jr(this.domContext.getDocument(),`pointerup`,mo(this.#s,this.#a)))}#a=e=>{this.#r(e)};#o=e=>{let t=this.opts.ref.current,n=e.target;!Fs(t)||!Fs(n)||!this.#t||!sl(this)||!Ss(t,n)||(this.#n(e),!e.defaultPrevented&&(this.#e=al(t,this.domContext.getDocument().body)))};#s=()=>{this.#e(),this.#e=$}},il=e=>e.style.userSelect||e.style.webkitUserSelect;function al(e,t){let n=il(t),r=il(e);return ol(t,`none`),ol(e,`text`),()=>{ol(t,n),ol(e,r)}}function ol(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function sl(e){let t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;let n=t.at(-1);return n?n[0]===e:!1}function cl(e,t){O(t,!0);let n=Y(t,`preventOverflowTextSelection`,3,!0),r=Y(t,`onPointerDown`,3,$),i=Y(t,`onPointerUp`,3,$);rl.create({id:Q(()=>t.id),onPointerDown:Q(()=>r()),onPointerUp:Q(()=>i()),enabled:Q(()=>t.enabled&&n()),ref:t.ref});var a=W();J(I(a),()=>t.children??f),G(e,a),k()}globalThis.bitsIdCounter??={current:0};function ll(e=`bits`){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}var ul=class{#e;#t=0;#n=N();#r;constructor(e){this.#e=e}#i(){--this.#t,this.#r&&this.#t<=0&&(this.#r(),P(this.#n,void 0),this.#r=void 0)}get(...e){return this.#t+=1,H(this.#n)===void 0&&(this.#r=Vn(()=>{P(this.#n,this.#e(...e),!0)})),Rn(()=>()=>{this.#i()}),H(this.#n)}},dl=new Zo,fl=N(null),pl=null,ml=null,hl=!1,gl=Q(()=>{for(let e of dl.values())if(e)return!0;return!1}),_l=null,vl=new ul(()=>{function e(){document.body.setAttribute(`style`,H(fl)??``),document.body.style.removeProperty(`--scrollbar-width`),Ns&&pl?.(),P(fl,null)}function t(){ml!==null&&(window.clearTimeout(ml),ml=null)}function n(e,n){t(),hl=!0,_l=Date.now();let r=_l,i=()=>{ml=null,_l===r&&(bl(dl)?hl=!1:(hl=!1,n()))},a=e===null?24:e;ml=window.setTimeout(i,a)}function r(){H(fl)===null&&dl.size===0&&!hl&&P(fl,document.body.getAttribute(`style`),!0)}return ns(()=>gl.current,()=>{if(!gl.current)return;r(),hl=!1;let e=getComputedStyle(document.documentElement),t=getComputedStyle(document.body),n=e.scrollbarGutter?.includes(`stable`)||t.scrollbarGutter?.includes(`stable`),i=window.innerWidth-document.documentElement.clientWidth,a={padding:Number.parseInt(t.paddingRight??`0`,10)+i,margin:Number.parseInt(t.marginRight??`0`,10)};i>0&&!n&&(document.body.style.paddingRight=`${a.padding}px`,document.body.style.marginRight=`${a.margin}px`,document.body.style.setProperty(`--scrollbar-width`,`${i}px`)),document.body.style.overflow=`hidden`,Ns&&(pl=Jr(document,`touchmove`,e=>{e.target===document.documentElement&&(e.touches.length>1||e.preventDefault())},{passive:!1})),ps(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})}),ds(()=>()=>{pl?.()}),{get lockMap(){return dl},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}}),yl=class{#e=ll();#t;#n=()=>null;#r;locked;constructor(e,t=()=>null){this.#t=e,this.#n=t,this.#r=vl.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=Q(()=>this.#r.lockMap.get(this.#e)??!1,e=>this.#r.lockMap.set(this.#e,e)),ds(()=>{if(this.#r.lockMap.delete(this.#e),bl(this.#r.lockMap))return;let e=this.#n();this.#r.scheduleCleanupIfNoNewLocks(e,()=>{this.#r.resetBodyStyle()})}))}};function bl(e){for(let[t,n]of e)if(n)return!0;return!1}function xl(e,t){O(t,!0);let n=Y(t,`preventScroll`,3,!0),r=Y(t,`restoreScrollDelay`,3,null);n()&&new yl(n(),()=>r()),k()}var Sl=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`forceMount`,`child`,`children`,`ref`]),Cl=U(`<div><!></div>`);function wl(e,t){let n=oi();O(t,!0);let r=Y(t,`id`,19,()=>zs(n)),i=Y(t,`forceMount`,3,!1),a=Y(t,`ref`,15,null),o=ca(t,Sl),s=qs.create({id:Q(()=>r()),ref:Q(()=>a(),e=>a(e))}),c=j(()=>Jo(o,s.props));var l=W(),u=I(l),d=e=>{var n=W(),r=I(n),i=e=>{var n=W(),r=I(n);{let e=j(()=>({props:Jo(H(c)),...s.snippetProps}));J(r,()=>t.child,()=>H(e))}G(e,n)},a=e=>{var n=Cl();ea(n,e=>({...e}),[()=>Jo(H(c))]),J(F(n),()=>t.children??f,()=>s.snippetProps),E(n),G(e,n)};q(r,e=>{t.child?e(i):e(a,-1)}),G(e,n)};q(u,e=>{(s.shouldRender||i())&&e(d)}),G(e,l),k()}var Tl=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`]),El=U(`<div><!></div>`);function Dl(e,t){let n=oi();O(t,!0);let r=Y(t,`id`,19,()=>zs(n)),i=Y(t,`ref`,15,null),a=ca(t,Tl),o=Gs.create({id:Q(()=>r()),ref:Q(()=>i(),e=>i(e))}),s=j(()=>Jo(a,o.props));var c=W(),l=I(c),u=e=>{var n=W();J(I(n),()=>t.child,()=>({props:H(s)})),G(e,n)},d=e=>{var n=El();ea(n,()=>({...H(s)})),J(F(n),()=>t.children??f),E(n),G(e,n)};q(l,e=>{t.child?e(u):e(d,-1)}),G(e,c),k()}function Ol(e,t){O(t,!0);let n=Y(t,`open`,15,!1),r=Y(t,`onOpenChange`,3,$),i=Y(t,`onOpenChangeComplete`,3,$);Hs.create({variant:Q(()=>`dialog`),open:Q(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:Q(()=>i())});var a=W();J(I(a),()=>t.children??f),G(e,a),k()}var kl=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`disabled`]),Al=U(`<button><!></button>`);function jl(e,t){let n=oi();O(t,!0);let r=Y(t,`id`,19,()=>zs(n)),i=Y(t,`ref`,15,null),a=Y(t,`disabled`,3,!1),o=ca(t,kl),s=Us.create({variant:Q(()=>`close`),id:Q(()=>r()),ref:Q(()=>i(),e=>i(e)),disabled:Q(()=>!!a())}),c=j(()=>Jo(o,s.props));var l=W(),u=I(l),d=e=>{var n=W();J(I(n),()=>t.child,()=>({props:H(c)})),G(e,n)},p=e=>{var n=Al();ea(n,()=>({...H(c)})),J(F(n),()=>t.children??f),E(n),G(e,n)};q(u,e=>{t.child?e(d):e(p,-1)}),G(e,l),k()}var Ml=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`,`forceMount`,`onCloseAutoFocus`,`onOpenAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`restoreScrollDelay`]),Nl=U(`<!> <!>`,1),Pl=U(`<!> <div><!></div>`,1);function Fl(e,t){let n=oi();O(t,!0);let r=Y(t,`id`,19,()=>zs(n)),i=Y(t,`ref`,15,null),a=Y(t,`forceMount`,3,!1),o=Y(t,`onCloseAutoFocus`,3,$),s=Y(t,`onOpenAutoFocus`,3,$),c=Y(t,`onEscapeKeydown`,3,$),l=Y(t,`onInteractOutside`,3,$),u=Y(t,`trapFocus`,3,!0),d=Y(t,`preventScroll`,3,!0),p=Y(t,`restoreScrollDelay`,3,null),m=ca(t,Ml),h=Ks.create({id:Q(()=>r()),ref:Q(()=>i(),e=>i(e))}),g=j(()=>Jo(m,h.props));var _=W(),v=I(_),y=e=>{tl(e,{get ref(){return h.opts.ref},loop:!0,get trapFocus(){return u()},get enabled(){return h.root.opts.open.current},get onOpenAutoFocus(){return s()},get onCloseAutoFocus(){return o()},focusScope:(e,n)=>{let r=()=>n?.().props;Qc(e,ua(()=>H(g),{get enabled(){return h.root.opts.open.current},get ref(){return h.opts.ref},onEscapeKeydown:e=>{c()(e),!e.defaultPrevented&&h.root.handleClose()},children:(e,n)=>{Yc(e,ua(()=>H(g),{get ref(){return h.opts.ref},get enabled(){return h.root.opts.open.current},onInteractOutside:e=>{l()(e),!e.defaultPrevented&&h.root.handleClose()},children:(e,n)=>{cl(e,ua(()=>H(g),{get ref(){return h.opts.ref},get enabled(){return h.root.opts.open.current},children:(e,n)=>{var i=W(),a=I(i),o=e=>{var n=Nl(),i=I(n),a=e=>{xl(e,{get preventScroll(){return d()},get restoreScrollDelay(){return p()}})};q(i,e=>{h.root.opts.open.current&&e(a)});var o=L(i,2);{let e=j(()=>({props:Jo(H(g),r()),...h.snippetProps}));J(o,()=>t.child,()=>H(e))}G(e,n)},s=e=>{var n=Pl(),i=I(n);xl(i,{get preventScroll(){return d()}});var a=L(i,2);ea(a,e=>({...e}),[()=>Jo(H(g),r())]),J(F(a),()=>t.children??f),E(a),G(e,n)};q(a,e=>{t.child?e(o):e(s,-1)}),G(e,i)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};q(v,e=>{(h.shouldRender||a())&&e(y)}),G(e,_),k()}var Il=U(`<button class="flex flex-col gap-1 text-left"><div class="flex items-center gap-2 font-mono text-sm"><span class="size-2 shrink-0 rounded-sm"></span> <span class="flex-1 truncate text-foreground"> </span> <span class="tabular-nums text-muted-foreground"> </span></div> <div class="h-1 overflow-hidden rounded-full bg-border"><div class="h-full"></div></div></button>`),Ll=U(`<div class="text-sm text-muted-foreground">No projects tracked yet \u2014 run <code class="text-foreground">syn .</code></div>`),Rl=U(`<div class="flex max-h-[260px] flex-col gap-2 overflow-y-auto pr-1"></div>`),zl=U(`<div class="flex flex-col gap-0.5 bg-card p-3"><span class="font-mono text-[10px] uppercase tracking-[0.1em] text-muted-foreground"> </span> <span class="font-mono text-sm text-foreground"> </span></div>`),Bl=U(`<!> <!> <div class="mt-4 grid grid-cols-2 gap-px overflow-hidden rounded-lg border bg-border"></div> <!>`,1),Vl=U(`<!> <!>`,1);function Hl(e,t){O(t,!0);let n=N(!1),r=N(null),i=j(()=>X.data?.projects??[]),a=j(()=>Math.max(1,...H(i).map(e=>e.total_turns)));function o(e){let t=(X.data?.recent_turns??[]).find(t=>t.project_path===e.path);return t?ma(t.ts):e.last_seen?ma(e.last_seen):`\u2014`}function s(e){return[[`Cost`,pa(e.estimated_cost_usd)],[`Turns`,Z(e.total_turns)],[`Input`,Z(e.total_input_tokens)],[`Output`,Z(e.total_output_tokens)],[`Cache R`,Z(e.total_cache_read)],[`Cache W`,Z(e.total_cache_create)],[`Blocks`,Z(e.blocked_count)],[`Last active`,o(e)]]}var c=Vl(),l=I(c);Xa(l,{title:`Projects`,meta:`by turns`,children:(e,t)=>{var o=Rl();yi(o,21,()=>H(i),e=>e.path,(e,t)=>{var i=Il(),o=F(i),s=F(o),c=L(s,2),l=F(c,!0);E(c);var u=L(c,2),d=F(u,!0);E(u),E(o);var f=L(o,2),p=F(f);E(f),E(i),R((e,n,r)=>{Ri(s,e),K(l,H(t).name),K(d,n),Ri(p,r)},[()=>`background:${ya(H(t).name)}`,()=>Z(H(t).total_turns),()=>`width:${H(t).total_turns/H(a)*100}%; background:${ya(H(t).name)}`]),Yr(`click`,i,()=>{P(r,H(t),!0),P(n,!0)}),G(e,i)},e=>{G(e,Ll())}),E(o),G(e,o)},$$slots:{default:!0}}),Ti(L(l,2),()=>Ol,(e,t)=>{t(e,{get open(){return H(n)},set open(e){P(n,e,!0)},children:(e,t)=>{var n=W();Ti(I(n),()=>ic,(e,t)=>{t(e,{children:(e,t)=>{var n=Vl(),i=I(n);Ti(i,()=>wl,(e,t)=>{t(e,{class:`fixed inset-0 z-50 bg-black/60`})}),Ti(L(i,2),()=>Fl,(e,t)=>{t(e,{class:`fixed left-1/2 top-1/2 z-50 w-[min(440px,92vw)] -translate-x-1/2 -translate-y-1/2 rounded-xl border bg-card p-5 text-card-foreground shadow-2xl`,children:(e,t)=>{var n=W(),i=I(n),a=e=>{var t=Bl(),n=I(t);{let e=j(()=>`color:${ya(H(r).name)}`);Ti(n,()=>Xs,(t,n)=>{n(t,{class:`font-serif text-xl`,get style(){return H(e)},children:(e,t)=>{Ue();var n=ai();R(()=>K(n,H(r).name)),G(e,n)},$$slots:{default:!0}})})}var i=L(n,2);Ti(i,()=>Dl,(e,t)=>{t(e,{class:`truncate font-mono text-xs text-muted-foreground`,children:(e,t)=>{Ue();var n=ai();R(()=>K(n,H(r).path)),G(e,n)},$$slots:{default:!0}})});var a=L(i,2);yi(a,21,()=>s(H(r)),([e,t])=>e,(e,t)=>{var n=j(()=>h(H(t),2));let r=()=>H(n)[0],i=()=>H(n)[1];var a=zl(),o=F(a),s=F(o,!0);E(o);var c=L(o,2),l=F(c,!0);E(c),E(a),R(()=>{K(s,r()),K(l,i())}),G(e,a)}),E(a),Ti(L(a,2),()=>jl,(e,t)=>{t(e,{class:`mt-4 w-full rounded-md border py-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:(e,t)=>{Ue(),G(e,ai(`Close`))},$$slots:{default:!0}})}),G(e,t)};q(i,e=>{H(r)&&e(a)}),G(e,n)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,c),k()}Xr([`click`]);var Ul=U(`<div class="flex items-baseline justify-between font-mono text-sm"><span class="text-muted-foreground"> </span> <span class="tabular-nums text-foreground"> </span></div>`),Wl=U(`<div class="text-sm text-muted-foreground">No graph-tool calls yet.</div>`),Gl=U(`<div class="font-mono text-2xl text-foreground"> <span class="text-sm text-muted-foreground">calls</span></div> <div class="flex flex-col gap-1.5"></div>`,1);function Kl(e,t){O(t,!0);let n=j(()=>{let e=X.data?.global?.tool_calls??{};return Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,8)}),r=j(()=>X.data?.global?.total_tool_calls??0);Xa(e,{title:`Graph tools used`,meta:`all projects`,children:(e,t)=>{var i=Gl(),a=I(i),o=F(a);Ue(),E(a);var s=L(a,2);yi(s,21,()=>H(n),([e,t])=>e,(e,t)=>{var n=j(()=>h(H(t),2));let r=()=>H(n)[0],i=()=>H(n)[1];var a=Ul(),o=F(a),s=F(o,!0);E(o);var c=L(o,2),l=F(c,!0);E(c),E(a),R(()=>{K(s,r()),K(l,i())}),G(e,a)},e=>{G(e,Wl())}),E(s),R(e=>K(o,`${e??``} `),[()=>Z(H(r))]),G(e,i)},$$slots:{default:!0}}),k()}var ql=U(`<tr class="border-t border-border/60"><td class="py-1.5 pr-2 text-muted-foreground"> </td><td class="max-w-[120px] truncate py-1.5 pr-2 text-foreground"> </td><td class="py-1.5 pr-2"><span class="inline-flex items-center gap-1.5 rounded px-1.5 py-0.5"><span class="size-1.5 rounded-sm"></span> </span></td><td class="py-1.5 pr-2 text-right tabular-nums text-foreground"> </td><td class="py-1.5 pr-2 text-right tabular-nums text-foreground"> </td><td class="py-1.5 pr-2 text-right tabular-nums text-muted-foreground"> </td><td class="py-1.5 text-right tabular-nums text-[var(--money)]"> </td></tr>`),Jl=U(`<tr><td colspan="7" class="py-6 text-center text-muted-foreground">No turns recorded yet.</td></tr>`),Yl=U(`<div class="flex items-center justify-end gap-3 pt-1 font-mono text-sm text-muted-foreground"><button class="rounded border px-2 py-1 disabled:opacity-40 enabled:hover:text-foreground">\u2039 Prev</button> <span> </span> <button class="rounded border px-2 py-1 disabled:opacity-40 enabled:hover:text-foreground">Next \u203A</button></div>`),Xl=U(`<div class="min-h-0 flex-1 overflow-x-auto"><table class="w-full border-collapse font-mono text-sm"><thead><tr class="text-left text-[10px] uppercase tracking-[0.1em] text-muted-foreground"><th class="py-1.5 pr-2 font-medium">Time</th><th class="py-1.5 pr-2 font-medium">Project</th><th class="py-1.5 pr-2 font-medium">Model</th><th class="py-1.5 pr-2 text-right font-medium">In</th><th class="py-1.5 pr-2 text-right font-medium">Out</th><th class="py-1.5 pr-2 text-right font-medium">Cache R/W</th><th class="py-1.5 text-right font-medium">Cost</th></tr></thead><tbody></tbody></table></div> <!>`,1);function Zl(e,t){O(t,!0);let n=N(1),r=j(()=>X.data?.recent_turns??[]),i=j(()=>Math.max(1,Math.ceil(H(r).length/25)));Rn(()=>{H(n)>H(i)&&P(n,H(i),!0)});let a=j(()=>H(r).slice((H(n)-1)*25,(H(n)-1)*25+25)),o=j(()=>H(r).length?(H(n)-1)*25+1:0),s=j(()=>Math.min(H(n)*25,H(r).length));{let t=j(()=>`showing ${H(o)}\u2013${H(s)} of ${H(r).length}`);Xa(e,{title:`Recent turns`,get meta(){return H(t)},children:(e,t)=>{var r=Xl(),o=I(r),s=F(o),c=L(F(s));yi(c,21,()=>H(a),e=>e.ts+e.project_path+e.model,(e,t)=>{var n=ql(),r=F(n),i=F(r,!0);E(r);var a=L(r),o=F(a,!0);E(a);var s=L(a),c=F(s),l=F(c),u=L(l);E(c),E(s);var d=L(s),f=F(d,!0);E(d);var p=L(d),m=F(p,!0);E(p);var h=L(p),g=F(h);E(h);var _=L(h),v=F(_,!0);E(_),E(n),R((e,n,r,s,d,p,h,_,y)=>{K(i,e),Qi(a,`title`,H(t).project_name),K(o,H(t).project_name),Ri(c,n),Ri(l,r),K(u,` ${s??``}`),K(f,d),K(m,p),K(g,`${h??``} / ${_??``}`),K(v,y)},[()=>ma(H(t).ts),()=>`color: var(--c-${ha(H(t).model)})`,()=>`background: var(--c-${ha(H(t).model)})`,()=>ga(H(t).model),()=>Z(H(t).input),()=>Z(H(t).output),()=>Z(H(t).cache_read),()=>Z(H(t).cache_create),()=>pa(H(t).cost_usd)]),G(e,n)},e=>{G(e,Jl())}),E(c),E(s),E(o);var l=L(o,2),u=e=>{var t=Yl(),r=F(t),a=L(r,2),o=F(a);E(a);var s=L(a,2);E(t),R(()=>{r.disabled=H(n)<=1,K(o,`page ${H(n)??``} of ${H(i)??``}`),s.disabled=H(n)>=H(i)}),Yr(`click`,r,()=>P(n,Math.max(1,H(n)-1),!0)),Yr(`click`,s,()=>P(n,Math.min(H(i),H(n)+1),!0)),G(e,t)};q(l,e=>{H(i)>1&&e(u)}),G(e,r)},$$slots:{default:!0}})}k()}Xr([`click`]);var Ql=U(`<div class="font-mono text-xs text-muted-foreground" title="Codebase exploration via the terminal (rg / cat / find) \u2014 observe-only, not yet blocked"> <span> </span></div>`),$l=U(`<div class="flex items-baseline gap-2 font-mono text-xs"><span class="shrink-0 text-muted-foreground"> </span> <span> </span> <span class="truncate text-foreground/80"> </span></div>`),eu=U(`<div class="text-sm text-muted-foreground">No gate decisions yet.</div>`),tu=U(`<div class="mt-2 border-t border-border pt-2 text-[10px] uppercase tracking-wide text-muted-foreground">Terminal hunts (observe-only)</div> <!>`,1),nu=U(`<div class="font-mono text-2xl text-foreground"> <span class="text-sm text-muted-foreground">blocks</span></div> <!> <div class="flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto"><!> <!></div>`,1);function ru(e,t){O(t,!0);let n=j(()=>(X.data?.recent_gates??[]).slice(0,50)),r=j(()=>X.data?.global?.blocked_count??0),i=j(()=>X.data?.global?.bash_explorations??0),a=j(()=>X.data?.global?.bash_avoidable??0),o=j(()=>(X.data?.recent_bash??[]).slice(0,12));Xa(e,{title:`The Moat`,meta:`PreToolUse`,children:(e,t)=>{var s=nu(),c=I(s),l=F(c);Ue(),E(c);var u=L(c,2),d=e=>{var t=Ql(),n=F(t),r=L(n),o=F(r);E(r),E(t),R((e,t)=>{K(n,`\u21B3 ${e??``} terminal hunts \xB7 `),Ii(r,1,Ai(H(a)>0?`text-destructive`:``)),K(o,`${t??``} the graph could answer`)},[()=>Z(H(i)),()=>Z(H(a))]),G(e,t)};q(u,e=>{H(i)>0&&e(d)});var f=L(u,2),p=F(f);yi(p,17,()=>H(n),e=>e.ts+e.query,(e,t)=>{var n=$l(),r=F(n),i=F(r,!0);E(r);var a=L(r,2),o=F(a,!0);E(a);var s=L(a,2),c=F(s,!0);E(s),E(n),R(e=>{K(i,e),Ii(a,1,`shrink-0 rounded px-1 text-[10px] uppercase `+(H(t).decision===`block`?`bg-destructive/15 text-destructive`:`bg-[var(--c-fable)]/12 text-[var(--c-fable)]`)),K(o,H(t).decision),Qi(s,`title`,H(t).query??``),K(c,H(t).query??`\u2014`)},[()=>ma(H(t).ts)]),G(e,n)},e=>{G(e,eu())});var m=L(p,2),h=e=>{var t=tu();yi(L(I(t),2),17,()=>H(o),e=>e.ts+e.query,(e,t)=>{var n=$l(),r=F(n),i=F(r,!0);E(r);var a=L(r,2),o=F(a,!0);E(a);var s=L(a,2),c=F(s,!0);E(s),E(n),R(e=>{K(i,e),Ii(a,1,`shrink-0 rounded px-1 text-[10px] uppercase `+(H(t).avoidable?`bg-destructive/15 text-destructive`:`bg-muted text-muted-foreground`)),K(o,H(t).tool),Qi(s,`title`,H(t).query??``),K(c,H(t).query??`\u2014`)},[()=>ma(H(t).ts)]),G(e,n)}),G(e,t)};q(m,e=>{H(o).length>0&&e(h)}),E(f),R(e=>K(l,`${e??``} `),[()=>Z(H(r))]),G(e,s)},$$slots:{default:!0}}),k()}var iu=U(`<div class="flex items-baseline justify-between gap-3 font-mono text-sm"><span class="truncate text-muted-foreground"> </span> <span class="tabular-nums text-foreground"> </span></div>`),au=U(`<div class="text-sm text-muted-foreground">No usage learned yet \u2014 Synthra learns as you read/edit files.</div>`),ou=U(`<div class="font-mono text-2xl text-foreground"> <span class="text-sm text-muted-foreground">tracked</span></div> <div class="flex max-h-[190px] flex-col gap-1.5 overflow-y-auto"></div>`,1);function su(e,t){O(t,!0);let n=j(()=>X.data?.active),r=j(()=>H(n)?.stats?.hot_files??[]);{let t=j(()=>H(n)?.project_name??`active project`);Xa(e,{title:`Hot files`,get meta(){return H(t)},children:(e,t)=>{var i=ou(),a=I(i),o=F(a);Ue(),E(a);var s=L(a,2);yi(s,21,()=>H(r),e=>e.path,(e,t)=>{var n=iu(),r=F(n),i=F(r,!0);E(r);var a=L(r,2),o=F(a,!0);E(a),E(n),R(e=>{Qi(n,`title`,H(t).path),K(i,e),K(o,H(t).score)},[()=>_a(H(t).path)]),G(e,n)},e=>{G(e,au())}),E(s),R(e=>K(o,`${e??``} `),[()=>Z(H(n)?.stats?.hot_files_total??0)]),G(e,i)},$$slots:{default:!0}})}k()}var cu=U(`<div class="grid grid-cols-1 gap-4 p-5 lg:grid-cols-3"><div class="lg:col-span-3 lg:row-start-1"><!></div> <div class="lg:col-start-1 lg:row-start-2"><!></div> <div class="lg:col-start-2 lg:row-start-2"><!></div> <div class="lg:col-start-1 lg:row-start-3"><!></div> <div class="lg:col-start-2 lg:row-start-3"><!></div> <div class="lg:col-start-1 lg:row-start-4"><!></div> <div class="lg:col-start-2 lg:row-start-4"><!></div> <div class="relative lg:col-start-3 lg:row-start-2 lg:row-span-3"><div class="lg:absolute lg:inset-0"><!></div></div> <div class="lg:col-span-3 lg:row-start-5"><!></div></div>`);function lu(e){var t=cu(),n=F(t);Ka(F(n),{}),E(n);var r=L(n,2);Qa(F(r),{}),E(r);var i=L(r,2);eo(F(i),{}),E(i);var a=L(i,2);ao(F(a),{}),E(a);var o=L(a,2);su(F(o),{}),E(o);var s=L(o,2);Hl(F(s),{}),E(s);var c=L(s,2);Kl(F(c),{}),E(c);var l=L(c,2),u=F(l);ru(F(u),{}),E(u),E(l);var d=L(l,2);Zl(F(d),{}),E(d),E(t),G(e,t)}var uu=new Set([`$$slots`,`$$events`,`$$legacy`]);function du(e,t){let n=ca(t,uu),r=[[`path`,{d:`M20 6 9 17l-5-5`}]];Ea(e,ua({name:`check`},()=>n,{get iconNode(){return r}}))}var fu=new Set([`$$slots`,`$$events`,`$$legacy`]);function pu(e,t){let n=ca(t,fu),r=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]];Ea(e,ua({name:`copy`},()=>n,{get iconNode(){return r}}))}var mu=U(`<p> </p>`),hu=U(`<div class="break-all"><span class="text-foreground/70"> </span> </div>`),gu=U(`<div class="mt-1 flex flex-col gap-0.5 font-mono text-xs text-muted-foreground/80"></div>`),_u=U(`<div role="button" tabindex="0" class="flex cursor-pointer flex-col gap-1.5 rounded-lg border bg-card/55 p-3 text-left transition-colors hover:bg-card/85"><div class="flex items-center gap-1.5"><span class="min-w-0 truncate font-mono text-sm text-foreground"> </span> <button type="button" title="Copy name" class="inline-flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground"><!></button> <span> </span></div> <!> <!></div>`);function vu(e,t){O(t,!0);let n=N(!1),r=N(!1),i,a=j(()=>t.item.scope===`plugin`?t.item.source??`plugin`:t.item.scope),o=j(()=>t.item.scope===`project`?`var(--c-fable)`:t.item.scope===`personal`?`var(--c-sonnet)`:`#9bc2ef`),s=j(()=>Object.entries(t.item.meta??{}));function c(){P(n,!H(n))}function l(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c())}async function u(e){e.stopPropagation();try{await navigator.clipboard.writeText(t.item.name),P(r,!0),clearTimeout(i),i=setTimeout(()=>P(r,!1),1200)}catch{}}var d=_u(),f=F(d),p=F(f),m=F(p,!0);E(p);var g=L(p,2),_=F(g),v=e=>{du(e,{class:`size-3.5`,style:`color: var(--c-fable)`})},y=e=>{pu(e,{class:`size-3.5`})};q(_,e=>{H(r)?e(v):e(y,-1)}),E(g);var b=L(g,2);let x;var S=F(b);E(b),E(f);var ee=L(f,2),te=e=>{var r=mu(),i=F(r,!0);E(r),R(()=>{Ii(r,1,`text-sm leading-snug text-muted-foreground `+(H(n)?``:`line-clamp-2`)),K(i,t.item.description)}),G(e,r)};q(ee,e=>{t.item.description&&e(te)});var ne=L(ee,2),re=e=>{var t=gu();yi(t,21,()=>H(s),([e,t])=>e,(e,t)=>{var n=j(()=>h(H(t),2));let r=()=>H(n)[0],i=()=>H(n)[1];var a=hu(),o=F(a),s=F(o);E(o);var c=L(o);E(a),R(()=>{K(s,`${r()??``}:`),K(c,` ${i()??``}`)}),G(e,a)}),E(t),G(e,t)};q(ne,e=>{H(n)&&H(s).length&&e(re)}),E(d),R(()=>{K(m,t.item.name),Qi(g,`aria-label`,`Copy "${t.item.name}"`),x=Ii(b,1,`ml-auto shrink-0 rounded border px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wide`,null,x,{"opacity-50":t.item.enabled===!1}),Ri(b,`color:${H(o)}; border-color:color-mix(in oklab, ${H(o)} 35%, transparent)`),K(S,`${H(a)??``}${t.item.enabled===!1?` \xB7 off`:``}`)}),Yr(`click`,d,c),Yr(`keydown`,d,l),Yr(`click`,g,u),G(e,d),k()}Xr([`click`,`keydown`]);var yu=U(`<span> </span>`),bu=U(`<button> <span class="opacity-60"> </span></button>`),xu=U(`<div class="text-sm text-muted-foreground">Scanning your arsenal\u2026</div>`),Su=U(`<div class="text-sm text-muted-foreground"> </div>`),Cu=U(`<section class="flex flex-col gap-2"><div class="flex items-center gap-3 border-b border-border pb-1.5"><span class="size-1.5 shrink-0 rounded-sm"></span> <span class="font-mono text-xs uppercase tracking-[0.14em]"> </span> <span class="font-mono text-xs tracking-[0.1em] text-muted-foreground"> </span></div> <div class="grid grid-cols-1 items-start gap-2 md:grid-cols-2 2xl:grid-cols-3"></div></section>`),wu=U(`<div class="flex flex-col gap-6"></div>`),Tu=U(`<div class="flex h-full flex-col gap-4 p-5"><div class="flex flex-wrap items-center justify-between gap-3"><h1 class="font-serif text-2xl text-foreground">\u2694 Arsenal</h1> <div class="flex items-center gap-2 font-mono text-xs text-muted-foreground"><!> <button class="rounded border px-2 py-1 transition-colors hover:text-foreground">\u21BB Rescan</button></div></div> <div class="flex flex-wrap items-center gap-2"><!> <input placeholder="Filter by name or description\u2026" autocomplete="off" class="ml-auto w-full max-w-72 rounded-md border bg-card/60 px-3 py-1.5 text-sm outline-none transition-colors focus:border-ring"/></div> <!></div>`);function Eu(e,t){O(t,!0);let n=N(`skills`),r=N(``),i=j(()=>X.arsenal),a=[{id:`skills`,label:`Skills`},{id:`agents`,label:`Agents`},{id:`mcp`,label:`MCP`}],o=j(()=>{let e=H(i)?H(i)[H(n)]:[],t=H(r).toLowerCase().trim();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||(e.source??``).toLowerCase().includes(t)):e}),s=j(()=>{let e=new Map;for(let t of H(o)){let n=t.scope===`plugin`?`plugin:${t.source??`plugin`}`:t.scope,r=e.get(n);r||(r={label:t.scope===`plugin`?t.source??`plugin`:t.scope===`project`?`In this project`:`Personal \xB7 this machine`,scope:t.scope,items:[]},e.set(n,r)),r.items.push(t)}return[...e.values()]});function c(e){return e===`project`?`var(--c-fable)`:e===`personal`?`var(--c-sonnet)`:`#9bc2ef`}let l=j(()=>H(i)?new Date(H(i).scanned_at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):``);var u=Tu(),d=F(u),f=L(F(d),2),p=F(f),m=e=>{var t=yu(),n=F(t);E(t),R(()=>K(n,`${H(i).counts.plugins??``} plugins \xB7 scanned ${H(l)??``}`)),G(e,t)};q(p,e=>{H(i)&&e(m)});var h=L(p,2);E(f),E(d);var g=L(d,2),_=F(g);yi(_,17,()=>a,e=>e.id,(e,t)=>{var r=bu(),a=F(r),o=L(a),s=F(o,!0);E(o),E(r),R(()=>{Ii(r,1,`rounded-lg px-3 py-1.5 font-mono text-xs transition-colors `+(H(n)===H(t).id?`bg-accent text-accent-foreground`:`text-muted-foreground hover:text-foreground`)),K(a,`${H(t).label??``} `),K(s,H(i)?.counts?.[H(t).id]??0)}),Yr(`click`,r,()=>P(n,H(t).id,!0)),G(e,r)});var v=L(_,2);Xi(v),E(g);var y=L(g,2),b=e=>{G(e,xu())},x=e=>{var t=Su(),n=F(t,!0);E(t),R(()=>K(n,H(r)?`No matches.`:`Nothing installed in this category.`)),G(e,t)},S=e=>{var t=wu();yi(t,21,()=>H(s),e=>e.label+e.scope,(e,t)=>{var n=Cu(),r=F(n),i=F(r),a=L(i,2),o=F(a,!0);E(a);var s=L(a,2),l=F(s,!0);E(s),E(r);var u=L(r,2);yi(u,21,()=>H(t).items,e=>e.scope+(e.source??``)+e.name,(e,t)=>{vu(e,{get item(){return H(t)}})}),E(u),E(n),R((e,n)=>{Ri(i,e),Ri(a,n),K(o,H(t).label),K(l,H(t).items.length)},[()=>`background:${c(H(t).scope)}`,()=>`color:${c(H(t).scope)}`]),G(e,n)}),E(t),G(e,t)};q(y,e=>{X.arsenalLoading&&!H(i)?e(b):H(s).length?e(S,-1):e(x,1)}),E(u),Yr(`click`,h,()=>X.loadArsenal(!0)),ia(v,()=>H(r),e=>P(r,e)),G(e,u),k()}Xr([`click`]);var Du=U(`<details class="rounded-lg border bg-card/50 p-3"><summary class="cursor-pointer text-sm font-medium text-foreground"> </summary> <p class="mt-2 text-[13px] leading-relaxed text-muted-foreground"> </p></details>`),Ou=U(`<!> <!> <div class="mt-4 flex flex-col gap-2"></div> <!>`,1),ku=U(`<!> <!>`,1);function Au(e,t){O(t,!0);let n=Y(t,`open`,15,!1),r=[{q:`Where do these numbers come from?`,a:`Synthra\'s Stop hook reads Claude Code\'s transcript JSONL after each turn and logs token usage to .synthra-graph/token_log.jsonl. The gate logs to gate_log.jsonl, tool calls to tool_log.jsonl. The dashboard reads those \u2014 it never feeds back into retrieval.`},{q:`How is cost calculated?`,a:`Token counts \xD7 Anthropic\'s published per-model rates (in src/shared/pricing.ts), summed across input, output, cache-read and cache-write. These are API-equivalent estimates, not your plan billing \u2014 useful for comparing sessions.`},{q:`What is the savings floor?`,a:`Each time the Moat blocks an exploratory Grep/Glob, we credit a deliberately conservative 500 tokens \xD7 $3/M input rate. Real savings are usually higher (it ignores cache thrash and follow-up reads the block also prevents). It\'s a floor, not a guess.`},{q:`What is the Moat?`,a:`A PreToolUse hook that intercepts Grep/Glob and, when the graph has confident context, blocks them and hands back the exact graph_read targets + signatures \u2014 so the agent reads ~50-token slices instead of whole files.`},{q:`What is the Arsenal view?`,a:`A scan of every skill, subagent, and MCP server available to you \u2014 project, personal (~/.claude), and plugin \u2014 with descriptions, so you never have to drop to the CLI to recall what\'s installed. MCP entries show name/type/url only; auth tokens are never read.`},{q:`What\'s the codebase graph?`,a:`tree-sitter parses your project into a symbol graph (files, symbols, imports, call edges). graph_read returns a symbol\'s source plus its dependency surface; graph_continue packs a context bundle.`},{q:`Where is everything stored?`,a:`.synthra-graph/ (machine-local, gitignored) holds the graph + logs; .synthra/ (git-tracked) holds branch-aware memory. Nothing leaves your machine.`},{q:`Why is my bill not lower already?`,a:`Savings land only when the agent actually uses the cheap path. v0.4\u20130.6 push the answer to the point of use (block payloads, edit recipes, dependency footers); a real dogfood session on the latest version is the true test.`}];var i=W();Ti(I(i),()=>Ol,(e,t)=>{t(e,{get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=W();Ti(I(n),()=>ic,(e,t)=>{t(e,{children:(e,t)=>{var n=ku(),i=I(n);Ti(i,()=>wl,(e,t)=>{t(e,{class:`fixed inset-0 z-50 bg-black/60`})}),Ti(L(i,2),()=>Fl,(e,t)=>{t(e,{class:`fixed left-1/2 top-1/2 z-50 max-h-[85vh] w-[min(640px,92vw)] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-xl border bg-card p-6 text-card-foreground shadow-2xl`,children:(e,t)=>{var n=Ou(),i=I(n);Ti(i,()=>Xs,(e,t)=>{t(e,{class:`font-serif text-2xl`,children:(e,t)=>{Ue(),G(e,ai(`FAQ`))},$$slots:{default:!0}})});var a=L(i,2);Ti(a,()=>Dl,(e,t)=>{t(e,{class:`text-xs text-muted-foreground`,children:(e,t)=>{Ue(),G(e,ai(`Where every number on this dashboard comes from.`))},$$slots:{default:!0}})});var o=L(a,2);yi(o,21,()=>r,e=>e.q,(e,t)=>{var n=Du(),r=F(n),i=F(r,!0);E(r);var a=L(r,2),o=F(a,!0);E(a),E(n),R(()=>{K(i,H(t).q),K(o,H(t).a)}),G(e,n)}),E(o),Ti(L(o,2),()=>jl,(e,t)=>{t(e,{class:`mt-4 w-full rounded-md border py-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:(e,t)=>{Ue(),G(e,ai(`Close`))},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,i),k()}var ju=U(`<div class="flex h-screen w-screen overflow-hidden"><!> <main class="min-w-0 flex-1 overflow-y-auto"><!></main></div> <!>`,1);function Mu(e,t){O(t,!0);let n=N(!1);da(()=>(X.start(),()=>X.stop()));var r=ju(),i=I(r),a=F(i);Ua(a,{onFaq:()=>P(n,!0)});var o=L(a,2),s=F(o),c=e=>{lu(e,{})},l=e=>{Eu(e,{})};q(s,e=>{X.view===`overview`?e(c):e(l,-1)}),E(o),E(i),Au(L(i,2),{get open(){return H(n)},set open(e){P(n,e,!0)}}),G(e,r),k()}var Nu=document.getElementById(`app`);if(!Nu)throw Error(`missing #app mount node`);si(Mu,{target:Nu});</script>\n <style rel="stylesheet" crossorigin>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:var(--font-sans);--font-serif:var(--font-serif);--font-mono:var(--font-mono);--color-black:#000;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-medium:500;--tracking-wide:.025em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}html,body{height:100%}body{background:radial-gradient(1200px 800px at 14% 16%, #2c5db81f, transparent 60%), var(--background);color:var(--foreground);font-family:var(--font-sans);-webkit-font-smoothing:antialiased}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:999px}::-webkit-scrollbar-track{background:0 0}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.top-1\\/2{top:50%}.left-1\\/2{left:50%}.z-50{z-index:50}.my-1{margin-block:var(--spacing)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.inline{display:inline}.inline-flex{display:inline-flex}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-\\[116px\\]{width:116px;height:116px}.size-full{width:100%;height:100%}.h-1{height:var(--spacing)}.h-2{height:calc(var(--spacing) * 2)}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[190px\\]{max-height:190px}.max-h-\\[260px\\]{max-height:260px}.min-h-0{min-height:0}.w-9{width:calc(var(--spacing) * 9)}.w-\\[64px\\]{width:64px}.w-\\[248px\\]{width:248px}.w-\\[min\\(440px\\,92vw\\)\\]{width:min(440px,92vw)}.w-\\[min\\(640px\\,92vw\\)\\]{width:min(640px,92vw)}.w-full{width:100%}.w-screen{width:100vw}.max-w-72{max-width:calc(var(--spacing) * 72)}.max-w-\\[120px\\]{max-width:120px}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-rotate-90{rotate:-90deg}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-border,.border-border\\/60{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\\/60{border-color:color-mix(in oklab, var(--border) 60%, transparent)}}.border-sidebar-border{border-color:var(--sidebar-border)}.bg-\\[var\\(--c-fable\\)\\],.bg-\\[var\\(--c-fable\\)\\]\\/12{background-color:var(--c-fable)}@supports (color:color-mix(in lab, red, red)){.bg-\\[var\\(--c-fable\\)\\]\\/12{background-color:color-mix(in oklab, var(--c-fable) 12%, transparent)}}.bg-\\[var\\(--money\\)\\]{background-color:var(--money)}.bg-accent{background-color:var(--accent)}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-border{background-color:var(--border)}.bg-card,.bg-card\\/50{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/50{background-color:color-mix(in oklab, var(--card) 50%, transparent)}}.bg-card\\/55{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/55{background-color:color-mix(in oklab, var(--card) 55%, transparent)}}.bg-card\\/60{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/60{background-color:color-mix(in oklab, var(--card) 60%, transparent)}}.bg-card\\/70{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/70{background-color:color-mix(in oklab, var(--card) 70%, transparent)}}.bg-destructive,.bg-destructive\\/15{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/15{background-color:color-mix(in oklab, var(--destructive) 15%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-muted-foreground,.bg-muted-foreground\\/40{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\/40{background-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.bg-primary\\/90{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.bg-primary\\/90{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-accent,.bg-sidebar-accent\\/40{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab, red, red)){.bg-sidebar-accent\\/40{background-color:color-mix(in oklab, var(--sidebar-accent) 40%, transparent)}}.bg-sidebar-border{background-color:var(--sidebar-border)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-serif{font-family:var(--font-serif)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[13px\\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.tracking-\\[0\\.1em\\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\\[0\\.12em\\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\\[0\\.14em\\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\\[0\\.18em\\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-all{word-break:break-all}.text-\\[var\\(--c-fable\\)\\]{color:var(--c-fable)}.text-\\[var\\(--money\\)\\]{color:var(--money)}.text-accent-foreground{color:var(--accent-foreground)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground,.text-foreground\\/70{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/70{color:color-mix(in oklab, var(--foreground) 70%, transparent)}}.text-foreground\\/80{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/80{color:color-mix(in oklab, var(--foreground) 80%, transparent)}}.text-muted-foreground,.text-muted-foreground\\/60{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/60{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.text-muted-foreground\\/80{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/80{color:color-mix(in oklab, var(--muted-foreground) 80%, transparent)}}.text-primary-foreground{color:var(--primary-foreground)}.text-sidebar-accent-foreground{color:var(--sidebar-accent-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\\/60{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab, red, red)){.text-sidebar-foreground\\/60{color:color-mix(in oklab, var(--sidebar-foreground) 60%, transparent)}}.text-sidebar-foreground\\/75{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab, red, red)){.text-sidebar-foreground\\/75{color:color-mix(in oklab, var(--sidebar-foreground) 75%, transparent)}}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-card\\/80:hover{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-card\\/80:hover{background-color:color-mix(in oklab, var(--card) 80%, transparent)}}.hover\\:bg-card\\/85:hover{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-card\\/85:hover{background-color:color-mix(in oklab, var(--card) 85%, transparent)}}.hover\\:bg-sidebar-accent\\/50:hover{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-sidebar-accent\\/50:hover{background-color:color-mix(in oklab, var(--sidebar-accent) 50%, transparent)}}.hover\\:text-foreground:hover{color:var(--foreground)}.hover\\:text-sidebar-foreground:hover{color:var(--sidebar-foreground)}}.focus\\:border-ring:focus{border-color:var(--ring)}@media (hover:hover){.enabled\\:hover\\:text-foreground:enabled:hover{color:var(--foreground)}}.disabled\\:opacity-40:disabled{opacity:.4}@media (width>=40rem){.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (width>=48rem){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width>=64rem){.lg\\:absolute{position:absolute}.lg\\:inset-0{inset:0}.lg\\:col-span-3{grid-column:span 3/span 3}.lg\\:col-start-1{grid-column-start:1}.lg\\:col-start-2{grid-column-start:2}.lg\\:col-start-3{grid-column-start:3}.lg\\:row-span-3{grid-row:span 3/span 3}.lg\\:row-start-1{grid-row-start:1}.lg\\:row-start-2{grid-row-start:2}.lg\\:row-start-3{grid-row-start:3}.lg\\:row-start-4{grid-row-start:4}.lg\\:row-start-5{grid-row-start:5}.lg\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (width>=96rem){.\\32 xl\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.75rem;--background:#04081a;--foreground:#ecf2fb;--card:#0a1733;--card-foreground:#ecf2fb;--popover:#0a1733;--popover-foreground:#ecf2fb;--primary:#2c5db8;--primary-foreground:#f4f7fc;--secondary:#122549;--secondary-foreground:#d7e6f7;--muted:#102146;--muted-foreground:#8ba0c2;--accent:#1b3a78;--accent-foreground:#ecf2fb;--destructive:#ff5d5d;--destructive-foreground:#fff5f5;--border:#9bc2ef24;--input:#9bc2ef2e;--ring:#5c8fe6;--sidebar:#081226;--sidebar-foreground:#d7e6f7;--sidebar-primary:#2c5db8;--sidebar-primary-foreground:#f4f7fc;--sidebar-accent:#122549;--sidebar-accent-foreground:#ecf2fb;--sidebar-border:#9bc2ef1f;--sidebar-ring:#5c8fe6;--c-fable:#2ee08f;--c-opus:#ff6338;--c-sonnet:#ffb938;--c-haiku:#7438ff;--c-unknown:#12cbf5;--money:#4ade9b;--font-sans:"Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-serif:"Instrument Serif", "Times New Roman", serif;--font-mono:"Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}\n/*$vite$:1*/</style>\n </head>\n <body>\n <div id="app"></div>\n </body>\n</html>\n';
|
|
881
|
+
var built_default = '<!doctype html>\n<html lang="en" class="dark">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>Synthra \xB7 Dashboard</title>\n <link rel="icon" href="/favicon.svg" type="image/svg+xml" />\n <link rel="preconnect" href="https://fonts.googleapis.com" />\n <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />\n <link\n href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap"\n rel="stylesheet"\n />\n <script type="module" crossorigin>(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible;function d(e){return typeof e==`function`}var f=()=>{};function p(e){for(var t=0;t<e.length;t++)e[t]()}function m(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function h(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var g=1<<24,_=1024,v=2048,y=4096,b=8192,ee=16384,x=32768,te=1<<25,ne=65536,re=1<<19,ie=1<<20,ae=1<<25,oe=65536,se=1<<21,ce=1<<22,le=1<<23,ue=Symbol(`$state`),de=Symbol(`legacy props`),fe=Symbol(``),pe=Symbol(`attributes`),me=Symbol(`class`),he=Symbol(`style`),ge=Symbol(`text`),_e=Symbol(`form reset`),ve=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ye=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function be(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function xe(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Se(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Ce(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function we(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Te(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Ee(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function De(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Oe(){throw Error(`https://svelte.dev/e/set_context_after_init`)}function ke(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ae(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function je(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Me(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Ne={},S=Symbol(`uninitialized`),Pe=`http://www.w3.org/1999/xhtml`,Fe=`http://www.w3.org/2000/svg`,Ie=`@attach`;function Le(){console.warn(`https://svelte.dev/e/derived_inert`)}function Re(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function ze(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function Be(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var C=!1;function Ve(e){C=e}var w;function He(e){if(e===null)throw Re(),Ne;return w=e}function Ue(){return He(wn(w))}function T(e){if(C){if(wn(w)!==null)throw Re(),Ne;w=e}}function We(e=1){if(C){for(var t=e,n=w;t--;)n=wn(n);w=n}}function Ge(e=!0){for(var t=0,n=w;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=wn(n);e&&n.remove(),n=i}}function Ke(e){if(!e||e.nodeType!==8)throw Re(),Ne;return e.data}function qe(e){return e===this.v}function Je(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ye(e){return!Je(e,this.v)}var Xe=!1,Ze=!1;function Qe(){Ze=!0}var E=null;function $e(e){E=e}function et(e){return at(`getContext`).get(e)}function tt(e,t){let n=at(`setContext`);if(Xe){var r=B.f;!z&&r&32&&!E.i||Oe()}return n.set(e,t),t}function nt(e){return at(`hasContext`).has(e)}function rt(){return at(`getAllContexts`)}function D(e,t=!1,n){E={p:E,i:!1,c:null,e:null,s:e,x:null,r:B,l:Ze&&!t?{s:null,u:null,$:[]}:null}}function O(e){var t=E,n=t.e;if(n!==null){t.e=null;for(var r of n)Bn(r)}return e!==void 0&&(t.x=e),t.i=!0,E=t.p,e??{}}function it(){return!Ze||E!==null&&E.l===null}function at(e){return E===null&&be(e),E.c??=new Map(ot(E)||void 0)}function ot(e){let t=e.p;for(;t!==null;){let e=t.c;if(e!==null)return e;t=t.p}return null}var st=[];function ct(){var e=st;st=[],p(e)}function lt(e){if(st.length===0&&!Ht){var t=st;queueMicrotask(()=>{t===st&&ct()})}st.push(e)}function ut(){for(;st.length>0;)ct()}function dt(e){var t=B;if(t===null)return z.f|=le,e;if(!(t.f&32768)&&!(t.f&4))throw e;ft(e,t)}function ft(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}var pt=~(v|y|_);function k(e,t){e.f=e.f&pt|t}function mt(e){e.f&512||e.deps===null?k(e,_):k(e,y)}function ht(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=oe,ht(t.deps))}function gt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),ht(e.deps),k(e,_)}var _t=!1,vt=!1;function yt(e){var t=vt;try{return vt=!1,[e(),vt]}finally{vt=t}}function bt(e){let t=0,n=cn(0),r;return()=>{Ln()&&(V(n),Kn(()=>(t===0&&(r=Nr(()=>e(()=>fn(n)))),t+=1,()=>{lt(()=>{--t,t===0&&(r?.(),r=void 0,fn(n))})})))}}var xt=ne|re;function St(e,t,n,r){new Ct(e,t,n,r)}var Ct=class{parent;is_pending=!1;transform_error;#e;#t=C?w:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=bt(()=>(this.#m=cn(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=B;t.b=this,t.f|=128,n(e)},this.parent=B.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=qn(()=>{if(C){let e=this.#t;Ue();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},xt),C&&(this.#e=w)}#g(){try{this.#a=Yn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=Yn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Yn(()=>e(this.#e)),lt(()=>{var e=this.#c=document.createDocumentFragment(),t=Sn();e.append(t),this.#a=this.#x(()=>Yn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,tr(this.#o,()=>{this.#o=null}),this.#b(j))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Yn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();ar(this.#a,e);let t=this.#n.pending;this.#o=Yn(()=>t(this.#e))}else this.#b(j)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){gt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=B,n=z,r=E;fr(this.#i),dr(this.#i),$e(this.#i.ctx);try{return Jt.ensure(),e()}catch(e){return dt(e),null}finally{fr(t),dr(n),$e(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&tr(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,lt(()=>{this.#d=!1,this.#m&&un(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),V(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;j?.is_fork?(this.#a&&j.skip_effect(this.#a),this.#o&&j.skip_effect(this.#o),this.#s&&j.skip_effect(this.#s),j.oncommit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(R(this.#a),null),this.#o&&=(R(this.#o),null),this.#s&&=(R(this.#s),null),C&&(He(this.#t),We(),He(Ge()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){Be();return}r=!0,i&&Me(),this.#s!==null&&tr(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){ft(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return Yn(()=>{var t=B;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return ft(e,this.#i.parent),null}}))};lt(()=>{var t;try{t=this.transform_error(e)}catch(e){ft(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>ft(e,this.#i&&this.#i.parent)):o(t)})}};function wt(e,t,n,r){let i=it()?Ot:jt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=B,c=Tt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){ft(e,s)}Et()}}var d=Dt();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>At(e))).then(u).catch(e=>ft(e,s)).finally(d)}l?l.then(()=>{c(),f(),Et()}):f()}function Tt(){var e=B,t=z,n=E,r=j;return function(i=!0){fr(e),dr(t),$e(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Et(e=!0){fr(null),dr(null),$e(null),e&&j?.deactivate()}function Dt(){var e=B,t=e.b,n=j,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Ot(e){var t=2|v;return B!==null&&(B.f|=re),{ctx:E,deps:null,effects:null,equals:qe,f:t,fn:e,reactions:null,rv:0,v:S,wv:0,parent:B,ac:null}}var kt=Symbol(`obsolete`);function At(e,t,n){let r=B;r===null&&xe();var i=void 0,a=cn(S),o=!z,s=new Set;return Gn(()=>{var t=B,n=m();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==ve&&n.reject(e)}).finally(Et)}catch(e){n.reject(e),Et()}var c=j;if(o){if(t.f&32768)var l=Dt();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(kt);else for(let e of s.values())e.reject(kt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==kt&&(c.activate(),t?(a.f|=le,un(a,t)):(a.f&8388608&&(a.f^=le),un(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),Rn(()=>{for(let e of s)e.reject(kt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function A(e){let t=Ot(e);return Xe||mr(t),t}function jt(e){let t=Ot(e);return t.equals=Ye,t}function Mt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)R(t[n])}}function Nt(e){var t,n=B,r=e.parent;if(!cr&&r!==null&&e.v!==S&&r.f&24576)return Le(),e.v;fr(r);try{e.f&=~oe,Mt(e),t=Er(e)}finally{fr(n)}return t}function Pt(e){var t=Nt(e);if(!e.equals(t)&&(e.wv=Cr(),(!j?.is_fork||e.deps===null)&&(j===null?e.v=t:(j.capture(e,t,!0),zt?.capture(e,t,!0)),e.deps===null))){k(e,_);return}cr||(Bt===null?mt(e):(Ln()||j?.is_fork)&&Bt.set(e,t))}function Ft(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(ve),t.fn!==null&&(t.teardown=f),t.ac=null,Or(t,0),Zn(t))}function It(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&kr(t)}var Lt=null,Rt=null,j=null,zt=null,Bt=null,Vt=null,Ht=!1,Ut=!1,Wt=null,Gt=null,Kt=0,qt=1,Jt=class e{id=qt++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){Rt===null?Lt=Rt=this:(Rt.#n=this,this.#t=Rt),Rt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)k(r,v),t(r);for(r of n.m)k(r,y),t(r)}this.#p.add(e)}#g(){this.#e=!0,Kt++>1e3&&(this.#S(),Xt());for(let e of this.#u)this.#d.delete(e),k(e,v),this.schedule(e);for(let e of this.#d)k(e,y),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=Wt=[],r=[],i=Gt=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw rn(e),this.#h()||this.discard(),t}if(j=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(Wt=null,Gt=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)nn(e,t);i.length>0&&j.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),zt=this,Qt(r),Qt(n),zt=null,this.#s?.resolve();var s=j;if(this.#a===0&&(this.#c.length===0||s!==null)&&(this.#S(),Xe&&(this.#x(),j=s)),this.#c.length>0)if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this;s!==null&&s.#g()}#_(e,t,n){e.f^=_;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=_:i&4?t.push(r):Xe&&i&16777224?n.push(r):wr(r)&&(i&16&&this.#d.add(r),kr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#y(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),k(i,v),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),j=this,this.#g()}#b(e){for(var t=0;t<e.length;t+=1)gt(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==S&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),Bt?.set(e,t)),this.is_fork||(e.v=t)}activate(){j=this}deactivate(){j=null,Bt=null}flush(){try{Ut=!0,j=this,this.#g()}finally{Kt=0,Vt=null,Wt=null,Gt=null,Ut=!1,j=null,Bt=null,on.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(kt);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}#x(){for(let u=Lt;u!==null;u=u.#n){var e=u.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(u.current.has(r)){var n=u.current.get(r)[0];if(e&&i!==n)u.current.set(r,[i,a]);else continue}t.push(r)}if(e)for(let[e,t]of this.async_deriveds){let n=u.async_deriveds.get(e);n&&t.promise.then(n.resolve).catch(n.reject)}var r=[...u.current.keys()].filter(e=>!u.current.get(e)[1]);if(!(!u.#e||r.length===0)){var i=r.filter(e=>!this.current.has(e));if(i.length===0)e&&u.discard();else if(t.length>0){if(e)for(let e of this.#p)u.unskip_effect(e,e=>{e.f&4194320?u.schedule(e):u.#b([e])});u.activate();var a=new Set,o=new Map;for(var s of t)$t(s,i,a,o);o=new Map;var c=[...u.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(c.length>0)for(let e of this.#l)!(e.f&155648)&&en(e,c,o)&&(e.f&4194320?(k(e,v),u.schedule(e)):u.#u.add(e));if(u.#c.length>0&&!u.#m){u.apply();for(var l of u.#c)u.#_(l,[],[]);u.#c=[]}u.deactivate()}}}}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,lt(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=m()).promise}static ensure(){if(j===null){let t=j=new e;!Ut&&!Ht&<(()=>{t.#e||t.flush()})}return j}apply(){if(!Xe||!this.is_fork&&this.#t===null&&this.#n===null){Bt=null;return}Bt=new Map;for(let[e,[t]]of this.current)Bt.set(e,t);for(let t=Lt;t!==null;t=t.#n)if(!(t===this||t.is_fork)){var e=!1;if(t.id<this.id){for(let[n,[,r]]of t.current)if(!r&&this.current.has(n)){e=!0;break}}if(!e)for(let[e,n]of t.previous)Bt.has(e)||Bt.set(e,n)}}schedule(e){if(Vt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(Wt!==null&&t===B&&(Xe||(z===null||!(z.f&2))&&!_t))return;if(n&96){if(!(n&1024))return;t.f^=_}}this.#c.push(t)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null?Lt=t:e.#n=t,t===null?Rt=e:t.#t=e,this.linked=!1}}};function Yt(e){var t=Ht;Ht=!0;try{var n;for(e&&(j!==null&&!j.is_fork&&j.flush(),n=e());;){if(ut(),j===null)return n;j.flush()}}finally{Ht=t}}function Xt(){try{Ee()}catch(e){ft(e,Vt)}}var Zt=null;function Qt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&wr(r)&&(Zt=new Set,kr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&er(r),Zt?.size>0)){on.clear();for(let e of Zt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Zt.has(n)&&(Zt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||kr(n)}}Zt.clear()}}Zt=null}}function $t(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?$t(i,t,n,r):e&4194320&&!(e&2048)&&en(i,t,r)&&(k(i,v),tn(i))}}function en(e,t,r){let i=r.get(e);if(i!==void 0)return i;if(e.deps!==null)for(let i of e.deps){if(n.call(t,i))return!0;if(i.f&2&&en(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function tn(e){j.schedule(e)}function nn(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),k(e,_);for(var n=e.first;n!==null;)nn(n,t),n=n.next}}function rn(e){k(e,_);for(var t=e.first;t!==null;)rn(t),t=t.next}var an=new Set,on=new Map,sn=!1;function cn(e,t){return{f:0,v:e,reactions:null,equals:qe,rv:0,wv:0}}function M(e,t){let n=cn(e,t);return mr(n),n}function ln(e,t=!1,n=!0){let r=cn(e);return t||(r.equals=Ye),Ze&&n&&E!==null&&E.l!==null&&(E.l.s??=[]).push(r),r}function N(e,t,n=!1){return z!==null&&(!ur||z.f&131072)&&it()&&z.f&4325394&&(pr===null||!pr.has(e))&&je(),un(e,n?mn(t):t,Gt)}function un(e,t,n=null){if(!e.equals(t)){on.set(e,cr?t:e.v);var r=Jt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&Nt(t),Bt===null&&mt(t)}e.wv=Cr(),pn(e,v,n),it()&&B!==null&&B.f&1024&&!(B.f&96)&&(_r===null?vr([e]):_r.push(e)),!r.is_fork&&an.size>0&&!sn&&dn()}return t}function dn(){sn=!1;for(let e of an){e.f&1024&&k(e,y);let t;try{t=wr(e)}catch{t=!0}t&&kr(e)}an.clear()}function fn(e){N(e,e.v+1)}function pn(e,t,n){var r=e.reactions;if(r!==null)for(var i=it(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===B)){var l=(c&v)===0;if(l&&k(s,t),c&131072)an.add(s);else if(c&2){var u=s;Bt?.delete(u),c&65536||(c&512&&(B===null||!(B.f&2097152))&&(s.f|=oe),pn(u,y,n))}else if(l){var d=s;c&16&&Zt!==null&&Zt.add(d),n===null?tn(d):n.push(d)}}}}function mn(t){if(typeof t!=`object`||!t||ue in t)return t;let n=l(t);if(n!==s&&n!==c)return t;var r=new Map,i=e(t),o=M(0),u=null,d=xr,f=e=>{if(xr===d)return e();var t=z,n=xr;dr(null),Sr(d);var r=e();return dr(t),Sr(n),r};return i&&r.set(`length`,M(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&ke();var i=r.get(t);return i===void 0?f(()=>{var e=M(n.value,u);return r.set(t,e),e}):N(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>M(S,u));r.set(t,e),fn(o)}}else N(n,S),fn(o);return!0},get(e,n,i){if(n===ue)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>M(mn(s?e[n]:S),u)),r.set(n,o)),o!==void 0){var c=V(o);return c===S?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=V(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==S)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===ue)return!0;var n=r.get(t),i=n!==void 0&&n.v!==S||Reflect.has(e,t);return(n!==void 0||B!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>M(i?mn(e[t]):S,u)),r.set(t,n)),V(n)===S)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;d<c.v;d+=1){var p=r.get(d+``);p===void 0?d in e&&(p=f(()=>M(S,u)),r.set(d+``,p)):N(p,S)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>M(void 0,u)),N(c,mn(n)),r.set(t,c));else{l=c.v!==S;var m=f(()=>mn(n));N(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&N(g,_+1)}fn(o)}return!0},ownKeys(e){V(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==S});for(var[n,i]of r)i.v!==S&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Ae()}})}function hn(e){try{if(typeof e==`object`&&e&&ue in e)return e[ue]}catch{}return e}function gn(e,t){return Object.is(hn(e),hn(t))}new Set([`copyWithin`,`fill`,`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`]);var _n,vn,yn,bn;function xn(){if(_n===void 0){_n=window,vn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;yn=a(t,`firstChild`).get,bn=a(t,`nextSibling`).get,u(e)&&(e[me]=void 0,e[pe]=null,e[he]=void 0,e.__e=void 0),u(n)&&(n[ge]=void 0)}}function Sn(e=``){return document.createTextNode(e)}function Cn(e){return yn.call(e)}function wn(e){return bn.call(e)}function P(e,t){if(!C)return Cn(e);var n=Cn(w);if(n===null)n=w.appendChild(Sn());else if(t&&n.nodeType!==3){var r=Sn();return n?.before(r),He(r),r}return t&&On(n),He(n),n}function F(e,t=!1){if(!C){var n=Cn(e);return n instanceof Comment&&n.data===``?wn(n):n}if(t){if(w?.nodeType!==3){var r=Sn();return w?.before(r),He(r),r}On(w)}return w}function I(e,t=1,n=!1){let r=C?w:e;for(var i;t--;)i=r,r=wn(r);if(!C)return r;if(n){if(r?.nodeType!==3){var a=Sn();return r===null?i?.after(a):r.before(a),He(a),a}On(r)}return He(r),r}function Tn(e){e.textContent=``}function En(){return!Xe||Zt!==null?!1:(B.f&x)!==0}function Dn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function On(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function kn(e,t){if(t){let t=document.body;e.autofocus=!0,lt(()=>{document.activeElement===t&&e.focus()})}}var An=!1;function jn(){An||(An=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[_e]?.()})},{capture:!0}))}function Mn(e){var t=z,n=B;dr(null),fr(null);try{return e()}finally{dr(t),fr(n)}}function Nn(e,t,n,r=n){e.addEventListener(t,()=>Mn(n));let i=e[_e];i?e[_e]=()=>{i(),r(!0)}:e[_e]=()=>r(!0),jn()}function Pn(e){B===null&&(z===null&&Te(e),we()),cr&&Ce(e)}function Fn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function In(e,t){var n=B;n!==null&&n.f&8192&&(e|=b);var r={ctx:E,deps:null,nodes:null,f:e|v|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};j?.register_created_effect(r);var i=r;if(e&4)Wt===null?Jt.ensure().schedule(r):Wt.push(r);else if(t!==null){try{kr(r)}catch(e){throw R(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ne))}if(i!==null&&(i.parent=n,n!==null&&Fn(i,n),z!==null&&z.f&2&&!(e&64))){var a=z;(a.effects??=[]).push(i)}return r}function Ln(){return z!==null&&!ur}function Rn(e){let t=In(8,null);return k(t,_),t.teardown=e,t}function zn(e){Pn(`$effect`);var t=B.f;if(!z&&t&32&&E!==null&&!E.i){var n=E;(n.e??=[]).push(e)}else return Bn(e)}function Bn(e){return In(4|ie,e)}function Vn(e){return Pn(`$effect.pre`),In(8|ie,e)}function Hn(e){Jt.ensure();let t=In(64|re,e);return()=>{R(t)}}function Un(e){Jt.ensure();let t=In(64|re,e);return(e={})=>new Promise(n=>{e.outro?tr(t,()=>{R(t),n(void 0)}):(R(t),n(void 0))})}function Wn(e){return In(4,e)}function Gn(e){return In(ce|re,e)}function Kn(e,t=0){return In(8|t,e)}function L(e,t=[],n=[],r=[]){wt(r,t,n,t=>{In(8,()=>{e(...t.map(V))})})}function qn(e,t=0){return In(16|t,e)}function Jn(e,t=0){return In(g|t,e)}function Yn(e){return In(32|re,e)}function Xn(e){var t=e.teardown;if(t!==null){let e=cr,n=z;lr(!0),dr(null);try{t.call(null)}finally{lr(e),dr(n)}}}function Zn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&Mn(()=>{e.abort(ve)});var r=n.next;n.f&64?n.parent=null:R(n,t),n=r}}function Qn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||R(t),t=n}}function R(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&($n(e.nodes.start,e.nodes.end),n=!0),e.f|=te,Zn(e,t&&!n),Or(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Xn(e),e.f^=te,e.f|=ee;var i=e.parent;i!==null&&i.first!==null&&er(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function $n(e,t){for(;e!==null;){var n=e===t?null:wn(e);e.remove(),e=n}}function er(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function tr(e,t,n=!0){var r=[];nr(e,r,!0);var i=()=>{n&&R(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function nr(e,t,n){if(!(e.f&8192)){e.f^=b;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;nr(i,t,o?n:!1)}i=a}}}function rr(e){ir(e,!0)}function ir(e,t){if(e.f&8192){e.f^=b,e.f&1024||(k(e,v),Jt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;ir(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function ar(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:wn(n);t.append(n),n=i}}var or=null,sr=!1,cr=!1;function lr(e){cr=e}var z=null,ur=!1;function dr(e){z=e}var B=null;function fr(e){B=e}var pr=null;function mr(e){z!==null&&(!Xe||z.f&2)&&(pr??=new Set).add(e)}var hr=null,gr=0,_r=null;function vr(e){_r=e}var yr=1,br=0,xr=br;function Sr(e){xr=e}function Cr(){return++yr}function wr(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~oe),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(wr(a)&&Pt(a),a.wv>e.wv)return!0}t&512&&Bt===null&&k(e,_)}return!1}function Tr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Xe&&pr!==null&&pr.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Tr(a,t,!1):t===a&&(n?k(a,v):a.f&1024&&k(a,y),tn(a))}}function Er(e){var t=hr,n=gr,r=_r,i=z,a=pr,o=E,s=ur,c=xr,l=e.f;hr=null,gr=0,_r=null,z=l&96?null:e,pr=null,$e(e.ctx),ur=!1,xr=++br,e.ac!==null&&(Mn(()=>{e.ac.abort(ve)}),e.ac=null);try{e.f|=se;var u=e.fn,d=u();e.f|=x;var f=e.deps,p=j?.is_fork;if(hr!==null){var m;if(p||Or(e,gr),f!==null&&gr>0)for(f.length=gr+hr.length,m=0;m<hr.length;m++)f[gr+m]=hr[m];else e.deps=f=hr;if(Ln()&&e.f&512)for(m=gr;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&gr<f.length&&(Or(e,gr),f.length=gr);if(it()&&_r!==null&&!ur&&f!==null&&!(e.f&6146))for(m=0;m<_r.length;m++)Tr(_r[m],e);if(i!==null&&i!==e){if(br++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=br;if(t!==null)for(let e of t)e.rv=br;_r!==null&&(r===null?r=_r:r.push(..._r))}return e.f&8388608&&(e.f^=le),d}catch(e){return dt(e)}finally{e.f^=se,hr=t,gr=n,_r=r,z=i,pr=a,$e(o),ur=s,xr=c}}function Dr(e,r){let i=r.reactions;if(i!==null){var a=t.call(i,e);if(a!==-1){var o=i.length-1;o===0?i=r.reactions=null:(i[a]=i[o],i.pop())}}if(i===null&&r.f&2&&(hr===null||!n.call(hr,r))){var s=r;s.f&512&&(s.f^=512,s.f&=~oe),s.v!==S&&mt(s),Ft(s),Or(s,0)}}function Or(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Dr(e,n[r])}function kr(e){var t=e.f;if(!(t&16384)){k(e,_);var n=B,r=sr;B=e,sr=!0;try{t&16777232?Qn(e):Zn(e),Xn(e);var i=Er(e);e.teardown=typeof i==`function`?i:null,e.wv=yr}finally{sr=r,B=n}}}async function Ar(){if(Xe)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),Yt()}function V(e){var t=(e.f&2)!=0;if(or?.add(e),z!==null&&!ur&&!(B!==null&&B.f&16384)&&(pr===null||!pr.has(e))){var r=z.deps;if(z.f&2097152)e.rv<br&&(e.rv=br,hr===null&&r!==null&&r[gr]===e?gr++:hr===null?hr=[e]:hr.push(e));else{z.deps??=[],n.call(z.deps,e)||z.deps.push(e);var i=e.reactions;i===null?e.reactions=[z]:n.call(i,z)||i.push(z)}}if(cr&&on.has(e))return on.get(e);if(t){var a=e;if(cr){var o=a.v;return(!(a.f&1024)&&a.reactions!==null||Mr(a))&&(o=Nt(a)),on.set(a,o),o}var s=(a.f&512)==0&&!ur&&z!==null&&(sr||(z.f&512)!=0),c=(a.f&x)===0;wr(a)&&(s&&(a.f|=512),Pt(a)),s&&!c&&(It(a),jr(a))}if(Bt?.has(e))return Bt.get(e);if(e.f&8388608)throw e.v;return e.v}function jr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(It(t),jr(t))}function Mr(e){if(e.v===S)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(on.has(t)||t.f&2&&Mr(t))return!0;return!1}function Nr(e){var t=ur;try{return ur=!0,e()}finally{ur=t}}function Pr(){return Symbol(Ie)}function Fr(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var Ir=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function Lr(e){return Ir.includes(e)}var Rr=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),zr={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function Br(e){return e=e.toLowerCase(),zr[e]??e}[...Rr];var Vr=[`touchstart`,`touchmove`];function Hr(e){return Vr.includes(e)}var Ur=[`textarea`,`script`,`style`,`title`];function Wr(e){return Ur.includes(e)}var Gr=Symbol(`events`),Kr=new Set,qr=new Set;function Jr(e,t,n,r={}){function i(e){if(r.capture||$r.call(t,e),!e.cancelBubble)return Mn(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?lt(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Yr(e,t,n,r={}){var i=Jr(t,e,n,r);return()=>{e.removeEventListener(t,i,r)}}function Xr(e,t,n){(t[Gr]??={})[e]=n}function Zr(e){for(var t=0;t<e.length;t++)Kr.add(e[t]);for(var n of qr)n(e)}var Qr=null;function $r(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],o=a[0]||e.target;Qr=e;var s=0,c=Qr===e&&e[Gr];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[Gr]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=z,f=B;dr(null),fr(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[Gr]?.[r];h!=null&&(!o.disabled||e.target===o)&&h.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;s++,o=s<a.length?a[s]:null}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Gr]=t,delete e.currentTarget,dr(d),fr(f)}}}var ei=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function ti(e){return ei?.createHTML(e)??e}function ni(e){var t=Dn(`template`);return t.innerHTML=ti(e.replaceAll(`<!>`,`\\x3C!---->`)),t.content}function ri(e,t){var n=B;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function H(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(C)return ri(w,null),w;i===void 0&&(i=ni(a?e:`<!>`+e),n||(i=Cn(i)));var t=r||vn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Cn(t),s=t.lastChild;ri(o,s)}else ri(t,t);return t}}function ii(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(C)return ri(w,null),w;if(!o){var e=Cn(ni(a));if(i)for(o=document.createDocumentFragment();Cn(e);)o.appendChild(Cn(e));else o=Cn(e)}var t=o.cloneNode(!0);if(i){var n=Cn(t),r=t.lastChild;ri(n,r)}else ri(t,t);return t}}function ai(e,t){return ii(e,t,`svg`)}function oi(e=``){if(!C){var t=Sn(e+``);return ri(t,t),t}var n=w;return n.nodeType===3?On(n):(n.before(n=Sn()),He(n)),ri(n,n),n}function U(){if(C)return ri(w,null),w;var e=document.createDocumentFragment(),t=document.createComment(``),n=Sn();return e.append(t,n),ri(t,n),e}function W(e,t){if(C){var n=B;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=w),Ue();return}e!==null&&e.before(t)}function si(){if(C&&w&&w.nodeType===8&&w.textContent?.startsWith(`$`)){let e=w.textContent.substring(1);return Ue(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function G(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[ge]??=e.nodeValue)&&(e[ge]=n,e.nodeValue=`${n}`)}function ci(e,t){return ui(e,t)}var li=new Map;function ui(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){xn();var l=void 0,u=Un(()=>{var s=n??t.appendChild(Sn());St(s,{pending:()=>{}},t=>{D({});var n=E;if(o&&(n.c=o),a&&(i.$$events=a),C&&ri(t,null),l=e(t,i)||{},C&&(B.nodes.end=w,w===null||w.nodeType!==8||w.data!==`]`))throw Re(),Ne;O()},c);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=Hr(r);for(let e of[t,document]){var a=li.get(e);a===void 0&&(a=new Map,li.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,$r,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(r(Kr)),qr.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=li.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,$r),r.delete(e),r.size===0&&li.delete(n)):r.set(e,i)}qr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return di.set(l,u),l}var di=new WeakMap;function fi(e,t){let n=di.get(e);return n?(di.delete(e),n(t)):Promise.resolve()}var pi=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)rr(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(rr(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(R(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();ar(r,t),t.append(Sn()),this.#n.set(e,{effect:r,fragment:t})}else R(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),tr(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(R(n.effect),this.#n.delete(e))};ensure(e,t){var n=j,r=En();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=Sn();i.append(a),this.#n.set(e,{effect:Yn(()=>t(a)),fragment:i})}else this.#t.set(e,Yn(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else C&&(this.anchor=w),this.#a(n)}};function K(e,t,n=!1){var r;C&&(r=w,Ue());var i=new pi(e),a=n?ne:0;function o(e,t){if(C){var n=Ke(r);if(e!==parseInt(n.substring(1))){var a=Ge();He(a),i.anchor=a,Ve(!1),i.ensure(e,t),Ve(!0);return}}i.ensure(e,t)}qn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var mi=Symbol(`NaN`);function hi(e,t,n){C&&Ue();var r=new pi(e),i=!it();qn(()=>{var e=t();e!==e&&(e=mi),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function gi(e,t){return t}function _i(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c<a;c++){let n=t[c];tr(n,()=>{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;vi(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else --s},!1)}if(s===0){var l=i.length===0&&n!==null;if(l){var u=n,d=u.parentNode;Tn(d),d.append(u),e.items.clear()}vi(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function vi(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ae,ar(a,document.createDocumentFragment())):R(t[i],n)}}var yi;function q(t,n,i,a,o,s=null){var c=t,l=new Map;if(n&4){var u=t;c=C?He(Cn(u)):u.appendChild(Sn())}C&&Ue();var d=null,f=jt(()=>{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,xi(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=ae,Ci(d,null,c)):rr(d):tr(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:qn(()=>{p=V(f);var e=p.length;let t=!1;C&&Ke(c)===`[!`!=(e===0)&&(c=Ge(),He(c),Ve(!1),t=!0);for(var r=new Set,u=j,v=En(),y=0;y<e;y+=1){C&&w.nodeType===8&&w.data===`]`&&(c=w,t=!0,Ve(!1));var b=p[y],ee=a(b,y),x=h?null:l.get(ee);x?(x.v&&un(x.v,b),x.i&&un(x.i,y),v&&u.unskip_effect(x.e)):(x=Si(l,h?c:yi??=Sn(),b,ee,y,o,n,i),h||(x.e.f|=ae),l.set(ee,x)),r.add(ee)}if(e===0&&s&&!d&&(h?d=Yn(()=>s(c)):(d=Yn(()=>s(yi??=Sn())),d.f|=ae)),e>r.size&&Se(``,``,``),C&&e>0&&He(Ge()),!h)if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);t&&Ve(!0),V(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,C&&(c=w)}function bi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function xi(e,t,n,i,a){var o=(i&8)!=0,s=t.length,c=e.items,l=bi(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v<s;v+=1)h=t[v],g=a(h,v),_=c.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<s;v+=1){if(h=t[v],g=a(h,v),_=c.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(rr(_),o&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=ae,_===l)Ci(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),wi(e,d,_),wi(e,_,y),Ci(_,y,n),d=_,p=[],m=[],l=bi(d.next);continue}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],ee;d=b.prev;var x=p[0],te=p[p.length-1];for(ee=0;ee<p.length;ee+=1)Ci(p[ee],b,n);for(ee=0;ee<m.length;ee+=1)u.delete(m[ee]);wi(e,x.prev,te.next),wi(e,d,x),wi(e,te,b),l=b,d=te,--v,p=[],m=[]}else u.delete(_),Ci(_,l,n),wi(e,_.prev,_.next),wi(e,_,d===null?e.effect.first:d.next),wi(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=bi(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=bi(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(vi(e,r(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var ne=[];if(u!==void 0)for(_ of u)_.f&8192||ne.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&ne.push(l),l=bi(l.next);var re=ne.length;if(re>0){var ie=i&4&&s===0?n:null;if(o){for(v=0;v<re;v+=1)ne[v].nodes?.a?.measure();for(v=0;v<re;v+=1)ne[v].nodes?.a?.fix()}_i(e,ne,ie)}}o&<(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Si(e,t,n,r,i,a,o,s){var c=o&1?o&16?cn(n):ln(n,!1,!1):null,l=o&2?cn(i):null;return{v:c,i:l,e:Yn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Ci(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=wn(r);if(a.before(r),r===i)return;r=o}}function wi(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function J(e,t,...n){var r=new pi(e);qn(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},ne)}function Ti(e,t,n){var r;C&&(r=w,Ue());var i=new pi(e);qn(()=>{var e=t()??null;if(C&&Ke(r)===`[`!=(e!==null)){var a=Ge();He(a),i.anchor=a,Ve(!1),i.ensure(e,e&&(t=>n(t,e))),Ve(!0);return}i.ensure(e,e&&(t=>n(t,e)))},ne)}function Ei(e,t,n,r,i,a){let o=C;C&&Ue();var s=null;C&&w.nodeType===1&&(s=w,Ue());var c=C?w:e,l=new pi(c,!1);qn(()=>{let e=t()||null;var a=i?i():n||e===`svg`?Fe:void 0;if(e===null){l.ensure(null,null);return}return l.ensure(e,t=>{if(e){if(s=C?s:Dn(e,a),ri(s,s),r){var n=null;C&&Wr(e)&&s.append(n=document.createComment(``));var i=C?Cn(s):s.appendChild(Sn());C&&(i===null?Ve(!1):He(i)),r(s,i),n?.remove()}B.nodes.end=s,t.before(s)}C&&He(t)}),()=>{}},ne),Rn(()=>{}),o&&(Ve(!0),He(c))}function Di(e,t){var n=void 0,r;Jn(()=>{n!==(n=t())&&(r&&=(R(r),null),n&&(r=Yn(()=>{Wn(()=>n(e))})))})}function Oi(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Oi(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function ki(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Oi(e))&&(r&&(r+=` `),r+=t);return r}function Ai(e){return typeof e==`object`?ki(e):e??``}var ji=[...` \n\\r\\f\\xA0\\v\uFEFF`];function Mi(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||ji.includes(r[o-1]))&&(s===r.length||ji.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Ni(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Pi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Fi(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Pi)),i&&c.push(...Object.keys(i).map(Pi));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`\'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Pi(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Ni(r)),i&&(n+=Ni(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Ii(e,t,n,r,i,a){var o=e[me];if(C||o!==n||o===void 0){var s=Mi(n,r,a);(!C||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[me]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function Li(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Ri(e,t,n,r){var i=e[he];if(C||i!==t){var a=Fi(t,r);(!C||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[he]=t}else r&&(Array.isArray(r)?(Li(e,n?.[0],r[0]),Li(e,n?.[1],r[1],`important`)):Li(e,n,r));return r}function zi(t,n,r=!1){if(t.multiple){if(n==null)return;if(!e(n))return ze();for(var i of t.options)i.selected=n.includes(Vi(i));return}for(i of t.options)if(gn(Vi(i),n)){i.selected=!0;return}(!r||n!==void 0)&&(t.selectedIndex=-1)}function Bi(e){var t=new MutationObserver(()=>{zi(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),Rn(()=>{t.disconnect()})}function Vi(e){return`__value`in e?e.__value:e.value}var Hi=Symbol(`class`),Ui=Symbol(`style`),Wi=Symbol(`is custom element`),Gi=Symbol(`is html`),Ki=ye?`link`:`LINK`,qi=ye?`input`:`INPUT`,Ji=ye?`option`:`OPTION`,Yi=ye?`select`:`SELECT`;function Xi(e){if(C){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Qi(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Qi(e,`checked`,null),e.checked=r}}};e[_e]=n,lt(n),jn()}}function Zi(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function Qi(e,t,n,r){var i=ta(e);C&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Ki)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[fe]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ra(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function $i(e,t,n,r,i=!1,a=!1){if(C&&i&&e.nodeName===qi){var o=e;(o.type===`checkbox`?`defaultChecked`:`defaultValue`)in n||Xi(o)}var s=ta(e),c=s[Wi],l=!s[Gi];let u=C&&c;u&&Ve(!1);var d=t||{},f=e.nodeName===Ji;for(var p in t)p in n||(n[p]=null);n.class?n.class=Ai(n.class):(r||n[Hi])&&(n.class=null),n[Ui]&&(n.style??=null);var m=ra(e);if(e.nodeName===qi&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==d.type||h===void 0&&e.hasAttribute(`type`))&&(d.type=h,Qi(e,`type`,h,a))}for(let i in n){let o=n[i];if(f&&i===`value`&&o==null){e.value=e.__value=``,d[i]=o;continue}if(i===`class`){Ii(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,o,r,t?.[Hi],n[Hi]),d[i]=o,d[Hi]=n[Hi];continue}if(i===`style`){Ri(e,o,t?.[Ui],n[Ui]),d[i]=o,d[Ui]=n[Ui];continue}var g=d[i];if(!(o===g&&!(o===void 0&&e.hasAttribute(i)))){d[i]=o;var _=i[0]+i[1];if(_!==`$$`)if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=Lr(r);if(Fr(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(o!=null)continue;e.removeEventListener(r,d[n],t),d[n]=null}if(v)Xr(r,e,o),Zr([r]);else if(o!=null){function a(e){d[i].call(this,e)}d[n]=Jr(r,e,a,t)}}else if(i===`style`)Qi(e,i,o);else if(i===`autofocus`)kn(e,!!o);else if(!c&&(i===`__value`||i===`value`&&o!=null))e.value=e.__value=o;else if(i===`selected`&&f)Zi(e,o);else{var y=i;l||(y=Br(y));var b=y===`defaultValue`||y===`defaultChecked`;if(o==null&&!c&&!b)if(s[i]=null,y===`value`||y===`checked`){let n=e,r=t===void 0;if(y===`value`){let e=n.defaultValue;n.removeAttribute(y),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(y),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i);else b||m.includes(y)&&(c||typeof o!=`string`)?(e[y]=o,y in s&&(s[y]=S)):typeof o!=`function`&&Qi(e,y,o,a)}}}return u&&Ve(!0),d}function ea(e,t,n=[],r=[],i=[],a,o=!1,s=!1){wt(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===Yi,l=!1;if(Jn(()=>{var u=t(...n.map(V)),d=$i(e,r,u,a,o,s);l&&c&&`value`in u&&zi(e,u.value);for(let e of Object.getOwnPropertySymbols(i))u[e]||R(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var f=u[t];t.description===`@attach`&&(!r||f!==r[t])&&(i[t]&&R(i[t]),i[t]=Yn(()=>Di(e,()=>f))),d[t]=f}r=d}),c){var u=e;Wn(()=>{zi(u,r.value,!0),Bi(u)})}l=!0})}function ta(e){return e[pe]??={[Wi]:e.nodeName.includes(`-`),[Gi]:e.namespaceURI===Pe}}var na=new Map;function ra(e){var t=e.getAttribute(`is`)||e.nodeName,n=na.get(t);if(n)return n;na.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&s!==`innerHTML`&&s!==`textContent`&&s!==`innerText`&&n.push(s);i=l(i)}return n}function ia(e,t,n=t){var r=new WeakSet;Nn(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=aa(e)?oa(a):a,n(a),j!==null&&r.add(j),await Ar(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(C&&e.defaultValue!==e.value||Nr(t)==null&&e.value)&&(n(aa(e)?oa(e.value):e.value),j!==null&&r.add(j)),Kn(()=>{var n=t();if(e===document.activeElement){var i=Xe?zt:j;if(r.has(i))return}aa(e)&&n===oa(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function aa(e){var t=e.type;return t===`number`||t===`range`}function oa(e){return e===``?null:+e}var sa={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.has(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function ca(e,t,n){return new Proxy({props:e,exclude:t},sa)}var la={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(d(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];d(i)&&(i=i());let o=a(i,t);if(o&&o.set)return o.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(d(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=a(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===ue||t===de)return!1;for(let n of e.props)if(d(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(d(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function ua(...e){return new Proxy({props:e},la)}function Y(e,t,n,r){var i=!Ze||(n&2)!=0,o=(n&8)!=0,s=(n&16)!=0,c=r,l=!0,u=void 0,d=()=>s&&i?(u??=Ot(r),V(u)):(l&&(l=!1,c=s?Nr(r):r),c);let f;if(o){var p=ue in e||de in e;f=a(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;o?[m,h]=yt(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&De(t),f(m)));var g=i?()=>{var n=e[t];return n===void 0?d():(l=!0,n)}:()=>{var n=e[t];return n!==void 0&&(c=void 0),n===void 0?c:n};if(i&&!(n&4))return g;if(f){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&f(t?g():e),e):g()})}var v=!1,y=(n&1?Ot:jt)(()=>(v=!1,g()));o&&V(y);var b=B;return(function(e,t){if(arguments.length>0){let n=t?V(y):i&&o?mn(e):e;return N(y,n),v=!0,c!==void 0&&(c=n),e}return cr&&v||b.f&16384?y.v:V(y)})}function da(e){E===null&&be(`onMount`),Ze&&E.l!==null?fa(E).m.push(e):zn(()=>{let t=Nr(e);if(typeof t==`function`)return t})}function fa(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var X=new class{#e=M(null);get data(){return V(this.#e)}set data(e){N(this.#e,e,!0)}#t=M(null);get arsenal(){return V(this.#t)}set arsenal(e){N(this.#t,e,!0)}#n=M(`connecting`);get status(){return V(this.#n)}set status(e){N(this.#n,e,!0)}#r=M(``);get clock(){return V(this.#r)}set clock(e){N(this.#r,e,!0)}#i=M(`overview`);get view(){return V(this.#i)}set view(e){N(this.#i,e,!0)}#a=M(!1);get arsenalLoading(){return V(this.#a)}set arsenalLoading(e){N(this.#a,e,!0)}#o=!1;#s=null;async tick(){try{let e=await fetch(`/data`);if(!e.ok)throw Error(`HTTP ${e.status}`);this.data=await e.json(),this.status=`live`,this.clock=new Date().toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}catch{this.status=`offline`}}start(){this.tick(),this.#s=setInterval(()=>void this.tick(),1e4)}stop(){this.#s&&clearInterval(this.#s)}async loadArsenal(e=!1){if(!(this.#o&&!e)){this.arsenalLoading=!0;try{let e=await fetch(`/arsenal`);e.ok&&(this.arsenal=await e.json(),this.#o=!0)}catch{}finally{this.arsenalLoading=!1}}}go(e){this.view=e,e===`arsenal`&&this.loadArsenal()}};function Z(e){return typeof e!=`number`||!Number.isFinite(e)?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function pa(e){return typeof e!=`number`||!Number.isFinite(e)?`$0.00`:`$${e.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function ma(e){if(!e)return`\u2014`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`\u2014`;let n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()?t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):t.toLocaleDateString([],{month:`short`,day:`numeric`})}function ha(e){if(!e)return`unknown`;let t=e.toLowerCase();return t===`<synthetic>`?`unknown`:t.includes(`fable`)?`fable`:t.includes(`opus`)?`opus`:t.includes(`sonnet`)?`sonnet`:t.includes(`haiku`)?`haiku`:`unknown`}function ga(e){return!e||e===`<synthetic>`?`synthetic`:e.replace(/^claude-/,``)}function _a(e){if(!e)return``;let t=e.split(/[/\\\\]/).filter(Boolean);return t.length<=2?t.join(`/`):`\u2026/${t.slice(-2).join(`/`)}`}var va=[220,75,20,155,285,330,250,45];function ya(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return`oklch(72% 0.15 ${va[t%va.length]})`}var ba={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},xa=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Sa=Symbol(`lucide-context`),Ca=()=>et(Sa),wa=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),Ta=ai(`<svg><!><!></svg>`);function Ea(e,t){D(t,!0);let n=Ca()??{},r=Y(t,`color`,19,()=>n.color??`currentColor`),i=Y(t,`size`,19,()=>n.size??24),a=Y(t,`strokeWidth`,19,()=>n.strokeWidth??2),o=Y(t,`absoluteStrokeWidth`,19,()=>n.absoluteStrokeWidth??!1),s=Y(t,`iconNode`,19,()=>[]),c=ca(t,wa),l=A(()=>o()?Number(a())*24/Number(i()):a());var u=Ta();ea(u,e=>({...ba,...e,...c,width:i(),height:i(),stroke:r(),"stroke-width":V(l),class:[`lucide-icon lucide`,n.class,t.name&&`lucide-${t.name}`,t.class]}),[()=>!t.children&&!xa(c)&&{"aria-hidden":`true`}]);var d=P(u);q(d,17,s,gi,(e,t)=>{var n=A(()=>h(V(t),2));let r=()=>V(n)[0],i=()=>V(n)[1];var a=U();Ei(F(a),r,!0,(e,t)=>{ea(e,()=>({...i()}))}),W(e,a)}),J(I(d),()=>t.children??f),T(u),W(e,u),O()}var Da=new Set([`$$slots`,`$$events`,`$$legacy`]);function Oa(e,t){let n=ca(t,Da),r=[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`}]];Ea(e,ua({name:`layout-dashboard`},()=>n,{get iconNode(){return r}}))}var ka=new Set([`$$slots`,`$$events`,`$$legacy`]);function Aa(e,t){let n=ca(t,ka),r=[[`polyline`,{points:`14.5 17.5 3 6 3 3 6 3 17.5 14.5`}],[`line`,{x1:`13`,x2:`19`,y1:`19`,y2:`13`}],[`line`,{x1:`16`,x2:`20`,y1:`16`,y2:`20`}],[`line`,{x1:`19`,x2:`21`,y1:`21`,y2:`19`}],[`polyline`,{points:`14.5 6.5 18 3 21 3 21 6 17.5 9.5`}],[`line`,{x1:`5`,x2:`9`,y1:`14`,y2:`18`}],[`line`,{x1:`7`,x2:`4`,y1:`17`,y2:`20`}],[`line`,{x1:`3`,x2:`5`,y1:`19`,y2:`21`}]];Ea(e,ua({name:`swords`},()=>n,{get iconNode(){return r}}))}var ja=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ma(e,t){let n=ca(t,ja),r=[[`path`,{d:`m7 11 2-2-2-2`}],[`path`,{d:`M11 13h4`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}]];Ea(e,ua({name:`square-terminal`},()=>n,{get iconNode(){return r}}))}var Na=new Set([`$$slots`,`$$events`,`$$legacy`]);function Pa(e,t){let n=ca(t,Na),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}],[`path`,{d:`M12 17h.01`}]];Ea(e,ua({name:`circle-question-mark`},()=>n,{get iconNode(){return r}}))}var Fa=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ia(e,t){let n=ca(t,Fa),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}]];Ea(e,ua({name:`panel-left`},()=>n,{get iconNode(){return r}}))}var La=H(`<div class="min-w-0"><div class="font-serif text-lg leading-none text-foreground">Synth<em>ra</em></div> <div class="font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground">Dashboard</div></div>`),Ra=H(`<span class="font-mono text-sm text-muted-foreground"> </span>`),za=H(`<span> </span>`),Ba=H(`<button><!> <!></button>`),Va=H(`<span>FAQ</span>`),Ha=H(`<div class="flex flex-col gap-1 rounded-lg bg-sidebar-accent/40 p-2.5"><div class="font-mono text-[10px] uppercase tracking-[0.14em] text-muted-foreground">Active</div> <div class="truncate font-mono text-sm text-sidebar-foreground"> </div> <div class="mt-1 flex items-center justify-between font-mono text-[10px] text-muted-foreground"><span> </span> <span>v__SYN_VERSION__</span></div></div>`),Ua=H(`<span class="text-xs">Collapse</span>`),Wa=H(`<aside><div class="flex items-center gap-2.5 px-1 py-2"><div class="grid size-8 shrink-0 place-items-center rounded-lg bg-primary/90 font-serif text-lg italic text-primary-foreground">S</div> <!></div> <div><span></span> <!></div> <div class="my-1 h-px bg-sidebar-border"></div> <nav class="flex flex-col gap-1"><!> <button title="FAQ"><!> <!></button></nav> <div class="flex-1"></div> <!> <button title="Toggle sidebar"><!> <!></button></aside>`);function Ga(e,t){D(t,!0);let n=M(!1),r=typeof window<`u`&&window.location.port||`8901`,i=[{id:`overview`,label:`Overview`,icon:Oa},{id:`arsenal`,label:`Arsenal`,icon:Aa},{id:`commands`,label:`Commands`,icon:Ma}];var a=Wa(),o=P(a),s=I(P(o),2),c=e=>{W(e,La())};K(s,e=>{V(n)||e(c)}),T(o);var l=I(o,2),u=P(l);let d;var f=I(u,2),p=e=>{var t=Ra(),n=P(t,!0);T(t),L(()=>G(n,X.status===`live`?`live \xB7 ${X.clock}`:X.status)),W(e,t)};K(f,e=>{V(n)||e(p)}),T(l);var m=I(l,4),h=P(m);q(h,17,()=>i,e=>e.id,(e,t)=>{var r=Ba(),i=P(r);Ti(i,()=>V(t).icon,(e,t)=>{t(e,{class:`size-4 shrink-0`})});var a=I(i,2),o=e=>{var n=za(),r=P(n,!0);T(n),L(()=>G(r,V(t).label)),W(e,n)};K(a,e=>{V(n)||e(o)}),T(r),L(()=>{Qi(r,`title`,V(t).label),Ii(r,1,`flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm transition-colors `+(X.view===V(t).id?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-sidebar-foreground/75 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground`)+(V(n)?` justify-center`:``))}),Xr(`click`,r,()=>X.go(V(t).id)),W(e,r)});var g=I(h,2),_=P(g);Pa(_,{class:`size-4 shrink-0`});var v=I(_,2),y=e=>{W(e,Va())};K(v,e=>{V(n)||e(y)}),T(g),T(m);var b=I(m,4),ee=e=>{var t=Ha(),n=I(P(t),2),i=P(n,!0);T(n);var a=I(n,2),o=P(a),s=P(o);T(o),We(2),T(a),T(t),L(()=>{Qi(n,`title`,X.data?.active?.project_root??`\u2014`),G(i,X.data?.active?.project_name??`\u2014`),G(s,`port ${r??``}`)}),W(e,t)};K(b,e=>{V(n)||e(ee)});var x=I(b,2),te=P(x);Ia(te,{class:`size-4 shrink-0`});var ne=I(te,2),re=e=>{W(e,Ua())};K(ne,e=>{V(n)||e(re)}),T(x),T(a),L(()=>{Ii(a,1,`flex h-screen shrink-0 flex-col gap-1 border-r border-sidebar-border bg-sidebar p-3 transition-[width] duration-200 `+(V(n)?`w-[64px] items-center`:`w-[248px]`)),Ii(l,1,`flex items-center gap-2 rounded-md px-2 py-1.5 `+(V(n)?`justify-center`:``)),d=Ii(u,1,`size-2 shrink-0 rounded-full `+(X.status===`live`?`bg-[var(--c-fable)]`:X.status===`offline`?`bg-destructive`:`bg-muted-foreground`),null,d,{"animate-pulse":X.status===`live`}),Ii(g,1,`flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm text-sidebar-foreground/75 transition-colors hover:bg-sidebar-accent/50 hover:text-sidebar-foreground `+(V(n)?`justify-center`:``)),Ii(x,1,`mt-1 flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent/50 hover:text-sidebar-foreground `+(V(n)?`justify-center`:``))}),Xr(`click`,g,function(...e){t.onFaq?.apply(this,e)}),Xr(`click`,x,()=>N(n,!V(n))),W(e,a),O()}Zr([`click`]),Qe();var Ka=H(`<div class="flex flex-col gap-1 bg-card/70 p-4"><span class="font-mono text-xs uppercase tracking-[0.12em] text-muted-foreground"> </span> <span class="font-mono text-2xl tabular-nums text-foreground"> </span></div>`),qa=H(`<div class="grid grid-cols-2 gap-px overflow-hidden rounded-xl border bg-border sm:grid-cols-3 lg:grid-cols-5"></div>`);function Ja(e,t){D(t,!0);let n=A(()=>{let e=X.data?.global;return[{label:`Turns`,v:e?.total_turns??0},{label:`\u2193 Input`,v:e?.total_input_tokens??0},{label:`\u2191 Output`,v:e?.total_output_tokens??0},{label:`\u27F2 Cache R`,v:e?.total_cache_read??0},{label:`\uFF0B Cache W`,v:e?.total_cache_create??0}]});var r=qa();q(r,21,()=>V(n),e=>e.label,(e,t)=>{var n=Ka(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a),T(n),L(e=>{G(i,V(t).label),G(o,e)},[()=>Z(V(t).v)]),W(e,n)}),T(r),W(e,r),O()}var Ya=H(`<span class="font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground"> </span>`),Xa=H(`<header class="flex items-baseline justify-between gap-3"><span class="font-mono text-xs uppercase tracking-[0.14em] text-muted-foreground"> </span> <!></header>`),Za=H(`<section><!> <!></section>`);function Qa(e,t){let n=Y(t,`class`,3,``);var r=Za(),i=P(r),a=e=>{var n=Xa(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=e=>{var n=Ya(),r=P(n,!0);T(n),L(()=>G(r,t.meta)),W(e,n)};K(a,e=>{t.meta&&e(o)}),T(n),L(()=>G(i,t.title)),W(e,n)};K(i,e=>{t.title&&e(a)}),J(I(i,2),()=>t.children??f),T(r),L(()=>Ii(r,1,`flex h-full min-h-0 flex-col gap-3 rounded-xl border bg-card/55 p-4 transition-colors hover:bg-card/80 `+n())),W(e,r)}var $a=H(`<div class="flex flex-col gap-3"><div><div class="font-mono text-3xl text-[var(--money)]"> </div> <div class="font-mono text-sm text-muted-foreground"> </div></div> <div class="flex h-2 overflow-hidden rounded-full bg-border"><div class="h-full bg-muted-foreground/40"></div> <div class="h-full bg-[var(--money)]"></div></div> <div class="flex justify-between font-mono text-xs text-muted-foreground"><span>you paid <b class="text-foreground"> </b></span> <span>baseline <b class="text-foreground"> </b></span></div> <div class="rounded-md border border-dashed border-border px-3 py-2 text-center font-mono text-xs text-muted-foreground"><b class="text-foreground"> </b> blocks \xD7 <b class="text-foreground">500</b> tokens \xD7 <b class="text-foreground">$3</b>/M = <b class="text-[var(--money)]"> </b></div></div>`);function eo(e,t){D(t,!0);let n=A(()=>{let e=X.data?.global,t=e?.blocked_count??0,n=t*500*3/1e6,r=e?.estimated_cost_usd??0,i=r+n;return{blocks:t,money:n,paid:r,baseline:i,pct:i>0?n/i*100:0,tokens:e?.estimated_tokens_saved??0,paidWidth:i>0?r/i*100:100}});{let t=A(()=>`${V(n).pct.toFixed(1)}% off \xB7 floor`);Qa(e,{title:`Synthra savings`,get meta(){return V(t)},children:(e,t)=>{var r=$a(),i=P(r),a=P(i),o=P(a,!0);T(a);var s=I(a,2),c=P(s);T(s),T(i);var l=I(i,2),u=P(l),d=I(u,2);T(l);var f=I(l,2),p=P(f),m=I(P(p)),h=P(m,!0);T(m),T(p);var g=I(p,2),_=I(P(g)),v=P(_,!0);T(_),T(g),T(f);var y=I(f,2),b=P(y),ee=P(b,!0);T(b);var x=I(b,6),te=P(x,!0);T(x),T(y),T(r),L((e,t,r,i,a)=>{G(o,e),G(c,`${t??``} tokens avoided`),Ri(u,`width:${V(n).paidWidth}%`),Ri(d,`width:${100-V(n).paidWidth}%`),G(h,r),G(v,i),G(ee,V(n).blocks),G(te,a)},[()=>pa(V(n).money),()=>Z(V(n).tokens),()=>pa(V(n).paid),()=>pa(V(n).baseline),()=>pa(V(n).money)]),W(e,r)},$$slots:{default:!0}})}O()}var to=H(`<div class="font-mono text-3xl text-[var(--money)]"> </div> <div class="mt-1 flex flex-col gap-1 font-mono text-sm text-muted-foreground"><div class="flex justify-between"><span>Tokens (in+out)</span><span class="text-foreground"> </span></div> <div class="flex justify-between"><span>Avg / turn</span><span class="text-foreground"> </span></div></div>`,1);function no(e,t){D(t,!0);let n=A(()=>{let e=X.data?.global,t=e?.total_turns??0,n=e?.estimated_cost_usd??0;return{cost:n,tokens:(e?.total_input_tokens??0)+(e?.total_output_tokens??0),avg:t>0?n/t:0}});Qa(e,{title:`Total spend`,meta:`all time`,children:(e,t)=>{var r=to(),i=F(r),a=P(i,!0);T(i);var o=I(i,2),s=P(o),c=I(P(s)),l=P(c,!0);T(c),T(s);var u=I(s,2),d=I(P(u)),f=P(d,!0);T(d),T(u),T(o),L((e,t,n)=>{G(a,e),G(l,t),G(f,n)},[()=>pa(V(n).cost),()=>Z(V(n).tokens),()=>pa(V(n).avg)]),W(e,r)},$$slots:{default:!0}}),O()}var ro=ai(`<circle cx="70" cy="70" r="52" fill="none" stroke-width="14"></circle>`),io=H(`<div class="flex items-center gap-2 font-mono text-sm"><span class="size-2 rounded-sm"></span> <span class="flex-1 text-muted-foreground"> </span> <span class="tabular-nums text-foreground"> </span> <span class="w-9 text-right tabular-nums text-muted-foreground"> </span></div>`),ao=H(`<div class="text-sm text-muted-foreground">No turns yet.</div>`),oo=H(`<div class="flex items-center gap-4"><div class="relative size-[116px] shrink-0"><svg viewBox="0 0 140 140" class="size-full -rotate-90"><circle cx="70" cy="70" r="52" fill="none" stroke="var(--border)" stroke-width="14"></circle><!></svg> <div class="absolute inset-0 grid place-items-center"><div class="text-center"><div class="font-mono text-2xl text-foreground"> </div> <div class="font-mono text-[10px] uppercase text-muted-foreground">turns</div></div></div></div> <div class="flex min-w-0 flex-1 flex-col gap-1.5"></div></div>`);function so(e,t){D(t,!0);let n=[{fam:`fable`,label:`Fable`,color:`var(--c-fable)`},{fam:`opus`,label:`Opus`,color:`var(--c-opus)`},{fam:`sonnet`,label:`Sonnet`,color:`var(--c-sonnet)`},{fam:`haiku`,label:`Haiku`,color:`var(--c-haiku)`},{fam:`unknown`,label:`Other`,color:`var(--c-unknown)`}],r=2*Math.PI*52,i=A(()=>{let e={fable:0,opus:0,sonnet:0,haiku:0,unknown:0};for(let t of X.data?.projects??[])for(let[n,r]of Object.entries(t.models??{}))e[ha(n)]+=r;let t=n.reduce((t,n)=>t+e[n.fam],0),i=0;return{arcs:n.filter(t=>e[t.fam]>0).map(n=>{let a=e[n.fam],o=t>0?a/t*r:0,s={...n,n:a,len:o,offset:i,pct:t>0?Math.round(a/t*100):0};return i+=o,s}),total:t}});Qa(e,{title:`Model usage`,meta:`by turns`,children:(e,t)=>{var n=oo(),a=P(n),o=P(a);q(I(P(o)),17,()=>V(i).arcs,e=>e.fam,(e,t)=>{var n=ro();L(()=>{Qi(n,`stroke`,V(t).color),Qi(n,`stroke-dasharray`,`${V(t).len} ${r}`),Qi(n,`stroke-dashoffset`,-V(t).offset),Qi(n,`stroke-linecap`,V(i).arcs.length===1?`round`:`butt`)}),W(e,n)}),T(o);var s=I(o,2),c=P(s),l=P(c),u=P(l,!0);T(l),We(2),T(c),T(s),T(a);var d=I(a,2);q(d,21,()=>V(i).arcs,e=>e.fam,(e,t)=>{var n=io(),r=P(n),i=I(r,2),a=P(i,!0);T(i);var o=I(i,2),s=P(o,!0);T(o);var c=I(o,2),l=P(c);T(c),T(n),L(()=>{Ri(r,`background:${V(t).color}`),G(a,V(t).label),G(s,V(t).n),G(l,`${V(t).pct??``}%`)}),W(e,n)},e=>{W(e,ao())}),T(d),T(n),L(()=>G(u,V(i).total)),W(e,n)},$$slots:{default:!0}}),O()}function co(e){return typeof e==`object`&&!!e}var lo=[`string`,`number`,`bigint`,`boolean`];function uo(e){return e==null||lo.includes(typeof e)?!0:Array.isArray(e)?e.every(e=>uo(e)):typeof e==`object`?Object.getPrototypeOf(e)===Object.prototype:!1}var fo=Symbol(`box`),po=Symbol(`is-writable`);function Q(e,t){let n=A(e);return t?{[fo]:!0,[po]:!0,get current(){return V(n)},set current(e){t(e)}}:{[fo]:!0,get current(){return e()}}}function mo(e){return co(e)&&fo in e}function ho(e){let t=M(mn(e));return{[fo]:!0,[po]:!0,get current(){return V(t)},set current(e){N(t,e,!0)}}}function go(...e){return function(t){for(let n of e)if(n){if(t.defaultPrevented)return;typeof n==`function`?n.call(this,t):n.current?.call(this,t)}}}var _o=/\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g,vo=/\\n/g,yo=/^\\s*/,bo=/^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/,xo=/^:\\s*/,So=/^((?:\'(?:\\\\\'|.)*?\'|"(?:\\\\"|.)*?"|\\([^)]*?\\)|[^};])+)/,Co=/^[;\\s]*/,wo=/^\\s+|\\s+$/g,To=`\n`,Eo=`/`,Do=`*`,Oo=``,ko=`comment`,Ao=`declaration`;function jo(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(vo);t&&(n+=t.length);var i=e.lastIndexOf(To);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(yo)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(!(Eo!=e.charAt(0)||Do!=e.charAt(1))){for(var n=2;Oo!=e.charAt(n)&&(Do!=e.charAt(n)||Eo!=e.charAt(n+1));)++n;if(n+=2,Oo===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:ko,comment:o})}}function f(){var e=a(),t=c(bo);if(t){if(d(),!c(xo))return s(`property missing \':\'`);var n=c(So),r=e({type:Ao,property:Mo(t[0].replace(_o,Oo)),value:n?Mo(n[0].replace(_o,Oo)):Oo});return c(Co),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Mo(e){return e?e.replace(wo,Oo):Oo}function No(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=jo(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var Po=/\\d/,Fo=[`-`,`_`,`/`,`.`];function Io(e=``){if(!Po.test(e))return e!==e.toLowerCase()}function Lo(e){let t=[],n=``,r,i;for(let a of e){let e=Fo.includes(a);if(e===!0){t.push(n),n=``,r=void 0;continue}let o=Io(a);if(i===!1){if(r===!1&&o===!0){t.push(n),n=a,r=o;continue}if(r===!0&&o===!1&&n.length>1){let e=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=e+a,r=o;continue}}n+=a,r=o,i=e}return t.push(n),t}function Ro(e){return e?Lo(e).map(e=>Bo(e)).join(``):``}function zo(e){return Vo(Ro(e||``))}function Bo(e){return e?e[0].toUpperCase()+e.slice(1):``}function Vo(e){return e?e[0].toLowerCase()+e.slice(1):``}function Ho(e){if(!e)return{};let t={};function n(e,n){if(e.startsWith(`-moz-`)||e.startsWith(`-webkit-`)||e.startsWith(`-ms-`)||e.startsWith(`-o-`)){t[Ro(e)]=n;return}if(e.startsWith(`--`)){t[e]=n;return}t[zo(e)]=n}return No(e,n),t}function Uo(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function Wo(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var Go=Wo(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Ko(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${Go(t)}: ${e[t]};`).join(`\n`)}function qo(e={}){return Ko(e).replace(`\n`,` `)}var Jo=new Set(`onabort.onanimationcancel.onanimationend.onanimationiteration.onanimationstart.onauxclick.onbeforeinput.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncompositionend.oncompositionstart.oncompositionupdate.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onfocusin.onfocusout.onformdata.ongotpointercapture.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onload.onloadeddata.onloadedmetadata.onloadstart.onlostpointercapture.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onpaste.onpause.onplay.onplaying.onpointercancel.onpointerdown.onpointerenter.onpointerleave.onpointermove.onpointerout.onpointerover.onpointerup.onprogress.onratechange.onreset.onresize.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onselectionchange.onselectstart.onslotchange.onstalled.onsubmit.onsuspend.ontimeupdate.ontoggle.ontouchcancel.ontouchend.ontouchmove.ontouchstart.ontransitioncancel.ontransitionend.ontransitionrun.ontransitionstart.onvolumechange.onwaiting.onwebkitanimationend.onwebkitanimationiteration.onwebkitanimationstart.onwebkittransitionend.onwheel`.split(`.`));function Yo(e){return Jo.has(e)}function Xo(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];if(r){for(let e of Object.keys(r)){let n=t[e],i=r[e],a=typeof n==`function`,o=typeof i==`function`;if(a&&typeof o&&Yo(e))t[e]=go(n,i);else if(a&&o)t[e]=Uo(n,i);else if(e===`class`){let r=uo(n),a=uo(i);r&&a?t[e]=ki(n,i):r?t[e]=ki(n):a&&(t[e]=ki(i))}else if(e===`style`){let r=typeof n==`object`,a=typeof i==`object`,o=typeof n==`string`,s=typeof i==`string`;if(r&&a)t[e]={...n,...i};else if(r&&s){let r=Ho(i);t[e]={...n,...r}}else if(o&&a)t[e]={...Ho(n),...i};else if(o&&s){let r=Ho(n),a=Ho(i);t[e]={...r,...a}}else r?t[e]=n:a?t[e]=i:o?t[e]=n:s&&(t[e]=i)}else t[e]=i===void 0?n:i}for(let e of Object.getOwnPropertySymbols(r)){let n=t[e],i=r[e];t[e]=i===void 0?n:i}}}return typeof t.style==`object`&&(t.style=qo(t.style).replaceAll(`\n`,` `)),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}var Zo=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function Qo(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var $o=class extends Map{#e=new Map;#t=M(0);#n=M(0);#r=xr||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return xr===this.#r?M(e):cn(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else return V(this.#t),!1;return V(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else{V(this.#t);return}return V(n),super.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),N(this.#n,super.size),fn(o);else if(i!==t){fn(r);var s=o.reactions===null?null:new Set(o.reactions);(s===null||!r.reactions?.every(e=>s.has(e)))&&fn(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),N(n,-1)),r&&(N(this.#n,super.size),fn(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;N(this.#n,0);for(var t of e.values())N(t,-1);fn(this.#t),e.clear()}}#a(){V(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)V(n)}keys(){return V(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return V(this.#n),super.size}};new class{#e;#t;constructor(e={}){let{window:t=Zo,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=bt(e=>{let n=Yr(t,`focusin`,e),r=Yr(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?Qo(this.#e):null}};var es=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return nt(this.#t)}get(){let e=et(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=et(this.#t);return t===void 0?e:t}set(e){return tt(this.#t,e)}};function ts(e,t){switch(e){case`post`:zn(t);break;case`pre`:Vn(t);break}}function ns(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;ts(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=Nr(()=>n(t,o));return o=t,r})}function rs(e,t,n){let r=Hn(()=>{let i=!1;ns(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});zn(()=>r)}function is(e,t,n){ns(e,`post`,t,n)}function as(e,t,n){ns(e,`pre`,t,n)}is.pre=as;function os(e,t){rs(e,`post`,t)}function ss(e,t){rs(e,`pre`,t)}os.pre=ss;function cs(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function ls(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function us(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=M(mn(o)),u=M(!1),d=M(void 0),f=M(mn([])),p=()=>{V(f).forEach(e=>e()),N(f,[],!0)},m=e=>{N(f,[...V(f),e],!0)},h=async(e,n,r=!1)=>{try{N(u,!0),N(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:V(l),refetching:r,onCleanup:m,signal:i.signal});return N(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||N(d,e,!0);return}finally{N(u,!1)}},g=s?cs(h,s):c?ls(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return V(l)},get loading(){return V(u)},get error(){return V(d)},mutate:e=>{N(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function ds(e,t,n){return us(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];is(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function fs(e,t,n){return us(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];is.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}ds.pre=fs;function ps(e){zn(()=>()=>{e()})}function ms(e,t){return setTimeout(t,e)}function hs(e){Ar().then(e)}var gs=1,_s=9,vs=11;function ys(e){return co(e)&&e.nodeType===gs&&typeof e.nodeName==`string`}function bs(e){return co(e)&&e.nodeType===_s}function xs(e){return co(e)&&e.constructor?.name===`VisualViewport`}function Ss(e){return co(e)&&e.nodeType!==void 0}function Cs(e){return Ss(e)&&e.nodeType===vs&&`host`in e}function ws(e,t){if(!e||!t||!ys(e)||!ys(t))return!1;let n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&Cs(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ts(e){return bs(e)?e:xs(e)?e.document:e?.ownerDocument??document}function Es(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var Ds=class{element;#e=A(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return V(this.#e)}set root(e){N(this.#e,e)}constructor(e){typeof e==`function`?this.element=Q(e):this.element=e}getDocument=()=>Ts(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>Es(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function Os(e,t){return{[Pr()]:n=>mo(e)?(e.current=n,Nr(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),Nr(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e(null),t?.(null))})}}function ks(e){return e?``:void 0}function As(e){return e?`open`:`closed`}function js(e){return e===`starting`?{"data-starting-style":``}:e===`ending`?{"data-ending-style":``}:{}}var Ms=class{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(e=>[e,this.getAttr(e)]))}getAttr(e,t){return t?`data-${t}-${e}`:`${this.#t}${e}`}selector(e,t){return`[${this.getAttr(e,t)}]`}};function Ns(e){let t=new Ms(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}var Ps=typeof document<`u`,Fs=Is();function Is(){return Ps&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Ls(e){return e instanceof HTMLElement}function Rs(e){return e instanceof Element||e instanceof SVGElement}var zs=class{#e;#t=null;#n=null;#r=0;constructor(e){this.#e=e,ps(()=>this.#i())}#i(){this.#t!==null&&(window.cancelAnimationFrame(this.#t),this.#t=null),this.#n?.disconnect(),this.#n=null,this.#r++}run(e){this.#i();let t=this.#e.ref.current;if(!t)return;if(typeof t.getAnimations!=`function`){this.#a(e);return}let n=this.#r,r=()=>{n===this.#r&&this.#a(e)},i=()=>{if(n!==this.#r)return;let e=t.getAnimations();if(e.length===0){r();return}Promise.all(e.map(e=>e.finished)).then(()=>{r()}).catch(()=>{if(n===this.#r){if(t.getAnimations().some(e=>e.pending||e.playState!==`finished`)){i();return}r()}})},a=()=>{this.#t=window.requestAnimationFrame(()=>{this.#t=null,i()})};if(!this.#e.afterTick.current){a();return}this.#t=window.requestAnimationFrame(()=>{this.#t=null;let e=`data-starting-style`;if(!t.hasAttribute(e)){a();return}this.#n=new MutationObserver(()=>{n===this.#r&&(t.hasAttribute(e)||(this.#n?.disconnect(),this.#n=null,a()))}),this.#n.observe(t,{attributes:!0,attributeFilter:[e]})})}#a(e){let t=()=>{e()};this.#e.afterTick?hs(t):t()}},Bs=class{#e;#t;#n;#r=M(!1);#i=M(void 0);#a=!1;#o=null;constructor(e){this.#e=e,N(this.#r,e.open.current,!0),this.#t=e.enabled??!0,this.#n=new zs({ref:this.#e.ref,afterTick:this.#e.open}),ps(()=>this.#s()),is(()=>this.#e.open.current,e=>{if(!this.#a){this.#a=!0;return}if(this.#s(),!e&&this.#e.shouldSkipExitAnimation?.()){N(this.#r,!1),N(this.#i,void 0),this.#e.onComplete?.();return}if(e&&N(this.#r,!0),N(this.#i,e?`starting`:`ending`,!0),e&&(this.#o=window.requestAnimationFrame(()=>{this.#o=null,this.#e.open.current&&N(this.#i,void 0)})),!this.#t){e||N(this.#r,!1),N(this.#i,void 0),this.#e.onComplete?.();return}this.#n.run(()=>{e===this.#e.open.current&&(this.#e.open.current||N(this.#r,!1),N(this.#i,void 0),this.#e.onComplete?.())})})}get shouldRender(){return V(this.#r)}get transitionStatus(){return V(this.#i)}#s(){this.#o!==null&&(window.cancelAnimationFrame(this.#o),this.#o=null)}};function $(){}function Vs(e,t){return t===void 0?`bits-${e}`:`bits-${e}-${t}`}var Hs=Ns({component:`dialog`,parts:[`content`,`trigger`,`overlay`,`title`,`description`,`close`,`cancel`,`action`]}),Us=new es(`Dialog.Root | AlertDialog.Root`),Ws=class e{static create(t){let n=Us.getOr(null);return Us.set(new e(t,n))}opts;#e=M(null);get triggerNode(){return V(this.#e)}set triggerNode(e){N(this.#e,e,!0)}#t=M(null);get contentNode(){return V(this.#t)}set contentNode(e){N(this.#t,e,!0)}#n=M(null);get overlayNode(){return V(this.#n)}set overlayNode(e){N(this.#n,e,!0)}#r=M(null);get descriptionNode(){return V(this.#r)}set descriptionNode(e){N(this.#r,e,!0)}#i=M(void 0);get contentId(){return V(this.#i)}set contentId(e){N(this.#i,e,!0)}#a=M(void 0);get titleId(){return V(this.#a)}set titleId(e){N(this.#a,e,!0)}#o=M(void 0);get triggerId(){return V(this.#o)}set triggerId(e){N(this.#o,e,!0)}#s=M(void 0);get descriptionId(){return V(this.#s)}set descriptionId(e){N(this.#s,e,!0)}#c=M(null);get cancelNode(){return V(this.#c)}set cancelNode(e){N(this.#c,e,!0)}#l=M(0);get nestedOpenCount(){return V(this.#l)}set nestedOpenCount(e){N(this.#l,e,!0)}depth;parent;contentPresence;overlayPresence;constructor(e,t){this.opts=e,this.parent=t,this.depth=t?t.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new Bs({ref:Q(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Bs({ref:Q(()=>this.overlayNode),open:this.opts.open,enabled:!0}),is(()=>this.opts.open.current,e=>{this.parent&&(e?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),ps(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=e=>Hs.getAttr(e,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#u=A(()=>({"data-state":As(this.opts.open.current)}));get sharedProps(){return V(this.#u)}set sharedProps(e){N(this.#u,e)}},Gs=class e{static create(t){return new e(t,Us.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Os(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),this.root.handleClose())}#e=A(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:``,onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return V(this.#e)}set props(e){N(this.#e,e)}},Ks=class e{static create(t){return new e(t,Us.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.titleId=this.opts.id.current,this.attachment=Os(this.opts.ref),is.pre(()=>this.opts.id.current,e=>{this.root.titleId=e})}#e=A(()=>({id:this.opts.id.current,role:`heading`,"aria-level":this.opts.level.current,[this.root.getBitsAttr(`title`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return V(this.#e)}set props(e){N(this.#e,e)}},qs=class e{static create(t){return new e(t,Us.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.descriptionId=this.opts.id.current,this.attachment=Os(this.opts.ref,e=>{this.root.descriptionNode=e}),is.pre(()=>this.opts.id.current,e=>{this.root.descriptionId=e})}#e=A(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`description`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return V(this.#e)}set props(e){N(this.#e,e)}},Js=class e{static create(t){return new e(t,Us.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Os(this.opts.ref,e=>{this.root.contentNode=e,this.root.contentId=e?.id})}#e=A(()=>({open:this.root.opts.open.current}));get snippetProps(){return V(this.#e)}set snippetProps(e){N(this.#e,e)}#t=A(()=>({id:this.opts.id.current,role:this.root.opts.variant.current===`alert-dialog`?`alertdialog`:`dialog`,"aria-modal":`true`,"aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr(`content`)]:``,style:{pointerEvents:`auto`,outline:this.root.opts.variant.current===`alert-dialog`?`none`:void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:`layout style`},tabindex:this.root.opts.variant.current===`alert-dialog`?-1:void 0,"data-nested-open":ks(this.root.nestedOpenCount>0),"data-nested":ks(this.root.parent!==null),...js(this.root.contentPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return V(this.#t)}set props(e){N(this.#t,e)}get shouldRender(){return this.root.contentPresence.shouldRender}},Ys=class e{static create(t){return new e(t,Us.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Os(this.opts.ref,e=>this.root.overlayNode=e)}#e=A(()=>({open:this.root.opts.open.current}));get snippetProps(){return V(this.#e)}set snippetProps(e){N(this.#e,e)}#t=A(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`overlay`)]:``,style:{pointerEvents:`auto`,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":ks(this.root.nestedOpenCount>0),"data-nested":ks(this.root.parent!==null),...js(this.root.overlayPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return V(this.#t)}set props(e){N(this.#t,e)}get shouldRender(){return this.root.overlayPresence.shouldRender}},Xs=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`level`]),Zs=H(`<div><!></div>`);function Qs(e,t){let n=si();D(t,!0);let r=Y(t,`id`,19,()=>Vs(n)),i=Y(t,`ref`,15,null),a=Y(t,`level`,3,2),o=ca(t,Xs),s=Ks.create({id:Q(()=>r()),level:Q(()=>a()),ref:Q(()=>i(),e=>i(e))}),c=A(()=>Xo(o,s.props));var l=U(),u=F(l),d=e=>{var n=U();J(F(n),()=>t.child,()=>({props:V(c)})),W(e,n)},p=e=>{var n=Zs();ea(n,()=>({...V(c)})),J(P(n),()=>t.children??f),T(n),W(e,n)};K(u,e=>{t.child?e(d):e(p,-1)}),W(e,l),O()}function $s(e,t){var n=U();hi(F(n),()=>t.children,e=>{var n=U();J(F(n),()=>t.children??f),W(e,n)}),W(e,n)}var ec=new es(`BitsConfig`);function tc(){let e=new nc(null,{});return ec.getOr(e).opts}var nc=class{opts;constructor(e,t){let n=rc(e,t);this.opts={defaultPortalTo:n(e=>e.defaultPortalTo),defaultLocale:n(e=>e.defaultLocale)}}};function rc(e,t){return n=>Q(()=>{let r=n(t)?.current;if(r!==void 0)return r;if(e!==null)return n(e.opts)?.current})}function ic(e,t){return n=>{let r=tc();return Q(()=>{let i=n();if(i!==void 0)return i;let a=e(r).current;return a===void 0?t:a})}}var ac=ic(e=>e.defaultPortalTo,`body`);function oc(e,t){D(t,!0);let n=ac(()=>t.to),r=rt(),i=A(a);function a(){if(!Ps||t.disabled)return null;let e=null;return e=typeof n.current==`string`?document.querySelector(n.current):n.current,e}let o;function s(){o&&=(fi(o),null)}is([()=>V(i),()=>t.disabled],([e,n])=>{if(!e||n){s();return}return o=ci($s,{target:e,props:{children:t.children},context:r}),()=>{s()}});var c=U(),l=F(c),u=e=>{var n=U();J(F(n),()=>t.children??f),W(e,n)};K(l,e=>{t.disabled&&e(u)}),W(e,c),O()}var sc=class{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){let n=this.createEvent(t);return e.dispatchEvent(n),n}listen(e,t,n){return Yr(e,this.eventName,e=>{t(e)},n)}};function cc(e,t=500){let n=null,r=(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function lc(e,t){return e===t||e.contains(t)}function uc(e){return e?.ownerDocument??document}function dc(e,t){let{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}var fc=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],pc=fc.join(`,`),mc=typeof Element>`u`,hc=mc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,gc=!mc&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},_c=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):_c(e.parentNode))},vc=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},yc=function(e,t,n){if(_c(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(pc));return t&&hc.call(e,pc)&&r.unshift(e),r=r.filter(n),r},bc=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!_c(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=bc(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{hc.call(a,pc)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!_c(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=bc(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},xc=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Sc=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||vc(e))&&!xc(e)?0:e.tabIndex},Cc=function(e,t){var n=Sc(e);return n<0&&t&&!xc(e)?0:n},wc=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Tc=function(e){return e.tagName===`INPUT`},Ec=function(e){return Tc(e)&&e.type===`hidden`},Dc=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Oc=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},kc=function(e){if(!e.name)return!0;var t=e.form||gc(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Oc(r,e.form);return!i||i===e},Ac=function(e){return Tc(e)&&e.type===`radio`},jc=function(e){return Ac(e)&&!kc(e)},Mc=function(e){var t=e&&gc(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=gc(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Nc=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Pc=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=hc.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(hc.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=gc(e);if(o&&!o.shadowRoot&&r(o)===!0)return Nc(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Mc(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Nc(e);return!1},Fc=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return hc.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Ic=function(e,t){return!(t.disabled||Ec(t)||Pc(t,e)||Dc(t)||Fc(t))},Lc=function(e,t){return!(jc(t)||Sc(t)<0||!Ic(e,t))},Rc=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},zc=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Cc(a,i),s=i?zc(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(wc).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Bc=function(e,t){return t||={},zc(t.getShadowRoot?bc([e],t.includeContainer,{filter:Lc.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Rc}):yc(e,t.includeContainer,Lc.bind(null,t)))},Vc=function(e,t){return t||={},t.getShadowRoot?bc([e],t.includeContainer,{filter:Ic.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):yc(e,t.includeContainer,Ic.bind(null,t))},Hc=fc.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),Uc=function(e,t){if(t||={},!e)throw Error(`No node provided`);return hc.call(e,Hc)===!1?!1:Ic(t,e)},Wc=`data-context-menu-trigger`,Gc=`data-context-menu-content`;new es(`Menu.Root`),new es(`Menu.Root | Menu.Sub`),new es(`Menu.Content`),new es(`Menu.Group | Menu.RadioGroup`),new es(`Menu.RadioGroup`),new es(`Menu.CheckboxGroup`),new sc(`bitsmenuopen`,{bubbles:!1,cancelable:!0}),Ns({component:`menu`,parts:[`trigger`,`content`,`sub-trigger`,`item`,`group`,`group-heading`,`checkbox-group`,`checkbox-item`,`radio-group`,`radio-item`,`separator`,`sub-content`,`arrow`]}),globalThis.bitsDismissableLayers??=new Map;var Kc=class e{static create(t){return new e(t)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#i=!1;#a=void 0;#o;#s=$;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#o=e.onFocusOutside,zn(()=>{this.#a=uc(this.opts.ref.current)});let t=$,n=()=>{this.#g(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),t()};is([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return ms(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),t(),t=this.#l())}),n}),ps(()=>{this.#g.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),t()})}#c=e=>{e.defaultPrevented||this.opts.ref.current&&hs(()=>{!this.opts.ref.current||this.#h(e.target)||e.target&&!this.#i&&this.#o.current?.(e)})};#l(){return Uo(Yr(this.#a,`pointerdown`,Uo(this.#f,this.#m),{capture:!0}),Yr(this.#a,`pointerdown`,Uo(this.#p,this.#d)),Yr(this.#a,`focusin`,this.#c))}#u=e=>{let t=e;t.defaultPrevented&&(t=Xc(e)),this.#e.current(e)};#d=cc(e=>{if(!this.opts.ref.current){this.#s();return}let t=this.opts.isValidEvent.current(e,this.opts.ref.current)||Yc(e,this.opts.ref.current);if(!this.#r||this.#_()||!t){this.#s();return}let n=e;if(n.defaultPrevented&&(n=Xc(n)),this.#t.current!==`close`&&this.#t.current!==`defer-otherwise-close`){this.#s();return}e.pointerType===`touch`?(this.#s(),this.#s=Yr(this.#a,`click`,this.#u,{once:!0})):this.#e.current(n)},10);#f=e=>{this.#n[e.type]=!0};#p=e=>{this.#n[e.type]=!1};#m=()=>{this.opts.ref.current&&(this.#r=Jc(this.opts.ref.current))};#h=e=>this.opts.ref.current?lc(this.opts.ref.current,e):!1;#g=cc(()=>{for(let e in this.#n)this.#n[e]=!1;this.#r=!1},20);#_(){return Object.values(this.#n).some(Boolean)}#v=()=>{this.#i=!0};#y=()=>{this.#i=!1};props={onfocuscapture:this.#v,onblurcapture:this.#y}};function qc(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([e,{current:t}])=>t===`close`||t===`ignore`)}function Jc(e){let t=[...globalThis.bitsDismissableLayers],n=qc(t);if(n)return n[0].opts.ref.current===e;let[r]=t[0];return r.opts.ref.current===e}function Yc(e,t){let n=e.target;if(!Rs(n))return!1;let r=!!n.closest(`[${Wc}]`),i=!!t.closest(`[${Gc}]`);return`button`in e&&e.button>0&&!r?!1:`button`in e&&e.button===0&&r&&i?!0:r&&i?!1:uc(n).documentElement.contains(n)&&!lc(t,n)&&dc(e,t)}function Xc(e){let t=e.currentTarget,n=e.target,r;r=e instanceof PointerEvent?new PointerEvent(e.type,e):new PointerEvent(`pointerdown`,e);let i=!1;return new Proxy(r,{get:(r,a)=>a===`currentTarget`?t:a===`target`?n:a===`preventDefault`?()=>{i=!0,typeof r.preventDefault==`function`&&r.preventDefault()}:a===`defaultPrevented`?i:a in r?r[a]:e[a]})}function Zc(e,t){D(t,!0);let n=Y(t,`interactOutsideBehavior`,3,`close`),r=Y(t,`onInteractOutside`,3,$),i=Y(t,`onFocusOutside`,3,$),a=Y(t,`isValidEvent`,3,()=>!1),o=Kc.create({id:Q(()=>t.id),interactOutsideBehavior:Q(()=>n()),onInteractOutside:Q(()=>r()),enabled:Q(()=>t.enabled),onFocusOutside:Q(()=>i()),isValidEvent:Q(()=>a()),ref:t.ref});var s=U();J(F(s),()=>t.children??f,()=>({props:o.props})),W(e,s),O()}globalThis.bitsEscapeLayers??=new Map;var Qc=class e{static create(t){return new e(t)}opts;domContext;constructor(e){this.opts=e,this.domContext=new Ds(this.opts.ref);let t=$;is(()=>e.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>Yr(this.domContext.getDocument(),`keydown`,this.#t,{passive:!1});#t=e=>{if(e.key!==`Escape`||!$c(this))return;let t=new KeyboardEvent(e.type,e);e.preventDefault();let n=this.opts.escapeKeydownBehavior.current;n!==`close`&&n!==`defer-otherwise-close`||this.opts.onEscapeKeydown.current(t)}};function $c(e){let t=[...globalThis.bitsEscapeLayers],n=t.findLast(([e,{current:t}])=>t===`close`||t===`ignore`);if(n)return n[0]===e;let[r]=t[0];return r===e}function el(e,t){D(t,!0);let n=Y(t,`escapeKeydownBehavior`,3,`close`),r=Y(t,`onEscapeKeydown`,3,$);Qc.create({escapeKeydownBehavior:Q(()=>n()),onEscapeKeydown:Q(()=>r()),enabled:Q(()=>t.enabled),ref:t.ref});var i=U();J(F(i),()=>t.children??f),W(e,i),O()}var tl=class e{static instance;#e=ho([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||=new e,this.instance}register(e){let t=this.getActive();t&&t!==e&&t.pause();let n=document.activeElement;n&&n!==document.body&&this.#n.set(e,n),this.#e.current=this.#e.current.filter(t=>t!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(t=>t!==e);let t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,t){this.#n.set(e,t)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}},nl=class e{#e=!1;#t=null;#n=tl.getInstance();#r=[];#i;constructor(e){this.#i=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#a(){for(let e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#c(),this.#o()}unmount(){this.#t&&=(this.#a(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),null)}#o(){if(!this.#t)return;let e=new CustomEvent(`focusScope.onOpenAutoFocus`,{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;let e=this.#u();e?(e.focus(),this.#n.setFocusMemory(this,e)):this.#t.focus()})}#s(){let e=new CustomEvent(`focusScope.onCloseAutoFocus`,{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(e),!e.defaultPrevented){let e=this.#n.getPreFocusMemory(this);if(e&&document.contains(e))try{e.focus()}catch{document.body.focus()}}}#c(){if(!this.#t||!this.#i.trap.current)return;let e=this.#t,t=e.ownerDocument;this.#r.push(Yr(t,`focusin`,t=>{if(this.#e||!this.#n.isActiveScope(this))return;let n=t.target;if(n)if(e.contains(n))this.#n.setFocusMemory(this,n);else{let n=this.#n.getFocusMemory(this);if(n&&e.contains(n)&&Uc(n))t.preventDefault(),n.focus();else{let t=this.#u(),n=this.#d()[0];(t||n||e).focus()}}},{capture:!0}),Yr(e,`keydown`,e=>{if(!this.#i.loop||this.#e||e.key!==`Tab`||!this.#n.isActiveScope(this))return;let n=this.#l();if(n.length===0)return;let r=n[0],i=n[n.length-1];!e.shiftKey&&t.activeElement===i?(e.preventDefault(),r.focus()):e.shiftKey&&t.activeElement===r&&(e.preventDefault(),i.focus())}));let n=new MutationObserver(()=>{let t=this.#n.getFocusMemory(this);if(t&&!e.contains(t)){let t=this.#u(),n=this.#d()[0],r=t||n;r?(r.focus(),this.#n.setFocusMemory(this,r)):e.focus()}});n.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>n.disconnect())}#l(){return this.#t?Bc(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#l()[0]||null}#d(){return this.#t?Vc(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return is([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||=new e(t),n.mount(r)):n&&=(n.unmount(),null)}),ps(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}};function rl(e,t){D(t,!0);let n=Y(t,`enabled`,3,!1),r=Y(t,`trapFocus`,3,!1),i=Y(t,`loop`,3,!1),a=Y(t,`onCloseAutoFocus`,3,$),o=Y(t,`onOpenAutoFocus`,3,$),s=nl.use({enabled:Q(()=>n()),trap:Q(()=>r()),loop:i(),onCloseAutoFocus:Q(()=>a()),onOpenAutoFocus:Q(()=>o()),ref:t.ref});var c=U();J(F(c),()=>t.focusScope??f,()=>({props:s.props})),W(e,c),O()}var il=()=>{};globalThis.bitsTextSelectionLayers??=new Map;var al=class e{static create(t){return new e(t)}opts;domContext;#e=$;#t=!1;#n=il;#r=il;constructor(e){this.opts=e,this.domContext=new Ds(e.ref);let t=$;is(()=>[this.opts.enabled.current,this.opts.onPointerDown.current,this.opts.onPointerUp.current],([e,n,r])=>(this.#t=e,this.#n=n,this.#r=r,e&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#i()),()=>{this.#t=!1,t(),this.#s(),globalThis.bitsTextSelectionLayers.delete(this)}))}#i(){return Uo(Yr(this.domContext.getDocument(),`pointerdown`,this.#o),Yr(this.domContext.getDocument(),`pointerup`,go(this.#s,this.#a)))}#a=e=>{this.#r(e)};#o=e=>{let t=this.opts.ref.current,n=e.target;!Ls(t)||!Ls(n)||!this.#t||!ll(this)||!ws(t,n)||(this.#n(e),!e.defaultPrevented&&(this.#e=sl(t,this.domContext.getDocument().body)))};#s=()=>{this.#e(),this.#e=$}},ol=e=>e.style.userSelect||e.style.webkitUserSelect;function sl(e,t){let n=ol(t),r=ol(e);return cl(t,`none`),cl(e,`text`),()=>{cl(t,n),cl(e,r)}}function cl(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function ll(e){let t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;let n=t.at(-1);return n?n[0]===e:!1}function ul(e,t){D(t,!0);let n=Y(t,`preventOverflowTextSelection`,3,!0),r=Y(t,`onPointerDown`,3,$),i=Y(t,`onPointerUp`,3,$);al.create({id:Q(()=>t.id),onPointerDown:Q(()=>r()),onPointerUp:Q(()=>i()),enabled:Q(()=>t.enabled&&n()),ref:t.ref});var a=U();J(F(a),()=>t.children??f),W(e,a),O()}globalThis.bitsIdCounter??={current:0};function dl(e=`bits`){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}var fl=class{#e;#t=0;#n=M();#r;constructor(e){this.#e=e}#i(){--this.#t,this.#r&&this.#t<=0&&(this.#r(),N(this.#n,void 0),this.#r=void 0)}get(...e){return this.#t+=1,V(this.#n)===void 0&&(this.#r=Hn(()=>{N(this.#n,this.#e(...e),!0)})),zn(()=>()=>{this.#i()}),V(this.#n)}},pl=new $o,ml=M(null),hl=null,gl=null,_l=!1,vl=Q(()=>{for(let e of pl.values())if(e)return!0;return!1}),yl=null,bl=new fl(()=>{function e(){document.body.setAttribute(`style`,V(ml)??``),document.body.style.removeProperty(`--scrollbar-width`),Fs&&hl?.(),N(ml,null)}function t(){gl!==null&&(window.clearTimeout(gl),gl=null)}function n(e,n){t(),_l=!0,yl=Date.now();let r=yl,i=()=>{gl=null,yl===r&&(Sl(pl)?_l=!1:(_l=!1,n()))},a=e===null?24:e;gl=window.setTimeout(i,a)}function r(){V(ml)===null&&pl.size===0&&!_l&&N(ml,document.body.getAttribute(`style`),!0)}return is(()=>vl.current,()=>{if(!vl.current)return;r(),_l=!1;let e=getComputedStyle(document.documentElement),t=getComputedStyle(document.body),n=e.scrollbarGutter?.includes(`stable`)||t.scrollbarGutter?.includes(`stable`),i=window.innerWidth-document.documentElement.clientWidth,a={padding:Number.parseInt(t.paddingRight??`0`,10)+i,margin:Number.parseInt(t.marginRight??`0`,10)};i>0&&!n&&(document.body.style.paddingRight=`${a.padding}px`,document.body.style.marginRight=`${a.margin}px`,document.body.style.setProperty(`--scrollbar-width`,`${i}px`)),document.body.style.overflow=`hidden`,Fs&&(hl=Yr(document,`touchmove`,e=>{e.target===document.documentElement&&(e.touches.length>1||e.preventDefault())},{passive:!1})),hs(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})}),ps(()=>()=>{hl?.()}),{get lockMap(){return pl},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}}),xl=class{#e=dl();#t;#n=()=>null;#r;locked;constructor(e,t=()=>null){this.#t=e,this.#n=t,this.#r=bl.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=Q(()=>this.#r.lockMap.get(this.#e)??!1,e=>this.#r.lockMap.set(this.#e,e)),ps(()=>{if(this.#r.lockMap.delete(this.#e),Sl(this.#r.lockMap))return;let e=this.#n();this.#r.scheduleCleanupIfNoNewLocks(e,()=>{this.#r.resetBodyStyle()})}))}};function Sl(e){for(let[t,n]of e)if(n)return!0;return!1}function Cl(e,t){D(t,!0);let n=Y(t,`preventScroll`,3,!0),r=Y(t,`restoreScrollDelay`,3,null);n()&&new xl(n(),()=>r()),O()}var wl=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`forceMount`,`child`,`children`,`ref`]),Tl=H(`<div><!></div>`);function El(e,t){let n=si();D(t,!0);let r=Y(t,`id`,19,()=>Vs(n)),i=Y(t,`forceMount`,3,!1),a=Y(t,`ref`,15,null),o=ca(t,wl),s=Ys.create({id:Q(()=>r()),ref:Q(()=>a(),e=>a(e))}),c=A(()=>Xo(o,s.props));var l=U(),u=F(l),d=e=>{var n=U(),r=F(n),i=e=>{var n=U(),r=F(n);{let e=A(()=>({props:Xo(V(c)),...s.snippetProps}));J(r,()=>t.child,()=>V(e))}W(e,n)},a=e=>{var n=Tl();ea(n,e=>({...e}),[()=>Xo(V(c))]),J(P(n),()=>t.children??f,()=>s.snippetProps),T(n),W(e,n)};K(r,e=>{t.child?e(i):e(a,-1)}),W(e,n)};K(u,e=>{(s.shouldRender||i())&&e(d)}),W(e,l),O()}var Dl=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`]),Ol=H(`<div><!></div>`);function kl(e,t){let n=si();D(t,!0);let r=Y(t,`id`,19,()=>Vs(n)),i=Y(t,`ref`,15,null),a=ca(t,Dl),o=qs.create({id:Q(()=>r()),ref:Q(()=>i(),e=>i(e))}),s=A(()=>Xo(a,o.props));var c=U(),l=F(c),u=e=>{var n=U();J(F(n),()=>t.child,()=>({props:V(s)})),W(e,n)},d=e=>{var n=Ol();ea(n,()=>({...V(s)})),J(P(n),()=>t.children??f),T(n),W(e,n)};K(l,e=>{t.child?e(u):e(d,-1)}),W(e,c),O()}function Al(e,t){D(t,!0);let n=Y(t,`open`,15,!1),r=Y(t,`onOpenChange`,3,$),i=Y(t,`onOpenChangeComplete`,3,$);Ws.create({variant:Q(()=>`dialog`),open:Q(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:Q(()=>i())});var a=U();J(F(a),()=>t.children??f),W(e,a),O()}var jl=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`disabled`]),Ml=H(`<button><!></button>`);function Nl(e,t){let n=si();D(t,!0);let r=Y(t,`id`,19,()=>Vs(n)),i=Y(t,`ref`,15,null),a=Y(t,`disabled`,3,!1),o=ca(t,jl),s=Gs.create({variant:Q(()=>`close`),id:Q(()=>r()),ref:Q(()=>i(),e=>i(e)),disabled:Q(()=>!!a())}),c=A(()=>Xo(o,s.props));var l=U(),u=F(l),d=e=>{var n=U();J(F(n),()=>t.child,()=>({props:V(c)})),W(e,n)},p=e=>{var n=Ml();ea(n,()=>({...V(c)})),J(P(n),()=>t.children??f),T(n),W(e,n)};K(u,e=>{t.child?e(d):e(p,-1)}),W(e,l),O()}var Pl=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`,`forceMount`,`onCloseAutoFocus`,`onOpenAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`restoreScrollDelay`]),Fl=H(`<!> <!>`,1),Il=H(`<!> <div><!></div>`,1);function Ll(e,t){let n=si();D(t,!0);let r=Y(t,`id`,19,()=>Vs(n)),i=Y(t,`ref`,15,null),a=Y(t,`forceMount`,3,!1),o=Y(t,`onCloseAutoFocus`,3,$),s=Y(t,`onOpenAutoFocus`,3,$),c=Y(t,`onEscapeKeydown`,3,$),l=Y(t,`onInteractOutside`,3,$),u=Y(t,`trapFocus`,3,!0),d=Y(t,`preventScroll`,3,!0),p=Y(t,`restoreScrollDelay`,3,null),m=ca(t,Pl),h=Js.create({id:Q(()=>r()),ref:Q(()=>i(),e=>i(e))}),g=A(()=>Xo(m,h.props));var _=U(),v=F(_),y=e=>{rl(e,{get ref(){return h.opts.ref},loop:!0,get trapFocus(){return u()},get enabled(){return h.root.opts.open.current},get onOpenAutoFocus(){return s()},get onCloseAutoFocus(){return o()},focusScope:(e,n)=>{let r=()=>n?.().props;el(e,ua(()=>V(g),{get enabled(){return h.root.opts.open.current},get ref(){return h.opts.ref},onEscapeKeydown:e=>{c()(e),!e.defaultPrevented&&h.root.handleClose()},children:(e,n)=>{Zc(e,ua(()=>V(g),{get ref(){return h.opts.ref},get enabled(){return h.root.opts.open.current},onInteractOutside:e=>{l()(e),!e.defaultPrevented&&h.root.handleClose()},children:(e,n)=>{ul(e,ua(()=>V(g),{get ref(){return h.opts.ref},get enabled(){return h.root.opts.open.current},children:(e,n)=>{var i=U(),a=F(i),o=e=>{var n=Fl(),i=F(n),a=e=>{Cl(e,{get preventScroll(){return d()},get restoreScrollDelay(){return p()}})};K(i,e=>{h.root.opts.open.current&&e(a)});var o=I(i,2);{let e=A(()=>({props:Xo(V(g),r()),...h.snippetProps}));J(o,()=>t.child,()=>V(e))}W(e,n)},s=e=>{var n=Il(),i=F(n);Cl(i,{get preventScroll(){return d()}});var a=I(i,2);ea(a,e=>({...e}),[()=>Xo(V(g),r())]),J(P(a),()=>t.children??f),T(a),W(e,n)};K(a,e=>{t.child?e(o):e(s,-1)}),W(e,i)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};K(v,e=>{(h.shouldRender||a())&&e(y)}),W(e,_),O()}var Rl=H(`<button class="flex flex-col gap-1 text-left"><div class="flex items-center gap-2 font-mono text-sm"><span class="size-2 shrink-0 rounded-sm"></span> <span class="flex-1 truncate text-foreground"> </span> <span class="tabular-nums text-muted-foreground"> </span></div> <div class="h-1 overflow-hidden rounded-full bg-border"><div class="h-full"></div></div></button>`),zl=H(`<div class="text-sm text-muted-foreground">No projects tracked yet \u2014 run <code class="text-foreground">syn .</code></div>`),Bl=H(`<div class="flex max-h-[260px] flex-col gap-2 overflow-y-auto pr-1"></div>`),Vl=H(`<div class="flex flex-col gap-0.5 bg-card p-3"><span class="font-mono text-[10px] uppercase tracking-[0.1em] text-muted-foreground"> </span> <span class="font-mono text-sm text-foreground"> </span></div>`),Hl=H(`<!> <!> <div class="mt-4 grid grid-cols-2 gap-px overflow-hidden rounded-lg border bg-border"></div> <!>`,1),Ul=H(`<!> <!>`,1);function Wl(e,t){D(t,!0);let n=M(!1),r=M(null),i=A(()=>X.data?.projects??[]),a=A(()=>Math.max(1,...V(i).map(e=>e.total_turns)));function o(e){let t=(X.data?.recent_turns??[]).find(t=>t.project_path===e.path);return t?ma(t.ts):e.last_seen?ma(e.last_seen):`\u2014`}function s(e){return[[`Cost`,pa(e.estimated_cost_usd)],[`Turns`,Z(e.total_turns)],[`Input`,Z(e.total_input_tokens)],[`Output`,Z(e.total_output_tokens)],[`Cache R`,Z(e.total_cache_read)],[`Cache W`,Z(e.total_cache_create)],[`Blocks`,Z(e.blocked_count)],[`Last active`,o(e)]]}var c=Ul(),l=F(c);Qa(l,{title:`Projects`,meta:`by turns`,children:(e,t)=>{var o=Bl();q(o,21,()=>V(i),e=>e.path,(e,t)=>{var i=Rl(),o=P(i),s=P(o),c=I(s,2),l=P(c,!0);T(c);var u=I(c,2),d=P(u,!0);T(u),T(o);var f=I(o,2),p=P(f);T(f),T(i),L((e,n,r)=>{Ri(s,e),G(l,V(t).name),G(d,n),Ri(p,r)},[()=>`background:${ya(V(t).name)}`,()=>Z(V(t).total_turns),()=>`width:${V(t).total_turns/V(a)*100}%; background:${ya(V(t).name)}`]),Xr(`click`,i,()=>{N(r,V(t),!0),N(n,!0)}),W(e,i)},e=>{W(e,zl())}),T(o),W(e,o)},$$slots:{default:!0}}),Ti(I(l,2),()=>Al,(e,t)=>{t(e,{get open(){return V(n)},set open(e){N(n,e,!0)},children:(e,t)=>{var n=U();Ti(F(n),()=>oc,(e,t)=>{t(e,{children:(e,t)=>{var n=Ul(),i=F(n);Ti(i,()=>El,(e,t)=>{t(e,{class:`fixed inset-0 z-50 bg-black/60`})}),Ti(I(i,2),()=>Ll,(e,t)=>{t(e,{class:`fixed left-1/2 top-1/2 z-50 w-[min(440px,92vw)] -translate-x-1/2 -translate-y-1/2 rounded-xl border bg-card p-5 text-card-foreground shadow-2xl`,children:(e,t)=>{var n=U(),i=F(n),a=e=>{var t=Hl(),n=F(t);{let e=A(()=>`color:${ya(V(r).name)}`);Ti(n,()=>Qs,(t,n)=>{n(t,{class:`font-serif text-xl`,get style(){return V(e)},children:(e,t)=>{We();var n=oi();L(()=>G(n,V(r).name)),W(e,n)},$$slots:{default:!0}})})}var i=I(n,2);Ti(i,()=>kl,(e,t)=>{t(e,{class:`truncate font-mono text-xs text-muted-foreground`,children:(e,t)=>{We();var n=oi();L(()=>G(n,V(r).path)),W(e,n)},$$slots:{default:!0}})});var a=I(i,2);q(a,21,()=>s(V(r)),([e,t])=>e,(e,t)=>{var n=A(()=>h(V(t),2));let r=()=>V(n)[0],i=()=>V(n)[1];var a=Vl(),o=P(a),s=P(o,!0);T(o);var c=I(o,2),l=P(c,!0);T(c),T(a),L(()=>{G(s,r()),G(l,i())}),W(e,a)}),T(a),Ti(I(a,2),()=>Nl,(e,t)=>{t(e,{class:`mt-4 w-full rounded-md border py-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:(e,t)=>{We(),W(e,oi(`Close`))},$$slots:{default:!0}})}),W(e,t)};K(i,e=>{V(r)&&e(a)}),W(e,n)},$$slots:{default:!0}})}),W(e,n)},$$slots:{default:!0}})}),W(e,n)},$$slots:{default:!0}})}),W(e,c),O()}Zr([`click`]);var Gl=H(`<div class="flex items-baseline justify-between font-mono text-sm"><span class="text-muted-foreground"> </span> <span class="tabular-nums text-foreground"> </span></div>`),Kl=H(`<div class="text-sm text-muted-foreground">No graph-tool calls yet.</div>`),ql=H(`<div class="font-mono text-2xl text-foreground"> <span class="text-sm text-muted-foreground">calls</span></div> <div class="flex flex-col gap-1.5"></div>`,1);function Jl(e,t){D(t,!0);let n=A(()=>{let e=X.data?.global?.tool_calls??{};return Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,8)}),r=A(()=>X.data?.global?.total_tool_calls??0);Qa(e,{title:`Graph tools used`,meta:`all projects`,children:(e,t)=>{var i=ql(),a=F(i),o=P(a);We(),T(a);var s=I(a,2);q(s,21,()=>V(n),([e,t])=>e,(e,t)=>{var n=A(()=>h(V(t),2));let r=()=>V(n)[0],i=()=>V(n)[1];var a=Gl(),o=P(a),s=P(o,!0);T(o);var c=I(o,2),l=P(c,!0);T(c),T(a),L(()=>{G(s,r()),G(l,i())}),W(e,a)},e=>{W(e,Kl())}),T(s),L(e=>G(o,`${e??``} `),[()=>Z(V(r))]),W(e,i)},$$slots:{default:!0}}),O()}var Yl=H(`<tr class="border-t border-border/60"><td class="py-1.5 pr-2 text-muted-foreground"> </td><td class="max-w-[120px] truncate py-1.5 pr-2 text-foreground"> </td><td class="py-1.5 pr-2"><span class="inline-flex items-center gap-1.5 rounded px-1.5 py-0.5"><span class="size-1.5 rounded-sm"></span> </span></td><td class="py-1.5 pr-2 text-right tabular-nums text-foreground"> </td><td class="py-1.5 pr-2 text-right tabular-nums text-foreground"> </td><td class="py-1.5 pr-2 text-right tabular-nums text-muted-foreground"> </td><td class="py-1.5 text-right tabular-nums text-[var(--money)]"> </td></tr>`),Xl=H(`<tr><td colspan="7" class="py-6 text-center text-muted-foreground">No turns recorded yet.</td></tr>`),Zl=H(`<div class="flex items-center justify-end gap-3 pt-1 font-mono text-sm text-muted-foreground"><button class="rounded border px-2 py-1 disabled:opacity-40 enabled:hover:text-foreground">\u2039 Prev</button> <span> </span> <button class="rounded border px-2 py-1 disabled:opacity-40 enabled:hover:text-foreground">Next \u203A</button></div>`),Ql=H(`<div class="min-h-0 flex-1 overflow-x-auto"><table class="w-full border-collapse font-mono text-sm"><thead><tr class="text-left text-[10px] uppercase tracking-[0.1em] text-muted-foreground"><th class="py-1.5 pr-2 font-medium">Time</th><th class="py-1.5 pr-2 font-medium">Project</th><th class="py-1.5 pr-2 font-medium">Model</th><th class="py-1.5 pr-2 text-right font-medium">In</th><th class="py-1.5 pr-2 text-right font-medium">Out</th><th class="py-1.5 pr-2 text-right font-medium">Cache R/W</th><th class="py-1.5 text-right font-medium">Cost</th></tr></thead><tbody></tbody></table></div> <!>`,1);function $l(e,t){D(t,!0);let n=M(1),r=A(()=>X.data?.recent_turns??[]),i=A(()=>Math.max(1,Math.ceil(V(r).length/25)));zn(()=>{V(n)>V(i)&&N(n,V(i),!0)});let a=A(()=>V(r).slice((V(n)-1)*25,(V(n)-1)*25+25)),o=A(()=>V(r).length?(V(n)-1)*25+1:0),s=A(()=>Math.min(V(n)*25,V(r).length));{let t=A(()=>`showing ${V(o)}\u2013${V(s)} of ${V(r).length}`);Qa(e,{title:`Recent turns`,get meta(){return V(t)},children:(e,t)=>{var r=Ql(),o=F(r),s=P(o),c=I(P(s));q(c,21,()=>V(a),e=>e.ts+e.project_path+e.model,(e,t)=>{var n=Yl(),r=P(n),i=P(r,!0);T(r);var a=I(r),o=P(a,!0);T(a);var s=I(a),c=P(s),l=P(c),u=I(l);T(c),T(s);var d=I(s),f=P(d,!0);T(d);var p=I(d),m=P(p,!0);T(p);var h=I(p),g=P(h);T(h);var _=I(h),v=P(_,!0);T(_),T(n),L((e,n,r,s,d,p,h,_,y)=>{G(i,e),Qi(a,`title`,V(t).project_name),G(o,V(t).project_name),Ri(c,n),Ri(l,r),G(u,` ${s??``}`),G(f,d),G(m,p),G(g,`${h??``} / ${_??``}`),G(v,y)},[()=>ma(V(t).ts),()=>`color: var(--c-${ha(V(t).model)})`,()=>`background: var(--c-${ha(V(t).model)})`,()=>ga(V(t).model),()=>Z(V(t).input),()=>Z(V(t).output),()=>Z(V(t).cache_read),()=>Z(V(t).cache_create),()=>pa(V(t).cost_usd)]),W(e,n)},e=>{W(e,Xl())}),T(c),T(s),T(o);var l=I(o,2),u=e=>{var t=Zl(),r=P(t),a=I(r,2),o=P(a);T(a);var s=I(a,2);T(t),L(()=>{r.disabled=V(n)<=1,G(o,`page ${V(n)??``} of ${V(i)??``}`),s.disabled=V(n)>=V(i)}),Xr(`click`,r,()=>N(n,Math.max(1,V(n)-1),!0)),Xr(`click`,s,()=>N(n,Math.min(V(i),V(n)+1),!0)),W(e,t)};K(l,e=>{V(i)>1&&e(u)}),W(e,r)},$$slots:{default:!0}})}O()}Zr([`click`]);var eu=H(`<div class="font-mono text-xs text-muted-foreground" title="Codebase exploration via the terminal (rg / cat / find) \u2014 observe-only, not yet blocked"> <span> </span></div>`),tu=H(`<div class="flex items-baseline gap-2 font-mono text-xs"><span class="shrink-0 text-muted-foreground"> </span> <span> </span> <span class="truncate text-foreground/80"> </span></div>`),nu=H(`<div class="text-sm text-muted-foreground">No gate decisions yet.</div>`),ru=H(`<div class="mt-2 border-t border-border pt-2 text-[10px] uppercase tracking-wide text-muted-foreground">Terminal hunts (observe-only)</div> <!>`,1),iu=H(`<div class="font-mono text-2xl text-foreground"> <span class="text-sm text-muted-foreground">blocks</span></div> <!> <div class="flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto"><!> <!></div>`,1);function au(e,t){D(t,!0);let n=A(()=>(X.data?.recent_gates??[]).slice(0,50)),r=A(()=>X.data?.global?.blocked_count??0),i=A(()=>X.data?.global?.bash_explorations??0),a=A(()=>X.data?.global?.bash_avoidable??0),o=A(()=>(X.data?.recent_bash??[]).slice(0,12));Qa(e,{title:`The Moat`,meta:`PreToolUse`,children:(e,t)=>{var s=iu(),c=F(s),l=P(c);We(),T(c);var u=I(c,2),d=e=>{var t=eu(),n=P(t),r=I(n),o=P(r);T(r),T(t),L((e,t)=>{G(n,`\u21B3 ${e??``} terminal hunts \xB7 `),Ii(r,1,Ai(V(a)>0?`text-destructive`:``)),G(o,`${t??``} the graph could answer`)},[()=>Z(V(i)),()=>Z(V(a))]),W(e,t)};K(u,e=>{V(i)>0&&e(d)});var f=I(u,2),p=P(f);q(p,17,()=>V(n),e=>e.ts+e.query,(e,t)=>{var n=tu(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a);var s=I(a,2),c=P(s,!0);T(s),T(n),L(e=>{G(i,e),Ii(a,1,`shrink-0 rounded px-1 text-[10px] uppercase `+(V(t).decision===`block`?`bg-destructive/15 text-destructive`:`bg-[var(--c-fable)]/12 text-[var(--c-fable)]`)),G(o,V(t).decision),Qi(s,`title`,V(t).query??``),G(c,V(t).query??`\u2014`)},[()=>ma(V(t).ts)]),W(e,n)},e=>{W(e,nu())});var m=I(p,2),h=e=>{var t=ru();q(I(F(t),2),17,()=>V(o),e=>e.ts+e.query,(e,t)=>{var n=tu(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a);var s=I(a,2),c=P(s,!0);T(s),T(n),L(e=>{G(i,e),Ii(a,1,`shrink-0 rounded px-1 text-[10px] uppercase `+(V(t).avoidable?`bg-destructive/15 text-destructive`:`bg-muted text-muted-foreground`)),G(o,V(t).tool),Qi(s,`title`,V(t).query??``),G(c,V(t).query??`\u2014`)},[()=>ma(V(t).ts)]),W(e,n)}),W(e,t)};K(m,e=>{V(o).length>0&&e(h)}),T(f),L(e=>G(l,`${e??``} `),[()=>Z(V(r))]),W(e,s)},$$slots:{default:!0}}),O()}var ou=H(`<div class="flex items-baseline justify-between gap-3 font-mono text-sm"><span class="truncate text-muted-foreground"> </span> <span class="tabular-nums text-foreground"> </span></div>`),su=H(`<div class="text-sm text-muted-foreground">No usage learned yet \u2014 Synthra learns as you read/edit files.</div>`),cu=H(`<div class="font-mono text-2xl text-foreground"> <span class="text-sm text-muted-foreground">tracked</span></div> <div class="flex max-h-[190px] flex-col gap-1.5 overflow-y-auto"></div>`,1);function lu(e,t){D(t,!0);let n=A(()=>X.data?.active),r=A(()=>V(n)?.stats?.hot_files??[]);{let t=A(()=>V(n)?.project_name??`active project`);Qa(e,{title:`Hot files`,get meta(){return V(t)},children:(e,t)=>{var i=cu(),a=F(i),o=P(a);We(),T(a);var s=I(a,2);q(s,21,()=>V(r),e=>e.path,(e,t)=>{var n=ou(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a),T(n),L(e=>{Qi(n,`title`,V(t).path),G(i,e),G(o,V(t).score)},[()=>_a(V(t).path)]),W(e,n)},e=>{W(e,su())}),T(s),L(e=>G(o,`${e??``} `),[()=>Z(V(n)?.stats?.hot_files_total??0)]),W(e,i)},$$slots:{default:!0}})}O()}var uu=H(`<div class="grid grid-cols-1 gap-4 p-5 lg:grid-cols-3"><div class="lg:col-span-3 lg:row-start-1"><!></div> <div class="lg:col-start-1 lg:row-start-2"><!></div> <div class="lg:col-start-2 lg:row-start-2"><!></div> <div class="lg:col-start-1 lg:row-start-3"><!></div> <div class="lg:col-start-2 lg:row-start-3"><!></div> <div class="lg:col-start-1 lg:row-start-4"><!></div> <div class="lg:col-start-2 lg:row-start-4"><!></div> <div class="relative lg:col-start-3 lg:row-start-2 lg:row-span-3"><div class="lg:absolute lg:inset-0"><!></div></div> <div class="lg:col-span-3 lg:row-start-5"><!></div></div>`);function du(e){var t=uu(),n=P(t);Ja(P(n),{}),T(n);var r=I(n,2);eo(P(r),{}),T(r);var i=I(r,2);no(P(i),{}),T(i);var a=I(i,2);so(P(a),{}),T(a);var o=I(a,2);lu(P(o),{}),T(o);var s=I(o,2);Wl(P(s),{}),T(s);var c=I(s,2);Jl(P(c),{}),T(c);var l=I(c,2),u=P(l);au(P(u),{}),T(u),T(l);var d=I(l,2);$l(P(d),{}),T(d),T(t),W(e,t)}var fu=new Set([`$$slots`,`$$events`,`$$legacy`]);function pu(e,t){let n=ca(t,fu),r=[[`path`,{d:`M20 6 9 17l-5-5`}]];Ea(e,ua({name:`check`},()=>n,{get iconNode(){return r}}))}var mu=new Set([`$$slots`,`$$events`,`$$legacy`]);function hu(e,t){let n=ca(t,mu),r=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]];Ea(e,ua({name:`copy`},()=>n,{get iconNode(){return r}}))}var gu=H(`<p> </p>`),_u=H(`<div class="break-all"><span class="text-foreground/70"> </span> </div>`),vu=H(`<div class="mt-1 flex flex-col gap-0.5 font-mono text-xs text-muted-foreground/80"></div>`),yu=H(`<div role="button" tabindex="0" class="flex cursor-pointer flex-col gap-1.5 rounded-lg border bg-card/55 p-3 text-left transition-colors hover:bg-card/85"><div class="flex items-center gap-1.5"><span class="min-w-0 truncate font-mono text-sm text-foreground"> </span> <button type="button" title="Copy name" class="inline-flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground"><!></button> <span> </span></div> <!> <!></div>`);function bu(e,t){D(t,!0);let n=M(!1),r=M(!1),i,a=A(()=>t.item.scope===`plugin`?t.item.source??`plugin`:t.item.scope),o=A(()=>t.item.scope===`project`?`var(--c-fable)`:t.item.scope===`personal`?`var(--c-sonnet)`:`#9bc2ef`),s=A(()=>Object.entries(t.item.meta??{}));function c(){N(n,!V(n))}function l(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c())}async function u(e){e.stopPropagation();try{await navigator.clipboard.writeText(t.item.name),N(r,!0),clearTimeout(i),i=setTimeout(()=>N(r,!1),1200)}catch{}}var d=yu(),f=P(d),p=P(f),m=P(p,!0);T(p);var g=I(p,2),_=P(g),v=e=>{pu(e,{class:`size-3.5`,style:`color: var(--c-fable)`})},y=e=>{hu(e,{class:`size-3.5`})};K(_,e=>{V(r)?e(v):e(y,-1)}),T(g);var b=I(g,2);let ee;var x=P(b);T(b),T(f);var te=I(f,2),ne=e=>{var r=gu(),i=P(r,!0);T(r),L(()=>{Ii(r,1,`text-sm leading-snug text-muted-foreground `+(V(n)?``:`line-clamp-2`)),G(i,t.item.description)}),W(e,r)};K(te,e=>{t.item.description&&e(ne)});var re=I(te,2),ie=e=>{var t=vu();q(t,21,()=>V(s),([e,t])=>e,(e,t)=>{var n=A(()=>h(V(t),2));let r=()=>V(n)[0],i=()=>V(n)[1];var a=_u(),o=P(a),s=P(o);T(o);var c=I(o);T(a),L(()=>{G(s,`${r()??``}:`),G(c,` ${i()??``}`)}),W(e,a)}),T(t),W(e,t)};K(re,e=>{V(n)&&V(s).length&&e(ie)}),T(d),L(()=>{G(m,t.item.name),Qi(g,`aria-label`,`Copy "${t.item.name}"`),ee=Ii(b,1,`ml-auto shrink-0 rounded border px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wide`,null,ee,{"opacity-50":t.item.enabled===!1}),Ri(b,`color:${V(o)}; border-color:color-mix(in oklab, ${V(o)} 35%, transparent)`),G(x,`${V(a)??``}${t.item.enabled===!1?` \xB7 off`:``}`)}),Xr(`click`,d,c),Xr(`keydown`,d,l),Xr(`click`,g,u),W(e,d),O()}Zr([`click`,`keydown`]);var xu=H(`<span> </span>`),Su=H(`<button> <span class="opacity-60"> </span></button>`),Cu=H(`<div class="text-sm text-muted-foreground">Scanning your arsenal\u2026</div>`),wu=H(`<div class="text-sm text-muted-foreground"> </div>`),Tu=H(`<section class="flex flex-col gap-2"><div class="flex items-center gap-3 border-b border-border pb-1.5"><span class="size-1.5 shrink-0 rounded-sm"></span> <span class="font-mono text-xs uppercase tracking-[0.14em]"> </span> <span class="font-mono text-xs tracking-[0.1em] text-muted-foreground"> </span></div> <div class="grid grid-cols-1 items-start gap-2 md:grid-cols-2 2xl:grid-cols-3"></div></section>`),Eu=H(`<div class="flex flex-col gap-6"></div>`),Du=H(`<div class="flex h-full flex-col gap-4 p-5"><div class="flex flex-wrap items-center justify-between gap-3"><h1 class="font-serif text-2xl text-foreground">\u2694 Arsenal</h1> <div class="flex items-center gap-2 font-mono text-xs text-muted-foreground"><!> <button class="rounded border px-2 py-1 transition-colors hover:text-foreground">\u21BB Rescan</button></div></div> <div class="flex flex-wrap items-center gap-2"><!> <input placeholder="Filter by name or description\u2026" autocomplete="off" class="ml-auto w-full max-w-72 rounded-md border bg-card/60 px-3 py-1.5 text-sm outline-none transition-colors focus:border-ring"/></div> <!></div>`);function Ou(e,t){D(t,!0);let n=M(`skills`),r=M(``),i=A(()=>X.arsenal),a=[{id:`skills`,label:`Skills`},{id:`agents`,label:`Agents`},{id:`mcp`,label:`MCP`}],o=A(()=>{let e=V(i)?V(i)[V(n)]:[],t=V(r).toLowerCase().trim();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||(e.source??``).toLowerCase().includes(t)):e}),s=A(()=>{let e=new Map;for(let t of V(o)){let n=t.scope===`plugin`?`plugin:${t.source??`plugin`}`:t.scope,r=e.get(n);r||(r={label:t.scope===`plugin`?t.source??`plugin`:t.scope===`project`?`In this project`:`Personal \xB7 this machine`,scope:t.scope,items:[]},e.set(n,r)),r.items.push(t)}return[...e.values()]});function c(e){return e===`project`?`var(--c-fable)`:e===`personal`?`var(--c-sonnet)`:`#9bc2ef`}let l=A(()=>V(i)?new Date(V(i).scanned_at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):``);var u=Du(),d=P(u),f=I(P(d),2),p=P(f),m=e=>{var t=xu(),n=P(t);T(t),L(()=>G(n,`${V(i).counts.plugins??``} plugins \xB7 scanned ${V(l)??``}`)),W(e,t)};K(p,e=>{V(i)&&e(m)});var h=I(p,2);T(f),T(d);var g=I(d,2),_=P(g);q(_,17,()=>a,e=>e.id,(e,t)=>{var r=Su(),a=P(r),o=I(a),s=P(o,!0);T(o),T(r),L(()=>{Ii(r,1,`rounded-lg px-3 py-1.5 font-mono text-xs transition-colors `+(V(n)===V(t).id?`bg-accent text-accent-foreground`:`text-muted-foreground hover:text-foreground`)),G(a,`${V(t).label??``} `),G(s,V(i)?.counts?.[V(t).id]??0)}),Xr(`click`,r,()=>N(n,V(t).id,!0)),W(e,r)});var v=I(_,2);Xi(v),T(g);var y=I(g,2),b=e=>{W(e,Cu())},ee=e=>{var t=wu(),n=P(t,!0);T(t),L(()=>G(n,V(r)?`No matches.`:`Nothing installed in this category.`)),W(e,t)},x=e=>{var t=Eu();q(t,21,()=>V(s),e=>e.label+e.scope,(e,t)=>{var n=Tu(),r=P(n),i=P(r),a=I(i,2),o=P(a,!0);T(a);var s=I(a,2),l=P(s,!0);T(s),T(r);var u=I(r,2);q(u,21,()=>V(t).items,e=>e.scope+(e.source??``)+e.name,(e,t)=>{bu(e,{get item(){return V(t)}})}),T(u),T(n),L((e,n)=>{Ri(i,e),Ri(a,n),G(o,V(t).label),G(l,V(t).items.length)},[()=>`background:${c(V(t).scope)}`,()=>`color:${c(V(t).scope)}`]),W(e,n)}),T(t),W(e,t)};K(y,e=>{X.arsenalLoading&&!V(i)?e(b):V(s).length?e(x,-1):e(ee,1)}),T(u),Xr(`click`,h,()=>X.loadArsenal(!0)),ia(v,()=>V(r),e=>N(r,e)),W(e,u),O()}Zr([`click`]);var ku=H(`<div class="flex items-baseline gap-3 text-sm"><code class="shrink-0 font-mono text-xs text-[var(--c-sonnet)]"> </code> <span class="text-muted-foreground"> </span></div>`),Au=H(`<div class="mt-1 flex flex-col gap-1"></div>`),ju=H(`<div class="flex flex-col gap-1.5 rounded-lg border bg-card/55 p-4"><code class="font-mono text-sm text-foreground"> </code> <p class="text-sm leading-snug text-muted-foreground"> </p> <!></div>`),Mu=H(`<div class="flex h-full flex-col gap-4 p-5"><div class="flex flex-wrap items-center justify-between gap-3"><h1 class="font-serif text-2xl text-foreground">\u276F Commands</h1> <span class="font-mono text-xs text-muted-foreground">all paths default to the current directory</span></div> <div class="flex max-w-3xl flex-col gap-2.5"></div> <p class="max-w-3xl font-mono text-xs leading-relaxed text-muted-foreground">Install: <code class="text-foreground">npm install -g @jefuriiij/synthra</code> \xB7 macOS/Linux hooks\n additionally need <code class="text-foreground">jq</code> (<code>brew install jq</code>) \u2014 without it\n the hooks silently no-op while the MCP tools keep working.</p></div>`);function Nu(e){let t=[{cmd:`syn . [path]`,desc:`The default flow: scan the project, start the MCP server + dashboard, install the hooks, and register the MCP entry for the IDE. Runs as a background service \u2014 Ctrl+C stops it.`,opts:[{flag:`--full`,desc:`Re-parse every file, ignoring the incremental parse cache`},{flag:`--launch-cli`,desc:"Also spawn the `claude` CLI in this terminal"},{flag:`--resume <id>`,desc:`Resume a Claude session (requires --launch-cli)`}]},{cmd:`syn scan [path]`,desc:`Scan only \u2014 walk the project, parse it into the symbol graph, and write it to .synthra-graph/. No servers, no hooks.`,opts:[{flag:`--full`,desc:`Re-parse every file, ignoring the incremental parse cache`}]},{cmd:`syn serve [path]`,desc:`Start the HTTP MCP server only, against an already-scanned project.`},{cmd:`syn dashboard [path]`,desc:`Run this dashboard as a standalone process (no graph required) \u2014 token spend, savings, the Moat, and your Arsenal across every registered project.`},{cmd:`syn doctor [path]`,desc:`Diagnose the setup: Node version, jq (required by the macOS/Linux hooks), the claude CLI, graph freshness, .mcp.json registration, policy version, and installed hooks. Run this first when something feels off.`},{cmd:`syn remove [path]`,desc:`Uninstall Synthra from a project: deletes .synthra-graph/ and .synthra/, strips the CLAUDE.md policy block, Synthra\'s .gitignore entries, and its hooks \u2014 your own content in those files always survives. Also deregisters MCP and removes the project from this dashboard. Shows a summary and asks [y/N] first.`,opts:[{flag:`--yes`,desc:`Skip the confirmation prompt (required when not in a terminal)`}]},{cmd:`syn --version`,desc:`Print the installed Synthra version.`}];var n=Mu(),r=I(P(n),2);q(r,5,()=>t,e=>e.cmd,(e,t)=>{var n=ju(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a);var s=I(a,2),c=e=>{var n=Au();q(n,5,()=>V(t).opts,e=>e.flag,(e,t)=>{var n=ku(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a),T(n),L(()=>{G(i,V(t).flag),G(o,V(t).desc)}),W(e,n)}),T(n),W(e,n)};K(s,e=>{V(t).opts?.length&&e(c)}),T(n),L(()=>{G(i,V(t).cmd),G(o,V(t).desc)}),W(e,n)}),T(r),We(2),T(n),W(e,n)}var Pu=H(`<details class="rounded-lg border bg-card/50 p-3"><summary class="cursor-pointer text-sm font-medium text-foreground"> </summary> <p class="mt-2 text-[13px] leading-relaxed text-muted-foreground"> </p></details>`),Fu=H(`<!> <!> <div class="mt-4 flex flex-col gap-2"></div> <!>`,1),Iu=H(`<!> <!>`,1);function Lu(e,t){D(t,!0);let n=Y(t,`open`,15,!1),r=[{q:`Where do these numbers come from?`,a:`Synthra\'s Stop hook reads Claude Code\'s transcript JSONL after each turn and logs token usage to .synthra-graph/token_log.jsonl. The gate logs to gate_log.jsonl, tool calls to tool_log.jsonl. The dashboard reads those \u2014 it never feeds back into retrieval.`},{q:`How is cost calculated?`,a:`Token counts \xD7 Anthropic\'s published per-model rates (in src/shared/pricing.ts), summed across input, output, cache-read and cache-write. These are API-equivalent estimates, not your plan billing \u2014 useful for comparing sessions.`},{q:`What is the savings floor?`,a:`Each time the Moat blocks an exploratory Grep/Glob, we credit a deliberately conservative 500 tokens \xD7 $3/M input rate. Real savings are usually higher (it ignores cache thrash and follow-up reads the block also prevents). It\'s a floor, not a guess.`},{q:`What is the Moat?`,a:`A PreToolUse hook that intercepts Grep/Glob and, when the graph has confident context, blocks them and hands back the exact graph_read targets + signatures \u2014 so the agent reads ~50-token slices instead of whole files.`},{q:`What is the Arsenal view?`,a:`A scan of every skill, subagent, and MCP server available to you \u2014 project, personal (~/.claude), and plugin \u2014 with descriptions, so you never have to drop to the CLI to recall what\'s installed. MCP entries show name/type/url only; auth tokens are never read.`},{q:`What\'s the codebase graph?`,a:`tree-sitter parses your project into a symbol graph (files, symbols, imports, call edges). graph_read returns a symbol\'s source plus its dependency surface; graph_continue packs a context bundle.`},{q:`Where is everything stored?`,a:`.synthra-graph/ (machine-local, gitignored) holds the graph + logs; .synthra/ (git-tracked) holds branch-aware memory. Nothing leaves your machine.`},{q:`Why is my bill not lower already?`,a:`Savings land only when the agent actually uses the cheap path. v0.4\u20130.6 push the answer to the point of use (block payloads, edit recipes, dependency footers); a real dogfood session on the latest version is the true test.`}];var i=U();Ti(F(i),()=>Al,(e,t)=>{t(e,{get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=U();Ti(F(n),()=>oc,(e,t)=>{t(e,{children:(e,t)=>{var n=Iu(),i=F(n);Ti(i,()=>El,(e,t)=>{t(e,{class:`fixed inset-0 z-50 bg-black/60`})}),Ti(I(i,2),()=>Ll,(e,t)=>{t(e,{class:`fixed left-1/2 top-1/2 z-50 max-h-[85vh] w-[min(640px,92vw)] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-xl border bg-card p-6 text-card-foreground shadow-2xl`,children:(e,t)=>{var n=Fu(),i=F(n);Ti(i,()=>Qs,(e,t)=>{t(e,{class:`font-serif text-2xl`,children:(e,t)=>{We(),W(e,oi(`FAQ`))},$$slots:{default:!0}})});var a=I(i,2);Ti(a,()=>kl,(e,t)=>{t(e,{class:`text-xs text-muted-foreground`,children:(e,t)=>{We(),W(e,oi(`Where every number on this dashboard comes from.`))},$$slots:{default:!0}})});var o=I(a,2);q(o,21,()=>r,e=>e.q,(e,t)=>{var n=Pu(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a),T(n),L(()=>{G(i,V(t).q),G(o,V(t).a)}),W(e,n)}),T(o),Ti(I(o,2),()=>Nl,(e,t)=>{t(e,{class:`mt-4 w-full rounded-md border py-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:(e,t)=>{We(),W(e,oi(`Close`))},$$slots:{default:!0}})}),W(e,n)},$$slots:{default:!0}})}),W(e,n)},$$slots:{default:!0}})}),W(e,n)},$$slots:{default:!0}})}),W(e,i),O()}var Ru=H(`<div class="flex h-screen w-screen overflow-hidden"><!> <main class="min-w-0 flex-1 overflow-y-auto"><!></main></div> <!>`,1);function zu(e,t){D(t,!0);let n=M(!1);da(()=>(X.start(),()=>X.stop()));var r=Ru(),i=F(r),a=P(i);Ga(a,{onFaq:()=>N(n,!0)});var o=I(a,2),s=P(o),c=e=>{du(e,{})},l=e=>{Nu(e,{})},u=e=>{Ou(e,{})};K(s,e=>{X.view===`overview`?e(c):X.view===`commands`?e(l,1):e(u,-1)}),T(o),T(i),Lu(I(i,2),{get open(){return V(n)},set open(e){N(n,e,!0)}}),W(e,r),O()}var Bu=document.getElementById(`app`);if(!Bu)throw Error(`missing #app mount node`);ci(zu,{target:Bu});</script>\n <style rel="stylesheet" crossorigin>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:var(--font-sans);--font-serif:var(--font-serif);--font-mono:var(--font-mono);--color-black:#000;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-medium:500;--tracking-wide:.025em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}html,body{height:100%}body{background:radial-gradient(1200px 800px at 14% 16%, #2c5db81f, transparent 60%), var(--background);color:var(--foreground);font-family:var(--font-sans);-webkit-font-smoothing:antialiased}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:999px}::-webkit-scrollbar-track{background:0 0}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.top-1\\/2{top:50%}.left-1\\/2{left:50%}.z-50{z-index:50}.my-1{margin-block:var(--spacing)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.inline{display:inline}.inline-flex{display:inline-flex}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-\\[116px\\]{width:116px;height:116px}.size-full{width:100%;height:100%}.h-1{height:var(--spacing)}.h-2{height:calc(var(--spacing) * 2)}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[190px\\]{max-height:190px}.max-h-\\[260px\\]{max-height:260px}.min-h-0{min-height:0}.w-9{width:calc(var(--spacing) * 9)}.w-\\[64px\\]{width:64px}.w-\\[248px\\]{width:248px}.w-\\[min\\(440px\\,92vw\\)\\]{width:min(440px,92vw)}.w-\\[min\\(640px\\,92vw\\)\\]{width:min(640px,92vw)}.w-full{width:100%}.w-screen{width:100vw}.max-w-3xl{max-width:var(--container-3xl)}.max-w-72{max-width:calc(var(--spacing) * 72)}.max-w-\\[120px\\]{max-width:120px}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-rotate-90{rotate:-90deg}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-border,.border-border\\/60{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\\/60{border-color:color-mix(in oklab, var(--border) 60%, transparent)}}.border-sidebar-border{border-color:var(--sidebar-border)}.bg-\\[var\\(--c-fable\\)\\],.bg-\\[var\\(--c-fable\\)\\]\\/12{background-color:var(--c-fable)}@supports (color:color-mix(in lab, red, red)){.bg-\\[var\\(--c-fable\\)\\]\\/12{background-color:color-mix(in oklab, var(--c-fable) 12%, transparent)}}.bg-\\[var\\(--money\\)\\]{background-color:var(--money)}.bg-accent{background-color:var(--accent)}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-border{background-color:var(--border)}.bg-card,.bg-card\\/50{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/50{background-color:color-mix(in oklab, var(--card) 50%, transparent)}}.bg-card\\/55{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/55{background-color:color-mix(in oklab, var(--card) 55%, transparent)}}.bg-card\\/60{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/60{background-color:color-mix(in oklab, var(--card) 60%, transparent)}}.bg-card\\/70{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/70{background-color:color-mix(in oklab, var(--card) 70%, transparent)}}.bg-destructive,.bg-destructive\\/15{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/15{background-color:color-mix(in oklab, var(--destructive) 15%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-muted-foreground,.bg-muted-foreground\\/40{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\/40{background-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.bg-primary\\/90{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.bg-primary\\/90{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-accent,.bg-sidebar-accent\\/40{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab, red, red)){.bg-sidebar-accent\\/40{background-color:color-mix(in oklab, var(--sidebar-accent) 40%, transparent)}}.bg-sidebar-border{background-color:var(--sidebar-border)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-serif{font-family:var(--font-serif)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[13px\\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.tracking-\\[0\\.1em\\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\\[0\\.12em\\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\\[0\\.14em\\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\\[0\\.18em\\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-all{word-break:break-all}.text-\\[var\\(--c-fable\\)\\]{color:var(--c-fable)}.text-\\[var\\(--c-sonnet\\)\\]{color:var(--c-sonnet)}.text-\\[var\\(--money\\)\\]{color:var(--money)}.text-accent-foreground{color:var(--accent-foreground)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground,.text-foreground\\/70{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/70{color:color-mix(in oklab, var(--foreground) 70%, transparent)}}.text-foreground\\/80{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/80{color:color-mix(in oklab, var(--foreground) 80%, transparent)}}.text-muted-foreground,.text-muted-foreground\\/60{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/60{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.text-muted-foreground\\/80{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/80{color:color-mix(in oklab, var(--muted-foreground) 80%, transparent)}}.text-primary-foreground{color:var(--primary-foreground)}.text-sidebar-accent-foreground{color:var(--sidebar-accent-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\\/60{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab, red, red)){.text-sidebar-foreground\\/60{color:color-mix(in oklab, var(--sidebar-foreground) 60%, transparent)}}.text-sidebar-foreground\\/75{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab, red, red)){.text-sidebar-foreground\\/75{color:color-mix(in oklab, var(--sidebar-foreground) 75%, transparent)}}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-card\\/80:hover{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-card\\/80:hover{background-color:color-mix(in oklab, var(--card) 80%, transparent)}}.hover\\:bg-card\\/85:hover{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-card\\/85:hover{background-color:color-mix(in oklab, var(--card) 85%, transparent)}}.hover\\:bg-sidebar-accent\\/50:hover{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-sidebar-accent\\/50:hover{background-color:color-mix(in oklab, var(--sidebar-accent) 50%, transparent)}}.hover\\:text-foreground:hover{color:var(--foreground)}.hover\\:text-sidebar-foreground:hover{color:var(--sidebar-foreground)}}.focus\\:border-ring:focus{border-color:var(--ring)}@media (hover:hover){.enabled\\:hover\\:text-foreground:enabled:hover{color:var(--foreground)}}.disabled\\:opacity-40:disabled{opacity:.4}@media (width>=40rem){.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (width>=48rem){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width>=64rem){.lg\\:absolute{position:absolute}.lg\\:inset-0{inset:0}.lg\\:col-span-3{grid-column:span 3/span 3}.lg\\:col-start-1{grid-column-start:1}.lg\\:col-start-2{grid-column-start:2}.lg\\:col-start-3{grid-column-start:3}.lg\\:row-span-3{grid-row:span 3/span 3}.lg\\:row-start-1{grid-row-start:1}.lg\\:row-start-2{grid-row-start:2}.lg\\:row-start-3{grid-row-start:3}.lg\\:row-start-4{grid-row-start:4}.lg\\:row-start-5{grid-row-start:5}.lg\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (width>=96rem){.\\32 xl\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.75rem;--background:#04081a;--foreground:#ecf2fb;--card:#0a1733;--card-foreground:#ecf2fb;--popover:#0a1733;--popover-foreground:#ecf2fb;--primary:#2c5db8;--primary-foreground:#f4f7fc;--secondary:#122549;--secondary-foreground:#d7e6f7;--muted:#102146;--muted-foreground:#8ba0c2;--accent:#1b3a78;--accent-foreground:#ecf2fb;--destructive:#ff5d5d;--destructive-foreground:#fff5f5;--border:#9bc2ef24;--input:#9bc2ef2e;--ring:#5c8fe6;--sidebar:#081226;--sidebar-foreground:#d7e6f7;--sidebar-primary:#2c5db8;--sidebar-primary-foreground:#f4f7fc;--sidebar-accent:#122549;--sidebar-accent-foreground:#ecf2fb;--sidebar-border:#9bc2ef1f;--sidebar-ring:#5c8fe6;--c-fable:#2ee08f;--c-opus:#ff6338;--c-sonnet:#ffb938;--c-haiku:#7438ff;--c-unknown:#12cbf5;--money:#4ade9b;--font-sans:"Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-serif:"Instrument Serif", "Times New Roman", serif;--font-mono:"Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}\n/*$vite$:1*/</style>\n </head>\n <body>\n <div id="app"></div>\n </body>\n</html>\n';
|
|
881
882
|
|
|
882
883
|
// src/dashboard/public/favicon.svg
|
|
883
884
|
var favicon_default = '<svg width="107" height="107" viewBox="0 0 107 107" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect x="0.5" y="0.5" width="106" height="106" rx="7.5" fill="url(#paint0_radial_21_11)"/>\n<rect x="0.5" y="0.5" width="106" height="106" rx="7.5" stroke="url(#paint1_linear_21_11)"/>\n<path d="M26.408 72.558C25.5813 72.558 24.6513 72.4753 23.618 72.31C22.626 72.1447 21.6753 71.938 20.766 71.69C19.898 71.442 19.216 71.1733 18.72 70.884C18.4307 70.7187 18.2033 70.5533 18.038 70.388C17.914 70.1813 17.852 69.8507 17.852 69.396L17.542 59.662C17.542 58.8353 17.8107 58.422 18.348 58.422C18.8027 58.422 19.1127 58.794 19.278 59.538L19.836 61.894C21.2413 67.8047 23.866 70.76 27.71 70.76C29.7767 70.76 31.4093 70.078 32.608 68.714C33.848 67.3087 34.468 65.3453 34.468 62.824C34.468 60.3853 33.8273 58.112 32.546 56.004C31.306 53.896 29.3013 51.8087 26.532 49.742C23.4733 47.5513 21.2413 45.4433 19.836 43.418C18.4307 41.3513 17.728 39.1607 17.728 36.846C17.728 33.7873 18.782 31.3487 20.89 29.53C23.0393 27.67 25.7673 26.74 29.074 26.74C30.314 26.74 31.5127 26.8847 32.67 27.174C33.8273 27.4633 34.778 27.8767 35.522 28.414C35.77 28.5793 35.956 28.7653 36.08 28.972C36.2453 29.1787 36.328 29.4473 36.328 29.778L36.514 39.14C36.514 39.8427 36.2453 40.194 35.708 40.194C35.336 40.194 35.0673 39.9047 34.902 39.326L34.468 37.776C33.5587 34.5933 32.608 32.2787 31.616 30.832C30.6653 29.344 29.2807 28.6 27.462 28.6C25.6847 28.6 24.2587 29.1787 23.184 30.336C22.1507 31.4933 21.634 33.126 21.634 35.234C21.634 37.0113 22.2127 38.706 23.37 40.318C24.5273 41.93 26.5527 43.8933 29.446 46.208C32.546 48.7293 34.7987 51.168 36.204 53.524C37.6507 55.8387 38.374 58.3187 38.374 60.964C38.374 63.2787 37.8573 65.304 36.824 67.04C35.7907 68.776 34.3647 70.14 32.546 71.132C30.7687 72.0827 28.7227 72.558 26.408 72.558ZM44.1831 84.71C43.0671 84.71 42.1784 84.3173 41.5171 83.532C40.8558 82.788 40.5251 81.92 40.5251 80.928C40.5251 80.1427 40.7524 79.4813 41.2071 78.944C41.6618 78.4067 42.2818 78.138 43.0671 78.138C43.7284 78.138 44.2038 78.2827 44.4931 78.572C44.7824 78.8613 44.9891 79.192 45.1131 79.564C45.2371 79.936 45.3611 80.2667 45.4851 80.556C45.6091 80.8453 45.8571 80.99 46.2291 80.99C46.6838 80.99 47.0971 80.6593 47.4691 79.998C47.8411 79.378 48.3578 78.0347 49.0191 75.968C49.4324 74.728 49.6804 73.6533 49.7631 72.744C49.8871 71.8347 49.8664 70.8633 49.7011 69.83C49.5771 68.7967 49.2671 67.536 48.7711 66.048L42.0131 44.534C41.7238 43.542 41.4344 42.9013 41.1451 42.612C40.8971 42.3227 40.4838 42.116 39.9051 41.992L38.9751 41.806C38.4378 41.682 38.1691 41.4133 38.1691 41C38.1691 40.5867 38.4584 40.38 39.0371 40.38H49.2671C49.8458 40.38 50.1351 40.5867 50.1351 41C50.1351 41.4547 49.8664 41.7233 49.3291 41.806L48.3371 41.93C47.3451 42.054 46.7044 42.302 46.4151 42.674C46.1671 43.0047 46.1878 43.6247 46.4771 44.534L51.9331 62.7C52.0571 63.1133 52.2431 63.32 52.4911 63.32C52.7804 63.32 52.9871 63.1133 53.1111 62.7L58.3811 45.65C58.7118 44.534 58.7944 43.7073 58.6291 43.17C58.5051 42.5913 57.9264 42.2193 56.8931 42.054L55.5911 41.806C55.0538 41.682 54.7851 41.4133 54.7851 41C54.7851 40.5867 55.0744 40.38 55.6531 40.38H63.5271C64.1058 40.38 64.3951 40.6073 64.3951 41.062C64.3951 41.4753 64.1471 41.7647 63.6511 41.93L63.0931 42.116C62.4731 42.3227 61.9564 42.6947 61.5431 43.232C61.1298 43.7693 60.6958 44.6993 60.2411 46.022L51.0031 74.852C50.0938 77.7453 49.2671 79.8947 48.5231 81.3C47.8204 82.7053 47.1384 83.6147 46.4771 84.028C45.8158 84.4827 45.0511 84.71 44.1831 84.71ZM64.9342 72C64.3142 72 64.0042 71.7727 64.0042 71.318C64.0042 70.946 64.2729 70.698 64.8102 70.574L65.5542 70.45C66.4222 70.2847 66.9802 70.0367 67.2282 69.706C67.5176 69.334 67.6622 68.714 67.6622 67.846V47.014C67.6622 46.27 67.5382 45.774 67.2902 45.526C67.0836 45.2367 66.6909 45.0507 66.1122 44.968L64.8102 44.782C64.2729 44.7407 64.0042 44.5133 64.0042 44.1C64.0042 43.7693 64.3349 43.542 64.9962 43.418C66.2776 43.2113 67.2489 42.8807 67.9102 42.426C68.6129 41.9713 69.3362 41.4133 70.0802 40.752C70.4522 40.38 70.7622 40.194 71.0102 40.194C71.3822 40.194 71.5682 40.442 71.5682 40.938V43.728C71.5682 44.1 71.6922 44.348 71.9402 44.472C72.2296 44.5547 72.5396 44.4307 72.8702 44.1C74.5236 42.5293 75.9702 41.4547 77.2102 40.876C78.4916 40.2973 79.8349 40.008 81.2402 40.008C83.1002 40.008 84.5882 40.6693 85.7042 41.992C86.8202 43.2733 87.3782 45.1747 87.3782 47.696V67.846C87.3782 68.714 87.5022 69.334 87.7502 69.706C88.0396 70.0367 88.6182 70.264 89.4862 70.388L90.8502 70.574C91.3049 70.6567 91.5322 70.9047 91.5322 71.318C91.5322 71.7727 91.2842 72 90.7882 72H80.3722C79.7936 72 79.5042 71.7727 79.5042 71.318C79.5042 70.9047 79.7316 70.6567 80.1862 70.574L81.0542 70.45C81.9222 70.326 82.4802 70.078 82.7282 69.706C83.0176 69.334 83.1622 68.714 83.1622 67.846V48.378C83.1622 46.3527 82.7902 44.9267 82.0462 44.1C81.3022 43.2733 80.2482 42.86 78.8842 42.86C77.5616 42.86 76.3629 43.2527 75.2882 44.038C74.2549 44.782 73.4282 45.7947 72.8082 47.076C72.1882 48.316 71.8782 49.7007 71.8782 51.23V67.846C71.8782 68.714 72.0022 69.334 72.2502 69.706C72.5396 70.078 73.1182 70.3053 73.9862 70.388L75.6602 70.574C76.1149 70.6567 76.3422 70.884 76.3422 71.256C76.3422 71.752 76.0322 72 75.4122 72H64.9342Z" fill="white"/>\n<defs>\n<radialGradient id="paint0_radial_21_11" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(14 16) rotate(43.5498) scale(167.638 156.2)">\n<stop stop-color="#2C5DB8"/>\n<stop offset="1" stop-color="#04081A"/>\n</radialGradient>\n<linearGradient id="paint1_linear_21_11" x1="1.77511" y1="1.50277e-06" x2="105.225" y2="107" gradientUnits="userSpaceOnUse">\n<stop stop-color="#5C8FE6"/>\n<stop offset="1" stop-color="#335080"/>\n</linearGradient>\n</defs>\n</svg>\n';
|
|
@@ -1062,6 +1063,44 @@ fi
|
|
|
1062
1063
|
exit 0
|
|
1063
1064
|
`;
|
|
1064
1065
|
|
|
1066
|
+
// src/hooks/scripts/route.ps1
|
|
1067
|
+
var route_default = '# UserPromptSubmit hook \u2014 Windows PowerShell.\n# THE DISPATCHER. Reads the prompt event from stdin (JSON), POSTs it to /route,\n# and prints the routing hint (if any) to stdout \u2014 Claude Code injects\n# UserPromptSubmit stdout into the conversation as added context.\n# Always exits 0; any failure leaves the prompt untouched.\n\n$ErrorActionPreference = "SilentlyContinue"\n\n$raw = [Console]::In.ReadToEnd()\nif (-not $raw) { exit 0 }\n\ntry {\n $hookInput = $raw | ConvertFrom-Json -ErrorAction Stop\n} catch {\n exit 0\n}\nif (-not $hookInput.prompt) { exit 0 }\n\n$portFile = Join-Path $PWD ".synthra-graph\\mcp_port"\nif (-not (Test-Path $portFile)) { exit 0 }\n$port = (Get-Content -Path $portFile -Raw).Trim()\nif (-not $port) { exit 0 }\n\n$payload = @{ prompt = $hookInput.prompt } | ConvertTo-Json -Compress\n\ntry {\n $resp = Invoke-RestMethod -Uri "http://127.0.0.1:$port/route" -Method POST `\n -Body $payload -ContentType "application/json" -TimeoutSec 3\n if ($resp.hint) { Write-Output $resp.hint }\n} catch {\n # silent on failure \u2014 the prompt proceeds without a routing hint\n}\nexit 0\n';
|
|
1068
|
+
|
|
1069
|
+
// src/hooks/scripts/route.sh
|
|
1070
|
+
var route_default2 = `#!/usr/bin/env bash
|
|
1071
|
+
# UserPromptSubmit hook \u2014 bash.
|
|
1072
|
+
# THE DISPATCHER. Reads the prompt event from stdin (JSON), POSTs it to /route,
|
|
1073
|
+
# and prints the routing hint (if any) to stdout \u2014 Claude Code injects
|
|
1074
|
+
# UserPromptSubmit stdout into the conversation as added context.
|
|
1075
|
+
# Always exits 0; requires \`jq\` (silently no-ops without it, like the other hooks).
|
|
1076
|
+
|
|
1077
|
+
set +e
|
|
1078
|
+
|
|
1079
|
+
PORT_FILE="$PWD/.synthra-graph/mcp_port"
|
|
1080
|
+
if [ ! -f "$PORT_FILE" ]; then exit 0; fi
|
|
1081
|
+
PORT=$(cat "$PORT_FILE" 2>/dev/null | tr -d '[:space:]')
|
|
1082
|
+
if [ -z "$PORT" ]; then exit 0; fi
|
|
1083
|
+
|
|
1084
|
+
if ! command -v jq >/dev/null 2>&1; then exit 0; fi
|
|
1085
|
+
|
|
1086
|
+
INPUT=$(cat 2>/dev/null)
|
|
1087
|
+
if [ -z "$INPUT" ]; then exit 0; fi
|
|
1088
|
+
|
|
1089
|
+
# Re-emit only the prompt field as the request body (jq handles escaping).
|
|
1090
|
+
BODY=$(printf '%s' "$INPUT" | jq -c '{prompt: (.prompt // empty)}' 2>/dev/null)
|
|
1091
|
+
if [ -z "$BODY" ] || [ "$BODY" = "{}" ]; then exit 0; fi
|
|
1092
|
+
|
|
1093
|
+
HINT=$(curl -sS --max-time 3 -X POST -H "Content-Type: application/json" \\
|
|
1094
|
+
--data "$BODY" "http://127.0.0.1:$PORT/route" 2>/dev/null \\
|
|
1095
|
+
| jq -r '.hint // empty' 2>/dev/null \\
|
|
1096
|
+
| head -c 2000)
|
|
1097
|
+
|
|
1098
|
+
if [ -n "$HINT" ]; then
|
|
1099
|
+
printf '%s\\n' "$HINT"
|
|
1100
|
+
fi
|
|
1101
|
+
exit 0
|
|
1102
|
+
`;
|
|
1103
|
+
|
|
1065
1104
|
// src/hooks/scripts/stop.ps1
|
|
1066
1105
|
var stop_default = `# Stop hook \u2014 Windows PowerShell.\r
|
|
1067
1106
|
# Reads Claude's transcript JSONL from $hookInput.transcript_path, sums\r
|
|
@@ -1226,7 +1265,9 @@ var SCRIPTS = [
|
|
|
1226
1265
|
sh: pre_tool_use_default2
|
|
1227
1266
|
},
|
|
1228
1267
|
{ event: "PreCompact", baseName: "synthra-pre-compact", ps1: pre_compact_default, sh: pre_compact_default2 },
|
|
1229
|
-
{ event: "Stop", baseName: "synthra-stop", ps1: stop_default, sh: stop_default2 }
|
|
1268
|
+
{ event: "Stop", baseName: "synthra-stop", ps1: stop_default, sh: stop_default2 },
|
|
1269
|
+
// The Dispatcher — per-prompt routing hint (best-fit agent/skill/model).
|
|
1270
|
+
{ event: "UserPromptSubmit", baseName: "synthra-route", ps1: route_default, sh: route_default2 }
|
|
1230
1271
|
];
|
|
1231
1272
|
function commandFor(scriptPath) {
|
|
1232
1273
|
if (process.platform === "win32") {
|
|
@@ -3046,7 +3087,7 @@ import { basename as basename5 } from "path";
|
|
|
3046
3087
|
// src/hooks/claude-md.ts
|
|
3047
3088
|
import { readFile as readFile12, writeFile as writeFile6 } from "fs/promises";
|
|
3048
3089
|
import { basename as basename4, dirname as dirname9 } from "path";
|
|
3049
|
-
var POLICY_VERSION =
|
|
3090
|
+
var POLICY_VERSION = 9;
|
|
3050
3091
|
var POLICY_BEGIN = `<!-- synthra-policy v${POLICY_VERSION} BEGIN -->`;
|
|
3051
3092
|
var POLICY_END = `<!-- synthra-policy v${POLICY_VERSION} END -->`;
|
|
3052
3093
|
var ANY_BLOCK_RE = /<!--\s*synthra-policy\s+v\d+\s+BEGIN\s*-->[\s\S]*?<!--\s*synthra-policy\s+v\d+\s+END\s*-->\s*/g;
|
|
@@ -3068,7 +3109,7 @@ function policyBlock() {
|
|
|
3068
3109
|
"> `mcp__synthra__graph_register_edit`. **Short names will NOT resolve**",
|
|
3069
3110
|
"> in ToolSearch or invocation \u2014 always use the full namespaced form.",
|
|
3070
3111
|
"> If the tools are deferred, load their schemas with ToolSearch:",
|
|
3071
|
-
"> `select:mcp__synthra__graph_continue,mcp__synthra__graph_read,mcp__synthra__graph_register_edit,mcp__synthra__find_symbol`.",
|
|
3112
|
+
"> `select:mcp__synthra__graph_continue,mcp__synthra__graph_read,mcp__synthra__graph_register_edit,mcp__synthra__find_symbol,mcp__synthra__route_task`.",
|
|
3072
3113
|
"> Below, short names (`graph_continue` etc.) appear in prose for",
|
|
3073
3114
|
"> readability only.",
|
|
3074
3115
|
"",
|
|
@@ -3086,6 +3127,11 @@ function policyBlock() {
|
|
|
3086
3127
|
" util, or function, call this to check whether one already exists. If it",
|
|
3087
3128
|
" returns matches, reuse or extend them instead of re-implementing; only",
|
|
3088
3129
|
' "no match \u2014 safe to create" means it is genuinely new.',
|
|
3130
|
+
"- **`route_task(task)`** \u2014 **delegate-first**: before starting a multi-step",
|
|
3131
|
+
" implementation task, ask which installed subagent/skill fits it. Plan on",
|
|
3132
|
+
" the primary model, then hand execution to the recommended subagent on a",
|
|
3133
|
+
" cheaper model (sonnet \u2248 5\xD7 cheaper than opus). Synthra may also inject a",
|
|
3134
|
+
" `[Synthra route]` hint on your prompt \u2014 treat it the same way.",
|
|
3089
3135
|
"",
|
|
3090
3136
|
"### When to call `graph_continue` \u2014 and when to skip",
|
|
3091
3137
|
"",
|
|
@@ -3473,6 +3519,10 @@ function loadConfig() {
|
|
|
3473
3519
|
// the terminal bypass of the Moat can be measured. Never blocks. Opt out
|
|
3474
3520
|
// with SYN_NO_BASH_OBSERVE.
|
|
3475
3521
|
bashObserve: !process.env.SYN_NO_BASH_OBSERVE,
|
|
3522
|
+
// The Dispatcher: per-prompt routing hints (best-fit agent/skill/model).
|
|
3523
|
+
// Silent unless the top agent clears routeMinScore. SYN_NO_ROUTE disables.
|
|
3524
|
+
route: !process.env.SYN_NO_ROUTE,
|
|
3525
|
+
routeMinScore: num("SYN_ROUTE_MIN_SCORE", 3),
|
|
3476
3526
|
mcpPort: process.env.SYN_MCP_PORT ? num("SYN_MCP_PORT", 0) : null,
|
|
3477
3527
|
dashboardPort: num("SYN_DASHBOARD_PORT", 8901),
|
|
3478
3528
|
logLevel: str("SYN_LOG_LEVEL", "info"),
|
|
@@ -3481,8 +3531,8 @@ function loadConfig() {
|
|
|
3481
3531
|
}
|
|
3482
3532
|
|
|
3483
3533
|
// src/server/mcp.ts
|
|
3484
|
-
import { appendFile as
|
|
3485
|
-
import { dirname as
|
|
3534
|
+
import { appendFile as appendFile4, mkdir as mkdir11 } from "fs/promises";
|
|
3535
|
+
import { dirname as dirname13 } from "path";
|
|
3486
3536
|
|
|
3487
3537
|
// src/graph/rank.ts
|
|
3488
3538
|
var KW_BASE_WEIGHT = 2;
|
|
@@ -4102,6 +4152,158 @@ async function pack(files, opts) {
|
|
|
4102
4152
|
};
|
|
4103
4153
|
}
|
|
4104
4154
|
|
|
4155
|
+
// src/server/routes/route-match.ts
|
|
4156
|
+
var ROUTE_MIN_PROMPT_TOKENS = 3;
|
|
4157
|
+
var ROUTE_MAX_AGENTS = 3;
|
|
4158
|
+
var ROUTE_MAX_SKILLS = 2;
|
|
4159
|
+
var FINGERPRINT_BOOST = 2;
|
|
4160
|
+
var NAME_HIT_WEIGHT = 3;
|
|
4161
|
+
var EXT_KEYWORDS = {
|
|
4162
|
+
".svelte": ["svelte"],
|
|
4163
|
+
".vue": ["vue"],
|
|
4164
|
+
".tsx": ["react", "typescript"],
|
|
4165
|
+
".jsx": ["react"],
|
|
4166
|
+
".ts": ["typescript"],
|
|
4167
|
+
".py": ["python"],
|
|
4168
|
+
".cs": ["csharp", "dotnet"],
|
|
4169
|
+
".dart": ["flutter", "dart"],
|
|
4170
|
+
".rs": ["rust"],
|
|
4171
|
+
".go": ["golang", "go"],
|
|
4172
|
+
".java": ["java"],
|
|
4173
|
+
".kt": ["kotlin"],
|
|
4174
|
+
".php": ["php", "laravel"],
|
|
4175
|
+
".rb": ["ruby", "rails"],
|
|
4176
|
+
".hubl": ["hubspot", "hubl"],
|
|
4177
|
+
".html": ["html", "css"]
|
|
4178
|
+
};
|
|
4179
|
+
function fingerprintKeywords(extCounts) {
|
|
4180
|
+
const total = [...extCounts.values()].reduce((a, b) => a + b, 0);
|
|
4181
|
+
const out = /* @__PURE__ */ new Set();
|
|
4182
|
+
if (total === 0) return out;
|
|
4183
|
+
for (const [ext, count] of extCounts) {
|
|
4184
|
+
if (count / total < 0.2) continue;
|
|
4185
|
+
for (const kw of EXT_KEYWORDS[ext] ?? []) out.add(kw);
|
|
4186
|
+
}
|
|
4187
|
+
return out;
|
|
4188
|
+
}
|
|
4189
|
+
function scoreItem(item, qTokens, fingerprint) {
|
|
4190
|
+
const nameTokens = new Set(tokenizeQuery(item.name));
|
|
4191
|
+
const descTokens = new Set(tokenizeQuery(item.description));
|
|
4192
|
+
let score2 = 0;
|
|
4193
|
+
const hits = [];
|
|
4194
|
+
for (const t of qTokens) {
|
|
4195
|
+
if (nameTokens.has(t)) {
|
|
4196
|
+
score2 += NAME_HIT_WEIGHT;
|
|
4197
|
+
hits.push(t);
|
|
4198
|
+
} else if (descTokens.has(t)) {
|
|
4199
|
+
score2 += 1;
|
|
4200
|
+
hits.push(t);
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
for (const kw of fingerprint) {
|
|
4204
|
+
if (nameTokens.has(kw) || descTokens.has(kw)) {
|
|
4205
|
+
score2 += FINGERPRINT_BOOST;
|
|
4206
|
+
break;
|
|
4207
|
+
}
|
|
4208
|
+
}
|
|
4209
|
+
return { item, score: score2, hits };
|
|
4210
|
+
}
|
|
4211
|
+
function scoreArsenal(prompt, arsenal, extCounts, minScore) {
|
|
4212
|
+
const qTokens = new Set(tokenizeQuery(prompt));
|
|
4213
|
+
if (qTokens.size < ROUTE_MIN_PROMPT_TOKENS) {
|
|
4214
|
+
return { confident: false, agents: [], skills: [] };
|
|
4215
|
+
}
|
|
4216
|
+
const fingerprint = fingerprintKeywords(extCounts);
|
|
4217
|
+
const rank = (items) => items.filter((i) => i.enabled !== false).map((i) => scoreItem(i, qTokens, fingerprint)).filter((s) => s.score > 0).sort((a, b) => b.score - a.score || a.item.name.localeCompare(b.item.name));
|
|
4218
|
+
const agents = rank(arsenal.agents).slice(0, ROUTE_MAX_AGENTS).map((s) => ({
|
|
4219
|
+
name: s.item.name,
|
|
4220
|
+
score: s.score,
|
|
4221
|
+
reason: s.hits.length ? `matches: ${s.hits.slice(0, 4).join(", ")}` : "language fit",
|
|
4222
|
+
model: s.item.meta?.model?.trim() || "sonnet"
|
|
4223
|
+
}));
|
|
4224
|
+
const skills = rank(arsenal.skills).slice(0, ROUTE_MAX_SKILLS).map((s) => ({
|
|
4225
|
+
name: s.item.name,
|
|
4226
|
+
score: s.score,
|
|
4227
|
+
reason: s.hits.length ? `matches: ${s.hits.slice(0, 4).join(", ")}` : "language fit"
|
|
4228
|
+
}));
|
|
4229
|
+
const confident = agents.length > 0 && (agents[0]?.score ?? 0) >= minScore;
|
|
4230
|
+
return { confident, agents, skills };
|
|
4231
|
+
}
|
|
4232
|
+
function renderHint(match) {
|
|
4233
|
+
if (!match.confident || match.agents.length === 0) return "";
|
|
4234
|
+
const a = match.agents[0];
|
|
4235
|
+
const skill = match.skills[0] ? ` + skill '${match.skills[0].name}'` : "";
|
|
4236
|
+
return `[Synthra route] This task fits agent '${a.name}' (model: ${a.model})${skill}. Plan here first, then delegate execution to it - execution on cheaper models cuts cost ~5x.`;
|
|
4237
|
+
}
|
|
4238
|
+
function renderRouteReport(task, match) {
|
|
4239
|
+
const lines = [`# route_task: "${task}"`, ""];
|
|
4240
|
+
if (match.agents.length === 0 && match.skills.length === 0) {
|
|
4241
|
+
lines.push(
|
|
4242
|
+
"No strong match in the installed Arsenal \u2014 proceed yourself (browse the dashboard's Arsenal tab to see what's available)."
|
|
4243
|
+
);
|
|
4244
|
+
return lines.join("\n");
|
|
4245
|
+
}
|
|
4246
|
+
if (match.agents.length > 0) {
|
|
4247
|
+
lines.push(match.confident ? "Recommended agents:" : "Possible agents (low confidence):");
|
|
4248
|
+
for (const a of match.agents) {
|
|
4249
|
+
lines.push(`- \`${a.name}\` (model: ${a.model}) \u2014 score ${a.score}, ${a.reason}`);
|
|
4250
|
+
}
|
|
4251
|
+
}
|
|
4252
|
+
if (match.skills.length > 0) {
|
|
4253
|
+
lines.push("");
|
|
4254
|
+
lines.push("Relevant skills:");
|
|
4255
|
+
for (const s of match.skills) lines.push(`- \`${s.name}\` \u2014 score ${s.score}, ${s.reason}`);
|
|
4256
|
+
}
|
|
4257
|
+
lines.push("");
|
|
4258
|
+
lines.push(
|
|
4259
|
+
"_Model policy: plan on the primary model; delegate execution to a subagent on a cheaper model (sonnet \u2248 5\xD7 cheaper than opus)._"
|
|
4260
|
+
);
|
|
4261
|
+
return lines.join("\n");
|
|
4262
|
+
}
|
|
4263
|
+
|
|
4264
|
+
// src/server/routes/route.ts
|
|
4265
|
+
import { appendFile as appendFile3, mkdir as mkdir10 } from "fs/promises";
|
|
4266
|
+
import { dirname as dirname12 } from "path";
|
|
4267
|
+
var defaultDeps = { arsenal: (root) => computeArsenal(root) };
|
|
4268
|
+
function graphExtCounts(ctx) {
|
|
4269
|
+
const counts = /* @__PURE__ */ new Map();
|
|
4270
|
+
for (const n of ctx.graph.nodes) {
|
|
4271
|
+
if (n.kind !== "file") continue;
|
|
4272
|
+
const ext = n.ext;
|
|
4273
|
+
counts.set(ext, (counts.get(ext) ?? 0) + 1);
|
|
4274
|
+
}
|
|
4275
|
+
return counts;
|
|
4276
|
+
}
|
|
4277
|
+
var PROMPT_LOG_MAX = 200;
|
|
4278
|
+
async function logRoute(ctx, prompt, hint) {
|
|
4279
|
+
try {
|
|
4280
|
+
await mkdir10(dirname12(ctx.paths.routeLog), { recursive: true });
|
|
4281
|
+
const entry = {
|
|
4282
|
+
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4283
|
+
prompt: prompt.length > PROMPT_LOG_MAX ? `${prompt.slice(0, PROMPT_LOG_MAX)}\u2026` : prompt,
|
|
4284
|
+
routed: hint.length > 0,
|
|
4285
|
+
hint_chars: hint.length
|
|
4286
|
+
};
|
|
4287
|
+
await appendFile3(ctx.paths.routeLog, JSON.stringify(entry) + "\n", "utf8");
|
|
4288
|
+
} catch {
|
|
4289
|
+
}
|
|
4290
|
+
}
|
|
4291
|
+
async function handleRoute(req, ctx, deps = defaultDeps) {
|
|
4292
|
+
const cfg = loadConfig();
|
|
4293
|
+
if (!cfg.route) return { hint: "" };
|
|
4294
|
+
const prompt = typeof req?.prompt === "string" ? req.prompt.trim() : "";
|
|
4295
|
+
if (!prompt) return { hint: "" };
|
|
4296
|
+
try {
|
|
4297
|
+
const arsenal = await deps.arsenal(ctx.paths.projectRoot);
|
|
4298
|
+
const match = scoreArsenal(prompt, arsenal, graphExtCounts(ctx), cfg.routeMinScore);
|
|
4299
|
+
const hint = renderHint(match);
|
|
4300
|
+
await logRoute(ctx, prompt, hint);
|
|
4301
|
+
return { hint };
|
|
4302
|
+
} catch {
|
|
4303
|
+
return { hint: "" };
|
|
4304
|
+
}
|
|
4305
|
+
}
|
|
4306
|
+
|
|
4105
4307
|
// src/server/mcp.ts
|
|
4106
4308
|
var PROTOCOL_VERSION = "2024-11-05";
|
|
4107
4309
|
var SERVER_INFO = { name: "synthra", version: "0.0.1" };
|
|
@@ -4290,6 +4492,17 @@ var TOOLS = [
|
|
|
4290
4492
|
},
|
|
4291
4493
|
required: ["from", "to"]
|
|
4292
4494
|
}
|
|
4495
|
+
},
|
|
4496
|
+
{
|
|
4497
|
+
name: "route_task",
|
|
4498
|
+
description: "Ask Synthra which installed subagent/skill best fits a task, and which model to run it on. Scores the task against every installed agent and skill (plus the project's language fingerprint). Use BEFORE starting a multi-step implementation task: plan on the primary model, then delegate execution to the recommended agent on a cheaper model (sonnet \u2248 5\xD7 cheaper than opus).",
|
|
4499
|
+
inputSchema: {
|
|
4500
|
+
type: "object",
|
|
4501
|
+
properties: {
|
|
4502
|
+
task: { type: "string", description: "The task to route, in a sentence." }
|
|
4503
|
+
},
|
|
4504
|
+
required: ["task"]
|
|
4505
|
+
}
|
|
4293
4506
|
}
|
|
4294
4507
|
];
|
|
4295
4508
|
async function callTool(name, args, ctx) {
|
|
@@ -4318,6 +4531,8 @@ async function callTool(name, args, ctx) {
|
|
|
4318
4531
|
return duplicateSymbols(args, ctx);
|
|
4319
4532
|
case "call_path":
|
|
4320
4533
|
return callPath(args, ctx);
|
|
4534
|
+
case "route_task":
|
|
4535
|
+
return routeTask(args, ctx);
|
|
4321
4536
|
default:
|
|
4322
4537
|
return errorContent(`Unknown tool: ${name}`);
|
|
4323
4538
|
}
|
|
@@ -4474,6 +4689,17 @@ function testsCoveringLine(graph, filePaths) {
|
|
|
4474
4689
|
const omitted = tests.length - shown.length;
|
|
4475
4690
|
return `Tests covering the impact: ${shown.join(" \xB7 ")}${omitted > 0 ? ` \u2026+${omitted} more` : ""}`;
|
|
4476
4691
|
}
|
|
4692
|
+
async function routeTask(args, ctx) {
|
|
4693
|
+
const task = typeof args?.task === "string" ? args.task.trim() : "";
|
|
4694
|
+
if (!task) return errorContent("route_task: 'task' (string) is required");
|
|
4695
|
+
try {
|
|
4696
|
+
const arsenal = await computeArsenal(ctx.paths.projectRoot);
|
|
4697
|
+
const match = scoreArsenal(task, arsenal, graphExtCounts(ctx), loadConfig().routeMinScore);
|
|
4698
|
+
return textContent(renderRouteReport(task, match));
|
|
4699
|
+
} catch (err2) {
|
|
4700
|
+
return errorContent(`route_task: arsenal scan failed \u2014 ${err2.message}`);
|
|
4701
|
+
}
|
|
4702
|
+
}
|
|
4477
4703
|
function resolveSymbolArg(ctx, arg) {
|
|
4478
4704
|
const a = arg.trim();
|
|
4479
4705
|
if (a.includes("::")) {
|
|
@@ -5032,8 +5258,8 @@ async function contextRecall(args, ctx) {
|
|
|
5032
5258
|
}
|
|
5033
5259
|
async function logToolCall(ctx, tool) {
|
|
5034
5260
|
try {
|
|
5035
|
-
await
|
|
5036
|
-
await
|
|
5261
|
+
await mkdir11(dirname13(ctx.paths.toolLog), { recursive: true });
|
|
5262
|
+
await appendFile4(
|
|
5037
5263
|
ctx.paths.toolLog,
|
|
5038
5264
|
JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), tool }) + "\n",
|
|
5039
5265
|
"utf8"
|
|
@@ -5226,8 +5452,8 @@ async function getChangedLineRanges(projectRoot, sinceRef) {
|
|
|
5226
5452
|
}
|
|
5227
5453
|
|
|
5228
5454
|
// src/memory/session.ts
|
|
5229
|
-
import { mkdir as
|
|
5230
|
-
import { dirname as
|
|
5455
|
+
import { mkdir as mkdir12, readFile as readFile17, writeFile as writeFile10 } from "fs/promises";
|
|
5456
|
+
import { dirname as dirname14 } from "path";
|
|
5231
5457
|
var SESSION_SCHEMA_VERSION = 2;
|
|
5232
5458
|
async function readSession(path) {
|
|
5233
5459
|
try {
|
|
@@ -5240,7 +5466,7 @@ async function readSession(path) {
|
|
|
5240
5466
|
}
|
|
5241
5467
|
}
|
|
5242
5468
|
async function writeSession(path, state) {
|
|
5243
|
-
await
|
|
5469
|
+
await mkdir12(dirname14(path), { recursive: true });
|
|
5244
5470
|
await writeFile10(path, JSON.stringify(state, null, 2) + "\n", "utf8");
|
|
5245
5471
|
}
|
|
5246
5472
|
|
|
@@ -5288,12 +5514,12 @@ async function handleContextUpdate(req, ctx) {
|
|
|
5288
5514
|
}
|
|
5289
5515
|
|
|
5290
5516
|
// src/server/routes/gate.ts
|
|
5291
|
-
import { appendFile as
|
|
5292
|
-
import { dirname as
|
|
5517
|
+
import { appendFile as appendFile6, mkdir as mkdir14 } from "fs/promises";
|
|
5518
|
+
import { dirname as dirname16 } from "path";
|
|
5293
5519
|
|
|
5294
5520
|
// src/server/routes/bash-observe.ts
|
|
5295
|
-
import { appendFile as
|
|
5296
|
-
import { dirname as
|
|
5521
|
+
import { appendFile as appendFile5, mkdir as mkdir13 } from "fs/promises";
|
|
5522
|
+
import { dirname as dirname15 } from "path";
|
|
5297
5523
|
|
|
5298
5524
|
// src/server/routes/query-heuristics.ts
|
|
5299
5525
|
function looksLikeNonSymbolQuery(pattern) {
|
|
@@ -5452,7 +5678,7 @@ var CMD_MAX = 300;
|
|
|
5452
5678
|
var trunc = (s, max) => s.length > max ? `${s.slice(0, max)}\u2026` : s;
|
|
5453
5679
|
async function logObservation(ctx, exp, confidence, avoidable, command) {
|
|
5454
5680
|
try {
|
|
5455
|
-
await
|
|
5681
|
+
await mkdir13(dirname15(ctx.paths.bashLog), { recursive: true });
|
|
5456
5682
|
const entry = {
|
|
5457
5683
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5458
5684
|
kind: exp.kind,
|
|
@@ -5462,7 +5688,7 @@ async function logObservation(ctx, exp, confidence, avoidable, command) {
|
|
|
5462
5688
|
avoidable,
|
|
5463
5689
|
command: trunc(command, CMD_MAX)
|
|
5464
5690
|
};
|
|
5465
|
-
await
|
|
5691
|
+
await appendFile5(ctx.paths.bashLog, JSON.stringify(entry) + "\n", "utf8");
|
|
5466
5692
|
} catch {
|
|
5467
5693
|
}
|
|
5468
5694
|
}
|
|
@@ -5532,7 +5758,7 @@ function recentlyTouchedMatchesQuery(recentPaths, queryTokens, graph) {
|
|
|
5532
5758
|
var LOG_REASON_MAX_CHARS = 240;
|
|
5533
5759
|
async function logDecision(ctx, toolName, query, decision, reason, hintChars) {
|
|
5534
5760
|
try {
|
|
5535
|
-
await
|
|
5761
|
+
await mkdir14(dirname16(ctx.paths.gateLog), { recursive: true });
|
|
5536
5762
|
const entry = {
|
|
5537
5763
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5538
5764
|
tool: toolName,
|
|
@@ -5541,7 +5767,7 @@ async function logDecision(ctx, toolName, query, decision, reason, hintChars) {
|
|
|
5541
5767
|
reason: reason && reason.length > LOG_REASON_MAX_CHARS ? `${reason.slice(0, LOG_REASON_MAX_CHARS)}\u2026` : reason,
|
|
5542
5768
|
...hintChars === void 0 ? {} : { hint_chars: hintChars }
|
|
5543
5769
|
};
|
|
5544
|
-
await
|
|
5770
|
+
await appendFile6(ctx.paths.gateLog, JSON.stringify(entry) + "\n", "utf8");
|
|
5545
5771
|
} catch {
|
|
5546
5772
|
}
|
|
5547
5773
|
}
|
|
@@ -5664,16 +5890,16 @@ async function handleGate(req, ctx) {
|
|
|
5664
5890
|
}
|
|
5665
5891
|
|
|
5666
5892
|
// src/server/routes/log.ts
|
|
5667
|
-
import { appendFile as
|
|
5668
|
-
import { dirname as
|
|
5893
|
+
import { appendFile as appendFile7, mkdir as mkdir15 } from "fs/promises";
|
|
5894
|
+
import { dirname as dirname17 } from "path";
|
|
5669
5895
|
async function handleLog(entry, ctx) {
|
|
5670
5896
|
if (!entry || typeof entry.input_tokens !== "number" || typeof entry.output_tokens !== "number") {
|
|
5671
5897
|
throw new Error("log: input_tokens and output_tokens (number) are required");
|
|
5672
5898
|
}
|
|
5673
5899
|
const written_at = (/* @__PURE__ */ new Date()).toISOString();
|
|
5674
5900
|
const record = { ...entry, written_at };
|
|
5675
|
-
await
|
|
5676
|
-
await
|
|
5901
|
+
await mkdir15(dirname17(ctx.paths.tokenLog), { recursive: true });
|
|
5902
|
+
await appendFile7(ctx.paths.tokenLog, JSON.stringify(record) + "\n", "utf8");
|
|
5677
5903
|
return { ok: true, written_at };
|
|
5678
5904
|
}
|
|
5679
5905
|
|
|
@@ -5867,6 +6093,10 @@ function buildApp(ctx, port) {
|
|
|
5867
6093
|
const body = await c.req.json().catch(() => ({}));
|
|
5868
6094
|
return c.json(await handleGate(body, ctx));
|
|
5869
6095
|
});
|
|
6096
|
+
app.post("/route", async (c) => {
|
|
6097
|
+
const body = await c.req.json().catch(() => ({}));
|
|
6098
|
+
return c.json(await handleRoute(body, ctx));
|
|
6099
|
+
});
|
|
5870
6100
|
app.get("/activity", async (c) => {
|
|
5871
6101
|
const sinceParam = c.req.query("since");
|
|
5872
6102
|
const sinceMs = sinceParam ? Number(sinceParam) : void 0;
|
|
@@ -6173,7 +6403,7 @@ import { readFile as readFile20, readdir as readdir4, rm, rmdir, stat as stat5,
|
|
|
6173
6403
|
import { basename as basename6, join as join13, resolve as resolve4 } from "path";
|
|
6174
6404
|
|
|
6175
6405
|
// src/cli/self-update.ts
|
|
6176
|
-
import { mkdir as
|
|
6406
|
+
import { mkdir as mkdir16, readFile as readFile19, writeFile as writeFile12 } from "fs/promises";
|
|
6177
6407
|
import { homedir as homedir4 } from "os";
|
|
6178
6408
|
import { join as join12 } from "path";
|
|
6179
6409
|
import { createInterface } from "readline/promises";
|
|
@@ -6240,7 +6470,7 @@ async function readLastSeen() {
|
|
|
6240
6470
|
}
|
|
6241
6471
|
async function writeLastSeen(version) {
|
|
6242
6472
|
try {
|
|
6243
|
-
await
|
|
6473
|
+
await mkdir16(SYNTHRA_DIR, { recursive: true });
|
|
6244
6474
|
const data = { version, updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
6245
6475
|
await writeFile12(LAST_SEEN_PATH, JSON.stringify(data, null, 2), "utf8");
|
|
6246
6476
|
} catch {
|
|
@@ -6410,7 +6640,8 @@ var HOOK_BASENAMES = [
|
|
|
6410
6640
|
"synthra-prime",
|
|
6411
6641
|
"synthra-pre-tool-use",
|
|
6412
6642
|
"synthra-pre-compact",
|
|
6413
|
-
"synthra-stop"
|
|
6643
|
+
"synthra-stop",
|
|
6644
|
+
"synthra-route"
|
|
6414
6645
|
];
|
|
6415
6646
|
async function exists3(path) {
|
|
6416
6647
|
try {
|