From c340ac3da67f2c744e277ebaf93e0097c1f83835 Mon Sep 17 00:00:00 2001 From: Steven Chong <25894545+teamchong@users.noreply.github.com> Date: Sat, 23 May 2026 21:25:55 -0400 Subject: [PATCH] feat(dashboard): direct compressed-vs-passthrough cost split Add per-path actual-billed cost counters to the dashboard alongside the existing counterfactual baseline. The compressed-vs-passthrough split sums what each code path actually cost on real traffic, partitioned by `info.compressed`, with no probe gating or counterfactuals. Surfaces sample counts in the UI so operators can judge sufficiency rather than having the dashboard auto-claim significance. Headline math also switched to share-of-all-paid-spend (counterfactual denominator bounded at 100%) so the slice number never lies when pixelpipe didn't run on every request. Regenerated dashboard-bundle. --- src/dashboard-bundle.ts | 71 +++++----- src/dashboard.ts | 86 ++++++++++++ src/dashboard/components/StatsHeader.svelte | 148 ++++++++++++++++++-- src/dashboard/types.ts | 14 ++ 4 files changed, 272 insertions(+), 47 deletions(-) diff --git a/src/dashboard-bundle.ts b/src/dashboard-bundle.ts index b0224be..e877e01 100644 --- a/src/dashboard-bundle.ts +++ b/src/dashboard-bundle.ts @@ -1,70 +1,71 @@ // 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: 91952 chars (89.8 KB). +// Size: 96777 chars (94.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,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 +export const DASHBOARD_JS = `"use strict";(()=>{var gs=globalThis.process?.env?.NODE_ENV,v=gs&&!gs.toLowerCase().startsWith("prod");var Vt=Array.isArray,$s=Array.prototype.indexOf,bt=Array.prototype.includes,Nr=Array.from,go=Object.keys,$e=Object.defineProperty,tt=Object.getOwnPropertyDescriptor,Nn=Object.getOwnPropertyDescriptors,$o=Object.prototype,bs=Array.prototype,fr=Object.getPrototypeOf,bo=Object.isExtensible;var ze=()=>{};function xs(e){return e()}function Rr(e){for(var t=0;t{e=n,t=s});return{promise:r,resolve:e,reject:t}}var Ce=Symbol("$state"),Cn=Symbol("legacy props"),ys=Symbol(""),On=Symbol("proxy path"),In=Symbol("attributes"),Jr=Symbol("class"),Qr=Symbol("style"),en=Symbol("text");var xo=Symbol("hmr anchor"),Qt=new class extends Error{name="StaleReactionError";message="The reaction that called \`getAbortSignal()\` was re-run or destroyed"},yo=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var ur=3,rt=8;function ws(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 +https://svelte.dev/e/invariant_violation\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/invariant_violation")}function Ts(){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 ks(){if(v){let e=new Error(\`derived_references_self A derived value cannot reference itself recursively -https://svelte.dev/e/derived_references_self\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/derived_references_self")}function fo(e,t,r){if(v){let n=new Error(\`each_key_duplicate +https://svelte.dev/e/derived_references_self\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/derived_references_self")}function wo(e,t,r){if(v){let n=new Error(\`each_key_duplicate \${r?\`Keyed each block has duplicate key \\\`\${r}\\\` at indexes \${e} and \${t}\`:\`Keyed each block has duplicate key at indexes \${e} and \${t}\`} -https://svelte.dev/e/each_key_duplicate\`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function xi(e,t,r){if(v){let n=new Error(\`each_key_volatile +https://svelte.dev/e/each_key_duplicate\`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function Ss(e,t,r){if(v){let n=new Error(\`each_key_volatile Keyed each block has key that is not idempotent \\u2014 the key for item at index \${e} was \\\`\${t}\\\` but is now \\\`\${r}\\\`. Keys must be the same each time for a given item -https://svelte.dev/e/each_key_volatile\`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_volatile")}function yi(e){if(v){let t=new Error(\`effect_in_teardown +https://svelte.dev/e/each_key_volatile\`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_volatile")}function As(e){if(v){let t=new Error(\`effect_in_teardown \\\`\${e}\\\` cannot be used inside an effect cleanup function -https://svelte.dev/e/effect_in_teardown\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function wi(){if(v){let e=new Error("effect_in_unowned_derived\\nEffect cannot be created inside a \`$derived\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ei(e){if(v){let t=new Error(\`effect_orphan +https://svelte.dev/e/effect_in_teardown\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ns(){if(v){let e=new Error("effect_in_unowned_derived\\nEffect cannot be created inside a \`$derived\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Rs(e){if(v){let t=new Error(\`effect_orphan \\\`\${e}\\\` can only be used inside an effect (e.g. during component initialisation) -https://svelte.dev/e/effect_orphan\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function Ti(){if(v){let e=new Error(\`effect_update_depth_exceeded +https://svelte.dev/e/effect_orphan\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function Cs(){if(v){let e=new Error(\`effect_update_depth_exceeded Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state -https://svelte.dev/e/effect_update_depth_exceeded\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function ki(){if(v){let e=new Error(\`hydration_failed +https://svelte.dev/e/effect_update_depth_exceeded\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Os(){if(v){let e=new Error(\`hydration_failed Failed to hydrate the application -https://svelte.dev/e/hydration_failed\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/hydration_failed")}function Si(e){if(v){let t=new Error(\`rune_outside_svelte +https://svelte.dev/e/hydration_failed\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/hydration_failed")}function Is(e){if(v){let t=new Error(\`rune_outside_svelte The \\\`\${e}\\\` rune is only available inside \\\`.svelte\\\` and \\\`.svelte.js/ts\\\` files -https://svelte.dev/e/rune_outside_svelte\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function Ai(){if(v){let e=new Error("state_descriptors_fixed\\nProperty descriptors defined on \`$state\` objects must contain \`value\` and always be \`enumerable\`, \`configurable\` and \`writable\`.\\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ni(){if(v){let e=new Error("state_prototype_fixed\\nCannot set prototype of \`$state\` object\\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ri(){if(v){let e=new Error("state_unsafe_mutation\\nUpdating state inside \`$derived(...)\`, \`$inspect(...)\` or a template expression is forbidden. If the value should not be reactive, declare it without \`$state\`\\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ci(){if(v){let e=new Error("svelte_boundary_reset_onerror\\nA \`\` \`reset\` function cannot be called while an error is still being handled\\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var kt={};var J=Symbol(),We=Symbol("filename");var $n="http://www.w3.org/1999/xhtml",Vr="http://www.w3.org/2000/svg",co="http://www.w3.org/1998/Math/MathML";var St="font-weight: bold",At="font-weight: normal";function Oi(e){v?console.warn(\`%c[svelte] await_reactivity_loss +https://svelte.dev/e/rune_outside_svelte\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function Ds(){if(v){let e=new Error("state_descriptors_fixed\\nProperty descriptors defined on \`$state\` objects must contain \`value\` and always be \`enumerable\`, \`configurable\` and \`writable\`.\\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ms(){if(v){let e=new Error("state_prototype_fixed\\nCannot set prototype of \`$state\` object\\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function qs(){if(v){let e=new Error("state_unsafe_mutation\\nUpdating state inside \`$derived(...)\`, \`$inspect(...)\` or a template expression is forbidden. If the value should not be reactive, declare it without \`$state\`\\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Fs(){if(v){let e=new Error("svelte_boundary_reset_onerror\\nA \`\` \`reset\` function cannot be called while an error is still being handled\\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var Rt={};var re=Symbol(),Ze=Symbol("filename");var Dn="http://www.w3.org/1999/xhtml",tn="http://www.w3.org/2000/svg",Eo="http://www.w3.org/1998/Math/MathML";var Ct="font-weight: bold",Ot="font-weight: normal";function Ls(e){v?console.warn(\`%c[svelte] await_reactivity_loss %cDetected reactivity loss when reading \\\`\${e}\\\`. This happens when state is read in an async function after an earlier \\\`await\\\` -https://svelte.dev/e/await_reactivity_loss\`,St,At):console.warn("https://svelte.dev/e/await_reactivity_loss")}function Ii(e,t){v?console.warn(\`%c[svelte] await_waterfall +https://svelte.dev/e/await_reactivity_loss\`,Ct,Ot):console.warn("https://svelte.dev/e/await_reactivity_loss")}function Ps(e,t){v?console.warn(\`%c[svelte] await_waterfall %cAn async derived, \\\`\${e}\\\` (\${t}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app -https://svelte.dev/e/await_waterfall\`,St,At):console.warn("https://svelte.dev/e/await_waterfall")}function Di(){v?console.warn(\`%c[svelte] derived_inert +https://svelte.dev/e/await_waterfall\`,Ct,Ot):console.warn("https://svelte.dev/e/await_waterfall")}function zs(){v?console.warn(\`%c[svelte] derived_inert %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 +https://svelte.dev/e/derived_inert\`,Ct,Ot):console.warn("https://svelte.dev/e/derived_inert")}function Bs(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 Li(e){v?console.warn(\`%c[svelte] hydration_html_changed +https://svelte.dev/e/hydration_attribute_changed\`,Ct,Ot):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Ys(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 +https://svelte.dev/e/hydration_html_changed\`,Ct,Ot):console.warn("https://svelte.dev/e/hydration_html_changed")}function er(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 Fi(){v?console.warn(\`%c[svelte] lifecycle_double_unmount +https://svelte.dev/e/hydration_mismatch\`,Ct,Ot):console.warn("https://svelte.dev/e/hydration_mismatch")}function Hs(){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 +https://svelte.dev/e/lifecycle_double_unmount\`,Ct,Ot):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Mn(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 +https://svelte.dev/e/state_proxy_equality_mismatch\`,Ct,Ot):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function Vs(){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 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(\` +https://svelte.dev/e/state_proxy_unmount\`,Ct,Ot):console.warn("https://svelte.dev/e/state_proxy_unmount")}function Us(){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",Ct,Ot):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var T=!1;function de(e){T=e}var D;function j(e){if(e===null)throw er(),Rt;return D=e}function be(){return j(xe(D))}function m(e){if(T){if(xe(D)!==null)throw er(),Rt;D=e}}function nn(e=1){if(T){for(var t=e,r=D;t--;)r=xe(r);D=r}}function It(e=!0){for(var t=0,r=D;;){if(r.nodeType===rt){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 s=xe(r);e&&r.remove(),r=s}}function on(e){if(!e||e.nodeType!==rt)throw er(),Rt;return e.data}function qn(e){return e===this.v}function Fn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Ln(e){return!Fn(e,this.v)}var ye=!1,tr=!1,xt=!1;function js(){tr=!0}var sn=null;function Be(e,t){return e.label=t,zn(e.v,t),e}function zn(e,t){return e?.[On]?.(t),e}function yt(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=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} +\`),n=[];for(let s=0;s{t===dr&&Xs()})}dr.push(e)}function Zs(){for(;dr.length>0;)Xs()}var ko=new WeakMap;function Yn(e){var t=E;if(t===null)return C.f|=8388608,e;if(v&&e instanceof Error&&!ko.has(e)&&ko.set(e,ba(e,t)),(t.f&32768)===0&&(t.f&4)===0)throw v&&!t.parent&&e instanceof Error&&Js(e),e;pt(e,t)}function pt(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&&Js(e),e}function ba(e,t){let r=tt(e,"message");if(!(r&&!r.configurable)){for(var n=ln?" ":" ",s=\` +\${n}in \${t.fn?.name||""}\`,o=t.ctx;o!==null;)s+=\` +\${n}in \${o.function?.[Ze].split("/").pop()}\`,o=o.p;return{message:e.message+\` +\${s} \`,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),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);} +\`)}}}function Js(e){let t=ko.get(e);t&&($e(e,"message",{value:t.message}),$e(e,"stack",{value:t.stack}))}var xa=-7169;function W(e,t){e.f=e.f&xa|t}function Dr(e){(e.f&512)!==0||e.deps===null?W(e,1024):W(e,4096)}function Qs(e){if(e!==null)for(let t of e)(t.f&2)===0||(t.f&65536)===0||(t.f^=65536,Qs(t.deps))}function Hn(e,t,r){(e.f&2048)!==0?t.add(e):(e.f&4096)!==0&&r.add(e),Qs(e.deps),W(e,1024)}function Vn(e,t,r){if(e==null)return t(void 0),r&&r(void 0),ze;let n=b(()=>e.subscribe(t,r));return n.unsubscribe?()=>n.unsubscribe():n}var Mr=[];function So(e,t){return{subscribe:qr(e,t).subscribe}}function qr(e,t=ze){let r=null,n=new Set;function s(l){if(Fn(e,l)&&(e=l,r)){let c=!Mr.length;for(let f of n)f[1](),Mr.push(f,e);if(c){for(let f=0;f{n.delete(f),n.size===0&&r&&(r(),r=null)}}return{set:s,update:o,subscribe:a}}function Un(e){let t;return Vn(e,r=>t=r)(),t}var ei=!1;var Ao=Symbol();function Ee(e,t,r){let n=r[t]??={store:null,source:q(void 0),unsubscribe:ze};if(v&&(n.source.label=t),n.store!==e&&!(Ao in r))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=ze;else{var s=!0;n.unsubscribe=Vn(e,o=>{s?n.source.v=o:R(n.source,o)}),s=!1}return e&&Ao in r?Un(e):i(n.source)}function Me(){let e={};function t(){Te(()=>{for(var r in e)e[r].unsubscribe();$e(e,Ao,{enumerable:!1,value:!0})})}return[e,t]}var jn=null,Lr=null,I=null,Pr=null,ke=null,Co=null,pr=!1,No=!1,_r=null,cn=null,ti=0,Ro=new Set,wa=1,st=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;#s=new Set;#o=0;#i=new Map;#d=null;#a=[];#_=[];#p=new Set;#f=new Set;#u=new Map;#c=new Set;is_fork=!1;#h=!1;#x(){if(this.is_fork)return!0;for(let n of this.#i.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.#c.delete(t)}unskip_effect(t,r=n=>this.schedule(n)){var n=this.#u.get(t);if(n){this.#u.delete(t);for(var s of n.d)W(s,2048),r(s);for(s of n.m)W(s,4096),r(s)}this.#c.add(t)}#m(){if(this.#e=!0,ti++>1e3&&(this.#b(),Ea()),v)for(let c of this.current.keys())Ro.add(c);if(!this.#x()){for(let c of this.#p)this.#f.delete(c),W(c,2048),this.schedule(c);for(let c of this.#f)W(c,4096),this.schedule(c)}let t=this.#a;this.#a=[],this.apply();var r=_r=[],n=[],s=cn=[];for(let c of t)try{this.#y(c,r,n)}catch(f){throw si(c),f}if(I=null,s.length>0){var o=e.ensure();for(let c of s)o.schedule(c)}if(_r=null,cn=null,this.#x()){this.#v(n),this.#v(r);for(let[c,f]of this.#u)oi(c,f);s.length>0&&I.#m();return}let a=this.#w();if(a){a.#g(this);return}this.#p.clear(),this.#f.clear();for(let c of this.#l)c(this);this.#l.clear(),Pr=this,ri(n),ri(r),Pr=null,this.#d?.resolve();var l=I;if(this.linked&&this.#o===0&&this.#b(),ye&&!this.linked&&(this.#E(),I=l),this.#a.length>0){l===null&&(l=this,this.#$());let c=l;c.#a.push(...this.#a.filter(f=>!c.#a.includes(f)))}l!==null&&l.#m()}#y(t,r,n){t.f^=1024;for(var s=t.first;s!==null;){var o=s.f,a=(o&96)!==0,l=a&&(o&1024)!==0,c=l||(o&8192)!==0||this.#u.has(s);if(!c&&s.fn!==null){a?s.f^=1024:(o&4)!==0?r.push(s):ye&&(o&16777224)!==0?n.push(s):Kt(s)&&((o&16)!==0&&this.#f.add(s),Et(s));var f=s.first;if(f!==null){s=f;continue}}for(;s!==null;){var _=s.next;if(_!==null){s=_;break}s=s.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,s]of t.current)!this.previous.has(n)&&t.previous.has(n)&&this.previous.set(n,t.previous.get(n)),this.current.set(n,s);for(let[n,s]of t.async_deriveds){let o=this.async_deriveds.get(n);o&&s.promise.then(o.resolve)}let r=n=>{var s=n.reactions;if(s!==null)for(let l of s){var o=l.f;if((o&2)!==0)r(l);else{var a=l;o&4194320&&!this.async_deriveds.has(a)&&(this.#f.delete(a),W(a,2048),this.schedule(a))}}};for(let n of this.current.keys())r(n);this.oncommit(()=>t.discard()),t.#b(),I=this,this.#m()}#v(t){for(var r=0;r!this.current.has(u));if(s.length===0)t&&_.discard();else if(r.length>0){if(v&&Ws(_.#a.length===0,"Batch has scheduled roots"),t)for(let u of this.#c)_.unskip_effect(u,d=>{(d.f&4194320)!==0?_.schedule(d):_.#v([d])});_.activate();var o=new Set,a=new Map;for(var l of r)ni(l,s,o,a);a=new Map;var c=[..._.current.keys()].filter(u=>this.current.has(u)?this.current.get(u)[0]!==u.v:!0);if(c.length>0)for(let u of this.#_)(u.f&155648)===0&&Oo(u,c,a)&&((u.f&4194320)!==0?(W(u,2048),_.schedule(u)):_.#p.add(u));if(_.#a.length>0){_.apply();for(var f of _.#a)_.#y(f,[],[]);_.#a=[]}_.deactivate()}}}}increment(t,r){if(this.#o+=1,t){let n=this.#i.get(r)??0;this.#i.set(r,n+1)}}decrement(t,r){if(this.#o-=1,t){let n=this.#i.get(r)??0;n===1?this.#i.delete(r):this.#i.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.#f.add(n);t.clear(),r.clear()}oncommit(t){this.#l.add(t)}ondiscard(t){this.#n.add(t)}on_fork_commit(t){this.#s.add(t)}run_fork_commit_callbacks(){for(let t of this.#s)t(this);this.#s.clear()}settled(){return(this.#d??=Rn()).promise}static ensure(){if(I===null){let t=I=new e;t.#$(),!No&&!pr&&we(()=>{t.#e||t.flush()})}return I}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=jn;r!==null;r=r.#r)if(!(r===this||r.is_fork)){var t=!1;if(r.id0)){Wt.clear();for(let s of vt){if((s.f&24576)!==0)continue;let o=[s],a=s.parent;for(;a!==null;)vt.has(a)&&(vt.delete(a),o.push(a)),a=a.parent;for(let l=o.length-1;l>=0;l--){let c=o[l];(c.f&24576)===0&&Et(c)}}vt.clear()}}vt=null}}function ni(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(let s of e.reactions){let o=s.f;(o&2)!==0?ni(s,t,r,n):(o&4194320)!==0&&(o&2048)===0&&Oo(s,t,n)&&(W(s,2048),fn(s))}}function Oo(e,t,r){let n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(let s of e.deps){if(bt.call(t,s))return!0;if((s.f&2)!==0&&Oo(s,t,r))return r.set(s,!0),!0}return r.set(e,!1),!1}function fn(e){I.schedule(e)}function oi(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),W(e,1024);for(var r=e.first;r!==null;)oi(r,t),r=r.next}}function si(e){W(e,1024);for(var t=e.first;t!==null;)si(t),t=t.next}function Do(e){let t=0,r=Ue(0),n;return v&&Be(r,"createSubscriber version"),()=>{Ut()&&(i(r),Se(()=>(t===0&&(n=b(()=>e(()=>mr(r)))),t+=1,()=>{we(()=>{t-=1,t===0&&(n?.(),n=void 0,mr(r))})})))}}var ka=589824;function qo(e,t,r,n){new Mo(e,t,r,n)}var Mo=class{parent;is_pending=!1;transform_error;#e;#t=T?D:null;#r;#l;#n;#s=null;#o=null;#i=null;#d=null;#a=0;#_=0;#p=!1;#f=new Set;#u=new Set;#c=null;#h=Do(()=>(this.#c=Ue(this.#a),v&&Be(this.#c,"$effect.pending()"),()=>{this.#c=null}));constructor(t,r,n,s){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=s??this.parent?.transform_error??(o=>o),this.#n=at(()=>{if(T){let o=this.#t;be();let a=o.data==="[!";if(o.data.startsWith("[?")){let c=JSON.parse(o.data.slice("[?".length));this.#m(c)}else a?this.#y():this.#x()}else this.#w()},ka),T&&(this.#e=D)}#x(){try{this.#s=ge(()=>this.#l(this.#e))}catch(t){this.error(t)}}#m(t){let r=this.#r.failed;r&&(this.#i=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=ue();r.append(n),this.#s=this.#v(()=>ge(()=>this.#l(n))),this.#_===0&&(this.#e.before(r),this.#d=null,qt(this.#o,()=>{this.#o=null}),this.#g(I))}))}#w(){try{if(this.is_pending=this.has_pending_snippet(),this.#_=0,this.#a=0,this.#s=ge(()=>{this.#l(this.#e)}),this.#_>0){var t=this.#d=document.createDocumentFragment();Yr(this.#s,t);let r=this.#r.pending;this.#o=ge(()=>r(this.#e))}else this.#g(I)}catch(r){this.error(r)}}#g(t){this.is_pending=!1,t.transfer_effects(this.#f,this.#u)}defer_effect(t){Hn(t,this.#f,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=C,s=P;ae(this.#n),fe(this.#n),jt(this.#n.ctx);try{return st.ensure(),t()}catch(o){return Yn(o),null}finally{ae(r),fe(n),jt(s)}}#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&&qt(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.#c||this.#p)&&(this.#p=!0,we(()=>{this.#p=!1,this.#c&&Tt(this.#c,this.#a)}))}get_effect_pending(){return this.#h(),i(this.#c)}error(t){if(!this.#r.onerror&&!this.#r.failed)throw t;I?.is_fork?(this.#s&&I.skip_effect(this.#s),this.#o&&I.skip_effect(this.#o),this.#i&&I.skip_effect(this.#i),I.on_fork_commit(()=>{this.#$(t)})):this.#$(t)}#$(t){this.#s&&(ie(this.#s),this.#s=null),this.#o&&(ie(this.#o),this.#o=null),this.#i&&(ie(this.#i),this.#i=null),T&&(j(this.#t),nn(),j(It()));var r=this.#r.onerror;let n=this.#r.failed;var s=!1,o=!1;let a=()=>{if(s){Us();return}s=!0,o&&Fs(),this.#i!==null&&qt(this.#i,()=>{this.#i=null}),this.#v(()=>{this.#w()})},l=c=>{try{o=!0,r?.(c,a),o=!1}catch(f){pt(f,this.#n&&this.#n.parent)}n&&(this.#i=this.#v(()=>{try{return ge(()=>{var f=E;f.b=this,f.f|=128,n(this.#e,()=>c,()=>a)})}catch(f){return pt(f,this.#n.parent),null}}))};we(()=>{var c;try{c=this.transform_error(t)}catch(f){pt(f,this.#n&&this.#n.parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(l,f=>pt(f,this.#n&&this.#n.parent)):l(c)})}};function Xn(e,t,r,n){let s=Mt()?hr:Vr;var o=e.filter(d=>!d.settled);if(r.length===0&&o.length===0){n(t.map(s));return}var a=E,l=li(),c=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(d=>d.promise)):null;function f(d){if((a.f&16384)===0){l();try{n(d)}catch(p){pt(p,a)}Hr()}}var _=Fo();if(r.length===0){c.then(()=>f(t.map(s))).finally(_);return}function u(){Promise.all(r.map(d=>Po(d))).then(d=>f([...t.map(s),...d])).catch(d=>pt(d,a)).finally(_)}c?c.then(()=>{l(),u(),Hr()}):u()}function li(){var e=E,t=C,r=P,n=I;if(v)var s=Dt;return function(a=!0){ae(e),fe(t),jt(r),a&&(e.f&16384)===0&&(n?.activate(),n?.apply()),v&&(Lo(null),Ir(s))}}function Hr(e=!0){ae(null),fe(null),jt(null),e&&I?.deactivate(),v&&(Lo(null),Ir(null))}function Fo(){var e=E,t=e.b,r=I,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 Je=null;function Lo(e){Je=e}var un=new Set;function hr(e){var t=2050;E!==null&&(E.f|=524288);let r={ctx:P,deps:null,effects:null,equals:qn,f:t,fn:e,reactions:null,rv:0,v:re,wv:0,parent:E,ac:null};return v&&xt&&(r.created=yt("created at")),r}var Zn=Symbol("obsolete");function Po(e,t,r){let n=E;n===null&&Ts();var s=void 0,o=Ue(re);v&&(o.label=t??e.toString());var a=!C,l=new Set;return ui(()=>{var c=E;v&&(Je={effect:c,effect_deps:new Set,warned:!1});var f=Rn();s=f.promise;try{Promise.resolve(e()).then(f.resolve,p=>{p!==Qt&&f.reject(p)}).finally(Hr)}catch(p){f.reject(p),Hr()}if(v){if(Je){if(c.deps!==null)for(let p=0;p{v&&(Je=null),u?.(),l.delete(f),g!==Zn&&(_.activate(),g?(o.f|=8388608,Tt(o,g)):((o.f&8388608)!==0&&(o.f^=8388608),Tt(o,p),v&&r!==void 0&&(un.add(o),setTimeout(()=>{un.has(o)&&(c.f&16384)===0&&(Ps(o.label,r),un.delete(o))}))),_.deactivate())};f.promise.then(d,p=>d(null,p||"unknown"))}),Te(()=>{for(let c of l)c.reject(Zn)}),v&&(o.f|=4194304),new Promise(c=>{function f(_){function u(){_===s?c(o):f(s)}_.then(u,u)}f(s)})}function Bo(e){let t=hr(e);return ye||Qn(t),t}function Vr(e){let t=hr(e);return t.equals=Ln,t}function ci(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r5){let o=yt("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 s=e;(e.f&2048)!==0&&dn(s),ke===null&&Dr(s)}e.wv=Br(),pi(e,2048,r),Mt()&&E!==null&&(E.f&1024)!==0&&(E.f&96)===0&&(ct===null?_i([e]):ct.push(e)),!n.is_fork&&gr.size>0&&!Vo&&Kn()}return t}function Kn(){Vo=!1;for(let e of gr){(e.f&1024)!==0&&W(e,4096);let t;try{t=Kt(e)}catch{t=!0}t&&Et(e)}gr.clear()}function mr(e){R(e,e.v+1)}function pi(e,t,r){var n=e.reactions;if(n!==null)for(var s=Mt(),o=n.length,a=0;a{if(or===a)return u();var d=C,p=or;fe(null),Uo(a);var g=u();return fe(d),Uo(p),g};n&&(r.set("length",Ft(e.length,o)),v&&(e=Ra(e)));var c="";let f=!1;function _(u){if(!f){f=!0,c=u,Be(s,\`\${c} version\`);for(let[d,p]of r)Be(p,br(c,d));f=!1}}return new Proxy(e,{defineProperty(u,d,p){(!("value"in p)||p.configurable===!1||p.enumerable===!1||p.writable===!1)&&Ds();var g=r.get(d);return g===void 0?l(()=>{var y=Ft(p.value,o);return r.set(d,y),v&&typeof d=="string"&&Be(y,br(c,d)),y}):R(g,p.value,!0),!0},deleteProperty(u,d){var p=r.get(d);if(p===void 0){if(d in u){let g=l(()=>Ft(re,o));r.set(d,g),mr(s),v&&Be(g,br(c,d))}}else R(p,re),mr(s);return!0},get(u,d,p){if(d===Ce)return e;if(v&&d===On)return _;var g=r.get(d),y=d in u;if(g===void 0&&(!y||tt(u,d)?.writable)&&(g=l(()=>{var N=nr(y?u[d]:re),B=Ft(N,o);return v&&Be(B,br(c,d)),B}),r.set(d,g)),g!==void 0){var x=i(g);return x===re?void 0:x}return Reflect.get(u,d,p)},getOwnPropertyDescriptor(u,d){var p=Reflect.getOwnPropertyDescriptor(u,d);if(p&&"value"in p){var g=r.get(d);g&&(p.value=i(g))}else if(p===void 0){var y=r.get(d),x=y?.v;if(y!==void 0&&x!==re)return{enumerable:!0,configurable:!0,value:x,writable:!0}}return p},has(u,d){if(d===Ce)return!0;var p=r.get(d),g=p!==void 0&&p.v!==re||Reflect.has(u,d);if(p!==void 0||E!==null&&(!g||tt(u,d)?.writable)){p===void 0&&(p=l(()=>{var x=g?nr(u[d]):re,N=Ft(x,o);return v&&Be(N,br(c,d)),N}),r.set(d,p));var y=i(p);if(y===re)return!1}return g},set(u,d,p,g){var y=r.get(d),x=d in u;if(n&&d==="length")for(var N=p;NFt(re,o)),r.set(N+"",B),v&&Be(B,br(c,N)))}if(y===void 0)(!x||tt(u,d)?.writable)&&(y=l(()=>Ft(void 0,o)),v&&Be(y,br(c,d)),R(y,nr(p)),r.set(d,y));else{x=y.v!==re;var F=l(()=>nr(p));R(y,F)}var K=Reflect.getOwnPropertyDescriptor(u,d);if(K?.set&&K.set.call(g,p),!x){if(n&&typeof d=="string"){var S=r.get("length"),w=Number(d);Number.isInteger(w)&&w>=S.v&&R(S,w+1)}mr(s)}return!0},ownKeys(u){i(s);var d=Reflect.ownKeys(u).filter(y=>{var x=r.get(y);return x===void 0||x.v!==re});for(var[p,g]of r)g.v!==re&&!(p in u)&&d.push(p);return d},setPrototypeOf(){Ms()}})}function br(e,t){return typeof t=="symbol"?\`\${e}[Symbol(\${t.description??""})]\`:Aa.test(t)?\`\${e}.\${t}\`:/^\\d+$/.test(t)?\`\${e}[\${t}]\`:\`\${e}['\${t}']\`}function eo(e){try{if(e!==null&&typeof e=="object"&&Ce in e)return e[Ce]}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 s=Reflect.get(t,r,n);return Na.has(r)?function(...o){di();var a=s.apply(this,o);return Kn(),a}:s}})}function vi(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t();let{indexOf:r,lastIndexOf:n,includes:s}=e;e.indexOf=function(o,a){let l=r.call(this,o,a);if(l===-1){for(let c=a??0;c{e.indexOf=r,e.lastIndexOf=n,e.includes=s}}var jo,mi,ln,hi,gi;function to(){if(jo===void 0){jo=window,mi=document,ln=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;hi=tt(t,"firstChild").get,gi=tt(t,"nextSibling").get,bo(e)&&(e[Jr]=void 0,e[In]=null,e[Qr]=void 0,e.__e=void 0),bo(r)&&(r[en]=void 0),v&&(e.__svelte_meta=null,vi())}}function ue(e=""){return document.createTextNode(e)}function ce(e){return hi.call(e)}function xe(e){return gi.call(e)}function h(e,t){if(!T)return ce(e);var r=ce(D);if(r===null)r=D.appendChild(ue());else if(t&&r.nodeType!==ur){var n=ue();return r?.before(n),j(n),n}return t&&vn(r),j(r),r}function Ne(e,t=!1){if(!T){var r=ce(e);return r instanceof Comment&&r.data===""?xe(r):r}if(t){if(D?.nodeType!==ur){var n=ue();return D?.before(n),j(n),n}vn(D)}return D}function $(e,t=1,r=!1){let n=T?D:e;for(var s;t--;)s=n,n=xe(n);if(!T)return n;if(r){if(n?.nodeType!==ur){var o=ue();return n===null?s?.after(o):n.before(o),j(o),o}vn(n)}return j(n),n}function _n(e){e.textContent=""}function ro(){if(!ye||vt!==null)return!1;var e=E.f;return(e&32768)!==0}function kt(e,t,r){let n=r?{is:r}:void 0;return document.createElementNS(t??Dn,e,n)}function vn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===ur;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function sr(e){var t=C,r=E;fe(null),ae(null);try{return e()}finally{fe(t),ae(r)}}function Wo(e){E===null&&(C===null&&Rs(e),Ns()),mt&&As(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 St(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:P,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=nt),I?.register_created_effect(n);var s=n;if((e&4)!==0)_r!==null?_r.push(n):st.ensure().schedule(n);else if(t!==null){try{Et(n)}catch(a){throw ie(n),a}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&524288)===0&&(s=s.first,(e&16)!==0&&(e&65536)!==0&&s!==null&&(s.f|=65536))}if(s!==null&&(s.parent=r,r!==null&&Oa(s,r),C!==null&&(C.f&2)!==0&&(e&64)===0)){var o=C;(o.effects??=[]).push(s)}return n}function Ut(){return C!==null&&!Ge}function Te(e){let t=St(8,null);return W(t,1024),t.teardown=e,t}function mn(e){Wo("$effect"),v&&$e(e,"name",{value:"$effect"});var t=E.f,r=!C&&(t&32)!==0&&(t&32768)===0;if(r){var n=P;(n.e??=[]).push(e)}else return To(e)}function To(e){return St(1048580,e)}function hn(e){return Wo("$effect.pre"),v&&$e(e,"name",{value:"$effect.pre"}),St(1048584,e)}function no(e){st.ensure();let t=St(524352,e);return()=>{ie(t)}}function yi(e){st.ensure();let t=St(524352,e);return(r={})=>new Promise(n=>{r.outro?qt(t,()=>{ie(t),n(void 0)}):(ie(t),n(void 0))})}function ht(e){return St(4,e)}function Y(e,t){var r=P,n={effect:null,ran:!1,deps:e};r.l.$.push(n),n.effect=Se(()=>{if(e(),!n.ran){n.ran=!0;var s=E;try{ae(s.parent),b(t)}finally{ae(s)}}})}function We(){var e=P;Se(()=>{for(var t of e.l.$){t.deps();var r=t.effect;(r.f&1024)!==0&&r.deps!==null&&W(r,4096),Kt(r)&&Et(r),t.ran=!1}})}function ui(e){return St(4718592,e)}function Se(e,t=0){return St(8|t,e)}function G(e,t=[],r=[],n=[]){Xn(n,t,r,s=>{St(8,()=>e(...s.map(i)))})}function at(e,t=0){var r=St(16|t,e);return v&&(r.dev_stack=Dt),r}function ge(e){return St(524320,e)}function Ko(e){var t=e.teardown;if(t!==null){let r=mt,n=C;Go(!0),fe(null);try{t.call(null)}finally{Go(r),fe(n)}}}function pn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){let s=r.ac;s!==null&&sr(()=>{s.abort(Qt)});var n=r.next;(r.f&64)!==0?r.parent=null:ie(r,t),r=n}}function wi(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&&(Xo(e.nodes.start,e.nodes.end),r=!0),W(e,33554432),pn(e,t&&!r),$r(e,0);var n=e.nodes&&e.nodes.t;if(n!==null)for(let o of n)o.stop();Ko(e),e.f^=33554432,e.f|=16384;var s=e.parent;s!==null&&s.first!==null&&Io(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 Xo(e,t){for(;e!==null;){var r=e===t?null:xe(e);e.remove(),e=r}}function Io(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 qt(e,t,r=!0){var n=[];Ei(e,n,!0);var s=()=>{r&&ie(e),t&&t()},o=n.length;if(o>0){var a=()=>--o||s();for(var l of n)l.out(a)}else s()}function Ei(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 s=e.first;s!==null;){var o=s.next;if((s.f&64)===0){var a=(s.f&65536)!==0||(s.f&32)!==0&&(e.f&16)!==0;Ei(s,t,a?r:!1)}s=o}}}function gn(e){Ti(e,!0)}function Ti(e,t){if((e.f&8192)!==0){e.f^=8192,(e.f&1024)===0&&(W(e,2048),st.ensure().schedule(e));for(var r=e.first;r!==null;){var n=r.next,s=(r.f&65536)!==0||(r.f&32)!==0;Ti(r,s?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 Yr(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var s=r===n?null:xe(r);t.append(r),r=s}}var ki=null;var oo=!1,mt=!1;function Go(e){mt=e}var C=null,Ge=!1;function fe(e){C=e}var E=null;function ae(e){E=e}var lt=null;function Qn(e){C!==null&&(!ye||(C.f&2)!==0)&&(lt===null?lt=[e]:lt.push(e))}var Ae=null,je=0,ct=null;function _i(e){ct=e}var Si=1,xr=0,or=xr;function Uo(e){or=e}function Br(){return++Si}function Kt(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,s=0;se.wv)return!0}(t&512)!==0&&ke===null&&W(e,1024)}return!1}function Ai(e,t,r=!0){var n=e.reactions;if(n!==null&&!(!ye&<!==null&&bt.call(lt,e)))for(var s=0;s{e.ac.abort(Qt)}),e.ac=null);try{e.f|=2097152;var _=e.fn,u=_();e.f|=32768;var d=e.deps,p=I?.is_fork;if(Ae!==null){var g;if(p||$r(e,je),d!==null&&je>0)for(d.length=je+Ae.length,g=0;g>>0).toString(36)}var qa=["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 Pp=[...qa,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var Fa=["touchstart","touchmove"];function Oi(e){return Fa.includes(e)}var La=["$state","$state.raw","$derived","$derived.by"],zp=[...La,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];function io(e){return e?.replace(/\\//g,"/\\u200B")}var Ii=new Map;function Di(e,t){var r=Ii.get(e);r||(r=new Set,Ii.set(e,r)),r.add(t)}var ao=Symbol("events"),Fi=new Set,Zo=new Set;function Li(e,t,r,n={}){function s(o){if(n.capture||lo.call(t,o),!o.cancelBubble)return sr(()=>r?.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?we(()=>{t.addEventListener(e,s,n)}):t.addEventListener(e,s,n),s}function Zt(e,t,r,n,s){var o={capture:n,passive:s},a=Li(e,t,r,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Te(()=>{t.removeEventListener(e,a,o)})}var qi=null;function lo(e){var t=this,r=t.ownerDocument,n=e.type,s=e.composedPath?.()||[],o=s[0]||e.target;qi=e;var a=0,l=qi===e&&e[ao];if(l){var c=s.indexOf(l);if(c!==-1&&(t===document||t===window)){e[ao]=t;return}var f=s.indexOf(t);if(f===-1)return;c<=f&&(a=c)}if(o=s[a]||e.target,o!==t){$e(e,"currentTarget",{configurable:!0,get(){return o||r}});var _=C,u=E;fe(null),ae(null);try{for(var d,p=[];o!==null;){var g=o.assignedSlot||o.parentNode||o.host||null;try{var y=o[ao]?.[n];y!=null&&(!o.disabled||e.target===o)&&y.call(o,e)}catch(x){d?p.push(x):d=x}if(e.cancelBubble||g===t||g===null)break;o=g}if(d){for(let x of p)queueMicrotask(()=>{throw x});throw d}}finally{e[ao]=t,delete e.currentTarget,fe(_),ae(u)}}}var za=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Pi(e){return za?.createHTML(e)??e}function Jo(e){var t=kt("template");return t.innerHTML=Pi(e.replaceAll("","")),t.content}function ft(e,t){var r=E;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function L(e,t){var r=(t&1)!==0,n=(t&2)!==0,s,o=!e.startsWith("");return()=>{if(T)return ft(D,null),D;s===void 0&&(s=Jo(o?e:""+e),r||(s=ce(s)));var a=n||ln?document.importNode(s,!0):s.cloneNode(!0);if(r){var l=ce(a),c=a.lastChild;ft(l,c)}else ft(a,a);return a}}function Lt(e=""){if(!T){var t=ue(e+"");return ft(t,t),t}var r=D;return r.nodeType!==ur?(r.before(r=ue()),j(r)):vn(r),ft(r,r),r}function O(e,t){if(T){var r=E;((r.f&32768)===0||r.nodes.end===null)&&(r.nodes.end=D),be();return}e!==null&&e.before(t)}var Qo=!0;function A(e,t){var r=t==null?"":typeof t=="object"?\`\${t}\`:t;r!==(e[en]??=e.nodeValue)&&(e[en]=r,e.nodeValue=\`\${r}\`)}function jr(e,t){return zi(e,t)}function ts(e,t){to(),t.intro=t.intro??!1;let r=t.target,n=T,s=D;try{for(var o=ce(r);o&&(o.nodeType!==rt||o.data!=="[");)o=xe(o);if(!o)throw Rt;de(!0),j(o);let a=zi(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!==Rt&&console.warn("Failed to hydrate: ",a),t.recover===!1&&Os(),to(),_n(r),de(!1),jr(e,t)}finally{de(n),j(s)}}var co=new Map;function zi(e,{target:t,anchor:r,props:n={},events:s,context:o,intro:a=!0,transformError:l}){to();var c=void 0,f=yi(()=>{var _=r??t.appendChild(ue());qo(_,{pending:()=>{}},p=>{pe({});var g=P;if(o&&(g.c=o),s&&(n.$$events=s),T&&ft(p,null),Qo=a,c=e(p,n)||{},Qo=!0,T&&(E.nodes.end=D,D===null||D.nodeType!==rt||D.data!=="]"))throw er(),Rt;_e()},l);var u=new Set,d=p=>{for(var g=0;g{for(var p of u)for(let x of[t,document]){var g=co.get(x),y=g.get(p);--y==0?(x.removeEventListener(p,lo),g.delete(p),g.size===0&&co.delete(x)):g.set(p,y)}Zo.delete(d),_!==r&&_.parentNode?.removeChild(_)}});return es.set(c,f),c}var es=new WeakMap;function rs(e,t){let r=es.get(e);return r?(es.delete(e),r(t)):(v&&(Ce in e?Vs():Hs()),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}#s=t=>{if(this.#e.has(t)){var r=this.#e.get(t),n=this.#t.get(r);if(n)gn(n),this.#l.delete(r);else{var s=this.#r.get(r);s&&(this.#t.set(r,s.effect),this.#r.delete(r),v&&(s.fragment.lastChild[xo]=this.anchor),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),n=s.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 f=document.createDocumentFragment();Yr(a,f),f.append(ue()),this.#r.set(o,{effect:a,fragment:f})}else ie(a);this.#l.delete(o),this.#t.delete(o)};this.#n||!n?(this.#l.add(o),qt(a,l,!1)):l()}}};#o=t=>{this.#e.delete(t);let r=Array.from(this.#e.values());for(let[n,s]of this.#r)r.includes(n)||(ie(s.effect),this.#r.delete(n))};ensure(t,r){var n=I,s=ro();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(s){var o=document.createDocumentFragment(),a=ue();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),s){for(let[l,c]of this.#t)l===t?n.unskip_effect(c):n.skip_effect(c);for(let[l,c]of this.#r)l===t?n.unskip_effect(c.effect):n.skip_effect(c.effect);n.oncommit(this.#s),n.ondiscard(this.#o)}else T&&(this.anchor=D),this.#s(n)}};function le(e,t,r=!1){var n;T&&(n=D,be());var s=new Jt(e),o=r?65536:0;function a(l,c){if(T){var f=on(n);if(l!==parseInt(f.substring(1))){var _=It();j(_),s.anchor=_,de(!1),s.ensure(l,c),de(!0);return}}s.ensure(l,c)}at(()=>{var l=!1;t((c,f=0)=>{l=!0,a(f,c)}),l||a(-1,null)},o)}function Xa(e,t,r){for(var n=[],s=t.length,o,a=t.length,l=0;l{if(o){if(o.pending.delete(u),o.done.add(u),o.pending.size===0){var d=e.outrogroups;ns(e,Nr(o.done)),d.delete(o),d.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var c=n.length===0&&r!==null;if(c){var f=r,_=f.parentNode;_n(_),_.append(f),e.items.clear()}ns(e,t,!c)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function ns(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 s=0;s{var F=r();return Vt(F)?F:F==null?[]:Nr(F)});v&&Be(u,"{#each ...}");var d,p=new Map,g=!0;function y(F){(B.effect.f&16384)===0&&(B.pending.delete(F),B.fallback=_,Za(B,d,a,t,n),_!==null&&(d.length===0?(_.f&33554432)===0?gn(_):(_.f^=33554432,bn(_,null,a)):qt(_,()=>{_=null})))}function x(F){B.pending.delete(F)}var N=at(()=>{d=i(u);var F=d.length;let K=!1;if(T){var S=on(a)==="[!";S!==(F===0)&&(a=It(),j(a),de(!1),K=!0)}for(var w=new Set,M=I,te=ro(),oe=0;oeo(a)):(_=ge(()=>o(Bi??=ue())),_.f|=33554432)),F>w.size&&(v?Qa(d,n):wo("","","")),T&&F>0&&j(It()),!g)if(p.set(M,w),te){for(let[Re,Ke]of l)w.has(Re)||M.skip_effect(Ke.e);M.oncommit(y),M.ondiscard(x)}else y(M);K&&de(!0),i(u)}),B={effect:N,flags:t,items:l,pending:p,outrogroups:null,fallback:_};g=!1,T&&(a=D)}function $n(e){for(;e!==null&&(e.f&32)===0;)e=e.next;return e}function Za(e,t,r,n,s){var o=(n&8)!==0,a=t.length,l=e.items,c=$n(e.effect.first),f,_=null,u,d=[],p=[],g,y,x,N;if(o)for(N=0;N0){var oe=(n&4)!==0&&a===0?r:null;if(o){for(N=0;N{if(u!==void 0)for(x of u)x.nodes?.a?.apply()})}function Ja(e,t,r,n,s,o,a,l){var c=(a&1)!==0?(a&16)===0?q(r,!1,!1):Ue(r):null,f=(a&2)!==0?Ue(s):null;return v&&c&&(c.trace=()=>{l()[f?.v??s]}),{v:c,i:f,e:ge(()=>(o(t,c??r,f??s,l),()=>{e.delete(n)}))}}function bn(e,t,r){if(e.nodes)for(var n=e.nodes.start,s=e.nodes.end,o=t&&(t.f&33554432)===0?t.nodes.start:r;n!==null;){var a=xe(n);if(o.before(n),n===s)return;n=a}}function ir(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 s=0;s{var f=E;if(l===(l=t()??"")){T&&be();return}if(r&&!T){f.nodes=null,c.innerHTML=l,l!==""&&ft(ce(c),c.lastChild);return}if(f.nodes!==null&&(Xo(f.nodes.start,f.nodes.end),f.nodes=null),l!==""){if(T){for(var _=D.data,u=be(),d=u;u!==null&&(u.nodeType!==rt||u.data!=="");)d=u,u=xe(u);if(u===null)throw er(),Rt;v&&!o&&el(u.parentNode,_,l),ft(D,d),a=j(u);return}var p=n?tn:s?Eo:void 0,g=kt(n?"svg":s?"math":"template",p);g.innerHTML=l;var y=n||s?g:g.content;if(ft(ce(y),y.lastChild),n||s)for(;ce(y);)a.before(ce(y));else a.before(y)}})}function qe(e,t){ht(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){let s=kt("style");s.id=t.hash,s.textContent=t.code,n.appendChild(s),v&&Di(t.hash,s)}})}var Hi=[...\` +\\r\\f\\xA0\\v\\uFEFF\`];function Ui(e,t,r){var n=e==null?"":""+e;if(t&&(n=n?n+" "+t:t),r){for(var s of Object.keys(r))if(r[s])n=n?n+" "+s:s;else if(n.length)for(var o=s.length,a=0;(a=n.indexOf(s,a))>=0;){var l=a+o;(a===0||Hi.includes(n[a-1]))&&(l===n.length||Hi.includes(n[l]))?n=(a===0?"":n.substring(0,a))+n.substring(l+1):a=l}}return n===""?null:n}function Vi(e,t=!1){var r=t?" !important;":";",n="";for(var s of Object.keys(e)){var o=e[s];o!=null&&o!==""&&(n+=" "+s+": "+o+r)}return n}function os(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function ji(e,t){if(t){var r="",n,s;if(Array.isArray(t)?(n=t[0],s=t[1]):n=t,e){e=String(e).replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g,"").trim();var o=!1,a=0,l=!1,c=[];n&&c.push(...Object.keys(n).map(os)),s&&c.push(...Object.keys(s).map(os));var f=0,_=-1;let y=e.length;for(var u=0;ut.trim().split(" ").filter(Boolean))}function bl(e,t){var r=Wi(e.srcset),n=Wi(t);return n.length===r.length&&n.every(([s,o],a)=>o===r[a][1]&&(is(r[a][0],s)||is(s,r[a][0])))}function Fe(e=!1){let t=P,r=t.l.u;if(!r)return;let n=()=>z(t.s);if(e){let s=0,o={},a=hr(()=>{let l=!1,c=t.s;for(let f in c)c[f]!==o[f]&&(o[f]=c[f],l=!0);return l&&s++,s});n=()=>i(a)}r.b.length&&hn(()=>{Zi(t,n),Rr(r.b)}),mn(()=>{let s=b(()=>r.m.map(xs));return()=>{for(let o of s)typeof o=="function"&&o()}}),r.a.length&&mn(()=>{Zi(t,n),Rr(r.a)})}function Zi(e,t){if(e.l.s)for(let r of e.l.s)i(r);t()}function Ji(e){return new as(e)}var as=class{#e;#t;constructor(t){var r=new Map,n=(o,a)=>{var l=q(a,!1,!1);return r.set(o,l),l};let s=new Proxy({...t.props||{},$$events:{}},{get(o,a){return i(r.get(a)??n(a,Reflect.get(o,a)))},has(o,a){return a===Cn?!0:(i(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?ts:jr)(t.component,{target:t.target,anchor:t.anchor,props:s,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),!ye&&(!t?.props?.$$host||t.sync===!1)&&zr(),this.#e=s.$$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(s,o)},this.#t.$destroy=()=>{rs(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];let n=(...s)=>r.call(this,...s);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(s=>s!==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 s=>{let o=kt("slot");n!=="default"&&(o.name=n),O(s,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 s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=ls(s,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=Ji({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=no(()=>{Se(()=>{this.$$r=!0;for(let n of go(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];let s=ls(n,this.$$d[n],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,s)}this.$$r=!1})});for(let n in this.$$l)for(let s of this.$$l[n]){let o=this.$$c.$on(n,s);this.$$l_u.set(s,o)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=ls(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 go(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function ls(e,t,r,n){let s=r[e]?.type;if(t=s==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(s){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(s){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;Is(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");js();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 cs(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 cs(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}async function Qi(e){return Il(Ol.compressionToggle,{enabled:e})}function xn(e,t){let r=()=>{};return{subscribe:So({data:null,error:null,loading:!0},s=>{let o=!1,a=null,l=null,c=async()=>{try{let f=await cs(e);if(o)return;l=f,s({data:f,error:null,loading:!1})}catch(f){if(o)return;s({data:l,error:f.message,loading:!1})}};return r=()=>{c()},c(),a=setInterval(c,t),()=>{o=!0,r=()=>{},a&&clearInterval(a)}}).subscribe,run:()=>r()}}var Gr=xn("/proxy-stats",2e3),Tr=xn("/proxy-recent",2e3),ea=xn("/api/sessions.json",5e3),m0=xn("/api/stats.json",5e3),yn=qr(null);function Dl(){let{subscribe:e,update:t}=qr([]),r=1;return{subscribe:e,push(n,s){let o=r++;t(a=>[...a,{id:o,level:n,text:s}]),setTimeout(()=>t(a=>a.filter(l=>l.id!==o)),5e3)},dismiss(n){t(s=>s.filter(o=>o.id!==n))}}}var wn=Dl();function k(e){return Math.round(Number(e)||0).toLocaleString()}function ta(e){if(!e)return"-";let t=String(e).split("/");return t[t.length-1]||e}function po(e){return e==null?"":String(e).replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}var Ml=L('
show calculation
'),ql=L('
show calculation
'),Fl=L('
',1),Ll=L('
small sample
',1),Pl=L('
show calculation
'),zl=L('
show calculation
'),Bl=L('
diagnostic: counterfactual "share of spend saved"
share of spend saved (counterfactual):
'),Yl=L('
requests
input tokens saved
cache-aware, input-side only
$ saved
at $5/M input tokens (Opus 4.7)
compressed $/req
passthrough $/req
compressed \\u2212 passthrough $/req
token-equivalent total
input + 5\\xD7output billed at 5\\xD7 input rate
',1),Hl={hash:"svelte-rhs7qr",code:\`.grid.svelte-rhs7qr {display:grid;grid-template-columns:repeat(6, 1fr);gap:14px;margin-bottom:22px;} + @media (max-width: 1400px) {.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;}.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', + }.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;}.value.small-sample.svelte-rhs7qr {color:#8b949e;font-size:18px;font-weight:500;}.diagnostic.svelte-rhs7qr {margin:0 0 22px;font-size:12px;color:#8b949e;}.diagnostic.svelte-rhs7qr summary {cursor:pointer;user-select:none;color:#58a6ff;padding:6px 0;}.diagnostic.svelte-rhs7qr summary::-webkit-details-marker {display:none;}.diagnostic.svelte-rhs7qr summary::before {content:'\\u25B8 ';color:#6e7681;font-size:9px;}.diagnostic.svelte-rhs7qr [open] summary::before {content:'\\u25BE ';}.diagnostic-body.svelte-rhs7qr {background:#161b22;border:1px solid #30363d;border-radius:6px;padding:12px 14px;margin-top:6px;}.diag-headline.svelte-rhs7qr {color:#c9d1d9;margin-bottom:8px;}.diag-headline.svelte-rhs7qr .pos:where(.svelte-rhs7qr) {color:#3fb950;font-weight:600;}.diag-headline.svelte-rhs7qr .neg:where(.svelte-rhs7qr) {color:#f85149;font-weight:600;}.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=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_baseline_equivalent + 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". Denominator = what the user WOULD have paid with no pixelpipe \\u2014 measured rows use their cache-aware baseline, unmeasured/passthrough rows fall back to actual (pixelpipe didn't run there, so counterfactual = actual). Dividing by counterfactual bill instead of actual bill keeps the ratio bounded at 100%; saved/actual is unbounded because pixelpipe shrinks the denominator.
\`+c("saved",s(o).saved_input_tokens,"(measured-rows numerator; cache-aware)")+c("all_baseline_equivalent",s(o).all_baseline_equivalent_weighted,"(every paid request, weighted; baseline on measured + actual on the rest)")+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_counterfactual_total",s(o).all_baseline_equivalent_weighted+s(o).all_output_weighted,'= all_baseline_equivalent + all_output')+c("share_of_spend",(s(o).saved_pct_of_all_spend||0).toFixed(1)+"%",'= saved / all_counterfactual_total \\xD7 100')+c("all_usage_requests",s(o).all_usage_requests,"(denominator request count - compressed + passthrough + probe-failed)")+'measured numerator, all-rows counterfactual denominator - bounded at 100%':"")}),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;} + 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 fs(e,t){pe(t,!1),qe(e,Hl);let r=()=>Ee(Gr,"$stats",n),[n,s]=Me(),o=q(),a=q(),l=q(),c=q(),f=q(),_=q(),u=q(),d=q();function p(H,V,Z){let Pe=typeof V=="number"?k(V):String(V??"-");return'
'+H+': '+po(Pe)+' '+(Z||"")+"
"}Y(()=>r(),()=>{R(o,r().data)}),Y(()=>i(o),()=>{R(a,i(o)?.pricing_assumptions??null)}),Y(()=>(i(o),i(a)),()=>{R(l,i(o)&&i(a)?'
formula: saved = baseline - actual
weights: input\\xD71.0, cache_create\\xD71.25, cache_read\\xD70.10
'+p("baseline",i(o).baseline_input_weighted,"(cache-aware: cacheable\\xD7weight + cold_tail)")+p("actual",i(o).actual_input_weighted,"(input + cc\\xD71.25 + cr\\xD70.10 from usage)")+p("saved",i(o).saved_input_tokens,'= baseline - actual')+'output excluded - identical with/without compression':"")}),Y(()=>i(a),()=>{R(c,i(a)?i(a).input_per_mtok:0)}),Y(()=>(i(o),i(a),i(c),po),()=>{R(f,i(o)&&i(a)?'
formula: $ saved = $ \\xD7 '+i(c)+'/Mtok
'+p("saved_tokens",i(o).saved_input_tokens,"(cache-aware, input-side)")+p("saved_usd",\`$\${(i(o).saved_usd||0).toFixed(4)}\\xA0\`,'= saved_tokens \\xD7 input_rate / 1e6')+\`source: \${po(i(a).source||"docs.anthropic.com pricing")}\`:"")}),Y(()=>(i(o),i(a)),()=>{R(_,i(o)&&i(a)?'
formula: share_of_spend = saved / (all_baseline_equivalent + all_output \\xD7 '+(i(a).output_multiplier??5)+\`)
why this is diagnostic, not the headline: this is a counterfactual ("what the user WOULD have paid"). It depends on the count_tokens probe, the cache-aware baseline split, and an Opus 4.7 input-rate assumption. Useful as a sanity check, but the operator's real question is "did the compressed path cost less per request than the passthrough path on real traffic" \\u2014 that's the headline split above, no counterfactuals.
\`+p("saved",i(o).saved_input_tokens,"(measured-rows numerator; cache-aware)")+p("all_baseline_equivalent",i(o).all_baseline_equivalent_weighted,"(every paid request, weighted; baseline on measured + actual on the rest)")+p("all_output \\xD7 "+(i(a).output_multiplier??5),i(o).all_output_weighted,"(every paid request, output \\xD7 "+(i(a).output_multiplier??5)+")")+p("all_counterfactual_total",i(o).all_baseline_equivalent_weighted+i(o).all_output_weighted,'= all_baseline_equivalent + all_output')+p("share_of_spend",(i(o).saved_pct_of_all_spend||0).toFixed(1)+"%",'= saved / all_counterfactual_total \\xD7 100')+p("all_usage_requests",i(o).all_usage_requests,"(denominator request count - compressed + passthrough + probe-failed)")+'measured numerator, all-rows counterfactual denominator - bounded at 100%':"")}),Y(()=>(i(o),i(a)),()=>{R(u,i(o)&&i(a)?'
formula: bucket_$ = (\\u03A3 actual_input + \\u03A3 output \\xD7 '+(i(a).output_multiplier??5)+") \\xD7 $"+(i(a).input_per_mtok??5)+'/Mtok
why: partition the paid-rows set by which path actually ran this turn (\`info.compressed = true\` for slab/history compression; false for passthrough or bypassed). Same $/Mtok rate on both sides so the rate-assumption bias cancels in the delta. Selection bias (the gate routes each turn) does NOT cancel \\u2014 interpret with sample counts.
'+p("compressed (n="+i(o).compressed_paid_requests+")","$"+(i(o).compressed_actual_usd||0).toFixed(4),"total \\xB7 avg $"+(i(o).compressed_avg_usd_per_request||0).toFixed(4)+"/req")+p("passthrough (n="+i(o).passthrough_paid_requests+")","$"+(i(o).passthrough_actual_usd||0).toFixed(4),"total \\xB7 avg $"+(i(o).passthrough_avg_usd_per_request||0).toFixed(4)+"/req")+p("compressed \\u2212 passthrough","$"+(i(o).compressed_minus_passthrough_avg_usd||0).toFixed(4)+"/req",i(o).split_sufficient_sample?"(both buckets \\u2265 "+i(o).split_min_sample_per_bucket+" \\u2014 delta is meaningful)":"(small sample: need \\u2265 "+i(o).split_min_sample_per_bucket+" per bucket; treat delta as noisy)")+'no counterfactual, no probe gate \\u2014 pure observed $/req on each path':"")}),Y(()=>(i(o),i(a)),()=>{R(d,i(o)&&i(a)?'
formula: token_equivalent = input + output \\xD7 '+(i(a).output_multiplier??5)+\`
why: matches Anthropic's per-Mtok price ratio ($\`+(i(a).input_per_mtok??5)+" input vs $"+(i(a).input_per_mtok??5)*(i(a).output_multiplier??5)+' output)
'+p("actual_input",i(o).actual_input_weighted,"(weighted upstream usage)")+'
+ = raw output_tokens (already weighted)
'+p("actual_token_equivalent",i(o).actual_token_equivalent)+p("baseline_token_equivalent",i(o).baseline_token_equivalent,"(unproxied counterfactual, same \\xD7 "+(i(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.
'+p("events_with_measurement",i(o).events_with_measurement,"(events where SSE/JSON scanner produced char counts)")+p("measured_text_chars",i(o).measured_text_chars,"(content_block_delta \\xB7 text_delta + response content[].text)")+p("measured_thinking_chars",i(o).measured_thinking_chars,"(content_block_delta \\xB7 thinking_delta + response reasoning text)")+p("measured_tool_use_chars",i(o).measured_tool_use_chars,"(content_block_delta \\xB7 input_json_delta + tool_use blocks)")+p("measured_redacted_blocks",i(o).measured_redacted_block_count,"(opaque encrypted blocks - chars unavailable, billed but unmeasurable)")+'measured - no estimation':"")}),We(),Fe();var g=Yl(),y=Ne(g),x=h(y),N=$(h(x),2),B=h(N,!0);m(N);var F=$(N,2),K=h(F);m(F),m(x);var S=$(x,2),w=$(h(S),2),M=h(w,!0);m(w);var te=$(w,4);{var oe=H=>{var V=Ml(),Z=$(h(V),2);wr(Z,()=>i(l),!0),m(Z),m(V),O(H,V)};le(te,H=>{i(o)&&i(a)&&H(oe)})}m(S);var Q=$(S,2),U=$(h(Q),2),se=h(U);m(U);var X=$(U,4);{var Re=H=>{var V=ql(),Z=$(h(V),2);wr(Z,()=>i(f),!0),m(Z),m(V),O(H,V)};le(X,H=>{i(o)&&i(a)&&H(Re)})}m(Q);var Ke=$(Q,2),zt=$(h(Ke),2),Bt=h(zt);m(zt);var Le=$(zt,2),Xe=h(Le);m(Le),m(Ke);var ut=$(Ke,2),Nt=$(h(ut),2),gt=h(Nt);m(Nt);var Qe=$(Nt,2),kr=h(Qe);m(Qe),m(ut);var Wr=$(ut,2),Sr=$(h(Wr),2);{var En=H=>{var V=Fl(),Z=Ne(V);let Pe;var et=h(Z);m(Z);var $t=$(Z,2),Yt=h($t);m($t),G(Ht=>{Pe=At(Z,1,"value svelte-rhs7qr",null,Pe,{pos:(i(o)?.compressed_minus_passthrough_avg_usd??0)<=0,neg:(i(o)?.compressed_minus_passthrough_avg_usd??0)>0}),A(et,\`\${i(o),b(()=>(i(o)?.compressed_minus_passthrough_avg_usd??0)>=0?"+$ ":"-$ ")??""}\${Ht??""}\`),A(Yt,\`negative = compressed path cheaper \\xB7 both buckets \\u2265 \${i(o),b(()=>i(o)?.split_min_sample_per_bucket)??""}\`)},[()=>(i(o),b(()=>Math.abs(i(o)?.compressed_minus_passthrough_avg_usd??0).toFixed(4)))]),O(H,V)},_o=H=>{var V=Ll(),Z=$(Ne(V),2),Pe=h(Z);m(Z),G((et,$t)=>A(Pe,\`need \\u2265 \${i(o),b(()=>i(o)?.split_min_sample_per_bucket)??""} requests per bucket \\xB7 have + \${et??""} / \${$t??""}\`),[()=>(z(k),i(o),b(()=>k(i(o)?.compressed_paid_requests))),()=>(z(k),i(o),b(()=>k(i(o)?.passthrough_paid_requests)))]),O(H,V)};le(Sr,H=>{i(o),b(()=>i(o)?.split_sufficient_sample)?H(En):H(_o,-1)})}var Kr=$(Sr,2);{var Tn=H=>{var V=Pl(),Z=$(h(V),2);wr(Z,()=>i(u),!0),m(Z),m(V),O(H,V)};le(Kr,H=>{i(o)&&i(a)&&H(Tn)})}m(Wr);var kn=$(Wr,2),lr=$(h(kn),2),Sn=h(lr,!0);m(lr);var vo=$(lr,4);{var Xr=H=>{var V=zl(),Z=$(h(V),2);wr(Z,()=>i(d),!0),m(Z),m(V),O(H,V)};le(vo,H=>{i(o)&&i(a)&&H(Xr)})}m(kn),m(y);var An=$(y,2);{var mo=H=>{var V=Bl(),Z=$(h(V),2),Pe=h(Z),et=$(h(Pe));let $t;var Yt=h(et);m(et);var Ht=$(et,2),Zr=h(Ht);m(Ht),m(Pe);var cr=$(Pe,2);wr(cr,()=>i(_),!0),m(cr),m(Z),m(V),G((Ar,ho)=>{$t=At(et,1,"svelte-rhs7qr",null,$t,{pos:(i(o)?.saved_pct_of_all_spend??0)>=0,neg:(i(o)?.saved_pct_of_all_spend??0)<0}),A(Yt,\`\${Ar??""}%\`),A(Zr,\`(\${ho??""} paid req \\xB7 compressed + passthrough + probe-failed)\`)},[()=>(i(o),b(()=>(i(o)?.saved_pct_of_all_spend??0).toFixed(1))),()=>(z(k),i(o),b(()=>k(i(o)?.all_usage_requests)))]),O(H,V)};le(An,H=>{i(o)&&i(a)&&H(mo)})}G((H,V,Z,Pe,et,$t,Yt,Ht,Zr,cr,Ar)=>{A(B,H),A(K,\`\\u2014 \${V??""} compressed\`),A(M,Z),A(se,\`$ \${Pe??""}\`),A(Bt,\`$ \${et??""}\`),A(Xe,\`n=\${$t??""} \\xB7 total $ \${Yt??""}\`),A(gt,\`$ \${Ht??""}\`),A(kr,\`n=\${Zr??""} \\xB7 total $ \${cr??""}\`),A(Sn,Ar)},[()=>(z(k),i(o),b(()=>k(i(o)?.requests))),()=>(z(k),i(o),b(()=>k(i(o)?.compressed_requests))),()=>(z(k),i(o),b(()=>k(i(o)?.saved_input_tokens))),()=>(i(o),b(()=>(i(o)?.saved_usd??0).toFixed(2))),()=>(i(o),b(()=>(i(o)?.compressed_avg_usd_per_request??0).toFixed(4))),()=>(z(k),i(o),b(()=>k(i(o)?.compressed_paid_requests))),()=>(i(o),b(()=>(i(o)?.compressed_actual_usd??0).toFixed(4))),()=>(i(o),b(()=>(i(o)?.passthrough_avg_usd_per_request??0).toFixed(4))),()=>(z(k),i(o),b(()=>k(i(o)?.passthrough_paid_requests))),()=>(i(o),b(()=>(i(o)?.passthrough_actual_usd??0).toFixed(4))),()=>(z(k),i(o),b(()=>k(i(o)?.actual_token_equivalent)))]),O(e,g),_e(),s()}var Vl=L(''),Ul=L('-'),jl=L(' '),Gl=L('no requests yet'),Wl=L('
#statuspathcccrbaselineactualsavedimg
'),Kl={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 us(e,t){pe(t,!1),qe(e,Kl);let r=()=>Ee(Tr,"$recent",n),[n,s]=Me(),o=q();function a(_){return _>=500?"bad":_>=400?"warn":"good"}function l(_){if(!_)return"-";let u=_.split("/");return u[u.length-1]||_}Y(()=>r(),()=>{R(o,r().data?.recent??[])}),We(),Fe();var c=Wl(),f=$(h(c));yr(f,7,()=>(i(o),b(()=>i(o).slice().reverse())),(_,u)=>_.ts+":"+u,(_,u,d)=>{var p=jl(),g=h(p),y=h(g,!0);m(g);var x=$(g),N=h(x,!0);m(x);var B=$(x),F=h(B,!0);m(B);var K=$(B),S=h(K,!0);m(K);var w=$(K),M=h(w,!0);m(w);var te=$(w),oe=h(te,!0);m(te);var Q=$(te),U=h(Q,!0);m(Q);var se=$(Q),X=h(se,!0);m(se);var Re=$(se),Ke=h(Re);{var zt=Le=>{var Xe=Vl();Zt("click",Xe,()=>yn.set(i(u).img_id??null)),O(Le,Xe)},Bt=Le=>{var Xe=Ul();O(Le,Xe)};le(Ke,Le=>{i(u),b(()=>i(u).img_id!=null)?Le(zt):Le(Bt,-1)})}m(Re),m(p),G((Le,Xe,ut,Nt,gt,Qe)=>{A(y,i(d)+1),At(x,1,\`num \${Le??""}\`,"svelte-hn7ohq"),A(N,(i(u),b(()=>i(u).status))),A(F,Xe),A(S,(i(u),b(()=>i(u).cc_added?"\\u2713":"-"))),A(M,ut),A(oe,Nt),A(U,gt),A(X,Qe)},[()=>(i(u),b(()=>a(i(u).status))),()=>(i(u),b(()=>l(i(u).path))),()=>(i(u),z(k),b(()=>i(u).cache_read!=null?k(i(u).cache_read):"-")),()=>(i(u),z(k),b(()=>i(u).baseline_input!=null?k(i(u).baseline_input):"-")),()=>(i(u),z(k),b(()=>i(u).actual_input!=null?k(i(u).actual_input):"-")),()=>(i(u),z(k),b(()=>(i(u).session_saved_so_far_delta??0)>0?"+"+k(i(u).session_saved_so_far_delta??0):"-"))]),O(_,p)},_=>{var u=Gl();O(_,u)}),m(f),m(c),O(e,c),_e(),s()}var Xl=L('
'),Zl=L('
'),Jl=L('
',1),Ql=L('
latest rendered
'),ec=L('
(none yet)
'),tc=L('
',1),rc={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=F(),l=F(),f=F(),u=F(),p=F(),d=F(),c=F();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(),Le();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(),le=g(j);h(j),X(()=>C(le,\`(image #\${s(u)??""} no longer in buffer)\`)),D(oe,j)},U=oe=>{var j=Wl(),le=g(j);h(j),X(()=>{hr(le,"src",s(d)),hr(le,"alt",\`image #\${s(u)??""}\`)}),D(oe,j)};ue(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)};ue(x,S=>{s(u)!=null?S($):s(a)?S(k,1):S(z,-1)})}h(m);var L=b(m,2),H=g(L,!0);h(L),X(()=>C(H,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=F(),a=F(),l=F(),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(),Le();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)};ue(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 L=S=>{var w=rf(),M=Xe(w);mr(M,5,()=>s(a),ee=>ee.id,(ee,U)=>{var oe=tf(),j=g(oe),le=g(j,!0);h(j);var Ze=b(j,2),rr=g(Ze);{var mt=Je=>{var ft=ef();X($r=>Kn(ft,\`width:max(3px,\${$r??""}%)\`),[()=>(s(U),y(()=>d(s(U).tokensSavedEst??0)))]),D(Je,ft)},He=Ao(()=>(s(U),y(()=>d(s(U).tokensSavedEst??0)>0)));ue(rr,Je=>{s(He)&&Je(mt)})}h(Ze);var Ge=b(Ze,2);let Tt;var Ft=g(Ge,!0);h(Ge),h(oe),X((Je,ft)=>{hr(j,"title",(s(U),y(()=>s(U).claudeCode?.projectPath||s(U).project||s(U).id))),C(le,Je),Tt=Lt(Ge,1,"value svelte-c2rstm",null,Tt,{neg:(s(U).tokensSavedEst??0)<0}),C(Ft,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)},H=S=>{var w=nf();D(S,w)};ue(z,S=>{s(a),y(()=>s(a).length>0)?S(L):(r(),y(()=>!r().loading&&!r().error)&&S(H,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=F(),a=F(),l=F(),f=F(),u=F(),p=F();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(),Le();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\`),[()=>(Y(A),s(o),y(()=>A(s(o).parsed)))]),D(w,M)},k=w=>{var M=Dt("-");D(w,M)};ue(_,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),L=g(z),H=g(L);{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 le=b(U,2),Ze=b(g(le)),rr=g(Ze,!0);h(Ze),h(le);var mt=b(le,2),He=b(g(mt)),Ge=g(He,!0);h(He),h(mt);var Tt=b(mt,2),Ft=b(g(Tt)),Je=g(Ft,!0);h(Ft),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(rr,aa),C(Ge,la),C(Je,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\`)},[()=>(Y(A),s(l),y(()=>A(s(l).total))),()=>(Y(A),s(l),y(()=>A(s(l).ok2xx))),()=>(Y(A),s(l),y(()=>A(s(l).err4xx))),()=>(Y(A),s(l),y(()=>A(s(l).err5xx))),()=>(Y(A),s(l),y(()=>A(s(l).compressed))),()=>(Y(A),s(l),y(()=>A(s(l).passthrough))),()=>(Y(A),s(l),y(()=>A(s(l).inputTokensTotal))),()=>(Y(A),s(l),y(()=>A(s(l).cacheCreateTokensTotal))),()=>(Y(A),s(l),y(()=>A(s(l).cacheReadTokensTotal))),()=>(Y(A),s(l),y(()=>A(s(l).origCharsTotal))),()=>(Y(A),s(l),y(()=>A(s(l).imageBytesTotal))),()=>(Y(A),s(l),y(()=>A(s(l).durationP50))),()=>(Y(A),s(l),y(()=>A(s(l).durationP95))),()=>(Y(A),s(l),y(()=>A(s(l).firstBytemsP50))),()=>(Y(A),s(l),y(()=>A(s(l).firstBytemsP95)))]),D(w,M)};ue(H,w=>{s(l)&&w(S)})}h(L),h(z),D(e,d),_e(),i()}var cf=P(\`\`),pc=L('
runtime kill switch \\xB7 not persisted across restart
',1),_c={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 vs(e,t){pe(t,!1),qe(e,_c);let r=()=>Ee(Tr,"$recent",n),[n,s]=Me(),o=q(),a=q(!1);async function l(){if(i(a))return;let g=!i(o);if(!(!g&&!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(),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:\` +/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 Qi(g),Tr.run()}catch(y){wn.push({level:"error",text:"failed to toggle: "+y.message})}finally{R(a,!1)}}}Y(()=>r(),()=>{R(o,r().data?.compression_enabled!==!1)}),We(),Fe();var c=pc(),f=Ne(c);{var _=g=>{var y=dc();O(g,y)};le(f,g=>{i(o)||g(_)})}var u=$(f,2),d=h(u),p=h(d,!0);m(d),nn(2),m(u),G(()=>{d.disabled=i(a),A(p,i(a)?"loading\\u2026":i(o)?"Disable compression":"Enable compression")}),Zt("click",d,l),O(e,c),_e(),s()}var vc=L('
'),mc=L('
'),hc={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 ms(e,t){pe(t,!1),qe(e,hc);let r=()=>Ee(wn,"$toasts",n),[n,s]=Me();Fe();var o=mc();yr(o,5,r,a=>a.id,(a,l)=>{var c=vc(),f=h(c),_=h(f,!0);m(f);var u=$(f,2);m(c),G(()=>{At(c,1,\`toast \${i(l),b(()=>i(l).level)??""}\`,"svelte-1c4to2y"),A(_,(i(l),b(()=>i(l).text)))}),Zt("click",u,()=>wn.dismiss(i(l).id)),O(a,c)}),m(o),O(e,o),_e(),s()}var gc=L('

pixelpipe

recent requests

latest rendered image

sessions (top savers)

stats (full history)

',1),$c={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 +87,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=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";})(); + }\`};function hs(e,t){pe(t,!1),qe(e,$c);let r=()=>Ee(Gr,"$stats",n),[n,s]=Me(),o=q();function a(w){w=Math.floor(w);let M=Math.floor(w/3600),te=Math.floor(w%3600/60),oe=w%60;return(M?M+"h ":"")+(te||M?te+"m ":"")+oe+"s"}Y(()=>r(),()=>{R(o,r().data?\`port \${location.port||"80"} \\xB7 uptime \${a(r().data.uptime_sec)} \\xB7 live\`:r().error?"proxy unreachable":"connecting...")}),We(),Fe();var l=gc(),c=$(Ne(l),2),f=h(c,!0);m(c);var _=$(c,2);vs(_,{});var u=$(_,2);fs(u,{});var d=$(u,2),p=h(d),g=$(h(p),2);us(g,{}),m(p);var y=$(p,2),x=$(h(y),2);ds(x,{}),m(y),m(d);var N=$(d,2),B=$(h(N),2);ps(B,{}),m(N);var F=$(N,2),K=$(h(F),2);_s(K,{}),m(F);var S=$(F,2);ms(S,{}),G(()=>A(f,i(o))),O(e,l),_e(),s()}var ra=document.getElementById("app");ra?jr(hs,{target:ra}):document.body.textContent="pixelpipe dashboard: mount target #app missing";})(); `; diff --git a/src/dashboard.ts b/src/dashboard.ts index 8a54c3b..dcad96b 100644 --- a/src/dashboard.ts +++ b/src/dashboard.ts @@ -185,6 +185,22 @@ interface Totals { /** Count of requests that contributed to allActualInputWeighted (had a * usage block). Lets the UI annotate "N of M paid requests". */ allUsageRequests: number; + /** Direct compressed-vs-passthrough actual-cost split. No counterfactuals, + * no probe gating — just sum what each path actually billed. + * + * These accumulate over `haveUsage` rows only (same gate as the all-rows + * counters above) and partition that set by `info.compressed`. The point + * is to answer "did the compressed path actually cost less per request + * than the passthrough path, on real traffic" without inventing a + * counterfactual. Selection bias is real (the gate decides which path + * each turn lands on), so the UI surfaces sample counts so the operator + * can judge sufficiency — the dashboard does not auto-claim significance. */ + compressedPaidRequests: number; + compressedActualInputWeighted: number; + compressedOutputWeighted: number; + passthroughPaidRequests: number; + passthroughActualInputWeighted: number; + passthroughOutputWeighted: 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 @@ -256,6 +272,12 @@ export class DashboardState { allActualInputWeighted: 0, allOutputWeighted: 0, allUsageRequests: 0, + compressedPaidRequests: 0, + compressedActualInputWeighted: 0, + compressedOutputWeighted: 0, + passthroughPaidRequests: 0, + passthroughActualInputWeighted: 0, + passthroughOutputWeighted: 0, textCharsMeasured: 0, thinkingCharsMeasured: 0, toolUseCharsMeasured: 0, @@ -421,6 +443,21 @@ export class DashboardState { this.totals.allActualInputWeighted += actualInputEff; this.totals.allOutputWeighted += outputEquiv; this.totals.allUsageRequests += 1; + // Direct observed compressed-vs-passthrough split. No counterfactual, + // no probe gating — just partition the paid-rows set by which path + // actually ran this turn. Headline answers "is the compressed path + // cheaper per request on real traffic". Selection bias (the gate + // routes each turn) is real; sample counts go to the UI so the + // operator can judge sufficiency. + if (compressed) { + this.totals.compressedPaidRequests += 1; + this.totals.compressedActualInputWeighted += actualInputEff; + this.totals.compressedOutputWeighted += outputEquiv; + } else { + this.totals.passthroughPaidRequests += 1; + this.totals.passthroughActualInputWeighted += actualInputEff; + this.totals.passthroughOutputWeighted += outputEquiv; + } } // Measurement totals are independent of usage/baseline gating — they @@ -568,6 +605,42 @@ export class DashboardState { const allCounterfactualBill = allBaselineEquiv + allOutput; const pctAllSpend = allCounterfactualBill > 0 ? (saved / allCounterfactualBill) * 100 : 0; + + // Direct observed split — actual $ per request, partitioned by which + // path ran. Token-equivalent (input × 1.0 + cache_create × 1.25 + + // cache_read × 0.10 + output × 5) → $ at the assumed Opus 4.7 input + // rate. Same $/Mtok rate is applied to both buckets, so the bias from + // the rate assumption cancels in the delta. Selection bias from the + // gate is NOT cancelled — the operator interprets that via the + // sample-count caveat below. + const compressedTokenEquiv = + this.totals.compressedActualInputWeighted + + this.totals.compressedOutputWeighted; + const passthroughTokenEquiv = + this.totals.passthroughActualInputWeighted + + this.totals.passthroughOutputWeighted; + const compressedActualUsd = + (compressedTokenEquiv * ASSUMED_INPUT_USD_PER_MTOK) / 1e6; + const passthroughActualUsd = + (passthroughTokenEquiv * ASSUMED_INPUT_USD_PER_MTOK) / 1e6; + const compressedAvgUsd = + this.totals.compressedPaidRequests > 0 + ? compressedActualUsd / this.totals.compressedPaidRequests + : 0; + const passthroughAvgUsd = + this.totals.passthroughPaidRequests > 0 + ? passthroughActualUsd / this.totals.passthroughPaidRequests + : 0; + // Sufficient-sample threshold is a soft heuristic. 20 paid requests per + // bucket is enough to see a real effect on Opus 4.7 traffic (a single + // big cold-miss can dominate at lower n). Below this, the UI shows the + // bucket numbers but hides the delta and surfaces "small sample". + const SUFFICIENT = 20; + const splitSufficient = + this.totals.compressedPaidRequests >= SUFFICIENT && + this.totals.passthroughPaidRequests >= SUFFICIENT; + const splitDeltaUsd = compressedAvgUsd - passthroughAvgUsd; + const uptimeSec = Date.now() / 1000 - this.totals.startedAt; const payload = { requests: this.totals.requests, @@ -590,6 +663,19 @@ export class DashboardState { all_actual_input_weighted: Math.round(allActual), all_output_weighted: Math.round(allOutput), all_usage_requests: this.totals.allUsageRequests, + // Direct observed split — replaces "share of spend saved" as the + // headline. Total actual $ and average $/req per path, plus a delta + // gated on `split_sufficient_sample`. No counterfactual: each + // bucket is what each path actually billed. + compressed_paid_requests: this.totals.compressedPaidRequests, + passthrough_paid_requests: this.totals.passthroughPaidRequests, + compressed_actual_usd: round4(compressedActualUsd), + passthrough_actual_usd: round4(passthroughActualUsd), + compressed_avg_usd_per_request: round4(compressedAvgUsd), + passthrough_avg_usd_per_request: round4(passthroughAvgUsd), + compressed_minus_passthrough_avg_usd: round4(splitDeltaUsd), + split_sufficient_sample: splitSufficient, + split_min_sample_per_bucket: SUFFICIENT, 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 5fadcc4..cefbd20 100644 --- a/src/dashboard/components/StatsHeader.svelte +++ b/src/dashboard/components/StatsHeader.svelte @@ -51,17 +51,18 @@ `source: ${escapeHtml(pa.source || 'docs.anthropic.com pricing')}` : ''; + // Diagnostic only — no longer the headline. See `split` math below for + // the headline. $: pctMath = s && pa ? `
formula: ` + ` share_of_spend = saved / (all_baseline_equivalent + all_output × ` + (pa.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". ` + - `Denominator = what the user WOULD have paid with no pixelpipe — measured rows use their cache-aware ` + - `baseline, unmeasured/passthrough rows fall back to actual (pixelpipe didn't run there, so counterfactual = actual). ` + - `Dividing by counterfactual bill instead of actual bill keeps the ratio bounded at 100%; saved/actual ` + - `is unbounded because pixelpipe shrinks the denominator.
` + + `
why this is diagnostic, not the headline: ` + + `this is a counterfactual ("what the user WOULD have paid"). It depends on the count_tokens probe, ` + + `the cache-aware baseline split, and an Opus 4.7 input-rate assumption. Useful as a sanity check, ` + + `but the operator's real question is "did the compressed path cost less per request than the ` + + `passthrough path on real traffic" — that's the headline split above, no counterfactuals.
` + `
` + row('saved', s.saved_input_tokens, '(measured-rows numerator; cache-aware)') + row( @@ -92,6 +93,43 @@ `measured numerator, all-rows counterfactual denominator - bounded at 100%` : ''; + // Headline "compressed vs passthrough" math. Direct observed split — no + // counterfactuals, no probe gating. Each bucket is the sum of actual + // billed token-equivalents (input + cc×1.25 + cr×0.10 + out×5) for that + // path, converted to $ at the assumed input rate. + $: splitMath = s && pa + ? `
formula: ` + + `bucket_$ = (Σ actual_input + Σ output × ` + (pa.output_multiplier ?? 5) + + `) × $` + (pa.input_per_mtok ?? 5) + `/Mtok
` + + `
why: ` + + `partition the paid-rows set by which path actually ran this turn ` + + `(\`info.compressed = true\` for slab/history compression; false for ` + + `passthrough or bypassed). Same $/Mtok rate on both sides so the ` + + `rate-assumption bias cancels in the delta. Selection bias (the ` + + `gate routes each turn) does NOT cancel — interpret with sample ` + + `counts.
` + + `
` + + row( + 'compressed (n=' + s.compressed_paid_requests + ')', + '$' + (s.compressed_actual_usd || 0).toFixed(4), + 'total · avg $' + (s.compressed_avg_usd_per_request || 0).toFixed(4) + '/req', + ) + + row( + 'passthrough (n=' + s.passthrough_paid_requests + ')', + '$' + (s.passthrough_actual_usd || 0).toFixed(4), + 'total · avg $' + (s.passthrough_avg_usd_per_request || 0).toFixed(4) + '/req', + ) + + row( + 'compressed − passthrough', + '$' + (s.compressed_minus_passthrough_avg_usd || 0).toFixed(4) + '/req', + s.split_sufficient_sample + ? '(both buckets ≥ ' + s.split_min_sample_per_bucket + ' — delta is meaningful)' + : '(small sample: need ≥ ' + s.split_min_sample_per_bucket + + ' per bucket; treat delta as noisy)', + ) + + `no counterfactual, no probe gate — pure observed $/req on each path` + : ''; + $: tokeqMath = s && pa ? `
formula: ` + `token_equivalent = input + output × ` + @@ -179,15 +217,37 @@ {/if}
-
share of spend saved
-
= 0} class:neg={(s?.saved_pct_of_all_spend ?? 0) < 0}>{(s?.saved_pct_of_all_spend ?? 0).toFixed(1)}%
+
compressed $/req
+
$ {(s?.compressed_avg_usd_per_request ?? 0).toFixed(4)}
- ÷ all paid requests ({numFmt(s?.all_usage_requests)} req · compressed + passthrough + probe-failed) · negative = pixelpipe added cost + n={numFmt(s?.compressed_paid_requests)} · total $ {(s?.compressed_actual_usd ?? 0).toFixed(4)}
+
+
+
passthrough $/req
+
$ {(s?.passthrough_avg_usd_per_request ?? 0).toFixed(4)}
+
+ n={numFmt(s?.passthrough_paid_requests)} · total $ {(s?.passthrough_actual_usd ?? 0).toFixed(4)} +
+
+
+
compressed − passthrough $/req
+ {#if s?.split_sufficient_sample} +
0}> + {((s?.compressed_minus_passthrough_avg_usd ?? 0) >= 0 ? '+$ ' : '-$ ')}{Math.abs(s?.compressed_minus_passthrough_avg_usd ?? 0).toFixed(4)} +
+
negative = compressed path cheaper · both buckets ≥ {s?.split_min_sample_per_bucket}
+ {:else} +
small sample
+
+ need ≥ {s?.split_min_sample_per_bucket} requests per bucket · have + {numFmt(s?.compressed_paid_requests)} / {numFmt(s?.passthrough_paid_requests)} +
+ {/if} {#if s && pa}
show calculation -
{@html pctMath}
+
{@html splitMath}
{/if}
@@ -204,14 +264,32 @@ +{#if s && pa} +
+ diagnostic: counterfactual "share of spend saved" +
+
+ share of spend saved (counterfactual): + = 0} class:neg={(s?.saved_pct_of_all_spend ?? 0) < 0}> + {(s?.saved_pct_of_all_spend ?? 0).toFixed(1)}% + + + ({numFmt(s?.all_usage_requests)} paid req · compressed + passthrough + probe-failed) + +
+
{@html pctMath}
+
+
+{/if} +