diff --git a/src/dashboard-bundle.ts b/src/dashboard-bundle.ts index f792407..c13fb2b 100644 --- a/src/dashboard-bundle.ts +++ b/src/dashboard-bundle.ts @@ -1,8 +1,8 @@ // AUTO-GENERATED by scripts/build-dashboard-ui.mjs — do not edit by hand. // Source: src/dashboard/ (Svelte). Run `pnpm run build:dashboard-ui` to regenerate. -// Size: 91235 chars (89.1 KB). +// Size: 91662 chars (89.5 KB). -export const DASHBOARD_JS = `"use strict";(()=>{var di=globalThis.process?.env?.NODE_ENV,v=di&&!di.toLowerCase().startsWith("prod");var Pt=Array.isArray,pi=Array.prototype.indexOf,mt=Array.prototype.includes,br=Array.from,oo=Object.keys,$e=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,_n=Object.getOwnPropertyDescriptors,io=Object.prototype,_i=Array.prototype,or=Object.getPrototypeOf,so=Object.isExtensible;var Le=()=>{};function vi(e){return e()}function xr(e){for(var t=0;t{e=n,t=i});return{promise:r,resolve:e,reject:t}}var Re=Symbol("$state"),mn=Symbol("legacy props"),mi=Symbol(""),hn=Symbol("proxy path"),gn=Symbol("attributes"),Br=Symbol("class"),Yr=Symbol("style"),Hr=Symbol("text");var ao=Symbol("hmr anchor"),Gt=new class extends Error{name="StaleReactionError";message="The reaction that called \`getAbortSignal()\` was re-run or destroyed"},lo=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var ir=3,Qe=8;function hi(e){if(v){let t=new Error(\`invariant_violation +export const DASHBOARD_JS = `"use strict";(()=>{var di=globalThis.process?.env?.NODE_ENV,v=di&&!di.toLowerCase().startsWith("prod");var Pt=Array.isArray,pi=Array.prototype.indexOf,ht=Array.prototype.includes,br=Array.from,oo=Object.keys,$e=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,_n=Object.getOwnPropertyDescriptors,io=Object.prototype,_i=Array.prototype,or=Object.getPrototypeOf,so=Object.isExtensible;var Fe=()=>{};function vi(e){return e()}function xr(e){for(var t=0;t{e=n,t=i});return{promise:r,resolve:e,reject:t}}var Re=Symbol("$state"),mn=Symbol("legacy props"),mi=Symbol(""),hn=Symbol("proxy path"),gn=Symbol("attributes"),Br=Symbol("class"),Yr=Symbol("style"),Hr=Symbol("text");var ao=Symbol("hmr anchor"),Gt=new class extends Error{name="StaleReactionError";message="The reaction that called \`getAbortSignal()\` was re-run or destroyed"},lo=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var ir=3,et=8;function hi(e){if(v){let t=new Error(\`invariant_violation An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app \\u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "\${e}" https://svelte.dev/e/invariant_violation\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/invariant_violation")}function $i(){if(v){let e=new Error("async_derived_orphan\\nCannot create a \`$derived(...)\` with an \`await\` expression outside of an effect tree\\nhttps://svelte.dev/e/async_derived_orphan");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function bi(){if(v){let e=new Error(\`derived_references_self A derived value cannot reference itself recursively @@ -28,43 +28,43 @@ https://svelte.dev/e/await_waterfall\`,St,At):console.warn("https://svelte.dev/e %cReading a derived belonging to a now-destroyed effect may result in stale values https://svelte.dev/e/derived_inert\`,St,At):console.warn("https://svelte.dev/e/derived_inert")}function Mi(e,t,r){v?console.warn(\`%c[svelte] hydration_attribute_changed %cThe \\\`\${e}\\\` attribute on \\\`\${t}\\\` changed its value between server and client renders. The client value, \\\`\${r}\\\`, will be ignored in favour of the server value -https://svelte.dev/e/hydration_attribute_changed\`,St,At):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Fi(e){v?console.warn(\`%c[svelte] hydration_html_changed +https://svelte.dev/e/hydration_attribute_changed\`,St,At):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Li(e){v?console.warn(\`%c[svelte] hydration_html_changed %c\${e?\`The value of an \\\`{@html ...}\\\` block \${e} changed between server and client renders. The client value will be ignored in favour of the server value\`:"The value of an \`{@html ...}\` block changed between server and client renders. The client value will be ignored in favour of the server value"} https://svelte.dev/e/hydration_html_changed\`,St,At):console.warn("https://svelte.dev/e/hydration_html_changed")}function Wt(e){v?console.warn(\`%c[svelte] hydration_mismatch %c\${e?\`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near \${e}\`:"Hydration failed because the initial UI does not match what was rendered on the server"} -https://svelte.dev/e/hydration_mismatch\`,St,At):console.warn("https://svelte.dev/e/hydration_mismatch")}function Li(){v?console.warn(\`%c[svelte] lifecycle_double_unmount +https://svelte.dev/e/hydration_mismatch\`,St,At):console.warn("https://svelte.dev/e/hydration_mismatch")}function Fi(){v?console.warn(\`%c[svelte] lifecycle_double_unmount %cTried to unmount a component that was not mounted https://svelte.dev/e/lifecycle_double_unmount\`,St,At):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function bn(e){v?console.warn(\`%c[svelte] state_proxy_equality_mismatch %cReactive \\\`$state(...)\\\` proxies and the values they proxy have different identities. Because of this, comparisons with \\\`\${e}\\\` will produce unexpected results https://svelte.dev/e/state_proxy_equality_mismatch\`,St,At):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function Pi(){v?console.warn(\`%c[svelte] state_proxy_unmount %cTried to unmount a state proxy, rather than a component -https://svelte.dev/e/state_proxy_unmount\`,St,At):console.warn("https://svelte.dev/e/state_proxy_unmount")}function qi(){v?console.warn("%c[svelte] svelte_boundary_reset_noop\\n%cA \`\` \`reset\` function only resets the boundary the first time it is called\\nhttps://svelte.dev/e/svelte_boundary_reset_noop",St,At):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var T=!1;function de(e){T=e}var I;function H(e){if(e===null)throw Wt(),kt;return I=e}function be(){return H(xe(I))}function h(e){if(T){if(xe(I)!==null)throw Wt(),kt;I=e}}function jr(e=1){if(T){for(var t=e,r=I;t--;)r=xe(r);I=r}}function Nt(e=!0){for(var t=0,r=I;;){if(r.nodeType===Qe){var n=r.data;if(n==="]"){if(t===0)return r;t-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(t+=1)}var i=xe(r);e&&r.remove(),r=i}}function Gr(e){if(!e||e.nodeType!==Qe)throw Wt(),kt;return e.data}function xn(e){return e===this.v}function yn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function wn(e){return!yn(e,this.v)}var ye=!1,Kt=!1,ht=!1;function zi(){Kt=!0}var Wr=null;function Pe(e,t){return e.label=t,Tn(e.v,t),e}function Tn(e,t){return e?.[hn]?.(t),e}function gt(e){let t=new Error,r=$a();return r.length===0?null:(r.unshift(\` +https://svelte.dev/e/state_proxy_unmount\`,St,At):console.warn("https://svelte.dev/e/state_proxy_unmount")}function qi(){v?console.warn("%c[svelte] svelte_boundary_reset_noop\\n%cA \`\` \`reset\` function only resets the boundary the first time it is called\\nhttps://svelte.dev/e/svelte_boundary_reset_noop",St,At):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var T=!1;function de(e){T=e}var I;function V(e){if(e===null)throw Wt(),kt;return I=e}function be(){return V(xe(I))}function h(e){if(T){if(xe(I)!==null)throw Wt(),kt;I=e}}function jr(e=1){if(T){for(var t=e,r=I;t--;)r=xe(r);I=r}}function Nt(e=!0){for(var t=0,r=I;;){if(r.nodeType===et){var n=r.data;if(n==="]"){if(t===0)return r;t-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(t+=1)}var i=xe(r);e&&r.remove(),r=i}}function Gr(e){if(!e||e.nodeType!==et)throw Wt(),kt;return e.data}function xn(e){return e===this.v}function yn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function wn(e){return!yn(e,this.v)}var ye=!1,Kt=!1,gt=!1;function zi(){Kt=!0}var Wr=null;function Pe(e,t){return e.label=t,Tn(e.v,t),e}function Tn(e,t){return e?.[hn]?.(t),e}function $t(e){let t=new Error,r=$a();return r.length===0?null:(r.unshift(\` \`),$e(t,"stack",{value:r.join(\` \`)}),$e(t,"name",{value:e}),t)}function $a(){let e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let t=new Error().stack;if(Error.stackTraceLimit=e,!t)return[];let r=t.split(\` -\`),n=[];for(let i=0;i{t===sr&&Vi()})}sr.push(e)}function Ui(){for(;sr.length>0;)Vi()}var po=new WeakMap;function Sn(e){var t=E;if(t===null)return N.f|=8388608,e;if(v&&e instanceof Error&&!po.has(e)&&po.set(e,ba(e,t)),(t.f&32768)===0&&(t.f&4)===0)throw v&&!t.parent&&e instanceof Error&&ji(e),e;ut(e,t)}function ut(e,t){for(;t!==null;){if((t.f&128)!==0){if((t.f&32768)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw v&&e instanceof Error&&ji(e),e}function ba(e,t){let r=Je(e,"message");if(!(r&&!r.configurable)){for(var n=Xr?" ":" ",i=\` +\`),n=[];for(let i=0;i{t===sr&&Vi()})}sr.push(e)}function Ui(){for(;sr.length>0;)Vi()}var po=new WeakMap;function Sn(e){var t=E;if(t===null)return N.f|=8388608,e;if(v&&e instanceof Error&&!po.has(e)&&po.set(e,ba(e,t)),(t.f&32768)===0&&(t.f&4)===0)throw v&&!t.parent&&e instanceof Error&&ji(e),e;ut(e,t)}function ut(e,t){for(;t!==null;){if((t.f&128)!==0){if((t.f&32768)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw v&&e instanceof Error&&ji(e),e}function ba(e,t){let r=Qe(e,"message");if(!(r&&!r.configurable)){for(var n=Xr?" ":" ",i=\` \${n}in \${t.fn?.name||""}\`,o=t.ctx;o!==null;)i+=\` \${n}in \${o.function?.[We].split("/").pop()}\`,o=o.p;return{message:e.message+\` \${i} \`,stack:e.stack?.split(\` \`).filter(a=>!a.includes("svelte/src/internal")).join(\` -\`)}}}function ji(e){let t=po.get(e);t&&($e(e,"message",{value:t.message}),$e(e,"stack",{value:t.stack}))}var xa=-7169;function G(e,t){e.f=e.f&xa|t}function Tr(e){(e.f&512)!==0||e.deps===null?G(e,1024):G(e,4096)}function Gi(e){if(e!==null)for(let t of e)(t.f&2)===0||(t.f&65536)===0||(t.f^=65536,Gi(t.deps))}function An(e,t,r){(e.f&2048)!==0?t.add(e):(e.f&4096)!==0&&r.add(e),Gi(e.deps),G(e,1024)}function Nn(e,t,r){if(e==null)return t(void 0),r&&r(void 0),Le;let n=y(()=>e.subscribe(t,r));return n.unsubscribe?()=>n.unsubscribe():n}var kr=[];function _o(e,t){return{subscribe:Sr(e,t).subscribe}}function Sr(e,t=Le){let r=null,n=new Set;function i(l){if(yn(e,l)&&(e=l,r)){let f=!kr.length;for(let u of n)u[1](),kr.push(u,e);if(f){for(let u=0;u{n.delete(u),n.size===0&&r&&(r(),r=null)}}return{set:i,update:o,subscribe:a}}function Rn(e){let t;return Nn(e,r=>t=r)(),t}var Wi=!1;var vo=Symbol();function Ee(e,t,r){let n=r[t]??={store:null,source:L(void 0),unsubscribe:Le};if(v&&(n.source.label=t),n.store!==e&&!(vo in r))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=Le;else{var i=!0;n.unsubscribe=Nn(e,o=>{i?n.source.v=o:R(n.source,o)}),i=!1}return e&&vo in r?Rn(e):s(n.source)}function De(){let e={};function t(){Te(()=>{for(var r in e)e[r].unsubscribe();$e(e,vo,{enumerable:!1,value:!0})})}return[e,t]}var Cn=null,Nr=null,O=null,Rr=null,ke=null,go=null,ar=!1,mo=!1,lr=null,Zr=null,Ki=0,ho=new Set,wa=1,rt=class e{id=wa++;#e=!1;linked=!0;#t=null;#r=null;async_deriveds=new Map;current=new Map;previous=new Map;unblocked=new Set;#l=new Set;#n=new Set;#i=new Set;#o=0;#s=new Map;#d=null;#a=[];#_=[];#p=new Set;#c=new Set;#u=new Map;#f=new Set;is_fork=!1;#h=!1;#x(){if(this.is_fork)return!0;for(let n of this.#s.keys()){for(var t=n,r=!1;t.parent!==null;){if(this.#u.has(t)){r=!0;break}t=t.parent}if(!r)return!0}return!1}skip_effect(t){this.#u.has(t)||this.#u.set(t,{d:[],m:[]}),this.#f.delete(t)}unskip_effect(t,r=n=>this.schedule(n)){var n=this.#u.get(t);if(n){this.#u.delete(t);for(var i of n.d)G(i,2048),r(i);for(i of n.m)G(i,4096),r(i)}this.#f.add(t)}#m(){if(this.#e=!0,Ki++>1e3&&(this.#b(),Ea()),v)for(let f of this.current.keys())ho.add(f);if(!this.#x()){for(let f of this.#p)this.#c.delete(f),G(f,2048),this.schedule(f);for(let f of this.#c)G(f,4096),this.schedule(f)}let t=this.#a;this.#a=[],this.apply();var r=lr=[],n=[],i=Zr=[];for(let f of t)try{this.#y(f,r,n)}catch(u){throw Qi(f),u}if(O=null,i.length>0){var o=e.ensure();for(let f of i)o.schedule(f)}if(lr=null,Zr=null,this.#x()){this.#v(n),this.#v(r);for(let[f,u]of this.#u)Ji(f,u);i.length>0&&O.#m();return}let a=this.#w();if(a){a.#g(this);return}this.#p.clear(),this.#c.clear();for(let f of this.#l)f(this);this.#l.clear(),Rr=this,Xi(n),Xi(r),Rr=null,this.#d?.resolve();var l=O;if(this.linked&&this.#o===0&&this.#b(),ye&&!this.linked&&(this.#E(),O=l),this.#a.length>0){l===null&&(l=this,this.#$());let f=l;f.#a.push(...this.#a.filter(u=>!f.#a.includes(u)))}l!==null&&l.#m()}#y(t,r,n){t.f^=1024;for(var i=t.first;i!==null;){var o=i.f,a=(o&96)!==0,l=a&&(o&1024)!==0,f=l||(o&8192)!==0||this.#u.has(i);if(!f&&i.fn!==null){a?i.f^=1024:(o&4)!==0?r.push(i):ye&&(o&16777224)!==0?n.push(i):Ht(i)&&((o&16)!==0&&this.#c.add(i),bt(i));var u=i.first;if(u!==null){i=u;continue}}for(;i!==null;){var p=i.next;if(p!==null){i=p;break}i=i.parent}}}#w(){for(var t=this.#t;t!==null;){if(!t.is_fork){for(let[r,[,n]]of this.current)if(t.current.has(r)&&!n)return t}t=t.#t}return null}#g(t){for(let[n,i]of t.current)!this.previous.has(n)&&t.previous.has(n)&&this.previous.set(n,t.previous.get(n)),this.current.set(n,i);for(let[n,i]of t.async_deriveds){let o=this.async_deriveds.get(n);o&&i.promise.then(o.resolve)}let r=n=>{var i=n.reactions;if(i!==null)for(let l of i){var o=l.f;if((o&2)!==0)r(l);else{var a=l;o&4194320&&!this.async_deriveds.has(a)&&(this.#c.delete(a),G(a,2048),this.schedule(a))}}};for(let n of this.current.keys())r(n);this.oncommit(()=>t.discard()),t.#b(),O=this,this.#m()}#v(t){for(var r=0;r!this.current.has(d));if(i.length===0)t&&p.discard();else if(r.length>0){if(v&&Yi(p.#a.length===0,"Batch has scheduled roots"),t)for(let d of this.#f)p.unskip_effect(d,c=>{(c.f&4194320)!==0?p.schedule(c):p.#v([c])});p.activate();var o=new Set,a=new Map;for(var l of r)Zi(l,i,o,a);a=new Map;var f=[...p.current.keys()].filter(d=>this.current.has(d)?this.current.get(d)[0]!==d.v:!0);if(f.length>0)for(let d of this.#_)(d.f&155648)===0&&$o(d,f,a)&&((d.f&4194320)!==0?(G(d,2048),p.schedule(d)):p.#p.add(d));if(p.#a.length>0){p.apply();for(var u of p.#a)p.#y(u,[],[]);p.#a=[]}p.deactivate()}}}}increment(t,r){if(this.#o+=1,t){let n=this.#s.get(r)??0;this.#s.set(r,n+1)}}decrement(t,r){if(this.#o-=1,t){let n=this.#s.get(r)??0;n===1?this.#s.delete(r):this.#s.set(r,n-1)}this.#h||(this.#h=!0,we(()=>{this.#h=!1,this.linked&&this.flush()}))}transfer_effects(t,r){for(let n of t)this.#p.add(n);for(let n of r)this.#c.add(n);t.clear(),r.clear()}oncommit(t){this.#l.add(t)}ondiscard(t){this.#n.add(t)}on_fork_commit(t){this.#i.add(t)}run_fork_commit_callbacks(){for(let t of this.#i)t(this);this.#i.clear()}settled(){return(this.#d??=vn()).promise}static ensure(){if(O===null){let t=O=new e;t.#$(),!mo&&!ar&&we(()=>{t.#e||t.flush()})}return O}apply(){if(!ye||!this.is_fork&&this.#t===null&&this.#r===null){ke=null;return}ke=new Map;for(let[r,[n]]of this.current)ke.set(r,n);for(let r=Cn;r!==null;r=r.#r)if(!(r===this||r.is_fork)){var t=!1;if(r.id0)){Yt.clear();for(let i of pt){if((i.f&24576)!==0)continue;let o=[i],a=i.parent;for(;a!==null;)pt.has(a)&&(pt.delete(a),o.push(a)),a=a.parent;for(let l=o.length-1;l>=0;l--){let f=o[l];(f.f&24576)===0&&bt(f)}}pt.clear()}}pt=null}}function Zi(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(let i of e.reactions){let o=i.f;(o&2)!==0?Zi(i,t,r,n):(o&4194320)!==0&&(o&2048)===0&&$o(i,t,n)&&(G(i,2048),Jr(i))}}function $o(e,t,r){let n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(let i of e.deps){if(mt.call(t,i))return!0;if((i.f&2)!==0&&$o(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function Jr(e){O.schedule(e)}function Ji(e,t){if(!((e.f&32)!==0&&(e.f&1024)!==0)){(e.f&2048)!==0?t.d.push(e):(e.f&4096)!==0&&t.m.push(e),G(e,1024);for(var r=e.first;r!==null;)Ji(r,t),r=r.next}}function Qi(e){G(e,1024);for(var t=e.first;t!==null;)Qi(t),t=t.next}function xo(e){let t=0,r=Ye(0),n;return v&&Pe(r,"createSubscriber version"),()=>{qt()&&(s(r),Se(()=>(t===0&&(n=y(()=>e(()=>cr(r)))),t+=1,()=>{we(()=>{t-=1,t===0&&(n?.(),n=void 0,cr(r))})})))}}var ka=589824;function wo(e,t,r,n){new yo(e,t,r,n)}var yo=class{parent;is_pending=!1;transform_error;#e;#t=T?I:null;#r;#l;#n;#i=null;#o=null;#s=null;#d=null;#a=0;#_=0;#p=!1;#c=new Set;#u=new Set;#f=null;#h=xo(()=>(this.#f=Ye(this.#a),v&&Pe(this.#f,"$effect.pending()"),()=>{this.#f=null}));constructor(t,r,n,i){this.#e=t,this.#r=r,this.#l=o=>{var a=E;a.b=this,a.f|=128,n(o)},this.parent=E.b,this.transform_error=i??this.parent?.transform_error??(o=>o),this.#n=ot(()=>{if(T){let o=this.#t;be();let a=o.data==="[!";if(o.data.startsWith("[?")){let f=JSON.parse(o.data.slice("[?".length));this.#m(f)}else a?this.#y():this.#x()}else this.#w()},ka),T&&(this.#e=I)}#x(){try{this.#i=ge(()=>this.#l(this.#e))}catch(t){this.error(t)}}#m(t){let r=this.#r.failed;r&&(this.#s=ge(()=>{r(this.#e,()=>t,()=>()=>{})}))}#y(){let t=this.#r.pending;t&&(this.is_pending=!0,this.#o=ge(()=>t(this.#e)),we(()=>{var r=this.#d=document.createDocumentFragment(),n=fe();r.append(n),this.#i=this.#v(()=>ge(()=>this.#l(n))),this.#_===0&&(this.#e.before(r),this.#d=null,Ot(this.#o,()=>{this.#o=null}),this.#g(O))}))}#w(){try{if(this.is_pending=this.has_pending_snippet(),this.#_=0,this.#a=0,this.#i=ge(()=>{this.#l(this.#e)}),this.#_>0){var t=this.#d=document.createDocumentFragment();Ir(this.#i,t);let r=this.#r.pending;this.#o=ge(()=>r(this.#e))}else this.#g(O)}catch(r){this.error(r)}}#g(t){this.is_pending=!1,t.transfer_effects(this.#c,this.#u)}defer_effect(t){An(t,this.#c,this.#u)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#v(t){var r=E,n=N,i=q;se(this.#n),le(this.#n),zt(this.#n.ctx);try{return rt.ensure(),t()}catch(o){return Sn(o),null}finally{se(r),le(n),zt(i)}}#E(t,r){if(!this.has_pending_snippet()){this.parent&&this.parent.#E(t,r);return}this.#_+=t,this.#_===0&&(this.#g(r),this.#o&&Ot(this.#o,()=>{this.#o=null}),this.#d&&(this.#e.before(this.#d),this.#d=null))}update_pending_count(t,r){this.#E(t,r),this.#a+=t,!(!this.#f||this.#p)&&(this.#p=!0,we(()=>{this.#p=!1,this.#f&&xt(this.#f,this.#a)}))}get_effect_pending(){return this.#h(),s(this.#f)}error(t){if(!this.#r.onerror&&!this.#r.failed)throw t;O?.is_fork?(this.#i&&O.skip_effect(this.#i),this.#o&&O.skip_effect(this.#o),this.#s&&O.skip_effect(this.#s),O.on_fork_commit(()=>{this.#$(t)})):this.#$(t)}#$(t){this.#i&&(ie(this.#i),this.#i=null),this.#o&&(ie(this.#o),this.#o=null),this.#s&&(ie(this.#s),this.#s=null),T&&(H(this.#t),jr(),H(Nt()));var r=this.#r.onerror;let n=this.#r.failed;var i=!1,o=!1;let a=()=>{if(i){qi();return}i=!0,o&&Ci(),this.#s!==null&&Ot(this.#s,()=>{this.#s=null}),this.#v(()=>{this.#w()})},l=f=>{try{o=!0,r?.(f,a),o=!1}catch(u){ut(u,this.#n&&this.#n.parent)}n&&(this.#s=this.#v(()=>{try{return ge(()=>{var u=E;u.b=this,u.f|=128,n(this.#e,()=>f,()=>a)})}catch(u){return ut(u,this.#n.parent),null}}))};we(()=>{var f;try{f=this.transform_error(t)}catch(u){ut(u,this.#n&&this.#n.parent);return}f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(l,u=>ut(u,this.#n&&this.#n.parent)):l(f)})}};function Mn(e,t,r,n){let i=Ct()?ur:Mr;var o=e.filter(c=>!c.settled);if(r.length===0&&o.length===0){n(t.map(i));return}var a=E,l=rs(),f=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(c=>c.promise)):null;function u(c){if((a.f&16384)===0){l();try{n(c)}catch(_){ut(_,a)}Dr()}}var p=Eo();if(r.length===0){f.then(()=>u(t.map(i))).finally(p);return}function d(){Promise.all(r.map(c=>ko(c))).then(c=>u([...t.map(i),...c])).catch(c=>ut(c,a)).finally(p)}f?f.then(()=>{l(),d(),Dr()}):d()}function rs(){var e=E,t=N,r=q,n=O;if(v)var i=Rt;return function(a=!0){se(e),le(t),zt(r),a&&(e.f&16384)===0&&(n?.activate(),n?.apply()),v&&(To(null),Er(i))}}function Dr(e=!0){se(null),le(null),zt(null),e&&O?.deactivate(),v&&(To(null),Er(null))}function Eo(){var e=E,t=e.b,r=O,n=t.is_rendered();return t.update_pending_count(1,r),r.increment(n,e),()=>{t.update_pending_count(-1,r),r.decrement(n,e)}}var Ke=null;function To(e){Ke=e}var Qr=new Set;function ur(e){var t=2050;E!==null&&(E.f|=524288);let r={ctx:q,deps:null,effects:null,equals:xn,f:t,fn:e,reactions:null,rv:0,v:J,wv:0,parent:E,ac:null};return v&&ht&&(r.created=gt("created at")),r}var Fn=Symbol("obsolete");function ko(e,t,r){let n=E;n===null&&$i();var i=void 0,o=Ye(J);v&&(o.label=t??e.toString());var a=!N,l=new Set;return is(()=>{var f=E;v&&(Ke={effect:f,effect_deps:new Set,warned:!1});var u=vn();i=u.promise;try{Promise.resolve(e()).then(u.resolve,_=>{_!==Gt&&u.reject(_)}).finally(Dr)}catch(_){u.reject(_),Dr()}if(v){if(Ke){if(f.deps!==null)for(let _=0;_{v&&(Ke=null),d?.(),l.delete(u),m!==Fn&&(p.activate(),m?(o.f|=8388608,xt(o,m)):((o.f&8388608)!==0&&(o.f^=8388608),xt(o,_),v&&r!==void 0&&(Qr.add(o),setTimeout(()=>{Qr.has(o)&&(f.f&16384)===0&&(Ii(o.label,r),Qr.delete(o))}))),p.deactivate())};u.promise.then(c,_=>c(null,_||"unknown"))}),Te(()=>{for(let f of l)f.reject(Fn)}),v&&(o.f|=4194304),new Promise(f=>{function u(p){function d(){p===i?f(o):u(i)}p.then(d,d)}u(i)})}function Ao(e){let t=ur(e);return ye||Pn(t),t}function Mr(e){let t=ur(e);return t.equals=wn,t}function ns(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r5){let o=gt("updated at");if(o!==null){let a=e.updated.get(o.stack);a||(a={error:o,count:0},e.updated.set(o.stack,a)),a.count++}}}E!==null&&(e.set_during_effect=!0)}if((e.f&2)!==0){let i=e;(e.f&2048)!==0&&en(i),ke===null&&Tr(i)}e.wv=Or(),as(e,2048,r),Ct()&&E!==null&&(E.f&1024)!==0&&(E.f&96)===0&&(st===null?ls([e]):st.push(e)),!n.is_fork&&dr.size>0&&!Co&&Dn()}return t}function Dn(){Co=!1;for(let e of dr){(e.f&1024)!==0&&G(e,4096);let t;try{t=Ht(e)}catch{t=!0}t&&bt(e)}dr.clear()}function cr(e){R(e,e.v+1)}function as(e,t,r){var n=e.reactions;if(n!==null)for(var i=Ct(),o=n.length,a=0;a{if(Jt===a)return d();var c=N,_=Jt;le(null),Oo(a);var m=d();return le(c),Oo(_),m};n&&(r.set("length",It(e.length,o)),v&&(e=Ra(e)));var f="";let u=!1;function p(d){if(!u){u=!0,f=d,Pe(i,\`\${f} version\`);for(let[c,_]of r)Pe(_,_r(f,c));u=!1}}return new Proxy(e,{defineProperty(d,c,_){(!("value"in _)||_.configurable===!1||_.enumerable===!1||_.writable===!1)&&Ai();var m=r.get(c);return m===void 0?l(()=>{var x=It(_.value,o);return r.set(c,x),v&&typeof c=="string"&&Pe(x,_r(f,c)),x}):R(m,_.value,!0),!0},deleteProperty(d,c){var _=r.get(c);if(_===void 0){if(c in d){let m=l(()=>It(J,o));r.set(c,m),cr(i),v&&Pe(m,_r(f,c))}}else R(_,J),cr(i);return!0},get(d,c,_){if(c===Re)return e;if(v&&c===hn)return p;var m=r.get(c),x=c in d;if(m===void 0&&(!x||Je(d,c)?.writable)&&(m=l(()=>{var k=Zt(x?d[c]:J),z=It(k,o);return v&&Pe(z,_r(f,c)),z}),r.set(c,m)),m!==void 0){var $=s(m);return $===J?void 0:$}return Reflect.get(d,c,_)},getOwnPropertyDescriptor(d,c){var _=Reflect.getOwnPropertyDescriptor(d,c);if(_&&"value"in _){var m=r.get(c);m&&(_.value=s(m))}else if(_===void 0){var x=r.get(c),$=x?.v;if(x!==void 0&&$!==J)return{enumerable:!0,configurable:!0,value:$,writable:!0}}return _},has(d,c){if(c===Re)return!0;var _=r.get(c),m=_!==void 0&&_.v!==J||Reflect.has(d,c);if(_!==void 0||E!==null&&(!m||Je(d,c)?.writable)){_===void 0&&(_=l(()=>{var $=m?Zt(d[c]):J,k=It($,o);return v&&Pe(k,_r(f,c)),k}),r.set(c,_));var x=s(_);if(x===J)return!1}return m},set(d,c,_,m){var x=r.get(c),$=c in d;if(n&&c==="length")for(var k=_;kIt(J,o)),r.set(k+"",z),v&&Pe(z,_r(f,k)))}if(x===void 0)(!$||Je(d,c)?.writable)&&(x=l(()=>It(void 0,o)),v&&Pe(x,_r(f,c)),R(x,Zt(_)),r.set(c,x));else{$=x.v!==J;var F=l(()=>Zt(_));R(x,F)}var Y=Reflect.getOwnPropertyDescriptor(d,c);if(Y?.set&&Y.set.call(m,_),!$){if(n&&typeof c=="string"){var S=r.get("length"),w=Number(c);Number.isInteger(w)&&w>=S.v&&R(S,w+1)}cr(i)}return!0},ownKeys(d){s(i);var c=Reflect.ownKeys(d).filter(x=>{var $=r.get(x);return $===void 0||$.v!==J});for(var[_,m]of r)m.v!==J&&!(_ in d)&&c.push(_);return c},setPrototypeOf(){Ni()}})}function _r(e,t){return typeof t=="symbol"?\`\${e}[Symbol(\${t.description??""})]\`:Aa.test(t)?\`\${e}.\${t}\`:/^\\d+$/.test(t)?\`\${e}[\${t}]\`:\`\${e}['\${t}']\`}function qn(e){try{if(e!==null&&typeof e=="object"&&Re in e)return e[Re]}catch{}return e}var Na=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function Ra(e){return new Proxy(e,{get(t,r,n){var i=Reflect.get(t,r,n);return Na.has(r)?function(...o){ss();var a=i.apply(this,o);return Dn(),a}:i}})}function fs(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t();let{indexOf:r,lastIndexOf:n,includes:i}=e;e.indexOf=function(o,a){let l=r.call(this,o,a);if(l===-1){for(let f=a??0;f{e.indexOf=r,e.lastIndexOf=n,e.includes=i}}var Io,cs,Xr,us,ds;function zn(){if(Io===void 0){Io=window,cs=document,Xr=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;us=Je(t,"firstChild").get,ds=Je(t,"nextSibling").get,so(e)&&(e[Br]=void 0,e[gn]=null,e[Yr]=void 0,e.__e=void 0),so(r)&&(r[Hr]=void 0),v&&(e.__svelte_meta=null,fs())}}function fe(e=""){return document.createTextNode(e)}function ae(e){return us.call(e)}function xe(e){return ds.call(e)}function g(e,t){if(!T)return ae(e);var r=ae(I);if(r===null)r=I.appendChild(fe());else if(t&&r.nodeType!==ir){var n=fe();return r?.before(n),H(n),n}return t&&nn(r),H(r),r}function Xe(e,t=!1){if(!T){var r=ae(e);return r instanceof Comment&&r.data===""?xe(r):r}if(t){if(I?.nodeType!==ir){var n=fe();return I?.before(n),H(n),n}nn(I)}return I}function b(e,t=1,r=!1){let n=T?I:e;for(var i;t--;)i=n,n=xe(n);if(!T)return n;if(r){if(n?.nodeType!==ir){var o=fe();return n===null?i?.after(o):n.before(o),H(o),o}nn(n)}return H(n),n}function rn(e){e.textContent=""}function Bn(){if(!ye||pt!==null)return!1;var e=E.f;return(e&32768)!==0}function yt(e,t,r){let n=r?{is:r}:void 0;return document.createElementNS(t??$n,e,n)}function nn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===ir;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Qt(e){var t=N,r=E;le(null),se(null);try{return e()}finally{le(t),se(r)}}function Mo(e){E===null&&(N===null&&Ei(e),wi()),_t&&yi(e)}function Oa(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function wt(e,t){var r=E;if(v)for(;r!==null&&(r.f&131072)!==0;)r=r.parent;r!==null&&(r.f&8192)!==0&&(e|=8192);var n={ctx:q,deps:null,nodes:null,f:e|2048|512,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};v&&(n.component_function=et),O?.register_created_effect(n);var i=n;if((e&4)!==0)lr!==null?lr.push(n):rt.ensure().schedule(n);else if(t!==null){try{bt(n)}catch(a){throw ie(n),a}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&524288)===0&&(i=i.first,(e&16)!==0&&(e&65536)!==0&&i!==null&&(i.f|=65536))}if(i!==null&&(i.parent=r,r!==null&&Oa(i,r),N!==null&&(N.f&2)!==0&&(e&64)===0)){var o=N;(o.effects??=[]).push(i)}return n}function qt(){return N!==null&&!Ue}function Te(e){let t=wt(8,null);return G(t,1024),t.teardown=e,t}function on(e){Mo("$effect"),v&&$e(e,"name",{value:"$effect"});var t=E.f,r=!N&&(t&32)!==0&&(t&32768)===0;if(r){var n=q;(n.e??=[]).push(e)}else return uo(e)}function uo(e){return wt(1048580,e)}function sn(e){return Mo("$effect.pre"),v&&$e(e,"name",{value:"$effect.pre"}),wt(1048584,e)}function Yn(e){rt.ensure();let t=wt(524352,e);return()=>{ie(t)}}function ms(e){rt.ensure();let t=wt(524352,e);return(r={})=>new Promise(n=>{r.outro?Ot(t,()=>{ie(t),n(void 0)}):(ie(t),n(void 0))})}function vt(e){return wt(4,e)}function B(e,t){var r=q,n={effect:null,ran:!1,deps:e};r.l.$.push(n),n.effect=Se(()=>{if(e(),!n.ran){n.ran=!0;var i=E;try{se(i.parent),y(t)}finally{se(i)}}})}function je(){var e=q;Se(()=>{for(var t of e.l.$){t.deps();var r=t.effect;(r.f&1024)!==0&&r.deps!==null&&G(r,4096),Ht(r)&&bt(r),t.ran=!1}})}function is(e){return wt(4718592,e)}function Se(e,t=0){return wt(8|t,e)}function X(e,t=[],r=[],n=[]){Mn(n,t,r,i=>{wt(8,()=>e(...i.map(s)))})}function ot(e,t=0){var r=wt(16|t,e);return v&&(r.dev_stack=Rt),r}function ge(e){return wt(524320,e)}function Fo(e){var t=e.teardown;if(t!==null){let r=_t,n=N;Do(!0),le(null);try{t.call(null)}finally{Do(r),le(n)}}}function tn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){let i=r.ac;i!==null&&Qt(()=>{i.abort(Gt)});var n=r.next;(r.f&64)!==0?r.parent=null:ie(r,t),r=n}}function hs(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&32)===0&&ie(t),t=r}}function ie(e,t=!0){var r=!1;(t||(e.f&262144)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Lo(e.nodes.start,e.nodes.end),r=!0),G(e,33554432),tn(e,t&&!r),pr(e,0);var n=e.nodes&&e.nodes.t;if(n!==null)for(let o of n)o.stop();Fo(e),e.f^=33554432,e.f|=16384;var i=e.parent;i!==null&&i.first!==null&&bo(e),v&&(e.component_function=null),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Lo(e,t){for(;e!==null;){var r=e===t?null:xe(e);e.remove(),e=r}}function bo(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function Ot(e,t,r=!0){var n=[];gs(e,n,!0);var i=()=>{r&&ie(e),t&&t()},o=n.length;if(o>0){var a=()=>--o||i();for(var l of n)l.out(a)}else i()}function gs(e,t,r){if((e.f&8192)===0){e.f^=8192;var n=e.nodes&&e.nodes.t;if(n!==null)for(let l of n)(l.is_global||r)&&t.push(l);for(var i=e.first;i!==null;){var o=i.next;if((i.f&64)===0){var a=(i.f&65536)!==0||(i.f&32)!==0&&(e.f&16)!==0;gs(i,t,a?r:!1)}i=o}}}function an(e){$s(e,!0)}function $s(e,t){if((e.f&8192)!==0){e.f^=8192,(e.f&1024)===0&&(G(e,2048),rt.ensure().schedule(e));for(var r=e.first;r!==null;){var n=r.next,i=(r.f&65536)!==0||(r.f&32)!==0;$s(r,i?t:!1),r=n}var o=e.nodes&&e.nodes.t;if(o!==null)for(let a of o)(a.is_global||t)&&a.in()}}function Ir(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var i=r===n?null:xe(r);t.append(r),r=i}}var bs=null;var Hn=!1,_t=!1;function Do(e){_t=e}var N=null,Ue=!1;function le(e){N=e}var E=null;function se(e){E=e}var it=null;function Pn(e){N!==null&&(!ye||(N.f&2)!==0)&&(it===null?it=[e]:it.push(e))}var Ae=null,Ve=0,st=null;function ls(e){st=e}var xs=1,vr=0,Jt=vr;function Oo(e){Jt=e}function Or(){return++xs}function Ht(e){var t=e.f;if((t&2048)!==0)return!0;if(t&2&&(e.f&=-65537),(t&4096)!==0){for(var r=e.deps,n=r.length,i=0;ie.wv)return!0}(t&512)!==0&&ke===null&&G(e,1024)}return!1}function ys(e,t,r=!0){var n=e.reactions;if(n!==null&&!(!ye&&it!==null&&mt.call(it,e)))for(var i=0;i{e.ac.abort(Gt)}),e.ac=null);try{e.f|=2097152;var p=e.fn,d=p();e.f|=32768;var c=e.deps,_=O?.is_fork;if(Ae!==null){var m;if(_||pr(e,Ve),c!==null&&Ve>0)for(c.length=Ve+Ae.length,m=0;m>>0).toString(36)}var Fa=["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"];var Fp=[...Fa,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var La=["touchstart","touchmove"];function ks(e){return La.includes(e)}var Pa=["$state","$state.raw","$derived","$derived.by"],Lp=[...Pa,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];function Un(e){return e?.replace(/\\//g,"/\\u200B")}var Ss=new Map;function As(e,t){var r=Ss.get(e);r||(r=new Set,Ss.set(e,r)),r.add(t)}var jn=Symbol("events"),Cs=new Set,Po=new Set;function Os(e,t,r,n={}){function i(o){if(n.capture||Gn.call(t,o),!o.cancelBubble)return Qt(()=>r?.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?we(()=>{t.addEventListener(e,i,n)}):t.addEventListener(e,i,n),i}function Ut(e,t,r,n,i){var o={capture:n,passive:i},a=Os(e,t,r,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Te(()=>{t.removeEventListener(e,a,o)})}var Rs=null;function Gn(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],o=i[0]||e.target;Rs=e;var a=0,l=Rs===e&&e[jn];if(l){var f=i.indexOf(l);if(f!==-1&&(t===document||t===window)){e[jn]=t;return}var u=i.indexOf(t);if(u===-1)return;f<=u&&(a=f)}if(o=i[a]||e.target,o!==t){$e(e,"currentTarget",{configurable:!0,get(){return o||r}});var p=N,d=E;le(null),se(null);try{for(var c,_=[];o!==null;){var m=o.assignedSlot||o.parentNode||o.host||null;try{var x=o[jn]?.[n];x!=null&&(!o.disabled||e.target===o)&&x.call(o,e)}catch($){c?_.push($):c=$}if(e.cancelBubble||m===t||m===null)break;o=m}if(c){for(let $ of _)queueMicrotask(()=>{throw $});throw c}}finally{e[jn]=t,delete e.currentTarget,le(p),se(d)}}}var za=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Is(e){return za?.createHTML(e)??e}function qo(e){var t=yt("template");return t.innerHTML=Is(e.replaceAll("","")),t.content}function at(e,t){var r=E;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function P(e,t){var r=(t&1)!==0,n=(t&2)!==0,i,o=!e.startsWith("");return()=>{if(T)return at(I,null),I;i===void 0&&(i=qo(o?e:""+e),r||(i=ae(i)));var a=n||Xr?document.importNode(i,!0):i.cloneNode(!0);if(r){var l=ae(a),f=a.lastChild;at(l,f)}else at(a,a);return a}}function Dt(e=""){if(!T){var t=fe(e+"");return at(t,t),t}var r=I;return r.nodeType!==ir?(r.before(r=fe()),H(r)):nn(r),at(r,r),r}function D(e,t){if(T){var r=E;((r.f&32768)===0||r.nodes.end===null)&&(r.nodes.end=I),be();return}e!==null&&e.before(t)}var zo=!0;function C(e,t){var r=t==null?"":typeof t=="object"?\`\${t}\`:t;r!==(e[Hr]??=e.nodeValue)&&(e[Hr]=r,e.nodeValue=\`\${r}\`)}function Lr(e,t){return Ds(e,t)}function Yo(e,t){zn(),t.intro=t.intro??!1;let r=t.target,n=T,i=I;try{for(var o=ae(r);o&&(o.nodeType!==Qe||o.data!=="[");)o=xe(o);if(!o)throw kt;de(!0),H(o);let a=Ds(e,{...t,anchor:o});return de(!1),a}catch(a){if(a instanceof Error&&a.message.split(\` -\`).some(l=>l.startsWith("https://svelte.dev/e/")))throw a;return a!==kt&&console.warn("Failed to hydrate: ",a),t.recover===!1&&ki(),zn(),rn(r),de(!1),Lr(e,t)}finally{de(n),H(i)}}var Wn=new Map;function Ds(e,{target:t,anchor:r,props:n={},events:i,context:o,intro:a=!0,transformError:l}){zn();var f=void 0,u=ms(()=>{var p=r??t.appendChild(fe());wo(p,{pending:()=>{}},_=>{pe({});var m=q;if(o&&(m.c=o),i&&(n.$$events=i),T&&at(_,null),zo=a,f=e(_,n)||{},zo=!0,T&&(E.nodes.end=I,I===null||I.nodeType!==Qe||I.data!=="]"))throw Wt(),kt;_e()},l);var d=new Set,c=_=>{for(var m=0;m<_.length;m++){var x=_[m];if(!d.has(x)){d.add(x);var $=ks(x);for(let F of[t,document]){var k=Wn.get(F);k===void 0&&(k=new Map,Wn.set(F,k));var z=k.get(x);z===void 0?(F.addEventListener(x,Gn,{passive:$}),k.set(x,1)):k.set(x,z+1)}}}};return c(br(Cs)),Po.add(c),()=>{for(var _ of d)for(let $ of[t,document]){var m=Wn.get($),x=m.get(_);--x==0?($.removeEventListener(_,Gn),m.delete(_),m.size===0&&Wn.delete($)):m.set(_,x)}Po.delete(c),p!==r&&p.parentNode?.removeChild(p)}});return Bo.set(f,u),f}var Bo=new WeakMap;function Ho(e,t){let r=Bo.get(e);return r?(Bo.delete(e),r(t)):(v&&(Re in e?Pi():Li()),Promise.resolve())}var jt=class{anchor;#e=new Map;#t=new Map;#r=new Map;#l=new Set;#n=!0;constructor(t,r=!0){this.anchor=t,this.#n=r}#i=t=>{if(this.#e.has(t)){var r=this.#e.get(t),n=this.#t.get(r);if(n)an(n),this.#l.delete(r);else{var i=this.#r.get(r);i&&(this.#t.set(r,i.effect),this.#r.delete(r),v&&(i.fragment.lastChild[ao]=this.anchor),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(let[o,a]of this.#e){if(this.#e.delete(o),o===t)break;let l=this.#r.get(a);l&&(ie(l.effect),this.#r.delete(a))}for(let[o,a]of this.#t){if(o===r||this.#l.has(o))continue;let l=()=>{if(Array.from(this.#e.values()).includes(o)){var u=document.createDocumentFragment();Ir(a,u),u.append(fe()),this.#r.set(o,{effect:a,fragment:u})}else ie(a);this.#l.delete(o),this.#t.delete(o)};this.#n||!n?(this.#l.add(o),Ot(a,l,!1)):l()}}};#o=t=>{this.#e.delete(t);let r=Array.from(this.#e.values());for(let[n,i]of this.#r)r.includes(n)||(ie(i.effect),this.#r.delete(n))};ensure(t,r){var n=O,i=Bn();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(i){var o=document.createDocumentFragment(),a=fe();o.append(a),this.#r.set(t,{effect:ge(()=>r(a)),fragment:o})}else this.#t.set(t,ge(()=>r(this.anchor)));if(this.#e.set(n,t),i){for(let[l,f]of this.#t)l===t?n.unskip_effect(f):n.skip_effect(f);for(let[l,f]of this.#r)l===t?n.unskip_effect(f.effect):n.skip_effect(f.effect);n.oncommit(this.#i),n.ondiscard(this.#o)}else T&&(this.anchor=I),this.#i(n)}};function ce(e,t,r=!1){var n;T&&(n=I,be());var i=new jt(e),o=r?65536:0;function a(l,f){if(T){var u=Gr(n);if(l!==parseInt(u.substring(1))){var p=Nt();H(p),i.anchor=p,de(!1),i.ensure(l,f),de(!0);return}}i.ensure(l,f)}ot(()=>{var l=!1;t((f,u=0)=>{l=!0,a(u,f)}),l||a(-1,null)},o)}function Xa(e,t,r){for(var n=[],i=t.length,o,a=t.length,l=0;l{if(o){if(o.pending.delete(d),o.done.add(d),o.pending.size===0){var c=e.outrogroups;Vo(e,br(o.done)),c.delete(o),c.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var f=n.length===0&&r!==null;if(f){var u=r,p=u.parentNode;rn(p),p.append(u),e.items.clear()}Vo(e,t,!f)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function Vo(e,t,r=!0){var n;if(e.pending.size>0){n=new Set;for(let a of e.pending.values())for(let l of a)n.add(e.items.get(l).e)}for(var i=0;i{var F=r();return Pt(F)?F:F==null?[]:br(F)});v&&Pe(d,"{#each ...}");var c,_=new Map,m=!0;function x(F){(z.effect.f&16384)===0&&(z.pending.delete(F),z.fallback=p,Za(z,c,a,t,n),p!==null&&(c.length===0?(p.f&33554432)===0?an(p):(p.f^=33554432,fn(p,null,a)):Ot(p,()=>{p=null})))}function $(F){z.pending.delete(F)}var k=ot(()=>{c=s(d);var F=c.length;let Y=!1;if(T){var S=Gr(a)==="[!";S!==(F===0)&&(a=Nt(),H(a),de(!1),Y=!0)}for(var w=new Set,M=O,W=Bn(),Q=0;Qo(a)):(p=ge(()=>o(Ms??=fe())),p.f|=33554432)),F>w.size&&(v?Qa(c,n):fo("","","")),T&&F>0&&H(Nt()),!m)if(_.set(M,w),W){for(let[ue,lt]of l)w.has(ue)||M.skip_effect(lt.e);M.oncommit(x),M.ondiscard($)}else x(M);Y&&de(!0),s(d)}),z={effect:k,flags:t,items:l,pending:_,outrogroups:null,fallback:p};m=!1,T&&(a=I)}function ln(e){for(;e!==null&&(e.f&32)===0;)e=e.next;return e}function Za(e,t,r,n,i){var o=(n&8)!==0,a=t.length,l=e.items,f=ln(e.effect.first),u,p=null,d,c=[],_=[],m,x,$,k;if(o)for(k=0;k0){var Q=(n&4)!==0&&a===0?r:null;if(o){for(k=0;k{if(d!==void 0)for($ of d)$.nodes?.a?.apply()})}function Ja(e,t,r,n,i,o,a,l){var f=(a&1)!==0?(a&16)===0?L(r,!1,!1):Ye(r):null,u=(a&2)!==0?Ye(i):null;return v&&f&&(f.trace=()=>{l()[u?.v??i]}),{v:f,i:u,e:ge(()=>(o(t,f??r,u??i,l),()=>{e.delete(n)}))}}function fn(e,t,r){if(e.nodes)for(var n=e.nodes.start,i=e.nodes.end,o=t&&(t.f&33554432)===0?t.nodes.start:r;n!==null;){var a=xe(n);if(o.before(n),n===i)return;n=a}}function er(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function Qa(e,t){let r=new Map,n=e.length;for(let i=0;i{var u=E;if(l===(l=t()??"")){T&&be();return}if(r&&!T){u.nodes=null,f.innerHTML=l,l!==""&&at(ae(f),f.lastChild);return}if(u.nodes!==null&&(Lo(u.nodes.start,u.nodes.end),u.nodes=null),l!==""){if(T){for(var p=I.data,d=be(),c=d;d!==null&&(d.nodeType!==Qe||d.data!=="");)c=d,d=xe(d);if(d===null)throw Wt(),kt;v&&!o&&el(d.parentNode,p,l),at(I,c),a=H(d);return}var _=n?Vr:i?co:void 0,m=yt(n?"svg":i?"math":"template",_);m.innerHTML=l;var x=n||i?m:m.content;if(at(ae(x),x.lastChild),n||i)for(;ae(x);)a.before(ae(x));else a.before(x)}})}function Me(e,t){vt(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){let i=yt("style");i.id=t.hash,i.textContent=t.code,n.appendChild(i),v&&As(t.hash,i)}})}var Ls=[...\` -\\r\\f\\xA0\\v\\uFEFF\`];function qs(e,t,r){var n=e==null?"":""+e;if(t&&(n=n?n+" "+t:t),r){for(var i of Object.keys(r))if(r[i])n=n?n+" "+i:i;else if(n.length)for(var o=i.length,a=0;(a=n.indexOf(i,a))>=0;){var l=a+o;(a===0||Ls.includes(n[a-1]))&&(l===n.length||Ls.includes(n[l]))?n=(a===0?"":n.substring(0,a))+n.substring(l+1):a=l}}return n===""?null:n}function Ps(e,t=!1){var r=t?" !important;":";",n="";for(var i of Object.keys(e)){var o=e[i];o!=null&&o!==""&&(n+=" "+i+": "+o+r)}return n}function Uo(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function zs(e,t){if(t){var r="",n,i;if(Array.isArray(t)?(n=t[0],i=t[1]):n=t,e){e=String(e).replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g,"").trim();var o=!1,a=0,l=!1,f=[];n&&f.push(...Object.keys(n).map(Uo)),i&&f.push(...Object.keys(i).map(Uo));var u=0,p=-1;let x=e.length;for(var d=0;dt.trim().split(" ").filter(Boolean))}function bl(e,t){var r=Ys(e.srcset),n=Ys(t);return n.length===r.length&&n.every(([i,o],a)=>o===r[a][1]&&(Go(r[a][0],i)||Go(i,r[a][0])))}function Fe(e=!1){let t=q,r=t.l.u;if(!r)return;let n=()=>V(t.s);if(e){let i=0,o={},a=ur(()=>{let l=!1,f=t.s;for(let u in f)f[u]!==o[u]&&(o[u]=f[u],l=!0);return l&&i++,i});n=()=>s(a)}r.b.length&&sn(()=>{Us(t,n),xr(r.b)}),on(()=>{let i=y(()=>r.m.map(vi));return()=>{for(let o of i)typeof o=="function"&&o()}}),r.a.length&&on(()=>{Us(t,n),xr(r.a)})}function Us(e,t){if(e.l.s)for(let r of e.l.s)s(r);t()}function js(e){return new Wo(e)}var Wo=class{#e;#t;constructor(t){var r=new Map,n=(o,a)=>{var l=L(a,!1,!1);return r.set(o,l),l};let i=new Proxy({...t.props||{},$$events:{}},{get(o,a){return s(r.get(a)??n(a,Reflect.get(o,a)))},has(o,a){return a===mn?!0:(s(r.get(a)??n(a,Reflect.get(o,a))),Reflect.has(o,a))},set(o,a,l){return R(r.get(a)??n(a,l),l),Reflect.set(o,a,l)}});this.#t=(t.hydrate?Yo:Lr)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),!ye&&(!t?.props?.$$host||t.sync===!1)&&Cr(),this.#e=i.$$events;for(let o of Object.keys(this.#t))o==="$set"||o==="$destroy"||o==="$on"||$e(this,o,{get(){return this.#t[o]},set(a){this.#t[o]=a},enumerable:!0});this.#t.$set=o=>{Object.assign(i,o)},this.#t.$destroy=()=>{Ho(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];let n=(...i)=>r.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}};var Nl;typeof HTMLElement=="function"&&(Nl=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&(this.$$shadowRoot=this.attachShadow(r))}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){let n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return i=>{let o=yt("slot");n!=="default"&&(o.name=n),D(i,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},r=Rl(this);for(let n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(let n of this.attributes){let i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=Ko(i,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=js({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=Yn(()=>{Se(()=>{this.$$r=!0;for(let n of oo(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];let i=Ko(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(let n in this.$$l)for(let i of this.$$l[n]){let o=this.$$c.$on(n,i);this.$$l_u.set(i,o)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ko(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return oo(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Ko(e,t,r,n){let i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Rl(e){let t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}if(v){let e=function(t){if(!(t in globalThis)){let r;Object.defineProperty(globalThis,t,{configurable:!0,get:()=>{if(r!==void 0)return r;Si(t)},set:n=>{r=n}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");zi();var Ol={stats:"/proxy-stats",recent:"/proxy-recent",latestPng:"/proxy-latest-png",sessions:"/api/sessions.json",fullStats:"/api/stats.json",compressionToggle:"/api/compression"};async function Xo(e,t){let r=await fetch(e,t);if(!r.ok){let n="";try{n=await r.text()}catch{}throw new Error(\`\${e}: \${r.status} \${r.statusText}\${n?\` \\u2014 \${n.slice(0,200)}\`:""}\`)}return r.json()}async function Il(e,t){return Xo(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}async function Gs(e){return Il(Ol.compressionToggle,{enabled:e})}function cn(e,t){let r=()=>{};return{subscribe:_o({data:null,error:null,loading:!0},i=>{let o=!1,a=null,l=null,f=async()=>{try{let u=await Xo(e);if(o)return;l=u,i({data:u,error:null,loading:!1})}catch(u){if(o)return;i({data:l,error:u.message,loading:!1})}};return r=()=>{f()},f(),a=setInterval(f,t),()=>{o=!0,r=()=>{},a&&clearInterval(a)}}).subscribe,run:()=>r()}}var qr=cn("/proxy-stats",2e3),gr=cn("/proxy-recent",2e3),Ws=cn("/api/sessions.json",5e3),p0=cn("/api/stats.json",5e3),un=Sr(null);function Dl(){let{subscribe:e,update:t}=Sr([]),r=1;return{subscribe:e,push(n,i){let o=r++;t(a=>[...a,{id:o,level:n,text:i}]),setTimeout(()=>t(a=>a.filter(l=>l.id!==o)),5e3)},dismiss(n){t(i=>i.filter(o=>o.id!==n))}}}var dn=Dl();function A(e){return Math.round(Number(e)||0).toLocaleString()}function Ks(e){if(!e)return"-";let t=String(e).split("/");return t[t.length-1]||e}function Zn(e){return e==null?"":String(e).replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}var Ml=P('
show calculation
'),Fl=P('
show calculation
'),Ll=P('
show calculation
'),Pl=P('
show calculation
'),ql=P('
requests
input tokens saved
cache-aware, input-side only
$ saved
at $5/M input tokens (Opus 4.7)
share of total bill saved
\\xF7 (input + 5\\xD7output) - output billed at 5\\xD7 input rate \\xB7 input-only:
token-equivalent total
input + 5\\xD7output billed at 5\\xD7 input rate
'),zl={hash:"svelte-rhs7qr",code:\`.grid.svelte-rhs7qr {display:grid;grid-template-columns:repeat(5, 1fr);gap:14px;margin-bottom:22px;} +\`)}}}function ji(e){let t=po.get(e);t&&($e(e,"message",{value:t.message}),$e(e,"stack",{value:t.stack}))}var xa=-7169;function G(e,t){e.f=e.f&xa|t}function Tr(e){(e.f&512)!==0||e.deps===null?G(e,1024):G(e,4096)}function Gi(e){if(e!==null)for(let t of e)(t.f&2)===0||(t.f&65536)===0||(t.f^=65536,Gi(t.deps))}function An(e,t,r){(e.f&2048)!==0?t.add(e):(e.f&4096)!==0&&r.add(e),Gi(e.deps),G(e,1024)}function Nn(e,t,r){if(e==null)return t(void 0),r&&r(void 0),Fe;let n=y(()=>e.subscribe(t,r));return n.unsubscribe?()=>n.unsubscribe():n}var kr=[];function _o(e,t){return{subscribe:Sr(e,t).subscribe}}function Sr(e,t=Fe){let r=null,n=new Set;function i(l){if(yn(e,l)&&(e=l,r)){let f=!kr.length;for(let u of n)u[1](),kr.push(u,e);if(f){for(let u=0;u{n.delete(u),n.size===0&&r&&(r(),r=null)}}return{set:i,update:o,subscribe:a}}function Rn(e){let t;return Nn(e,r=>t=r)(),t}var Wi=!1;var vo=Symbol();function Ee(e,t,r){let n=r[t]??={store:null,source:F(void 0),unsubscribe:Fe};if(v&&(n.source.label=t),n.store!==e&&!(vo in r))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=Fe;else{var i=!0;n.unsubscribe=Nn(e,o=>{i?n.source.v=o:R(n.source,o)}),i=!1}return e&&vo in r?Rn(e):s(n.source)}function De(){let e={};function t(){Te(()=>{for(var r in e)e[r].unsubscribe();$e(e,vo,{enumerable:!1,value:!0})})}return[e,t]}var Cn=null,Nr=null,O=null,Rr=null,ke=null,go=null,ar=!1,mo=!1,lr=null,Zr=null,Ki=0,ho=new Set,wa=1,nt=class e{id=wa++;#e=!1;linked=!0;#t=null;#r=null;async_deriveds=new Map;current=new Map;previous=new Map;unblocked=new Set;#l=new Set;#n=new Set;#i=new Set;#o=0;#s=new Map;#d=null;#a=[];#_=[];#p=new Set;#c=new Set;#u=new Map;#f=new Set;is_fork=!1;#h=!1;#x(){if(this.is_fork)return!0;for(let n of this.#s.keys()){for(var t=n,r=!1;t.parent!==null;){if(this.#u.has(t)){r=!0;break}t=t.parent}if(!r)return!0}return!1}skip_effect(t){this.#u.has(t)||this.#u.set(t,{d:[],m:[]}),this.#f.delete(t)}unskip_effect(t,r=n=>this.schedule(n)){var n=this.#u.get(t);if(n){this.#u.delete(t);for(var i of n.d)G(i,2048),r(i);for(i of n.m)G(i,4096),r(i)}this.#f.add(t)}#m(){if(this.#e=!0,Ki++>1e3&&(this.#b(),Ea()),v)for(let f of this.current.keys())ho.add(f);if(!this.#x()){for(let f of this.#p)this.#c.delete(f),G(f,2048),this.schedule(f);for(let f of this.#c)G(f,4096),this.schedule(f)}let t=this.#a;this.#a=[],this.apply();var r=lr=[],n=[],i=Zr=[];for(let f of t)try{this.#y(f,r,n)}catch(u){throw Qi(f),u}if(O=null,i.length>0){var o=e.ensure();for(let f of i)o.schedule(f)}if(lr=null,Zr=null,this.#x()){this.#v(n),this.#v(r);for(let[f,u]of this.#u)Ji(f,u);i.length>0&&O.#m();return}let a=this.#w();if(a){a.#g(this);return}this.#p.clear(),this.#c.clear();for(let f of this.#l)f(this);this.#l.clear(),Rr=this,Xi(n),Xi(r),Rr=null,this.#d?.resolve();var l=O;if(this.linked&&this.#o===0&&this.#b(),ye&&!this.linked&&(this.#E(),O=l),this.#a.length>0){l===null&&(l=this,this.#$());let f=l;f.#a.push(...this.#a.filter(u=>!f.#a.includes(u)))}l!==null&&l.#m()}#y(t,r,n){t.f^=1024;for(var i=t.first;i!==null;){var o=i.f,a=(o&96)!==0,l=a&&(o&1024)!==0,f=l||(o&8192)!==0||this.#u.has(i);if(!f&&i.fn!==null){a?i.f^=1024:(o&4)!==0?r.push(i):ye&&(o&16777224)!==0?n.push(i):Ht(i)&&((o&16)!==0&&this.#c.add(i),xt(i));var u=i.first;if(u!==null){i=u;continue}}for(;i!==null;){var p=i.next;if(p!==null){i=p;break}i=i.parent}}}#w(){for(var t=this.#t;t!==null;){if(!t.is_fork){for(let[r,[,n]]of this.current)if(t.current.has(r)&&!n)return t}t=t.#t}return null}#g(t){for(let[n,i]of t.current)!this.previous.has(n)&&t.previous.has(n)&&this.previous.set(n,t.previous.get(n)),this.current.set(n,i);for(let[n,i]of t.async_deriveds){let o=this.async_deriveds.get(n);o&&i.promise.then(o.resolve)}let r=n=>{var i=n.reactions;if(i!==null)for(let l of i){var o=l.f;if((o&2)!==0)r(l);else{var a=l;o&4194320&&!this.async_deriveds.has(a)&&(this.#c.delete(a),G(a,2048),this.schedule(a))}}};for(let n of this.current.keys())r(n);this.oncommit(()=>t.discard()),t.#b(),O=this,this.#m()}#v(t){for(var r=0;r!this.current.has(d));if(i.length===0)t&&p.discard();else if(r.length>0){if(v&&Yi(p.#a.length===0,"Batch has scheduled roots"),t)for(let d of this.#f)p.unskip_effect(d,c=>{(c.f&4194320)!==0?p.schedule(c):p.#v([c])});p.activate();var o=new Set,a=new Map;for(var l of r)Zi(l,i,o,a);a=new Map;var f=[...p.current.keys()].filter(d=>this.current.has(d)?this.current.get(d)[0]!==d.v:!0);if(f.length>0)for(let d of this.#_)(d.f&155648)===0&&$o(d,f,a)&&((d.f&4194320)!==0?(G(d,2048),p.schedule(d)):p.#p.add(d));if(p.#a.length>0){p.apply();for(var u of p.#a)p.#y(u,[],[]);p.#a=[]}p.deactivate()}}}}increment(t,r){if(this.#o+=1,t){let n=this.#s.get(r)??0;this.#s.set(r,n+1)}}decrement(t,r){if(this.#o-=1,t){let n=this.#s.get(r)??0;n===1?this.#s.delete(r):this.#s.set(r,n-1)}this.#h||(this.#h=!0,we(()=>{this.#h=!1,this.linked&&this.flush()}))}transfer_effects(t,r){for(let n of t)this.#p.add(n);for(let n of r)this.#c.add(n);t.clear(),r.clear()}oncommit(t){this.#l.add(t)}ondiscard(t){this.#n.add(t)}on_fork_commit(t){this.#i.add(t)}run_fork_commit_callbacks(){for(let t of this.#i)t(this);this.#i.clear()}settled(){return(this.#d??=vn()).promise}static ensure(){if(O===null){let t=O=new e;t.#$(),!mo&&!ar&&we(()=>{t.#e||t.flush()})}return O}apply(){if(!ye||!this.is_fork&&this.#t===null&&this.#r===null){ke=null;return}ke=new Map;for(let[r,[n]]of this.current)ke.set(r,n);for(let r=Cn;r!==null;r=r.#r)if(!(r===this||r.is_fork)){var t=!1;if(r.id0)){Yt.clear();for(let i of pt){if((i.f&24576)!==0)continue;let o=[i],a=i.parent;for(;a!==null;)pt.has(a)&&(pt.delete(a),o.push(a)),a=a.parent;for(let l=o.length-1;l>=0;l--){let f=o[l];(f.f&24576)===0&&xt(f)}}pt.clear()}}pt=null}}function Zi(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(let i of e.reactions){let o=i.f;(o&2)!==0?Zi(i,t,r,n):(o&4194320)!==0&&(o&2048)===0&&$o(i,t,n)&&(G(i,2048),Jr(i))}}function $o(e,t,r){let n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(let i of e.deps){if(ht.call(t,i))return!0;if((i.f&2)!==0&&$o(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function Jr(e){O.schedule(e)}function Ji(e,t){if(!((e.f&32)!==0&&(e.f&1024)!==0)){(e.f&2048)!==0?t.d.push(e):(e.f&4096)!==0&&t.m.push(e),G(e,1024);for(var r=e.first;r!==null;)Ji(r,t),r=r.next}}function Qi(e){G(e,1024);for(var t=e.first;t!==null;)Qi(t),t=t.next}function xo(e){let t=0,r=Ye(0),n;return v&&Pe(r,"createSubscriber version"),()=>{qt()&&(s(r),Se(()=>(t===0&&(n=y(()=>e(()=>cr(r)))),t+=1,()=>{we(()=>{t-=1,t===0&&(n?.(),n=void 0,cr(r))})})))}}var ka=589824;function wo(e,t,r,n){new yo(e,t,r,n)}var yo=class{parent;is_pending=!1;transform_error;#e;#t=T?I:null;#r;#l;#n;#i=null;#o=null;#s=null;#d=null;#a=0;#_=0;#p=!1;#c=new Set;#u=new Set;#f=null;#h=xo(()=>(this.#f=Ye(this.#a),v&&Pe(this.#f,"$effect.pending()"),()=>{this.#f=null}));constructor(t,r,n,i){this.#e=t,this.#r=r,this.#l=o=>{var a=E;a.b=this,a.f|=128,n(o)},this.parent=E.b,this.transform_error=i??this.parent?.transform_error??(o=>o),this.#n=it(()=>{if(T){let o=this.#t;be();let a=o.data==="[!";if(o.data.startsWith("[?")){let f=JSON.parse(o.data.slice("[?".length));this.#m(f)}else a?this.#y():this.#x()}else this.#w()},ka),T&&(this.#e=I)}#x(){try{this.#i=ge(()=>this.#l(this.#e))}catch(t){this.error(t)}}#m(t){let r=this.#r.failed;r&&(this.#s=ge(()=>{r(this.#e,()=>t,()=>()=>{})}))}#y(){let t=this.#r.pending;t&&(this.is_pending=!0,this.#o=ge(()=>t(this.#e)),we(()=>{var r=this.#d=document.createDocumentFragment(),n=ce();r.append(n),this.#i=this.#v(()=>ge(()=>this.#l(n))),this.#_===0&&(this.#e.before(r),this.#d=null,Ot(this.#o,()=>{this.#o=null}),this.#g(O))}))}#w(){try{if(this.is_pending=this.has_pending_snippet(),this.#_=0,this.#a=0,this.#i=ge(()=>{this.#l(this.#e)}),this.#_>0){var t=this.#d=document.createDocumentFragment();Ir(this.#i,t);let r=this.#r.pending;this.#o=ge(()=>r(this.#e))}else this.#g(O)}catch(r){this.error(r)}}#g(t){this.is_pending=!1,t.transfer_effects(this.#c,this.#u)}defer_effect(t){An(t,this.#c,this.#u)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#v(t){var r=E,n=N,i=q;se(this.#n),fe(this.#n),zt(this.#n.ctx);try{return nt.ensure(),t()}catch(o){return Sn(o),null}finally{se(r),fe(n),zt(i)}}#E(t,r){if(!this.has_pending_snippet()){this.parent&&this.parent.#E(t,r);return}this.#_+=t,this.#_===0&&(this.#g(r),this.#o&&Ot(this.#o,()=>{this.#o=null}),this.#d&&(this.#e.before(this.#d),this.#d=null))}update_pending_count(t,r){this.#E(t,r),this.#a+=t,!(!this.#f||this.#p)&&(this.#p=!0,we(()=>{this.#p=!1,this.#f&&yt(this.#f,this.#a)}))}get_effect_pending(){return this.#h(),s(this.#f)}error(t){if(!this.#r.onerror&&!this.#r.failed)throw t;O?.is_fork?(this.#i&&O.skip_effect(this.#i),this.#o&&O.skip_effect(this.#o),this.#s&&O.skip_effect(this.#s),O.on_fork_commit(()=>{this.#$(t)})):this.#$(t)}#$(t){this.#i&&(ie(this.#i),this.#i=null),this.#o&&(ie(this.#o),this.#o=null),this.#s&&(ie(this.#s),this.#s=null),T&&(V(this.#t),jr(),V(Nt()));var r=this.#r.onerror;let n=this.#r.failed;var i=!1,o=!1;let a=()=>{if(i){qi();return}i=!0,o&&Ci(),this.#s!==null&&Ot(this.#s,()=>{this.#s=null}),this.#v(()=>{this.#w()})},l=f=>{try{o=!0,r?.(f,a),o=!1}catch(u){ut(u,this.#n&&this.#n.parent)}n&&(this.#s=this.#v(()=>{try{return ge(()=>{var u=E;u.b=this,u.f|=128,n(this.#e,()=>f,()=>a)})}catch(u){return ut(u,this.#n.parent),null}}))};we(()=>{var f;try{f=this.transform_error(t)}catch(u){ut(u,this.#n&&this.#n.parent);return}f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(l,u=>ut(u,this.#n&&this.#n.parent)):l(f)})}};function Mn(e,t,r,n){let i=Ct()?ur:Mr;var o=e.filter(c=>!c.settled);if(r.length===0&&o.length===0){n(t.map(i));return}var a=E,l=rs(),f=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(c=>c.promise)):null;function u(c){if((a.f&16384)===0){l();try{n(c)}catch(_){ut(_,a)}Dr()}}var p=Eo();if(r.length===0){f.then(()=>u(t.map(i))).finally(p);return}function d(){Promise.all(r.map(c=>ko(c))).then(c=>u([...t.map(i),...c])).catch(c=>ut(c,a)).finally(p)}f?f.then(()=>{l(),d(),Dr()}):d()}function rs(){var e=E,t=N,r=q,n=O;if(v)var i=Rt;return function(a=!0){se(e),fe(t),zt(r),a&&(e.f&16384)===0&&(n?.activate(),n?.apply()),v&&(To(null),Er(i))}}function Dr(e=!0){se(null),fe(null),zt(null),e&&O?.deactivate(),v&&(To(null),Er(null))}function Eo(){var e=E,t=e.b,r=O,n=t.is_rendered();return t.update_pending_count(1,r),r.increment(n,e),()=>{t.update_pending_count(-1,r),r.decrement(n,e)}}var Ke=null;function To(e){Ke=e}var Qr=new Set;function ur(e){var t=2050;E!==null&&(E.f|=524288);let r={ctx:q,deps:null,effects:null,equals:xn,f:t,fn:e,reactions:null,rv:0,v:J,wv:0,parent:E,ac:null};return v&>&&(r.created=$t("created at")),r}var Ln=Symbol("obsolete");function ko(e,t,r){let n=E;n===null&&$i();var i=void 0,o=Ye(J);v&&(o.label=t??e.toString());var a=!N,l=new Set;return is(()=>{var f=E;v&&(Ke={effect:f,effect_deps:new Set,warned:!1});var u=vn();i=u.promise;try{Promise.resolve(e()).then(u.resolve,_=>{_!==Gt&&u.reject(_)}).finally(Dr)}catch(_){u.reject(_),Dr()}if(v){if(Ke){if(f.deps!==null)for(let _=0;_{v&&(Ke=null),d?.(),l.delete(u),m!==Ln&&(p.activate(),m?(o.f|=8388608,yt(o,m)):((o.f&8388608)!==0&&(o.f^=8388608),yt(o,_),v&&r!==void 0&&(Qr.add(o),setTimeout(()=>{Qr.has(o)&&(f.f&16384)===0&&(Ii(o.label,r),Qr.delete(o))}))),p.deactivate())};u.promise.then(c,_=>c(null,_||"unknown"))}),Te(()=>{for(let f of l)f.reject(Ln)}),v&&(o.f|=4194304),new Promise(f=>{function u(p){function d(){p===i?f(o):u(i)}p.then(d,d)}u(i)})}function Ao(e){let t=ur(e);return ye||Pn(t),t}function Mr(e){let t=ur(e);return t.equals=wn,t}function ns(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r5){let o=$t("updated at");if(o!==null){let a=e.updated.get(o.stack);a||(a={error:o,count:0},e.updated.set(o.stack,a)),a.count++}}}E!==null&&(e.set_during_effect=!0)}if((e.f&2)!==0){let i=e;(e.f&2048)!==0&&en(i),ke===null&&Tr(i)}e.wv=Or(),as(e,2048,r),Ct()&&E!==null&&(E.f&1024)!==0&&(E.f&96)===0&&(at===null?ls([e]):at.push(e)),!n.is_fork&&dr.size>0&&!Co&&Dn()}return t}function Dn(){Co=!1;for(let e of dr){(e.f&1024)!==0&&G(e,4096);let t;try{t=Ht(e)}catch{t=!0}t&&xt(e)}dr.clear()}function cr(e){R(e,e.v+1)}function as(e,t,r){var n=e.reactions;if(n!==null)for(var i=Ct(),o=n.length,a=0;a{if(Jt===a)return d();var c=N,_=Jt;fe(null),Oo(a);var m=d();return fe(c),Oo(_),m};n&&(r.set("length",It(e.length,o)),v&&(e=Ra(e)));var f="";let u=!1;function p(d){if(!u){u=!0,f=d,Pe(i,\`\${f} version\`);for(let[c,_]of r)Pe(_,_r(f,c));u=!1}}return new Proxy(e,{defineProperty(d,c,_){(!("value"in _)||_.configurable===!1||_.enumerable===!1||_.writable===!1)&&Ai();var m=r.get(c);return m===void 0?l(()=>{var x=It(_.value,o);return r.set(c,x),v&&typeof c=="string"&&Pe(x,_r(f,c)),x}):R(m,_.value,!0),!0},deleteProperty(d,c){var _=r.get(c);if(_===void 0){if(c in d){let m=l(()=>It(J,o));r.set(c,m),cr(i),v&&Pe(m,_r(f,c))}}else R(_,J),cr(i);return!0},get(d,c,_){if(c===Re)return e;if(v&&c===hn)return p;var m=r.get(c),x=c in d;if(m===void 0&&(!x||Qe(d,c)?.writable)&&(m=l(()=>{var k=Zt(x?d[c]:J),z=It(k,o);return v&&Pe(z,_r(f,c)),z}),r.set(c,m)),m!==void 0){var $=s(m);return $===J?void 0:$}return Reflect.get(d,c,_)},getOwnPropertyDescriptor(d,c){var _=Reflect.getOwnPropertyDescriptor(d,c);if(_&&"value"in _){var m=r.get(c);m&&(_.value=s(m))}else if(_===void 0){var x=r.get(c),$=x?.v;if(x!==void 0&&$!==J)return{enumerable:!0,configurable:!0,value:$,writable:!0}}return _},has(d,c){if(c===Re)return!0;var _=r.get(c),m=_!==void 0&&_.v!==J||Reflect.has(d,c);if(_!==void 0||E!==null&&(!m||Qe(d,c)?.writable)){_===void 0&&(_=l(()=>{var $=m?Zt(d[c]):J,k=It($,o);return v&&Pe(k,_r(f,c)),k}),r.set(c,_));var x=s(_);if(x===J)return!1}return m},set(d,c,_,m){var x=r.get(c),$=c in d;if(n&&c==="length")for(var k=_;kIt(J,o)),r.set(k+"",z),v&&Pe(z,_r(f,k)))}if(x===void 0)(!$||Qe(d,c)?.writable)&&(x=l(()=>It(void 0,o)),v&&Pe(x,_r(f,c)),R(x,Zt(_)),r.set(c,x));else{$=x.v!==J;var L=l(()=>Zt(_));R(x,L)}var H=Reflect.getOwnPropertyDescriptor(d,c);if(H?.set&&H.set.call(m,_),!$){if(n&&typeof c=="string"){var S=r.get("length"),w=Number(c);Number.isInteger(w)&&w>=S.v&&R(S,w+1)}cr(i)}return!0},ownKeys(d){s(i);var c=Reflect.ownKeys(d).filter(x=>{var $=r.get(x);return $===void 0||$.v!==J});for(var[_,m]of r)m.v!==J&&!(_ in d)&&c.push(_);return c},setPrototypeOf(){Ni()}})}function _r(e,t){return typeof t=="symbol"?\`\${e}[Symbol(\${t.description??""})]\`:Aa.test(t)?\`\${e}.\${t}\`:/^\\d+$/.test(t)?\`\${e}[\${t}]\`:\`\${e}['\${t}']\`}function qn(e){try{if(e!==null&&typeof e=="object"&&Re in e)return e[Re]}catch{}return e}var Na=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function Ra(e){return new Proxy(e,{get(t,r,n){var i=Reflect.get(t,r,n);return Na.has(r)?function(...o){ss();var a=i.apply(this,o);return Dn(),a}:i}})}function fs(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t();let{indexOf:r,lastIndexOf:n,includes:i}=e;e.indexOf=function(o,a){let l=r.call(this,o,a);if(l===-1){for(let f=a??0;f{e.indexOf=r,e.lastIndexOf=n,e.includes=i}}var Io,cs,Xr,us,ds;function zn(){if(Io===void 0){Io=window,cs=document,Xr=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;us=Qe(t,"firstChild").get,ds=Qe(t,"nextSibling").get,so(e)&&(e[Br]=void 0,e[gn]=null,e[Yr]=void 0,e.__e=void 0),so(r)&&(r[Hr]=void 0),v&&(e.__svelte_meta=null,fs())}}function ce(e=""){return document.createTextNode(e)}function ae(e){return us.call(e)}function xe(e){return ds.call(e)}function g(e,t){if(!T)return ae(e);var r=ae(I);if(r===null)r=I.appendChild(ce());else if(t&&r.nodeType!==ir){var n=ce();return r?.before(n),V(n),n}return t&&nn(r),V(r),r}function Xe(e,t=!1){if(!T){var r=ae(e);return r instanceof Comment&&r.data===""?xe(r):r}if(t){if(I?.nodeType!==ir){var n=ce();return I?.before(n),V(n),n}nn(I)}return I}function b(e,t=1,r=!1){let n=T?I:e;for(var i;t--;)i=n,n=xe(n);if(!T)return n;if(r){if(n?.nodeType!==ir){var o=ce();return n===null?i?.after(o):n.before(o),V(o),o}nn(n)}return V(n),n}function rn(e){e.textContent=""}function Bn(){if(!ye||pt!==null)return!1;var e=E.f;return(e&32768)!==0}function wt(e,t,r){let n=r?{is:r}:void 0;return document.createElementNS(t??$n,e,n)}function nn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===ir;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Qt(e){var t=N,r=E;fe(null),se(null);try{return e()}finally{fe(t),se(r)}}function Mo(e){E===null&&(N===null&&Ei(e),wi()),_t&&yi(e)}function Oa(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function Et(e,t){var r=E;if(v)for(;r!==null&&(r.f&131072)!==0;)r=r.parent;r!==null&&(r.f&8192)!==0&&(e|=8192);var n={ctx:q,deps:null,nodes:null,f:e|2048|512,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};v&&(n.component_function=tt),O?.register_created_effect(n);var i=n;if((e&4)!==0)lr!==null?lr.push(n):nt.ensure().schedule(n);else if(t!==null){try{xt(n)}catch(a){throw ie(n),a}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&524288)===0&&(i=i.first,(e&16)!==0&&(e&65536)!==0&&i!==null&&(i.f|=65536))}if(i!==null&&(i.parent=r,r!==null&&Oa(i,r),N!==null&&(N.f&2)!==0&&(e&64)===0)){var o=N;(o.effects??=[]).push(i)}return n}function qt(){return N!==null&&!Ue}function Te(e){let t=Et(8,null);return G(t,1024),t.teardown=e,t}function on(e){Mo("$effect"),v&&$e(e,"name",{value:"$effect"});var t=E.f,r=!N&&(t&32)!==0&&(t&32768)===0;if(r){var n=q;(n.e??=[]).push(e)}else return uo(e)}function uo(e){return Et(1048580,e)}function sn(e){return Mo("$effect.pre"),v&&$e(e,"name",{value:"$effect.pre"}),Et(1048584,e)}function Yn(e){nt.ensure();let t=Et(524352,e);return()=>{ie(t)}}function ms(e){nt.ensure();let t=Et(524352,e);return(r={})=>new Promise(n=>{r.outro?Ot(t,()=>{ie(t),n(void 0)}):(ie(t),n(void 0))})}function vt(e){return Et(4,e)}function B(e,t){var r=q,n={effect:null,ran:!1,deps:e};r.l.$.push(n),n.effect=Se(()=>{if(e(),!n.ran){n.ran=!0;var i=E;try{se(i.parent),y(t)}finally{se(i)}}})}function je(){var e=q;Se(()=>{for(var t of e.l.$){t.deps();var r=t.effect;(r.f&1024)!==0&&r.deps!==null&&G(r,4096),Ht(r)&&xt(r),t.ran=!1}})}function is(e){return Et(4718592,e)}function Se(e,t=0){return Et(8|t,e)}function X(e,t=[],r=[],n=[]){Mn(n,t,r,i=>{Et(8,()=>e(...i.map(s)))})}function it(e,t=0){var r=Et(16|t,e);return v&&(r.dev_stack=Rt),r}function ge(e){return Et(524320,e)}function Lo(e){var t=e.teardown;if(t!==null){let r=_t,n=N;Do(!0),fe(null);try{t.call(null)}finally{Do(r),fe(n)}}}function tn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){let i=r.ac;i!==null&&Qt(()=>{i.abort(Gt)});var n=r.next;(r.f&64)!==0?r.parent=null:ie(r,t),r=n}}function hs(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&32)===0&&ie(t),t=r}}function ie(e,t=!0){var r=!1;(t||(e.f&262144)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Fo(e.nodes.start,e.nodes.end),r=!0),G(e,33554432),tn(e,t&&!r),pr(e,0);var n=e.nodes&&e.nodes.t;if(n!==null)for(let o of n)o.stop();Lo(e),e.f^=33554432,e.f|=16384;var i=e.parent;i!==null&&i.first!==null&&bo(e),v&&(e.component_function=null),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Fo(e,t){for(;e!==null;){var r=e===t?null:xe(e);e.remove(),e=r}}function bo(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function Ot(e,t,r=!0){var n=[];gs(e,n,!0);var i=()=>{r&&ie(e),t&&t()},o=n.length;if(o>0){var a=()=>--o||i();for(var l of n)l.out(a)}else i()}function gs(e,t,r){if((e.f&8192)===0){e.f^=8192;var n=e.nodes&&e.nodes.t;if(n!==null)for(let l of n)(l.is_global||r)&&t.push(l);for(var i=e.first;i!==null;){var o=i.next;if((i.f&64)===0){var a=(i.f&65536)!==0||(i.f&32)!==0&&(e.f&16)!==0;gs(i,t,a?r:!1)}i=o}}}function an(e){$s(e,!0)}function $s(e,t){if((e.f&8192)!==0){e.f^=8192,(e.f&1024)===0&&(G(e,2048),nt.ensure().schedule(e));for(var r=e.first;r!==null;){var n=r.next,i=(r.f&65536)!==0||(r.f&32)!==0;$s(r,i?t:!1),r=n}var o=e.nodes&&e.nodes.t;if(o!==null)for(let a of o)(a.is_global||t)&&a.in()}}function Ir(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var i=r===n?null:xe(r);t.append(r),r=i}}var bs=null;var Hn=!1,_t=!1;function Do(e){_t=e}var N=null,Ue=!1;function fe(e){N=e}var E=null;function se(e){E=e}var st=null;function Pn(e){N!==null&&(!ye||(N.f&2)!==0)&&(st===null?st=[e]:st.push(e))}var Ae=null,Ve=0,at=null;function ls(e){at=e}var xs=1,vr=0,Jt=vr;function Oo(e){Jt=e}function Or(){return++xs}function Ht(e){var t=e.f;if((t&2048)!==0)return!0;if(t&2&&(e.f&=-65537),(t&4096)!==0){for(var r=e.deps,n=r.length,i=0;ie.wv)return!0}(t&512)!==0&&ke===null&&G(e,1024)}return!1}function ys(e,t,r=!0){var n=e.reactions;if(n!==null&&!(!ye&&st!==null&&ht.call(st,e)))for(var i=0;i{e.ac.abort(Gt)}),e.ac=null);try{e.f|=2097152;var p=e.fn,d=p();e.f|=32768;var c=e.deps,_=O?.is_fork;if(Ae!==null){var m;if(_||pr(e,Ve),c!==null&&Ve>0)for(c.length=Ve+Ae.length,m=0;m>>0).toString(36)}var La=["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"];var Lp=[...La,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var Fa=["touchstart","touchmove"];function ks(e){return Fa.includes(e)}var Pa=["$state","$state.raw","$derived","$derived.by"],Fp=[...Pa,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];function Un(e){return e?.replace(/\\//g,"/\\u200B")}var Ss=new Map;function As(e,t){var r=Ss.get(e);r||(r=new Set,Ss.set(e,r)),r.add(t)}var jn=Symbol("events"),Cs=new Set,Po=new Set;function Os(e,t,r,n={}){function i(o){if(n.capture||Gn.call(t,o),!o.cancelBubble)return Qt(()=>r?.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?we(()=>{t.addEventListener(e,i,n)}):t.addEventListener(e,i,n),i}function Ut(e,t,r,n,i){var o={capture:n,passive:i},a=Os(e,t,r,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Te(()=>{t.removeEventListener(e,a,o)})}var Rs=null;function Gn(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],o=i[0]||e.target;Rs=e;var a=0,l=Rs===e&&e[jn];if(l){var f=i.indexOf(l);if(f!==-1&&(t===document||t===window)){e[jn]=t;return}var u=i.indexOf(t);if(u===-1)return;f<=u&&(a=f)}if(o=i[a]||e.target,o!==t){$e(e,"currentTarget",{configurable:!0,get(){return o||r}});var p=N,d=E;fe(null),se(null);try{for(var c,_=[];o!==null;){var m=o.assignedSlot||o.parentNode||o.host||null;try{var x=o[jn]?.[n];x!=null&&(!o.disabled||e.target===o)&&x.call(o,e)}catch($){c?_.push($):c=$}if(e.cancelBubble||m===t||m===null)break;o=m}if(c){for(let $ of _)queueMicrotask(()=>{throw $});throw c}}finally{e[jn]=t,delete e.currentTarget,fe(p),se(d)}}}var za=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Is(e){return za?.createHTML(e)??e}function qo(e){var t=wt("template");return t.innerHTML=Is(e.replaceAll("","")),t.content}function lt(e,t){var r=E;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function P(e,t){var r=(t&1)!==0,n=(t&2)!==0,i,o=!e.startsWith("");return()=>{if(T)return lt(I,null),I;i===void 0&&(i=qo(o?e:""+e),r||(i=ae(i)));var a=n||Xr?document.importNode(i,!0):i.cloneNode(!0);if(r){var l=ae(a),f=a.lastChild;lt(l,f)}else lt(a,a);return a}}function Dt(e=""){if(!T){var t=ce(e+"");return lt(t,t),t}var r=I;return r.nodeType!==ir?(r.before(r=ce()),V(r)):nn(r),lt(r,r),r}function D(e,t){if(T){var r=E;((r.f&32768)===0||r.nodes.end===null)&&(r.nodes.end=I),be();return}e!==null&&e.before(t)}var zo=!0;function C(e,t){var r=t==null?"":typeof t=="object"?\`\${t}\`:t;r!==(e[Hr]??=e.nodeValue)&&(e[Hr]=r,e.nodeValue=\`\${r}\`)}function Fr(e,t){return Ds(e,t)}function Yo(e,t){zn(),t.intro=t.intro??!1;let r=t.target,n=T,i=I;try{for(var o=ae(r);o&&(o.nodeType!==et||o.data!=="[");)o=xe(o);if(!o)throw kt;de(!0),V(o);let a=Ds(e,{...t,anchor:o});return de(!1),a}catch(a){if(a instanceof Error&&a.message.split(\` +\`).some(l=>l.startsWith("https://svelte.dev/e/")))throw a;return a!==kt&&console.warn("Failed to hydrate: ",a),t.recover===!1&&ki(),zn(),rn(r),de(!1),Fr(e,t)}finally{de(n),V(i)}}var Wn=new Map;function Ds(e,{target:t,anchor:r,props:n={},events:i,context:o,intro:a=!0,transformError:l}){zn();var f=void 0,u=ms(()=>{var p=r??t.appendChild(ce());wo(p,{pending:()=>{}},_=>{pe({});var m=q;if(o&&(m.c=o),i&&(n.$$events=i),T&<(_,null),zo=a,f=e(_,n)||{},zo=!0,T&&(E.nodes.end=I,I===null||I.nodeType!==et||I.data!=="]"))throw Wt(),kt;_e()},l);var d=new Set,c=_=>{for(var m=0;m<_.length;m++){var x=_[m];if(!d.has(x)){d.add(x);var $=ks(x);for(let L of[t,document]){var k=Wn.get(L);k===void 0&&(k=new Map,Wn.set(L,k));var z=k.get(x);z===void 0?(L.addEventListener(x,Gn,{passive:$}),k.set(x,1)):k.set(x,z+1)}}}};return c(br(Cs)),Po.add(c),()=>{for(var _ of d)for(let $ of[t,document]){var m=Wn.get($),x=m.get(_);--x==0?($.removeEventListener(_,Gn),m.delete(_),m.size===0&&Wn.delete($)):m.set(_,x)}Po.delete(c),p!==r&&p.parentNode?.removeChild(p)}});return Bo.set(f,u),f}var Bo=new WeakMap;function Ho(e,t){let r=Bo.get(e);return r?(Bo.delete(e),r(t)):(v&&(Re in e?Pi():Fi()),Promise.resolve())}var jt=class{anchor;#e=new Map;#t=new Map;#r=new Map;#l=new Set;#n=!0;constructor(t,r=!0){this.anchor=t,this.#n=r}#i=t=>{if(this.#e.has(t)){var r=this.#e.get(t),n=this.#t.get(r);if(n)an(n),this.#l.delete(r);else{var i=this.#r.get(r);i&&(this.#t.set(r,i.effect),this.#r.delete(r),v&&(i.fragment.lastChild[ao]=this.anchor),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(let[o,a]of this.#e){if(this.#e.delete(o),o===t)break;let l=this.#r.get(a);l&&(ie(l.effect),this.#r.delete(a))}for(let[o,a]of this.#t){if(o===r||this.#l.has(o))continue;let l=()=>{if(Array.from(this.#e.values()).includes(o)){var u=document.createDocumentFragment();Ir(a,u),u.append(ce()),this.#r.set(o,{effect:a,fragment:u})}else ie(a);this.#l.delete(o),this.#t.delete(o)};this.#n||!n?(this.#l.add(o),Ot(a,l,!1)):l()}}};#o=t=>{this.#e.delete(t);let r=Array.from(this.#e.values());for(let[n,i]of this.#r)r.includes(n)||(ie(i.effect),this.#r.delete(n))};ensure(t,r){var n=O,i=Bn();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(i){var o=document.createDocumentFragment(),a=ce();o.append(a),this.#r.set(t,{effect:ge(()=>r(a)),fragment:o})}else this.#t.set(t,ge(()=>r(this.anchor)));if(this.#e.set(n,t),i){for(let[l,f]of this.#t)l===t?n.unskip_effect(f):n.skip_effect(f);for(let[l,f]of this.#r)l===t?n.unskip_effect(f.effect):n.skip_effect(f.effect);n.oncommit(this.#i),n.ondiscard(this.#o)}else T&&(this.anchor=I),this.#i(n)}};function ue(e,t,r=!1){var n;T&&(n=I,be());var i=new jt(e),o=r?65536:0;function a(l,f){if(T){var u=Gr(n);if(l!==parseInt(u.substring(1))){var p=Nt();V(p),i.anchor=p,de(!1),i.ensure(l,f),de(!0);return}}i.ensure(l,f)}it(()=>{var l=!1;t((f,u=0)=>{l=!0,a(u,f)}),l||a(-1,null)},o)}function Xa(e,t,r){for(var n=[],i=t.length,o,a=t.length,l=0;l{if(o){if(o.pending.delete(d),o.done.add(d),o.pending.size===0){var c=e.outrogroups;Vo(e,br(o.done)),c.delete(o),c.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var f=n.length===0&&r!==null;if(f){var u=r,p=u.parentNode;rn(p),p.append(u),e.items.clear()}Vo(e,t,!f)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function Vo(e,t,r=!0){var n;if(e.pending.size>0){n=new Set;for(let a of e.pending.values())for(let l of a)n.add(e.items.get(l).e)}for(var i=0;i{var L=r();return Pt(L)?L:L==null?[]:br(L)});v&&Pe(d,"{#each ...}");var c,_=new Map,m=!0;function x(L){(z.effect.f&16384)===0&&(z.pending.delete(L),z.fallback=p,Za(z,c,a,t,n),p!==null&&(c.length===0?(p.f&33554432)===0?an(p):(p.f^=33554432,fn(p,null,a)):Ot(p,()=>{p=null})))}function $(L){z.pending.delete(L)}var k=it(()=>{c=s(d);var L=c.length;let H=!1;if(T){var S=Gr(a)==="[!";S!==(L===0)&&(a=Nt(),V(a),de(!1),H=!0)}for(var w=new Set,M=O,W=Bn(),Q=0;Qo(a)):(p=ge(()=>o(Ms??=ce())),p.f|=33554432)),L>w.size&&(v?Qa(c,n):fo("","","")),T&&L>0&&V(Nt()),!m)if(_.set(M,w),W){for(let[le,Ze]of l)w.has(le)||M.skip_effect(Ze.e);M.oncommit(x),M.ondiscard($)}else x(M);H&&de(!0),s(d)}),z={effect:k,flags:t,items:l,pending:_,outrogroups:null,fallback:p};m=!1,T&&(a=I)}function ln(e){for(;e!==null&&(e.f&32)===0;)e=e.next;return e}function Za(e,t,r,n,i){var o=(n&8)!==0,a=t.length,l=e.items,f=ln(e.effect.first),u,p=null,d,c=[],_=[],m,x,$,k;if(o)for(k=0;k0){var Q=(n&4)!==0&&a===0?r:null;if(o){for(k=0;k{if(d!==void 0)for($ of d)$.nodes?.a?.apply()})}function Ja(e,t,r,n,i,o,a,l){var f=(a&1)!==0?(a&16)===0?F(r,!1,!1):Ye(r):null,u=(a&2)!==0?Ye(i):null;return v&&f&&(f.trace=()=>{l()[u?.v??i]}),{v:f,i:u,e:ge(()=>(o(t,f??r,u??i,l),()=>{e.delete(n)}))}}function fn(e,t,r){if(e.nodes)for(var n=e.nodes.start,i=e.nodes.end,o=t&&(t.f&33554432)===0?t.nodes.start:r;n!==null;){var a=xe(n);if(o.before(n),n===i)return;n=a}}function er(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function Qa(e,t){let r=new Map,n=e.length;for(let i=0;i{var u=E;if(l===(l=t()??"")){T&&be();return}if(r&&!T){u.nodes=null,f.innerHTML=l,l!==""&<(ae(f),f.lastChild);return}if(u.nodes!==null&&(Fo(u.nodes.start,u.nodes.end),u.nodes=null),l!==""){if(T){for(var p=I.data,d=be(),c=d;d!==null&&(d.nodeType!==et||d.data!=="");)c=d,d=xe(d);if(d===null)throw Wt(),kt;v&&!o&&el(d.parentNode,p,l),lt(I,c),a=V(d);return}var _=n?Vr:i?co:void 0,m=wt(n?"svg":i?"math":"template",_);m.innerHTML=l;var x=n||i?m:m.content;if(lt(ae(x),x.lastChild),n||i)for(;ae(x);)a.before(ae(x));else a.before(x)}})}function Me(e,t){vt(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){let i=wt("style");i.id=t.hash,i.textContent=t.code,n.appendChild(i),v&&As(t.hash,i)}})}var Fs=[...\` +\\r\\f\\xA0\\v\\uFEFF\`];function qs(e,t,r){var n=e==null?"":""+e;if(t&&(n=n?n+" "+t:t),r){for(var i of Object.keys(r))if(r[i])n=n?n+" "+i:i;else if(n.length)for(var o=i.length,a=0;(a=n.indexOf(i,a))>=0;){var l=a+o;(a===0||Fs.includes(n[a-1]))&&(l===n.length||Fs.includes(n[l]))?n=(a===0?"":n.substring(0,a))+n.substring(l+1):a=l}}return n===""?null:n}function Ps(e,t=!1){var r=t?" !important;":";",n="";for(var i of Object.keys(e)){var o=e[i];o!=null&&o!==""&&(n+=" "+i+": "+o+r)}return n}function Uo(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function zs(e,t){if(t){var r="",n,i;if(Array.isArray(t)?(n=t[0],i=t[1]):n=t,e){e=String(e).replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g,"").trim();var o=!1,a=0,l=!1,f=[];n&&f.push(...Object.keys(n).map(Uo)),i&&f.push(...Object.keys(i).map(Uo));var u=0,p=-1;let x=e.length;for(var d=0;dt.trim().split(" ").filter(Boolean))}function bl(e,t){var r=Ys(e.srcset),n=Ys(t);return n.length===r.length&&n.every(([i,o],a)=>o===r[a][1]&&(Go(r[a][0],i)||Go(i,r[a][0])))}function Le(e=!1){let t=q,r=t.l.u;if(!r)return;let n=()=>Y(t.s);if(e){let i=0,o={},a=ur(()=>{let l=!1,f=t.s;for(let u in f)f[u]!==o[u]&&(o[u]=f[u],l=!0);return l&&i++,i});n=()=>s(a)}r.b.length&&sn(()=>{Us(t,n),xr(r.b)}),on(()=>{let i=y(()=>r.m.map(vi));return()=>{for(let o of i)typeof o=="function"&&o()}}),r.a.length&&on(()=>{Us(t,n),xr(r.a)})}function Us(e,t){if(e.l.s)for(let r of e.l.s)s(r);t()}function js(e){return new Wo(e)}var Wo=class{#e;#t;constructor(t){var r=new Map,n=(o,a)=>{var l=F(a,!1,!1);return r.set(o,l),l};let i=new Proxy({...t.props||{},$$events:{}},{get(o,a){return s(r.get(a)??n(a,Reflect.get(o,a)))},has(o,a){return a===mn?!0:(s(r.get(a)??n(a,Reflect.get(o,a))),Reflect.has(o,a))},set(o,a,l){return R(r.get(a)??n(a,l),l),Reflect.set(o,a,l)}});this.#t=(t.hydrate?Yo:Fr)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),!ye&&(!t?.props?.$$host||t.sync===!1)&&Cr(),this.#e=i.$$events;for(let o of Object.keys(this.#t))o==="$set"||o==="$destroy"||o==="$on"||$e(this,o,{get(){return this.#t[o]},set(a){this.#t[o]=a},enumerable:!0});this.#t.$set=o=>{Object.assign(i,o)},this.#t.$destroy=()=>{Ho(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];let n=(...i)=>r.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}};var Nl;typeof HTMLElement=="function"&&(Nl=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&(this.$$shadowRoot=this.attachShadow(r))}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){let n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return i=>{let o=wt("slot");n!=="default"&&(o.name=n),D(i,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},r=Rl(this);for(let n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(let n of this.attributes){let i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=Ko(i,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=js({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=Yn(()=>{Se(()=>{this.$$r=!0;for(let n of oo(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];let i=Ko(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(let n in this.$$l)for(let i of this.$$l[n]){let o=this.$$c.$on(n,i);this.$$l_u.set(i,o)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ko(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return oo(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Ko(e,t,r,n){let i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Rl(e){let t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}if(v){let e=function(t){if(!(t in globalThis)){let r;Object.defineProperty(globalThis,t,{configurable:!0,get:()=>{if(r!==void 0)return r;Si(t)},set:n=>{r=n}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");zi();var Ol={stats:"/proxy-stats",recent:"/proxy-recent",latestPng:"/proxy-latest-png",sessions:"/api/sessions.json",fullStats:"/api/stats.json",compressionToggle:"/api/compression"};async function Xo(e,t){let r=await fetch(e,t);if(!r.ok){let n="";try{n=await r.text()}catch{}throw new Error(\`\${e}: \${r.status} \${r.statusText}\${n?\` \\u2014 \${n.slice(0,200)}\`:""}\`)}return r.json()}async function Il(e,t){return Xo(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}async function Gs(e){return Il(Ol.compressionToggle,{enabled:e})}function cn(e,t){let r=()=>{};return{subscribe:_o({data:null,error:null,loading:!0},i=>{let o=!1,a=null,l=null,f=async()=>{try{let u=await Xo(e);if(o)return;l=u,i({data:u,error:null,loading:!1})}catch(u){if(o)return;i({data:l,error:u.message,loading:!1})}};return r=()=>{f()},f(),a=setInterval(f,t),()=>{o=!0,r=()=>{},a&&clearInterval(a)}}).subscribe,run:()=>r()}}var qr=cn("/proxy-stats",2e3),gr=cn("/proxy-recent",2e3),Ws=cn("/api/sessions.json",5e3),p0=cn("/api/stats.json",5e3),un=Sr(null);function Dl(){let{subscribe:e,update:t}=Sr([]),r=1;return{subscribe:e,push(n,i){let o=r++;t(a=>[...a,{id:o,level:n,text:i}]),setTimeout(()=>t(a=>a.filter(l=>l.id!==o)),5e3)},dismiss(n){t(i=>i.filter(o=>o.id!==n))}}}var dn=Dl();function A(e){return Math.round(Number(e)||0).toLocaleString()}function Ks(e){if(!e)return"-";let t=String(e).split("/");return t[t.length-1]||e}function Zn(e){return e==null?"":String(e).replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}var Ml=P('
show calculation
'),Ll=P('
show calculation
'),Fl=P('
show calculation
'),Pl=P('
show calculation
'),ql=P('
requests
input tokens saved
cache-aware, input-side only
$ saved
at $5/M input tokens (Opus 4.7)
share of spend saved
token-equivalent total
input + 5\\xD7output billed at 5\\xD7 input rate
'),zl={hash:"svelte-rhs7qr",code:\`.grid.svelte-rhs7qr {display:grid;grid-template-columns:repeat(5, 1fr);gap:14px;margin-bottom:22px;} @media (max-width: 1200px) {.grid.svelte-rhs7qr {grid-template-columns:repeat(3, 1fr);} } @media (max-width: 900px) {.grid.svelte-rhs7qr {grid-template-columns:repeat(2, 1fr);} - }.card.svelte-rhs7qr {background:#161b22;border:1px solid #30363d;border-radius:10px;padding:14px 16px;}.label.svelte-rhs7qr {font-size:11px;text-transform:uppercase;letter-spacing:0.08em;color:#8b949e;margin-bottom:10px;}.value.svelte-rhs7qr {font-size:24px;font-weight:600;color:#e6edf3;font-variant-numeric:tabular-nums;}.value.pos.svelte-rhs7qr {color:#3fb950;}.small.svelte-rhs7qr {font-size:11px;color:#6e7681;margin-top:4px;}.math.svelte-rhs7qr {margin-top:10px;font-size:11px;}.math.svelte-rhs7qr summary {cursor:pointer;user-select:none;color:#58a6ff;}.math.svelte-rhs7qr summary::-webkit-details-marker {display:none;}.math.svelte-rhs7qr summary::before {content:'\\u25B8 ';color:#6e7681;font-size:9px;}.math.svelte-rhs7qr [open] summary::before {content:'\\u25BE ';}.math.svelte-rhs7qr summary:hover {color:#79c0ff;}.formula.svelte-rhs7qr {background:#0d1117;border:1px solid #21262d;border-radius:6px;padding:8px 10px;margin-top:6px;font:11px/1.5 'SF Mono', + }.card.svelte-rhs7qr {background:#161b22;border:1px solid #30363d;border-radius:10px;padding:14px 16px;}.label.svelte-rhs7qr {font-size:11px;text-transform:uppercase;letter-spacing:0.08em;color:#8b949e;margin-bottom:10px;}.value.svelte-rhs7qr {font-size:24px;font-weight:600;color:#e6edf3;font-variant-numeric:tabular-nums;}.value.pos.svelte-rhs7qr {color:#3fb950;}.value.neg.svelte-rhs7qr {color:#f85149;}.small.svelte-rhs7qr {font-size:11px;color:#6e7681;margin-top:4px;}.math.svelte-rhs7qr {margin-top:10px;font-size:11px;}.math.svelte-rhs7qr summary {cursor:pointer;user-select:none;color:#58a6ff;}.math.svelte-rhs7qr summary::-webkit-details-marker {display:none;}.math.svelte-rhs7qr summary::before {content:'\\u25B8 ';color:#6e7681;font-size:9px;}.math.svelte-rhs7qr [open] summary::before {content:'\\u25BE ';}.math.svelte-rhs7qr summary:hover {color:#79c0ff;}.formula.svelte-rhs7qr {background:#0d1117;border:1px solid #21262d;border-radius:6px;padding:8px 10px;margin-top:6px;font:11px/1.5 'SF Mono', Menlo, - monospace;color:#c9d1d9;white-space:pre-wrap;word-break:break-word;}.formula.svelte-rhs7qr .k {color:#8b949e;}.formula.svelte-rhs7qr .v {color:#e6edf3;}.formula.svelte-rhs7qr .op {color:#f0883e;}.formula.svelte-rhs7qr .src {color:#6e7681;font-size:10px;display:block;margin-top:6px;border-top:1px solid #21262d;padding-top:6px;}\`};function Zo(e,t){pe(t,!1),Me(e,zl);let r=()=>Ee(qr,"$stats",n),[n,i]=De(),o=L(),a=L(),l=L(),f=L(),u=L(),p=L(),d=L();function c(ne,re,Ne){let nr=typeof re=="number"?A(re):String(re??"-");return'
'+ne+': '+Zn(nr)+' '+(Ne||"")+"
"}B(()=>r(),()=>{R(o,r().data)}),B(()=>s(o),()=>{R(a,s(o)?.pricing_assumptions??null)}),B(()=>(s(o),s(a)),()=>{R(l,s(o)&&s(a)?'
formula: saved = baseline - actual
weights: input\\xD71.0, cache_create\\xD71.25, cache_read\\xD70.10
'+c("baseline",s(o).baseline_input_weighted,"(cache-aware: cacheable\\xD7weight + cold_tail)")+c("actual",s(o).actual_input_weighted,"(input + cc\\xD71.25 + cr\\xD70.10 from usage)")+c("saved",s(o).saved_input_tokens,'= baseline - actual')+'output excluded - identical with/without compression':"")}),B(()=>s(a),()=>{R(f,s(a)?s(a).input_per_mtok:0)}),B(()=>(s(o),s(a),s(f),Zn),()=>{R(u,s(o)&&s(a)?'
formula: $ saved = $ \\xD7 '+s(f)+'/Mtok
'+c("saved_tokens",s(o).saved_input_tokens,"(cache-aware, input-side)")+c("saved_usd",\`$\${(s(o).saved_usd||0).toFixed(4)}\\xA0\`,'= saved_tokens \\xD7 input_rate / 1e6')+\`source: \${Zn(s(a).source||"docs.anthropic.com pricing")}\`:"")}),B(()=>(s(o),s(a)),()=>{R(p,s(o)&&s(a)?'
formula: share_of_bill = saved / (baseline_input + output \\xD7 '+(s(a).output_multiplier??5)+\`)
why include output: Anthropic's weekly meter counts input + output \\xD7 5, the proxy only moves input
\`+c("saved",s(o).saved_input_tokens,"(input savings - proxy doesn't touch output)")+c("baseline_input",s(o).baseline_input_weighted,"(cache-aware counterfactual)")+c("output"," \\xD7 "+(s(a).output_multiplier??5),s(o).output_weighted+" (weighted output tokens)")+c("baseline_total",s(o).baseline_input_weighted+s(o).output_weighted,'= baseline_input + output')+c("share_of_bill",(s(o).saved_pct_of_total_bill||0).toFixed(1)+"%",'= saved / baseline_total \\xD7 100')+c("input-only %",(s(o).saved_pct_input_only||0).toFixed(1)+"%","(sub-line: saved / baseline_input \\xD7 100 - output excluded)")+'measured - no estimation':"")}),B(()=>(s(o),s(a)),()=>{R(d,s(o)&&s(a)?'
formula: token_equivalent = input + output \\xD7 '+(s(a).output_multiplier??5)+\`
why: matches Anthropic's per-Mtok price ratio ($\`+(s(a).input_per_mtok??5)+" input vs $"+(s(a).input_per_mtok??5)*(s(a).output_multiplier??5)+' output)
'+c("actual_input",s(o).actual_input_weighted,"(weighted upstream usage)")+'
+ = raw output_tokens (already weighted)
'+c("actual_token_equivalent",s(o).actual_token_equivalent)+c("baseline_token_equivalent",s(o).baseline_token_equivalent,"(unproxied counterfactual, same \\xD7 "+(s(a).output_multiplier??5)+" on output)")+'
measured vs billed: we now SSE-tee response bodies + count text_delta / thinking_delta / tool_use chars so you can compare what we actually saw on the wire against output_tokens. The redacted_thinking block count is included because Anthropic ships those as opaque server-encrypted bytes with no char count \\u2014 output_tokens invisibly. This is what surfaced the May-2026 weekly-meter gap.
'+c("events_with_measurement",s(o).events_with_measurement,"(events where SSE/JSON scanner produced char counts)")+c("measured_text_chars",s(o).measured_text_chars,"(content_block_delta \\xB7 text_delta + response content[].text)")+c("measured_thinking_chars",s(o).measured_thinking_chars,"(content_block_delta \\xB7 thinking_delta + response reasoning text)")+c("measured_tool_use_chars",s(o).measured_tool_use_chars,"(content_block_delta \\xB7 input_json_delta + tool_use blocks)")+c("measured_redacted_blocks",s(o).measured_redacted_block_count,"(opaque encrypted blocks - chars unavailable, billed but unmeasurable)")+'measured - no estimation':"")}),je(),Fe();var _=ql(),m=g(_),x=b(g(m),2),$=g(x,!0);h(x);var k=b(x,2),z=g(k);h(k),h(m);var F=b(m,2),Y=b(g(F),2),S=g(Y,!0);h(Y);var w=b(Y,4);{var M=ne=>{var re=Ml(),Ne=b(g(re),2);Pr(Ne,()=>s(l),!0),h(Ne),h(re),D(ne,re)};ce(w,ne=>{s(o)&&s(a)&&ne(M)})}h(F);var W=b(F,2),Q=b(g(W),2),ee=g(Q);h(Q);var U=b(Q,4);{var oe=ne=>{var re=Fl(),Ne=b(g(re),2);Pr(Ne,()=>s(u),!0),h(Ne),h(re),D(ne,re)};ce(U,ne=>{s(o)&&s(a)&&ne(oe)})}h(W);var j=b(W,2),ue=b(g(j),2),lt=g(ue);h(ue);var Ft=b(ue,2),Et=b(g(Ft)),He=g(Et);h(Et),h(Ft);var Ge=b(Ft,2);{var Tt=ne=>{var re=Ll(),Ne=b(g(re),2);Pr(Ne,()=>s(p),!0),h(Ne),h(re),D(ne,re)};ce(Ge,ne=>{s(o)&&s(a)&&ne(Tt)})}h(j);var Lt=b(j,2),Ze=b(g(Lt),2),ft=g(Ze,!0);h(Ze);var $r=b(Ze,4);{var Jn=ne=>{var re=Pl(),Ne=b(g(re),2);Pr(Ne,()=>s(d),!0),h(Ne),h(re),D(ne,re)};ce($r,ne=>{s(o)&&s(a)&&ne(Jn)})}h(Lt),h(_),X((ne,re,Ne,nr,pn,Qn,zr)=>{C($,ne),C(z,\`\\u2014 \${re??""} compressed\`),C(S,Ne),C(ee,\`$ \${nr??""}\`),C(lt,\`\${pn??""}%\`),C(He,\`\${Qn??""}%\`),C(ft,zr)},[()=>(V(A),s(o),y(()=>A(s(o)?.requests))),()=>(V(A),s(o),y(()=>A(s(o)?.compressed_requests))),()=>(V(A),s(o),y(()=>A(s(o)?.saved_input_tokens))),()=>(s(o),y(()=>(s(o)?.saved_usd??0).toFixed(2))),()=>(s(o),y(()=>(s(o)?.saved_pct_of_total_bill??0).toFixed(1))),()=>(s(o),y(()=>(s(o)?.saved_pct_input_only??0).toFixed(1))),()=>(V(A),s(o),y(()=>A(s(o)?.actual_token_equivalent)))]),D(e,_),_e(),i()}var Bl=P(''),Yl=P('-'),Hl=P(' '),Vl=P('no requests yet'),Ul=P('
#statuspathcccrbaselineactualsavedimg
'),jl={hash:"svelte-hn7ohq",code:\`table.svelte-hn7ohq {width:100%;border-collapse:collapse;font-size:12px;}th.svelte-hn7ohq {text-align:left;color:#6e7681;font-weight:500;padding:6px 8px;border-bottom:1px solid #30363d;}td.svelte-hn7ohq {padding:6px 8px;border-bottom:1px solid #21262d;font-variant-numeric:tabular-nums;}tr.svelte-hn7ohq:last-child td:where(.svelte-hn7ohq) {border-bottom:none;}th.num.svelte-hn7ohq, - td.num.svelte-hn7ohq {text-align:right;}.small.svelte-hn7ohq {font-size:11px;color:#6e7681;}td.good.svelte-hn7ohq {color:#3fb950;}td.warn.svelte-hn7ohq {color:#d29922;}td.bad.svelte-hn7ohq {color:#f85149;}td.pos.svelte-hn7ohq {color:#3fb950;}.muted.svelte-hn7ohq {color:#6e7681;}.view-btn.svelte-hn7ohq {font-size:11px;background:#21262d;color:#58a6ff;border:1px solid #30363d;border-radius:4px;padding:1px 6px;cursor:pointer;}.view-btn.svelte-hn7ohq:hover {background:#30363d;}\`};function Jo(e,t){pe(t,!1),Me(e,jl);let r=()=>Ee(gr,"$recent",n),[n,i]=De(),o=L();function a(p){return p>=500?"bad":p>=400?"warn":"good"}function l(p){if(!p)return"-";let d=p.split("/");return d[d.length-1]||p}B(()=>r(),()=>{R(o,r().data?.recent??[])}),je(),Fe();var f=Ul(),u=b(g(f));mr(u,7,()=>(s(o),y(()=>s(o).slice().reverse())),(p,d)=>p.ts+":"+d,(p,d,c)=>{var _=Hl(),m=g(_),x=g(m,!0);h(m);var $=b(m),k=g($,!0);h($);var z=b($),F=g(z,!0);h(z);var Y=b(z),S=g(Y,!0);h(Y);var w=b(Y),M=g(w,!0);h(w);var W=b(w),Q=g(W,!0);h(W);var ee=b(W),U=g(ee,!0);h(ee);var oe=b(ee),j=g(oe,!0);h(oe);var ue=b(oe),lt=g(ue);{var Ft=He=>{var Ge=Bl();Ut("click",Ge,()=>un.set(s(d).img_id??null)),D(He,Ge)},Et=He=>{var Ge=Yl();D(He,Ge)};ce(lt,He=>{s(d),y(()=>s(d).img_id!=null)?He(Ft):He(Et,-1)})}h(ue),h(_),X((He,Ge,Tt,Lt,Ze,ft)=>{C(x,s(c)+1),tr($,1,\`num \${He??""}\`,"svelte-hn7ohq"),C(k,(s(d),y(()=>s(d).status))),C(F,Ge),C(S,(s(d),y(()=>s(d).cc_added?"\\u2713":"-"))),C(M,Tt),C(Q,Lt),C(U,Ze),C(j,ft)},[()=>(s(d),y(()=>a(s(d).status))),()=>(s(d),y(()=>l(s(d).path))),()=>(s(d),V(A),y(()=>s(d).cache_read!=null?A(s(d).cache_read):"-")),()=>(s(d),V(A),y(()=>s(d).baseline_input!=null?A(s(d).baseline_input):"-")),()=>(s(d),V(A),y(()=>s(d).actual_input!=null?A(s(d).actual_input):"-")),()=>(s(d),V(A),y(()=>(s(d).session_saved_so_far_delta??0)>0?"+"+A(s(d).session_saved_so_far_delta??0):"-"))]),D(p,_)},p=>{var d=Vl();D(p,d)}),h(u),h(f),D(e,f),_e(),i()}var Gl=P('
'),Wl=P('
'),Kl=P('
',1),Xl=P('
latest rendered
'),Zl=P('
(none yet)
'),Jl=P('
',1),Ql={hash:"svelte-3whs73",code:\`.wrap.svelte-3whs73 {margin-top:0;} + monospace;color:#c9d1d9;white-space:pre-wrap;word-break:break-word;}.formula.svelte-rhs7qr .k {color:#8b949e;}.formula.svelte-rhs7qr .v {color:#e6edf3;}.formula.svelte-rhs7qr .op {color:#f0883e;}.formula.svelte-rhs7qr .src {color:#6e7681;font-size:10px;display:block;margin-top:6px;border-top:1px solid #21262d;padding-top:6px;}\`};function Zo(e,t){pe(t,!1),Me(e,zl);let r=()=>Ee(qr,"$stats",n),[n,i]=De(),o=F(),a=F(),l=F(),f=F(),u=F(),p=F(),d=F();function c(ne,re,Ne){let nr=typeof re=="number"?A(re):String(re??"-");return'
'+ne+': '+Zn(nr)+' '+(Ne||"")+"
"}B(()=>r(),()=>{R(o,r().data)}),B(()=>s(o),()=>{R(a,s(o)?.pricing_assumptions??null)}),B(()=>(s(o),s(a)),()=>{R(l,s(o)&&s(a)?'
formula: saved = baseline - actual
weights: input\\xD71.0, cache_create\\xD71.25, cache_read\\xD70.10
'+c("baseline",s(o).baseline_input_weighted,"(cache-aware: cacheable\\xD7weight + cold_tail)")+c("actual",s(o).actual_input_weighted,"(input + cc\\xD71.25 + cr\\xD70.10 from usage)")+c("saved",s(o).saved_input_tokens,'= baseline - actual')+'output excluded - identical with/without compression':"")}),B(()=>s(a),()=>{R(f,s(a)?s(a).input_per_mtok:0)}),B(()=>(s(o),s(a),s(f),Zn),()=>{R(u,s(o)&&s(a)?'
formula: $ saved = $ \\xD7 '+s(f)+'/Mtok
'+c("saved_tokens",s(o).saved_input_tokens,"(cache-aware, input-side)")+c("saved_usd",\`$\${(s(o).saved_usd||0).toFixed(4)}\\xA0\`,'= saved_tokens \\xD7 input_rate / 1e6')+\`source: \${Zn(s(a).source||"docs.anthropic.com pricing")}\`:"")}),B(()=>(s(o),s(a)),()=>{R(p,s(o)&&s(a)?'
formula: share_of_spend = saved / (all_actual_input + all_output \\xD7 '+(s(a).output_multiplier??5)+')
why this denominator: the question is "did pixelpipe move my real bill", not "did pixelpipe help on the slice it ran on". The denominator is every paid request \\u2014 compressed, passthrough, probe-failed \\u2014 so passthrough rows and flap-polluted turns count against the proxy the same way they count against the user.
'+c("saved",s(o).saved_input_tokens,"(measured-rows numerator; cache-aware)")+c("all_actual_input",s(o).all_actual_input_weighted,"(every paid request, weighted)")+c("all_output \\xD7 "+(s(a).output_multiplier??5),s(o).all_output_weighted,"(every paid request, output \\xD7 "+(s(a).output_multiplier??5)+")")+c("all_spend_total",s(o).all_actual_input_weighted+s(o).all_output_weighted,'= all_actual_input + all_output')+c("share_of_spend",(s(o).saved_pct_of_all_spend||0).toFixed(1)+"%",'= saved / all_spend_total \\xD7 100')+c("all_usage_requests",s(o).all_usage_requests,"(denominator request count - compressed + passthrough + probe-failed)")+'measured numerator, all-rows denominator - no cherry-pick':"")}),B(()=>(s(o),s(a)),()=>{R(d,s(o)&&s(a)?'
formula: token_equivalent = input + output \\xD7 '+(s(a).output_multiplier??5)+\`
why: matches Anthropic's per-Mtok price ratio ($\`+(s(a).input_per_mtok??5)+" input vs $"+(s(a).input_per_mtok??5)*(s(a).output_multiplier??5)+' output)
'+c("actual_input",s(o).actual_input_weighted,"(weighted upstream usage)")+'
+ = raw output_tokens (already weighted)
'+c("actual_token_equivalent",s(o).actual_token_equivalent)+c("baseline_token_equivalent",s(o).baseline_token_equivalent,"(unproxied counterfactual, same \\xD7 "+(s(a).output_multiplier??5)+" on output)")+'
measured vs billed: we now SSE-tee response bodies + count text_delta / thinking_delta / tool_use chars so you can compare what we actually saw on the wire against output_tokens. The redacted_thinking block count is included because Anthropic ships those as opaque server-encrypted bytes with no char count \\u2014 output_tokens invisibly. This is what surfaced the May-2026 weekly-meter gap.
'+c("events_with_measurement",s(o).events_with_measurement,"(events where SSE/JSON scanner produced char counts)")+c("measured_text_chars",s(o).measured_text_chars,"(content_block_delta \\xB7 text_delta + response content[].text)")+c("measured_thinking_chars",s(o).measured_thinking_chars,"(content_block_delta \\xB7 thinking_delta + response reasoning text)")+c("measured_tool_use_chars",s(o).measured_tool_use_chars,"(content_block_delta \\xB7 input_json_delta + tool_use blocks)")+c("measured_redacted_blocks",s(o).measured_redacted_block_count,"(opaque encrypted blocks - chars unavailable, billed but unmeasurable)")+'measured - no estimation':"")}),je(),Le();var _=ql(),m=g(_),x=b(g(m),2),$=g(x,!0);h(x);var k=b(x,2),z=g(k);h(k),h(m);var L=b(m,2),H=b(g(L),2),S=g(H,!0);h(H);var w=b(H,4);{var M=ne=>{var re=Ml(),Ne=b(g(re),2);Pr(Ne,()=>s(l),!0),h(Ne),h(re),D(ne,re)};ue(w,ne=>{s(o)&&s(a)&&ne(M)})}h(L);var W=b(L,2),Q=b(g(W),2),ee=g(Q);h(Q);var U=b(Q,4);{var oe=ne=>{var re=Ll(),Ne=b(g(re),2);Pr(Ne,()=>s(u),!0),h(Ne),h(re),D(ne,re)};ue(U,ne=>{s(o)&&s(a)&&ne(oe)})}h(W);var j=b(W,2),le=b(g(j),2);let Ze;var rr=g(le);h(le);var mt=b(le,2),He=g(mt);h(mt);var Ge=b(mt,2);{var Tt=ne=>{var re=Fl(),Ne=b(g(re),2);Pr(Ne,()=>s(p),!0),h(Ne),h(re),D(ne,re)};ue(Ge,ne=>{s(o)&&s(a)&&ne(Tt)})}h(j);var Ft=b(j,2),Je=b(g(Ft),2),ft=g(Je,!0);h(Je);var $r=b(Je,4);{var Jn=ne=>{var re=Pl(),Ne=b(g(re),2);Pr(Ne,()=>s(d),!0),h(Ne),h(re),D(ne,re)};ue($r,ne=>{s(o)&&s(a)&&ne(Jn)})}h(Ft),h(_),X((ne,re,Ne,nr,pn,Qn,zr)=>{C($,ne),C(z,\`\\u2014 \${re??""} compressed\`),C(S,Ne),C(ee,\`$ \${nr??""}\`),Ze=Lt(le,1,"value svelte-rhs7qr",null,Ze,{pos:(s(o)?.saved_pct_of_all_spend??0)>=0,neg:(s(o)?.saved_pct_of_all_spend??0)<0}),C(rr,\`\${pn??""}%\`),C(He,\`\\xF7 all paid requests (\${Qn??""} req \\xB7 compressed + passthrough + probe-failed) \\xB7 negative = pixelpipe added cost\`),C(ft,zr)},[()=>(Y(A),s(o),y(()=>A(s(o)?.requests))),()=>(Y(A),s(o),y(()=>A(s(o)?.compressed_requests))),()=>(Y(A),s(o),y(()=>A(s(o)?.saved_input_tokens))),()=>(s(o),y(()=>(s(o)?.saved_usd??0).toFixed(2))),()=>(s(o),y(()=>(s(o)?.saved_pct_of_all_spend??0).toFixed(1))),()=>(Y(A),s(o),y(()=>A(s(o)?.all_usage_requests))),()=>(Y(A),s(o),y(()=>A(s(o)?.actual_token_equivalent)))]),D(e,_),_e(),i()}var Bl=P(''),Yl=P('-'),Hl=P(' '),Vl=P('no requests yet'),Ul=P('
#statuspathcccrbaselineactualsavedimg
'),jl={hash:"svelte-hn7ohq",code:\`table.svelte-hn7ohq {width:100%;border-collapse:collapse;font-size:12px;}th.svelte-hn7ohq {text-align:left;color:#6e7681;font-weight:500;padding:6px 8px;border-bottom:1px solid #30363d;}td.svelte-hn7ohq {padding:6px 8px;border-bottom:1px solid #21262d;font-variant-numeric:tabular-nums;}tr.svelte-hn7ohq:last-child td:where(.svelte-hn7ohq) {border-bottom:none;}th.num.svelte-hn7ohq, + td.num.svelte-hn7ohq {text-align:right;}.small.svelte-hn7ohq {font-size:11px;color:#6e7681;}td.good.svelte-hn7ohq {color:#3fb950;}td.warn.svelte-hn7ohq {color:#d29922;}td.bad.svelte-hn7ohq {color:#f85149;}td.pos.svelte-hn7ohq {color:#3fb950;}.muted.svelte-hn7ohq {color:#6e7681;}.view-btn.svelte-hn7ohq {font-size:11px;background:#21262d;color:#58a6ff;border:1px solid #30363d;border-radius:4px;padding:1px 6px;cursor:pointer;}.view-btn.svelte-hn7ohq:hover {background:#30363d;}\`};function Jo(e,t){pe(t,!1),Me(e,jl);let r=()=>Ee(gr,"$recent",n),[n,i]=De(),o=F();function a(p){return p>=500?"bad":p>=400?"warn":"good"}function l(p){if(!p)return"-";let d=p.split("/");return d[d.length-1]||p}B(()=>r(),()=>{R(o,r().data?.recent??[])}),je(),Le();var f=Ul(),u=b(g(f));mr(u,7,()=>(s(o),y(()=>s(o).slice().reverse())),(p,d)=>p.ts+":"+d,(p,d,c)=>{var _=Hl(),m=g(_),x=g(m,!0);h(m);var $=b(m),k=g($,!0);h($);var z=b($),L=g(z,!0);h(z);var H=b(z),S=g(H,!0);h(H);var w=b(H),M=g(w,!0);h(w);var W=b(w),Q=g(W,!0);h(W);var ee=b(W),U=g(ee,!0);h(ee);var oe=b(ee),j=g(oe,!0);h(oe);var le=b(oe),Ze=g(le);{var rr=He=>{var Ge=Bl();Ut("click",Ge,()=>un.set(s(d).img_id??null)),D(He,Ge)},mt=He=>{var Ge=Yl();D(He,Ge)};ue(Ze,He=>{s(d),y(()=>s(d).img_id!=null)?He(rr):He(mt,-1)})}h(le),h(_),X((He,Ge,Tt,Ft,Je,ft)=>{C(x,s(c)+1),Lt($,1,\`num \${He??""}\`,"svelte-hn7ohq"),C(k,(s(d),y(()=>s(d).status))),C(L,Ge),C(S,(s(d),y(()=>s(d).cc_added?"\\u2713":"-"))),C(M,Tt),C(Q,Ft),C(U,Je),C(j,ft)},[()=>(s(d),y(()=>a(s(d).status))),()=>(s(d),y(()=>l(s(d).path))),()=>(s(d),Y(A),y(()=>s(d).cache_read!=null?A(s(d).cache_read):"-")),()=>(s(d),Y(A),y(()=>s(d).baseline_input!=null?A(s(d).baseline_input):"-")),()=>(s(d),Y(A),y(()=>s(d).actual_input!=null?A(s(d).actual_input):"-")),()=>(s(d),Y(A),y(()=>(s(d).session_saved_so_far_delta??0)>0?"+"+A(s(d).session_saved_so_far_delta??0):"-"))]),D(p,_)},p=>{var d=Vl();D(p,d)}),h(u),h(f),D(e,f),_e(),i()}var Gl=P('
'),Wl=P('
'),Kl=P('
',1),Xl=P('
latest rendered
'),Zl=P('
(none yet)
'),Jl=P('
',1),Ql={hash:"svelte-3whs73",code:\`.wrap.svelte-3whs73 {margin-top:0;} /* Crop is done client-side via CSS (object-position + overflow:hidden). The legacy dashboard pulled a separately-cropped PNG which doubled image traffic. The full 1466\\xD71568 image lives on disk; we just show - the top-left corner at native res. */.preview-crop.svelte-3whs73 {width:100%;height:400px;overflow:hidden;background:#fff;border:1px solid #30363d;border-radius:4px;padding:4px;box-sizing:border-box;}.preview-crop.svelte-3whs73 img:where(.svelte-3whs73) {display:block;width:auto;height:auto;max-width:none;image-rendering:pixelated;}.sub.svelte-3whs73 {color:#6e7681;font-size:12px;}.small.svelte-3whs73 {font-size:11px;color:#6e7681;margin-top:8px;}.pin-bar.svelte-3whs73 {margin-bottom:8px;}.back-btn.svelte-3whs73 {font-size:11px;background:#21262d;color:#58a6ff;border:1px solid #30363d;border-radius:4px;padding:2px 8px;cursor:pointer;}.back-btn.svelte-3whs73:hover {background:#30363d;}.evicted.svelte-3whs73 {font-size:11px;color:#6e7681;padding:12px 0;}\`};function Qo(e,t){pe(t,!1),Me(e,Ql);let r=()=>Ee(gr,"$recent",i),n=()=>Ee(un,"$selectedImageId",i),[i,o]=De(),a=L(),l=L(),f=L(),u=L(),p=L(),d=L(),c=L();B(()=>r(),()=>{R(a,r().data?.has_preview===!0)}),B(()=>r(),()=>{R(l,r().data?.preview_meta??"")}),B(()=>r(),()=>{R(f,r().data?.image_ids??[])}),B(()=>n(),()=>{R(u,n())}),B(()=>(s(u),s(f)),()=>{R(p,s(u)!=null&&!s(f).includes(s(u)))}),B(()=>(s(u),s(a),s(l)),()=>{R(d,s(u)!=null?\`/proxy-latest-png?id=\${s(u)}\`:s(a)?"/proxy-latest-png?t="+encodeURIComponent(s(l)):"")}),B(()=>(s(u),s(l)),()=>{R(c,s(u)!=null?\`image #\${s(u)}\`:s(l)?s(l)+" - showing top-left at native resolution":"")}),je(),Fe();var _=Jl(),m=Xe(_),x=g(m);{var $=S=>{var w=Kl(),M=Xe(w),W=g(M);h(M);var Q=b(M,2);{var ee=oe=>{var j=Gl(),ue=g(j);h(j),X(()=>C(ue,\`(image #\${s(u)??""} no longer in buffer)\`)),D(oe,j)},U=oe=>{var j=Wl(),ue=g(j);h(j),X(()=>{hr(ue,"src",s(d)),hr(ue,"alt",\`image #\${s(u)??""}\`)}),D(oe,j)};ce(Q,oe=>{s(p)?oe(ee):oe(U,-1)})}Ut("click",W,()=>un.set(null)),D(S,w)},k=S=>{var w=Xl(),M=g(w);h(w),X(()=>hr(M,"src",s(d))),D(S,w)},z=S=>{var w=Zl();D(S,w)};ce(x,S=>{s(u)!=null?S($):s(a)?S(k,1):S(z,-1)})}h(m);var F=b(m,2),Y=g(F,!0);h(F),X(()=>C(Y,s(c))),D(e,_),_e(),o()}var ef=P('
'),tf=P('
'),rf=P('
',1),nf=P('
no sessions yet
'),of=P('
',1),sf={hash:"svelte-c2rstm",code:".status.svelte-c2rstm {margin-bottom:12px;color:#6e7681;font-size:12px;}.chart.svelte-c2rstm {display:flex;flex-direction:column;gap:8px;}.bar-row.svelte-c2rstm {display:flex;align-items:center;gap:10px;font-size:12px;}.label.svelte-c2rstm {width:132px;flex:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#c9d1d9;}.track.svelte-c2rstm {flex:1;min-width:0;height:14px;background:#21262d;border-radius:3px;overflow:hidden;}.fill.svelte-c2rstm {height:100%;background:#3fb950;border-radius:3px;}.value.svelte-c2rstm {width:72px;flex:none;text-align:right;font-variant-numeric:tabular-nums;color:#3fb950;}.value.neg.svelte-c2rstm {color:#f85149;}.axis.svelte-c2rstm {margin-top:12px;color:#6e7681;font-size:11px;}.empty.svelte-c2rstm {text-align:center;color:#6e7681;padding:24px;font-size:12px;}"};function ei(e,t){pe(t,!1),Me(e,sf);let r=()=>Ee(Ws,"$sessions",n),[n,i]=De(),o=L(),a=L(),l=L(),f=8;function u(S){let w=S.claudeCode?.projectPath||S.project;return w?Ks(w):S.id.slice(0,8)}function p(S){return Math.round(S).toLocaleString("en-US")}function d(S){return s(l)<=0||S<=0?0:S/s(l)*100}B(()=>r(),()=>{R(o,r().data?.sessions??[])}),B(()=>s(o),()=>{R(a,[...s(o)].sort((S,w)=>(w.tokensSavedEst??0)-(S.tokensSavedEst??0)).slice(0,f))}),B(()=>s(a),()=>{R(l,s(a).reduce((S,w)=>Math.max(S,w.tokensSavedEst??0),0))}),je(),Fe();var c=of(),_=Xe(c),m=g(_);{var x=S=>{var w=Dt("loading\\u2026");D(S,w)},$=S=>{var w=Dt();X(()=>C(w,(r(),y(()=>r().error)))),D(S,w)},k=S=>{var w=Dt();X(()=>C(w,\`\${s(o),y(()=>s(o).length)??""} session\${s(o),y(()=>s(o).length===1?"":"s")??""}\`)),D(S,w)};ce(m,S=>{r(),s(o),y(()=>r().loading&&s(o).length===0)?S(x):(r(),y(()=>r().error)?S($,1):S(k,-1))})}h(_);var z=b(_,2);{var F=S=>{var w=rf(),M=Xe(w);mr(M,5,()=>s(a),ee=>ee.id,(ee,U)=>{var oe=tf(),j=g(oe),ue=g(j,!0);h(j);var lt=b(j,2),Ft=g(lt);{var Et=Ze=>{var ft=ef();X($r=>Kn(ft,\`width:max(3px,\${$r??""}%)\`),[()=>(s(U),y(()=>d(s(U).tokensSavedEst??0)))]),D(Ze,ft)},He=Ao(()=>(s(U),y(()=>d(s(U).tokensSavedEst??0)>0)));ce(Ft,Ze=>{s(He)&&Ze(Et)})}h(lt);var Ge=b(lt,2);let Tt;var Lt=g(Ge,!0);h(Ge),h(oe),X((Ze,ft)=>{hr(j,"title",(s(U),y(()=>s(U).claudeCode?.projectPath||s(U).project||s(U).id))),C(ue,Ze),Tt=tr(Ge,1,"value svelte-c2rstm",null,Tt,{neg:(s(U).tokensSavedEst??0)<0}),C(Lt,ft)},[()=>(s(U),y(()=>u(s(U)))),()=>(s(U),y(()=>p(s(U).tokensSavedEst??0)))]),D(ee,oe)}),h(M);var W=b(M,2),Q=g(W);h(W),X(()=>C(Q,\`input tokens saved (cache-aware) \\xB7 top \${s(a),y(()=>s(a).length)??""} of \${s(o),y(()=>s(o).length)??""}\`)),D(S,w)},Y=S=>{var w=nf();D(S,w)};ce(z,S=>{s(a),y(()=>s(a).length>0)?S(F):(r(),y(()=>!r().loading&&!r().error)&&S(Y,1))})}D(e,c),_e(),i()}var af=P('requests 2xx / 4xx / 5xx compressed passthrough input tokens cache create cache read cache hit (tok) cache hit (ev) orig chars image bytes bytes/char latency p50/p95 first-byte p50/p95 ',1),lf=P('
',1),ff={hash:"svelte-1bksro2",code:".status.svelte-1bksro2 {margin-bottom:12px;color:#6e7681;font-size:12px;}table.svelte-1bksro2 {width:100%;border-collapse:collapse;font-size:12px;}td.svelte-1bksro2 {padding:6px 8px;border-bottom:1px solid #21262d;vertical-align:top;font-variant-numeric:tabular-nums;}td.svelte-1bksro2:last-child {border-bottom:none;}.num.svelte-1bksro2 {text-align:right;}"};function ti(e,t){pe(t,!1),Me(e,ff);let r=()=>Ee(qr,"$stats",n),[n,i]=De(),o=L(),a=L(),l=L(),f=L(),u=L(),p=L();B(()=>r(),()=>{R(o,r().data)}),B(()=>s(o),()=>{R(a,s(o)?.error)}),B(()=>s(o),()=>{R(l,s(o)?.summary)}),B(()=>s(l),()=>{R(f,(()=>{if(!s(l))return"-";let w=(s(l).inputTokensTotal||0)+(s(l).cacheCreateTokensTotal||0)+(s(l).cacheReadTokensTotal||0);return w>0?(s(l).cacheReadTokensTotal/w*100).toFixed(1)+"%":"-"})())}),B(()=>s(l),()=>{R(u,s(l)&&s(l).eventsWithBaseline>0?(s(l).cacheHitEvents/s(l).eventsWithBaseline*100).toFixed(1)+"%":"-")}),B(()=>s(l),()=>{R(p,s(l)&&s(l).origCharsTotal>0?(s(l).imageBytesTotal/s(l).origCharsTotal*100).toFixed(3)+"x":"-")}),je(),Fe();var d=lf(),c=Xe(d),_=g(c);{var m=w=>{var M=Dt("loading\\u2026");D(w,M)},x=w=>{var M=Dt();X(()=>C(M,s(a))),D(w,M)},$=w=>{var M=Dt();X(W=>C(M,\`\${W??""} events parsed\`),[()=>(V(A),s(o),y(()=>A(s(o).parsed)))]),D(w,M)},k=w=>{var M=Dt("-");D(w,M)};ce(_,w=>{r(),s(o),y(()=>r().loading&&!s(o))?w(m):s(a)?w(x,1):s(o)?w($,2):w(k,-1)})}h(c);var z=b(c,2),F=g(z),Y=g(F);{var S=w=>{var M=af(),W=Xe(M),Q=b(g(W)),ee=g(Q,!0);h(Q),h(W);var U=b(W,2),oe=b(g(U)),j=g(oe);h(oe),h(U);var ue=b(U,2),lt=b(g(ue)),Ft=g(lt,!0);h(lt),h(ue);var Et=b(ue,2),He=b(g(Et)),Ge=g(He,!0);h(He),h(Et);var Tt=b(Et,2),Lt=b(g(Tt)),Ze=g(Lt,!0);h(Lt),h(Tt);var ft=b(Tt,2),$r=b(g(ft)),Jn=g($r,!0);h($r),h(ft);var ne=b(ft,2),re=b(g(ne)),Ne=g(re,!0);h(re),h(ne);var nr=b(ne,2),pn=b(g(nr)),Qn=g(pn,!0);h(pn),h(nr);var zr=b(nr,2),ii=b(g(zr)),Zs=g(ii,!0);h(ii),h(zr);var eo=b(zr,2),si=b(g(eo)),Js=g(si,!0);h(si),h(eo);var to=b(eo,2),ai=b(g(to)),Qs=g(ai,!0);h(ai),h(to);var ro=b(to,2),li=b(g(ro)),ea=g(li,!0);h(li),h(ro);var no=b(ro,2),fi=b(g(no)),ta=g(fi);h(fi),h(no);var ci=b(no,2),ui=b(g(ci)),ra=g(ui);h(ui),h(ci),X((na,oa,ia,sa,aa,la,fa,ca,ua,da,pa,_a,va,ma,ha)=>{C(ee,na),C(j,\`\${oa??""} / \${ia??""} / \${sa??""}\`),C(Ft,aa),C(Ge,la),C(Ze,fa),C(Jn,ca),C(Ne,ua),C(Qn,s(f)),C(Zs,s(u)),C(Js,da),C(Qs,pa),C(ea,s(p)),C(ta,\`\${_a??""} / \${va??""} ms\`),C(ra,\`\${ma??""} / \${ha??""} ms\`)},[()=>(V(A),s(l),y(()=>A(s(l).total))),()=>(V(A),s(l),y(()=>A(s(l).ok2xx))),()=>(V(A),s(l),y(()=>A(s(l).err4xx))),()=>(V(A),s(l),y(()=>A(s(l).err5xx))),()=>(V(A),s(l),y(()=>A(s(l).compressed))),()=>(V(A),s(l),y(()=>A(s(l).passthrough))),()=>(V(A),s(l),y(()=>A(s(l).inputTokensTotal))),()=>(V(A),s(l),y(()=>A(s(l).cacheCreateTokensTotal))),()=>(V(A),s(l),y(()=>A(s(l).cacheReadTokensTotal))),()=>(V(A),s(l),y(()=>A(s(l).origCharsTotal))),()=>(V(A),s(l),y(()=>A(s(l).imageBytesTotal))),()=>(V(A),s(l),y(()=>A(s(l).durationP50))),()=>(V(A),s(l),y(()=>A(s(l).durationP95))),()=>(V(A),s(l),y(()=>A(s(l).firstBytemsP50))),()=>(V(A),s(l),y(()=>A(s(l).firstBytemsP95)))]),D(w,M)};ce(Y,w=>{s(l)&&w(S)})}h(F),h(z),D(e,d),_e(),i()}var cf=P(\`\`),uf=P('
runtime kill switch \\xB7 not persisted across restart
',1),df={hash:"svelte-1mocmsr",code:".banner.svelte-1mocmsr {display:inline-block;margin:8px 0;padding:10px 14px;background:#21262d;border:1px solid #f85149;border-radius:6px;color:#f85149;font-size:12px;}.toggle-wrap.svelte-1mocmsr {margin-bottom:14px;display:flex;align-items:center;gap:10px;}.toggle.svelte-1mocmsr {background:#21262d;color:#c9d1d9;border:1px solid #30363d;padding:6px 12px;cursor:pointer;border-radius:6px;font:inherit;font-size:12px;}.toggle.svelte-1mocmsr:disabled {opacity:0.5;cursor:wait;}.hint.svelte-1mocmsr {color:#6e7681;font-size:11px;}"};function ri(e,t){pe(t,!1),Me(e,df);let r=()=>Ee(gr,"$recent",n),[n,i]=De(),o=F(),a=F(!1);async function l(){if(s(a))return;let m=!s(o);if(!(!m&&!window.confirm(\`Disable compression? -/v1/messages will forward unchanged to upstream. Use this when upstream is unhealthy or to A/B test the proxy. Restart resets to enabled.\`))){R(a,!0);try{await Gs(m),gr.run()}catch(x){dn.push({level:"error",text:"failed to toggle: "+x.message})}finally{R(a,!1)}}}B(()=>r(),()=>{R(o,r().data?.compression_enabled!==!1)}),je(),Fe();var f=uf(),u=Xe(f);{var p=m=>{var x=cf();D(m,x)};ce(u,m=>{s(o)||m(p)})}var d=b(u,2),c=g(d),_=g(c,!0);h(c),jr(2),h(d),X(()=>{c.disabled=s(a),C(_,s(a)?"loading\\u2026":s(o)?"Disable compression":"Enable compression")}),Ut("click",c,l),D(e,f),_e(),i()}var pf=P('
'),_f=P('
'),vf={hash:"svelte-1c4to2y",code:".tray.svelte-1c4to2y {position:fixed;bottom:16px;right:16px;display:flex;flex-direction:column;gap:8px;z-index:1000;pointer-events:none;}.toast.svelte-1c4to2y {background:#21262d;color:#c9d1d9;border:1px solid #30363d;border-radius:6px;padding:10px 14px;font-size:12px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.4);display:flex;align-items:center;gap:12px;pointer-events:auto;max-width:360px;}.toast.error.svelte-1c4to2y {border-color:#f85149;color:#f85149;}.toast.warn.svelte-1c4to2y {border-color:#d29922;color:#d29922;}.toast.info.svelte-1c4to2y {border-color:#58a6ff;}button.svelte-1c4to2y {background:transparent;color:inherit;border:0;cursor:pointer;font-size:16px;line-height:1;padding:0;}"};function ni(e,t){pe(t,!1),Me(e,vf);let r=()=>Ee(dn,"$toasts",n),[n,i]=De();Fe();var o=_f();mr(o,5,r,a=>a.id,(a,l)=>{var f=pf(),u=g(f),p=g(u,!0);h(u);var d=b(u,2);h(f),X(()=>{tr(f,1,\`toast \${s(l),y(()=>s(l).level)??""}\`,"svelte-1c4to2y"),C(p,(s(l),y(()=>s(l).text)))}),Ut("click",d,()=>dn.dismiss(s(l).id)),D(a,f)}),h(o),D(e,o),_e(),i()}var mf=P('

pixelpipe

recent requests

latest rendered image

sessions (top savers)

stats (full history)

',1),hf={hash:"svelte-1bzzuab",code:\` +/v1/messages will forward unchanged to upstream. Use this when upstream is unhealthy or to A/B test the proxy. Restart resets to enabled.\`))){R(a,!0);try{await Gs(m),gr.run()}catch(x){dn.push({level:"error",text:"failed to toggle: "+x.message})}finally{R(a,!1)}}}B(()=>r(),()=>{R(o,r().data?.compression_enabled!==!1)}),je(),Le();var f=uf(),u=Xe(f);{var p=m=>{var x=cf();D(m,x)};ue(u,m=>{s(o)||m(p)})}var d=b(u,2),c=g(d),_=g(c,!0);h(c),jr(2),h(d),X(()=>{c.disabled=s(a),C(_,s(a)?"loading\\u2026":s(o)?"Disable compression":"Enable compression")}),Ut("click",c,l),D(e,f),_e(),i()}var pf=P('
'),_f=P('
'),vf={hash:"svelte-1c4to2y",code:".tray.svelte-1c4to2y {position:fixed;bottom:16px;right:16px;display:flex;flex-direction:column;gap:8px;z-index:1000;pointer-events:none;}.toast.svelte-1c4to2y {background:#21262d;color:#c9d1d9;border:1px solid #30363d;border-radius:6px;padding:10px 14px;font-size:12px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.4);display:flex;align-items:center;gap:12px;pointer-events:auto;max-width:360px;}.toast.error.svelte-1c4to2y {border-color:#f85149;color:#f85149;}.toast.warn.svelte-1c4to2y {border-color:#d29922;color:#d29922;}.toast.info.svelte-1c4to2y {border-color:#58a6ff;}button.svelte-1c4to2y {background:transparent;color:inherit;border:0;cursor:pointer;font-size:16px;line-height:1;padding:0;}"};function ni(e,t){pe(t,!1),Me(e,vf);let r=()=>Ee(dn,"$toasts",n),[n,i]=De();Le();var o=_f();mr(o,5,r,a=>a.id,(a,l)=>{var f=pf(),u=g(f),p=g(u,!0);h(u);var d=b(u,2);h(f),X(()=>{Lt(f,1,\`toast \${s(l),y(()=>s(l).level)??""}\`,"svelte-1c4to2y"),C(p,(s(l),y(()=>s(l).text)))}),Ut("click",d,()=>dn.dismiss(s(l).id)),D(a,f)}),h(o),D(e,o),_e(),i()}var mf=P('

pixelpipe

recent requests

latest rendered image

sessions (top savers)

stats (full history)

',1),hf={hash:"svelte-1bzzuab",code:\` /* Match the legacy dashboard 1:1 \\u2014 same fonts, colors, spacing. The page looks identical pre/post rewrite to keep visual regression cheap. */body {margin:0;padding:24px;background:#0d1117;color:#c9d1d9;font:14px/1.45 -apple-system, BlinkMacSystemFont, @@ -86,5 +86,5 @@ https://svelte.dev/e/state_proxy_unmount\`,St,At):console.warn("https://svelte.d 50% { opacity: 0.4; } - }\`};function oi(e,t){pe(t,!1),Me(e,hf);let r=()=>Ee(qr,"$stats",n),[n,i]=De(),o=L();function a(w){w=Math.floor(w);let M=Math.floor(w/3600),W=Math.floor(w%3600/60),Q=w%60;return(M?M+"h ":"")+(W||M?W+"m ":"")+Q+"s"}B(()=>r(),()=>{R(o,r().data?\`port \${location.port||"80"} \\xB7 uptime \${a(r().data.uptime_sec)} \\xB7 live\`:r().error?"proxy unreachable":"connecting...")}),je(),Fe();var l=mf(),f=b(Xe(l),2),u=g(f,!0);h(f);var p=b(f,2);ri(p,{});var d=b(p,2);Zo(d,{});var c=b(d,2),_=g(c),m=b(g(_),2);Jo(m,{}),h(_);var x=b(_,2),$=b(g(x),2);Qo($,{}),h(x),h(c);var k=b(c,2),z=b(g(k),2);ei(z,{}),h(k);var F=b(k,2),Y=b(g(F),2);ti(Y,{}),h(F);var S=b(F,2);ni(S,{}),X(()=>C(u,s(o))),D(e,l),_e(),i()}var Xs=document.getElementById("app");Xs?Lr(oi,{target:Xs}):document.body.textContent="pixelpipe dashboard: mount target #app missing";})(); + }\`};function oi(e,t){pe(t,!1),Me(e,hf);let r=()=>Ee(qr,"$stats",n),[n,i]=De(),o=F();function a(w){w=Math.floor(w);let M=Math.floor(w/3600),W=Math.floor(w%3600/60),Q=w%60;return(M?M+"h ":"")+(W||M?W+"m ":"")+Q+"s"}B(()=>r(),()=>{R(o,r().data?\`port \${location.port||"80"} \\xB7 uptime \${a(r().data.uptime_sec)} \\xB7 live\`:r().error?"proxy unreachable":"connecting...")}),je(),Le();var l=mf(),f=b(Xe(l),2),u=g(f,!0);h(f);var p=b(f,2);ri(p,{});var d=b(p,2);Zo(d,{});var c=b(d,2),_=g(c),m=b(g(_),2);Jo(m,{}),h(_);var x=b(_,2),$=b(g(x),2);Qo($,{}),h(x),h(c);var k=b(c,2),z=b(g(k),2);ei(z,{}),h(k);var L=b(k,2),H=b(g(L),2);ti(H,{}),h(L);var S=b(L,2);ni(S,{}),X(()=>C(u,s(o))),D(e,l),_e(),i()}var Xs=document.getElementById("app");Xs?Fr(oi,{target:Xs}):document.body.textContent="pixelpipe dashboard: mount target #app missing";})(); `; diff --git a/src/dashboard.ts b/src/dashboard.ts index a3afb5a..fcad5c1 100644 --- a/src/dashboard.ts +++ b/src/dashboard.ts @@ -159,6 +159,23 @@ interface Totals { * doesn't touch output). Without this the headline ignores half the * bill on output-heavy sessions. */ outputWeighted: number; + /** Sum of weighted actual input tokens across ALL requests that had a + * usage block, regardless of whether the probe succeeded — i.e. every + * request the user actually paid for, measured or not, transformed or + * passthrough. Forms the honest denominator for "share of total spend + * saved": you can only credit savings against the slice where pixelpipe + * ran AND we measured, but you have to divide by the full bill (passthrough + * + probe-failed + unmeasured + measured) to answer "did pixelpipe move + * my real bill" instead of "did pixelpipe help on rows where it ran". */ + allActualInputWeighted: number; + /** Sum of output_tokens × OUTPUT_TOKEN_RATE across the same all-rows set + * as allActualInputWeighted. Output is on both sides of the savings ratio + * at its actual 5× rate; numerator stays measured-rows-only because saved + * cancels output (proxy doesn't touch it). */ + allOutputWeighted: number; + /** Count of requests that contributed to allActualInputWeighted (had a + * usage block). Lets the UI annotate "N of M paid requests". */ + allUsageRequests: number; /** Sum of ground-truth output character counts from the SSE/JSON scanner * (see `OutputMeasurement` in proxy.ts). These three accumulators are * independent of Anthropic's `usage.output_tokens` — they let the operator @@ -226,6 +243,9 @@ export class DashboardState { actualInputWeighted: 0, baselineInputWeighted: 0, outputWeighted: 0, + allActualInputWeighted: 0, + allOutputWeighted: 0, + allUsageRequests: 0, textCharsMeasured: 0, thinkingCharsMeasured: 0, toolUseCharsMeasured: 0, @@ -377,6 +397,15 @@ export class DashboardState { this.totals.actualInputWeighted += actualInputEff; this.totals.outputWeighted += outputEquiv; } + // All-rows spend, ungated on the probe. The "share of total bill saved" + // headline divides measured-rows savings into this, so passthrough rows, + // probe-failed rows, and uncompressed rows all dilute the headline the + // same way they dilute the user's real bill. + if (haveUsage) { + this.totals.allActualInputWeighted += actualInputEff; + this.totals.allOutputWeighted += outputEquiv; + this.totals.allUsageRequests += 1; + } // Measurement totals are independent of usage/baseline gating — they // accumulate whenever the scanner produced numbers. The scanner sets @@ -505,6 +534,18 @@ export class DashboardState { const baselineTotal = baseline + output; const actualTotal = actual + output; const pctTotal = baselineTotal > 0 ? (saved / baselineTotal) * 100 : 0; + + // Share-of-all-spend: honest denominator. The numerator can only credit + // savings against rows where we have a probe baseline (otherwise it's + // estimation), but the denominator MUST include every request the user + // actually paid for — including passthrough rows, probe-failed rows, + // and untransformed turns the gate said no to. Otherwise the headline + // answers "did pixelpipe help on the rows where it ran" instead of + // "did pixelpipe move my real bill". The first is a cherry-pick. + const allActual = this.totals.allActualInputWeighted; + const allOutput = this.totals.allOutputWeighted; + const allSpend = allActual + allOutput; + const pctAllSpend = allSpend > 0 ? (saved / allSpend) * 100 : 0; const uptimeSec = Date.now() / 1000 - this.totals.startedAt; const payload = { requests: this.totals.requests, @@ -517,6 +558,15 @@ export class DashboardState { saved_pct: round1(pctInput), saved_pct_input_only: round1(pctInput), saved_pct_of_total_bill: round1(pctTotal), + // Honest "share of total bill saved" — measured-rows numerator over + // ALL paid requests in the denominator (compressed + passthrough + + // probe-failed). This is the number users actually want when they + // ask "is pixelpipe helping". Negative when flap-pollution from + // passthrough turns exceeds the collapse win on measured turns. + saved_pct_of_all_spend: round1(pctAllSpend), + all_actual_input_weighted: Math.round(allActual), + all_output_weighted: Math.round(allOutput), + all_usage_requests: this.totals.allUsageRequests, saved_usd: round4((saved * ASSUMED_INPUT_USD_PER_MTOK) / 1e6), output_weighted: Math.round(output), baseline_token_equivalent: Math.round(baselineTotal), diff --git a/src/dashboard/components/StatsHeader.svelte b/src/dashboard/components/StatsHeader.svelte index ee05035..d3967c1 100644 --- a/src/dashboard/components/StatsHeader.svelte +++ b/src/dashboard/components/StatsHeader.svelte @@ -53,35 +53,37 @@ $: pctMath = s && pa ? `
formula: ` + - ` share_of_bill = saved / (baseline_input + output × ` + + ` share_of_spend = saved / (all_actual_input + all_output × ` + (pa.output_multiplier ?? 5) + `)
` + - `
why include output: ` + - `Anthropic's weekly meter counts input + output × 5, the proxy only moves input
` + + `
why this denominator: ` + + `the question is "did pixelpipe move my real bill", not "did pixelpipe help on the slice it ran on". ` + + `The denominator is every paid request — compressed, passthrough, probe-failed — so passthrough rows ` + + `and flap-polluted turns count against the proxy the same way they count against the user.
` + `
` + - row('saved', s.saved_input_tokens, '(input savings - proxy doesn\'t touch output)') + - row('baseline_input', s.baseline_input_weighted, '(cache-aware counterfactual)') + + row('saved', s.saved_input_tokens, '(measured-rows numerator; cache-aware)') + + row('all_actual_input', s.all_actual_input_weighted, '(every paid request, weighted)') + row( - 'output', - ` × ` + (pa.output_multiplier ?? 5), - s.output_weighted + ' (weighted output tokens)', + 'all_output × ' + (pa.output_multiplier ?? 5), + s.all_output_weighted, + '(every paid request, output × ' + (pa.output_multiplier ?? 5) + ')', ) + row( - 'baseline_total', - s.baseline_input_weighted + s.output_weighted, - `= baseline_input + output`, + 'all_spend_total', + s.all_actual_input_weighted + s.all_output_weighted, + `= all_actual_input + all_output`, ) + row( - 'share_of_bill', - (s.saved_pct_of_total_bill || 0).toFixed(1) + '%', - `= saved / baseline_total × 100`, + 'share_of_spend', + (s.saved_pct_of_all_spend || 0).toFixed(1) + '%', + `= saved / all_spend_total × 100`, ) + row( - 'input-only %', - (s.saved_pct_input_only || 0).toFixed(1) + '%', - '(sub-line: saved / baseline_input × 100 - output excluded)', + 'all_usage_requests', + s.all_usage_requests, + '(denominator request count - compressed + passthrough + probe-failed)', ) + - `measured - no estimation` + `measured numerator, all-rows denominator - no cherry-pick` : ''; $: tokeqMath = s && pa @@ -171,11 +173,10 @@ {/if}
-
share of total bill saved
-
{(s?.saved_pct_of_total_bill ?? 0).toFixed(1)}%
+
share of spend saved
+
= 0} class:neg={(s?.saved_pct_of_all_spend ?? 0) < 0}>{(s?.saved_pct_of_all_spend ?? 0).toFixed(1)}%
- ÷ (input + 5×output) - output billed at 5× input rate · input-only: - {(s?.saved_pct_input_only ?? 0).toFixed(1)}% + ÷ all paid requests ({numFmt(s?.all_usage_requests)} req · compressed + passthrough + probe-failed) · negative = pixelpipe added cost
{#if s && pa}
@@ -236,6 +237,9 @@ .value.pos { color: #3fb950; } + .value.neg { + color: #f85149; + } .small { font-size: 11px; color: #6e7681; diff --git a/src/dashboard/types.ts b/src/dashboard/types.ts index f240bf5..eced251 100644 --- a/src/dashboard/types.ts +++ b/src/dashboard/types.ts @@ -15,7 +15,15 @@ export interface StatsPayload { /** Back-compat duplicate of `saved_pct_input_only`. */ saved_pct: number; saved_pct_input_only: number; + /** DEPRECATED — denominator was filtered to measured-rows-only, which + * cherry-picks the wins. Kept on the wire for back-compat. */ saved_pct_of_total_bill: number; + /** Honest "share of total bill saved": measured-rows savings ÷ ALL paid + * requests in the window (compressed + passthrough + probe-failed). */ + saved_pct_of_all_spend: number; + all_actual_input_weighted: number; + all_output_weighted: number; + all_usage_requests: number; saved_usd: number; output_weighted: number; baseline_token_equivalent: number;