tokmon 0.20.3 → 0.20.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ import {
8
8
  detectProviders,
9
9
  fetchPeak,
10
10
  resolveTimezone
11
- } from "./chunk-ANCKHLJV.js";
11
+ } from "./chunk-EHIQHGJL.js";
12
12
  import {
13
13
  cacheDir,
14
14
  expandHome,
@@ -319,6 +319,14 @@ var PEAK_INTERVAL_MS = 3e5;
319
319
  var IDLE_PAUSE_MS = 6e4;
320
320
  var SNAPSHOT_CACHE_THROTTLE_MS = 2e4;
321
321
  var REVEAL_THROTTLE_MS = 500;
322
+ var FETCH_TIMEOUT_MS = 3e4;
323
+ var withTimeout = (p, ms) => Promise.race([
324
+ p,
325
+ new Promise((_, reject) => {
326
+ const t = setTimeout(() => reject(new Error("fetch timeout")), ms);
327
+ t.unref?.();
328
+ })
329
+ ]);
322
330
  function createDataEngine(opts) {
323
331
  const { version } = opts;
324
332
  let tz = opts.tz;
@@ -438,7 +446,7 @@ function createDataEngine(opts) {
438
446
  let dashboard = null;
439
447
  let ok = true;
440
448
  try {
441
- dashboard = await fetchAccountSummary(r.account, tz);
449
+ dashboard = await withTimeout(fetchAccountSummary(r.account, tz), FETCH_TIMEOUT_MS);
442
450
  } catch {
443
451
  ok = false;
444
452
  }
@@ -475,7 +483,7 @@ function createDataEngine(opts) {
475
483
  let table = null;
476
484
  let ok = true;
477
485
  try {
478
- table = await fetchAccountTable(r.account, tz);
486
+ table = await withTimeout(fetchAccountTable(r.account, tz), FETCH_TIMEOUT_MS);
479
487
  } catch {
480
488
  ok = false;
481
489
  }
@@ -512,7 +520,7 @@ function createDataEngine(opts) {
512
520
  let result = null;
513
521
  let ok = true;
514
522
  try {
515
- result = await fetchAccountBilling(r.account);
523
+ result = await withTimeout(fetchAccountBilling(r.account), FETCH_TIMEOUT_MS);
516
524
  } catch {
517
525
  ok = false;
518
526
  }
@@ -702,6 +710,10 @@ import { join as join3, resolve as resolvePath, isAbsolute, sep as sep2 } from "
702
710
  function isContained(root, target) {
703
711
  return target === root || target.startsWith(root + sep2);
704
712
  }
713
+ function parentFor(root, abs) {
714
+ const parentResolved = resolvePath(abs, "..");
715
+ return abs === root || !isContained(root, parentResolved) ? null : parentResolved;
716
+ }
705
717
  async function listHomeDirectory(rawPath) {
706
718
  const root = resolvePath(homedir());
707
719
  const expanded = expandHome(rawPath || "~");
@@ -714,9 +726,19 @@ async function listHomeDirectory(rawPath) {
714
726
  real = lexical;
715
727
  }
716
728
  const abs = isContained(root, real) ? real : root;
717
- const st = await stat2(abs);
718
- if (!st.isDirectory()) throw new Error("not a directory");
719
- const dirents = await readdir(abs, { withFileTypes: true });
729
+ let st;
730
+ try {
731
+ st = await stat2(abs);
732
+ } catch {
733
+ return { path: abs, parent: parentFor(root, abs), entries: [] };
734
+ }
735
+ if (!st.isDirectory()) return { path: abs, parent: parentFor(root, abs), entries: [] };
736
+ let dirents;
737
+ try {
738
+ dirents = await readdir(abs, { withFileTypes: true });
739
+ } catch {
740
+ return { path: abs, parent: parentFor(root, abs), entries: [] };
741
+ }
720
742
  const entries = [];
721
743
  for (const d of dirents) {
722
744
  if (d.name.startsWith(".")) continue;
@@ -739,9 +761,7 @@ async function listHomeDirectory(rawPath) {
739
761
  entries.push({ name: d.name, path: full, dir });
740
762
  }
741
763
  entries.sort((a, b) => a.dir === b.dir ? a.name.localeCompare(b.name) : a.dir ? -1 : 1);
742
- const parentResolved = resolvePath(abs, "..");
743
- const parent = abs === root || !isContained(root, parentResolved) ? null : parentResolved;
744
- return { path: abs, parent, entries };
764
+ return { path: abs, parent: parentFor(root, abs), entries };
745
765
  }
746
766
 
747
767
  // src/web/ws.ts
@@ -841,12 +861,12 @@ async function mountWsRpc(server, deps) {
841
861
  const wss = new NodeWS.WebSocketServer({ noServer: true });
842
862
  const handlersLayer = TokmonRpcGroup.toLayer(
843
863
  TokmonRpcGroup.of({
844
- [TOKMON_WS_METHODS.getConfig]: () => Effect.promise(async () => deps.state.config ?? await loadConfig()),
845
- [TOKMON_WS_METHODS.setConfig]: (config) => Effect.promise(() => applyConfigUpdate(deps.engine, deps.state, config)),
864
+ [TOKMON_WS_METHODS.getConfig]: () => Effect.tryPromise(() => Promise.resolve(deps.state.config ?? loadConfig())),
865
+ [TOKMON_WS_METHODS.setConfig]: (config) => Effect.tryPromise(() => applyConfigUpdate(deps.engine, deps.state, config)),
846
866
  [TOKMON_WS_METHODS.refresh]: ({ scope: scope2 }) => Effect.sync(() => {
847
867
  deps.engine.refresh(scope2);
848
868
  }),
849
- [TOKMON_WS_METHODS.browseFs]: ({ path }) => Effect.promise(() => listHomeDirectory(path)),
869
+ [TOKMON_WS_METHODS.browseFs]: ({ path }) => Effect.tryPromise(() => listHomeDirectory(path)),
850
870
  [TOKMON_WS_METHODS.snapshot]: () => snapshotStream(deps.engine),
851
871
  [TOKMON_WS_METHODS.config]: () => configStream(deps.engine)
852
872
  })
package/dist/cli.js CHANGED
@@ -14,12 +14,12 @@ process.emitWarning = ((warning, ...rest) => {
14
14
  var args = process.argv.slice(2);
15
15
  var subcommand = args[0]?.toLowerCase();
16
16
  if (subcommand === "__daemon") {
17
- const { runDaemon } = await import("./daemon-BUYFTSED.js");
17
+ const { runDaemon } = await import("./daemon-HEBPH6PG.js");
18
18
  await runDaemon(args.slice(1), { foreground: false });
19
19
  process.exit(typeof process.exitCode === "number" ? process.exitCode : 0);
20
20
  }
21
21
  if (subcommand === "serve" || subcommand === "web") {
22
- const { runDaemon } = await import("./daemon-BUYFTSED.js");
22
+ const { runDaemon } = await import("./daemon-HEBPH6PG.js");
23
23
  await runDaemon(args.slice(1), { foreground: true });
24
24
  process.exit(typeof process.exitCode === "number" ? process.exitCode : 0);
25
25
  }
@@ -56,7 +56,7 @@ for (let i = 0; i < args.length; i++) {
56
56
  }
57
57
  var { loadConfig } = await import("./config-C6Z65JUP.js");
58
58
  var { resolveGlyphs, setGlyphs } = await import("./glyphs-NKCSZLGO.js");
59
- var { attachOrSpawn } = await import("./daemon-handle-ZHECQZ6Q.js");
59
+ var { attachOrSpawn } = await import("./daemon-handle-HLSKLMWU.js");
60
60
  var config = await loadConfig();
61
61
  var isTTY = process.stdout.isTTY === true;
62
62
  setGlyphs(resolveGlyphs({
@@ -68,5 +68,5 @@ setGlyphs(resolveGlyphs({
68
68
  }));
69
69
  var daemon = await attachOrSpawn();
70
70
  var mode = daemon.kind === "spawned" ? "connected" : "degraded";
71
- var { bootstrapInk } = await import("./bootstrap-ink-F3JFQ3ON.js");
71
+ var { bootstrapInk } = await import("./bootstrap-ink-MVH5QEVR.js");
72
72
  await bootstrapInk({ interval, config, daemon, mode });
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  appVersion,
4
4
  startWebServer
5
- } from "./chunk-M3RGQIOW.js";
5
+ } from "./chunk-YYATNY5E.js";
6
6
  import {
7
7
  flushDisk
8
- } from "./chunk-ANCKHLJV.js";
8
+ } from "./chunk-EHIQHGJL.js";
9
9
  import {
10
10
  cacheDir,
11
11
  loadConfig
@@ -3,7 +3,7 @@
3
3
  // src/client/daemon-handle.ts
4
4
  import { spawn } from "child_process";
5
5
  import { extname } from "path";
6
- var HANDSHAKE_TIMEOUT_MS = 3e3;
6
+ var HANDSHAKE_TIMEOUT_MS = process.platform === "win32" ? 8e3 : 3e3;
7
7
  function runtimeExecArgv(entry, override) {
8
8
  if (override) return override;
9
9
  const ext = extname(entry).toLowerCase();
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startWebServer
4
- } from "./chunk-M3RGQIOW.js";
5
- import "./chunk-ANCKHLJV.js";
4
+ } from "./chunk-YYATNY5E.js";
5
+ import "./chunk-EHIQHGJL.js";
6
6
  import "./chunk-XQEJ4WQ5.js";
7
7
  export {
8
8
  startWebServer
@@ -1,4 +1,4 @@
1
- import{R as h,g as Qe,r as J,j as u,P as fe,E as pe,a as Ye,s as ee,b as G,c as z,d as Je,e as xt,T as re}from"./index-Bqe9b8BZ.js";import{c as I,a as k,z as et,B as At,F as tt,H as kt,i as C,I as Pe,J as S,L as _,K as nt,M as Oe,N as rt,D as Pt,C as Ot,e as W,j as F,S as jt,A as _t,O as wt,b as De,d as Tt,l as M,g as je,u as St,G as Et,P as ae,f as Rt,Q as _e,U as It,V as ie,W as Be,o as it,Z as we,X as Te,Y as Se,p as Nt,_ as Lt,q as Ee,$ as at,r as Re,R as Ie,s as ot,t as st,v as se,T as ct,x as Ne}from"./chart-CDwPcOeB.js";var $t=["points","className","baseLinePoints","connectNulls"];function V(){return V=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])}return n},V.apply(this,arguments)}function Ct(n,e){if(n==null)return{};var r=Dt(n,e),t,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)t=a[i],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Dt(n,e){if(n==null)return{};var r={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(e.indexOf(t)>=0)continue;r[t]=n[t]}return r}function Ke(n){return Mt(n)||Ft(n)||Kt(n)||Bt()}function Bt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{R as h,g as Qe,r as J,j as u,P as fe,E as pe,a as Ye,s as ee,b as G,c as z,d as Je,e as xt,T as re}from"./index-B9eW55YB.js";import{c as I,a as k,z as et,B as At,F as tt,H as kt,i as C,I as Pe,J as S,L as _,K as nt,M as Oe,N as rt,D as Pt,C as Ot,e as W,j as F,S as jt,A as _t,O as wt,b as De,d as Tt,l as M,g as je,u as St,G as Et,P as ae,f as Rt,Q as _e,U as It,V as ie,W as Be,o as it,Z as we,X as Te,Y as Se,p as Nt,_ as Lt,q as Ee,$ as at,r as Re,R as Ie,s as ot,t as st,v as se,T as ct,x as Ne}from"./chart-C8J22kR3.js";var $t=["points","className","baseLinePoints","connectNulls"];function V(){return V=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])}return n},V.apply(this,arguments)}function Ct(n,e){if(n==null)return{};var r=Dt(n,e),t,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)t=a[i],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Dt(n,e){if(n==null)return{};var r={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(e.indexOf(t)>=0)continue;r[t]=n[t]}return r}function Ke(n){return Mt(n)||Ft(n)||Kt(n)||Bt()}function Bt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kt(n,e){if(n){if(typeof n=="string")return be(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);if(r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set")return Array.from(n);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return be(n,e)}}function Ft(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Mt(n){if(Array.isArray(n))return be(n)}function be(n,e){(e==null||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}var Fe=function(e){return e&&e.x===+e.x&&e.y===+e.y},Vt=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return e.forEach(function(t){Fe(t)?r[r.length-1].push(t):r[r.length-1].length>0&&r.push([])}),Fe(e[0])&&r[r.length-1].push(e[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Q=function(e,r){var t=Vt(e);r&&(t=[t.reduce(function(a,o){return[].concat(Ke(a),Ke(o))},[])]);var i=t.map(function(a){return a.reduce(function(o,c,f){return"".concat(o).concat(f===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return t.length===1?"".concat(i,"Z"):i},qt=function(e,r,t){var i=Q(e,t);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Q(r.reverse(),t).slice(1))},zt=function(e){var r=e.points,t=e.className,i=e.baseLinePoints,a=e.connectNulls,o=Ct(e,$t);if(!r||!r.length)return null;var c=I("recharts-polygon",t);if(i&&i.length){var f=o.stroke&&o.stroke!=="none",s=qt(r,i,a);return h.createElement("g",{className:c},h.createElement("path",V({},k(o,!0),{fill:s.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:s})),f?h.createElement("path",V({},k(o,!0),{fill:"none",d:Q(r,a)})):null,f?h.createElement("path",V({},k(o,!0),{fill:"none",d:Q(i,a)})):null)}var p=Q(r,a);return h.createElement("path",V({},k(o,!0),{fill:p.slice(-1)==="Z"?o.fill:"none",className:c,d:p}))},ye,Me;function Wt(){if(Me)return ye;Me=1;var n=et(),e=At(),r=tt();function t(i,a){return i&&i.length?n(i,r(a,2),e):void 0}return ye=t,ye}var Gt=Wt();const Ht=Qe(Gt);var ge,Ve;function Zt(){if(Ve)return ge;Ve=1;var n=et(),e=tt(),r=kt();function t(i,a){return i&&i.length?n(i,e(a,2),r):void 0}return ge=t,ge}var Ut=Zt();const Xt=Qe(Ut);var Qt=["cx","cy","angle","ticks","axisLine"],Yt=["ticks","tick","angle","tickFormatter","stroke"];function H(n){"@babel/helpers - typeof";return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(n)}function Y(){return Y=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])}return n},Y.apply(this,arguments)}function qe(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),r.push.apply(r,t)}return r}function L(n){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?qe(Object(r),!0).forEach(function(t){de(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))})}return n}function ze(n,e){if(n==null)return{};var r=Jt(n,e),t,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)t=a[i],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Jt(n,e){if(n==null)return{};var r={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(e.indexOf(t)>=0)continue;r[t]=n[t]}return r}function en(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function We(n,e){for(var r=0;r<e.length;r++){var t=e[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,ut(t.key),t)}}function tn(n,e,r){return e&&We(n.prototype,e),r&&We(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}function nn(n,e,r){return e=ce(e),rn(n,lt()?Reflect.construct(e,r||[],ce(n).constructor):e.apply(n,r))}function rn(n,e){if(e&&(H(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return an(n)}function an(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function lt(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lt=function(){return!!n})()}function ce(n){return ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ce(n)}function on(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&xe(n,e)}function xe(n,e){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},xe(n,e)}function de(n,e,r){return e=ut(e),e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function ut(n){var e=sn(n,"string");return H(e)=="symbol"?e:e+""}function sn(n,e){if(H(n)!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var t=r.call(n,e);if(H(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var me=(function(n){function e(){return en(this,e),nn(this,e,arguments)}return on(e,n),tn(e,[{key:"getTickValueCoord",value:function(t){var i=t.coordinate,a=this.props,o=a.angle,c=a.cx,f=a.cy;return S(c,f,i,o)}},{key:"getTickTextAnchor",value:function(){var t=this.props.orientation,i;switch(t){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var t=this.props,i=t.cx,a=t.cy,o=t.angle,c=t.ticks,f=Ht(c,function(p){return p.coordinate||0}),s=Xt(c,function(p){return p.coordinate||0});return{cx:i,cy:a,startAngle:o,endAngle:o,innerRadius:s.coordinate||0,outerRadius:f.coordinate||0}}},{key:"renderAxisLine",value:function(){var t=this.props,i=t.cx,a=t.cy,o=t.angle,c=t.ticks,f=t.axisLine,s=ze(t,Qt),p=c.reduce(function(m,l){return[Math.min(m[0],l.coordinate),Math.max(m[1],l.coordinate)]},[1/0,-1/0]),d=S(i,a,p[0],o),v=S(i,a,p[1],o),A=L(L(L({},k(s,!1)),{},{fill:"none"},k(f,!1)),{},{x1:d.x,y1:d.y,x2:v.x,y2:v.y});return h.createElement("line",Y({className:"recharts-polar-radius-axis-line"},A))}},{key:"renderTicks",value:function(){var t=this,i=this.props,a=i.ticks,o=i.tick,c=i.angle,f=i.tickFormatter,s=i.stroke,p=ze(i,Yt),d=this.getTickTextAnchor(),v=k(p,!1),A=k(o,!1),m=a.map(function(l,g){var b=t.getTickValueCoord(l),x=L(L(L(L({textAnchor:d,transform:"rotate(".concat(90-c,", ").concat(b.x,", ").concat(b.y,")")},v),{},{stroke:"none",fill:s},A),{},{index:g},b),{},{payload:l});return h.createElement(_,Y({className:I("recharts-polar-radius-axis-tick",nt(o)),key:"tick-".concat(l.coordinate)},Oe(t.props,l,g)),e.renderTickItem(o,x,f?f(l.value,g):l.value))});return h.createElement(_,{className:"recharts-polar-radius-axis-ticks"},m)}},{key:"render",value:function(){var t=this.props,i=t.ticks,a=t.axisLine,o=t.tick;return!i||!i.length?null:h.createElement(_,{className:I("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),o&&this.renderTicks(),rt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(t,i,a){var o;return h.isValidElement(t)?o=h.cloneElement(t,i):C(t)?o=t(i):o=h.createElement(Pe,Y({},i,{className:"recharts-polar-radius-axis-tick-value"}),a),o}}])})(J.PureComponent);de(me,"displayName","PolarRadiusAxis");de(me,"axisType","radiusAxis");de(me,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Z(n){"@babel/helpers - typeof";return Z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z(n)}function D(){return D=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])}return n},D.apply(this,arguments)}function Ge(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),r.push.apply(r,t)}return r}function $(n){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ge(Object(r),!0).forEach(function(t){ve(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))})}return n}function cn(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function He(n,e){for(var r=0;r<e.length;r++){var t=e[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,pt(t.key),t)}}function ln(n,e,r){return e&&He(n.prototype,e),r&&He(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}function un(n,e,r){return e=le(e),fn(n,ft()?Reflect.construct(e,r||[],le(n).constructor):e.apply(n,r))}function fn(n,e){if(e&&(Z(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pn(n)}function pn(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ft(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ft=function(){return!!n})()}function le(n){return le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},le(n)}function dn(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Ae(n,e)}function Ae(n,e){return Ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},Ae(n,e)}function ve(n,e,r){return e=pt(e),e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function pt(n){var e=mn(n,"string");return Z(e)=="symbol"?e:e+""}function mn(n,e){if(Z(n)!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var t=r.call(n,e);if(Z(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var vn=Math.PI/180,Ze=1e-5,he=(function(n){function e(){return cn(this,e),un(this,e,arguments)}return dn(e,n),ln(e,[{key:"getTickLineCoord",value:function(t){var i=this.props,a=i.cx,o=i.cy,c=i.radius,f=i.orientation,s=i.tickSize,p=s||8,d=S(a,o,c,t.coordinate),v=S(a,o,c+(f==="inner"?-1:1)*p,t.coordinate);return{x1:d.x,y1:d.y,x2:v.x,y2:v.y}}},{key:"getTickTextAnchor",value:function(t){var i=this.props.orientation,a=Math.cos(-t.coordinate*vn),o;return a>Ze?o=i==="outer"?"start":"end":a<-Ze?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var t=this.props,i=t.cx,a=t.cy,o=t.radius,c=t.axisLine,f=t.axisLineType,s=$($({},k(this.props,!1)),{},{fill:"none"},k(c,!1));if(f==="circle")return h.createElement(Pt,D({className:"recharts-polar-angle-axis-line"},s,{cx:i,cy:a,r:o}));var p=this.props.ticks,d=p.map(function(v){return S(i,a,o,v.coordinate)});return h.createElement(zt,D({className:"recharts-polar-angle-axis-line"},s,{points:d}))}},{key:"renderTicks",value:function(){var t=this,i=this.props,a=i.ticks,o=i.tick,c=i.tickLine,f=i.tickFormatter,s=i.stroke,p=k(this.props,!1),d=k(o,!1),v=$($({},p),{},{fill:"none"},k(c,!1)),A=a.map(function(m,l){var g=t.getTickLineCoord(m),b=t.getTickTextAnchor(m),x=$($($({textAnchor:b},p),{},{stroke:"none",fill:s},d),{},{index:l,payload:m,x:g.x2,y:g.y2});return h.createElement(_,D({className:I("recharts-polar-angle-axis-tick",nt(o)),key:"tick-".concat(m.coordinate)},Oe(t.props,m,l)),c&&h.createElement("line",D({className:"recharts-polar-angle-axis-tick-line"},v,g)),o&&e.renderTickItem(o,x,f?f(m.value,l):m.value))});return h.createElement(_,{className:"recharts-polar-angle-axis-ticks"},A)}},{key:"render",value:function(){var t=this.props,i=t.ticks,a=t.radius,o=t.axisLine;return a<=0||!i||!i.length?null:h.createElement(_,{className:I("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(t,i,a){var o;return h.isValidElement(t)?o=h.cloneElement(t,i):C(t)?o=t(i):o=h.createElement(Pe,D({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])})(J.PureComponent);ve(he,"displayName","PolarAngleAxis");ve(he,"axisType","angleAxis");ve(he,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var oe;function U(n){"@babel/helpers - typeof";return U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(n)}function q(){return q=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])}return n},q.apply(this,arguments)}function Ue(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),r.push.apply(r,t)}return r}function y(n){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ue(Object(r),!0).forEach(function(t){O(n,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Ue(Object(r)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))})}return n}function hn(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Xe(n,e){for(var r=0;r<e.length;r++){var t=e[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,mt(t.key),t)}}function yn(n,e,r){return e&&Xe(n.prototype,e),r&&Xe(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}function gn(n,e,r){return e=ue(e),bn(n,dt()?Reflect.construct(e,r||[],ue(n).constructor):e.apply(n,r))}function bn(n,e){if(e&&(U(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xn(n)}function xn(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function dt(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dt=function(){return!!n})()}function ue(n){return ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ue(n)}function An(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&ke(n,e)}function ke(n,e){return ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},ke(n,e)}function O(n,e,r){return e=mt(e),e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function mt(n){var e=kn(n,"string");return U(e)=="symbol"?e:e+""}function kn(n,e){if(U(n)!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var t=r.call(n,e);if(U(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}var E=(function(n){function e(r){var t;return hn(this,e),t=gn(this,e,[r]),O(t,"pieRef",null),O(t,"sectorRefs",[]),O(t,"id",St("recharts-pie-")),O(t,"handleAnimationEnd",function(){var i=t.props.onAnimationEnd;t.setState({isAnimationFinished:!0}),C(i)&&i()}),O(t,"handleAnimationStart",function(){var i=t.props.onAnimationStart;t.setState({isAnimationFinished:!1}),C(i)&&i()}),t.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},t}return An(e,n),yn(e,[{key:"isActiveIndex",value:function(t){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(t)!==-1:t===i}},{key:"hasActiveIndex",value:function(){var t=this.props.activeIndex;return Array.isArray(t)?t.length!==0:t||t===0}},{key:"renderLabels",value:function(t){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.label,c=a.labelLine,f=a.dataKey,s=a.valueKey,p=k(this.props,!1),d=k(o,!1),v=k(c,!1),A=o&&o.offsetRadius||20,m=t.map(function(l,g){var b=(l.startAngle+l.endAngle)/2,x=S(l.cx,l.cy,l.outerRadius+A,b),j=y(y(y(y({},p),l),{},{stroke:"none"},d),{},{index:g,textAnchor:e.getTextAnchor(x.x,l.cx)},x),B=y(y(y(y({},p),l),{},{fill:"none",stroke:l.fill},v),{},{index:g,points:[S(l.cx,l.cy,l.outerRadius,b),x]}),w=f;return W(f)&&W(s)?w="value":W(f)&&(w=s),h.createElement(_,{key:"label-".concat(l.startAngle,"-").concat(l.endAngle,"-").concat(l.midAngle,"-").concat(g)},c&&e.renderLabelLineItem(c,B,"line"),e.renderLabelItem(o,j,F(l,w)))});return h.createElement(_,{className:"recharts-pie-labels"},m)}},{key:"renderSectorsStatically",value:function(t){var i=this,a=this.props,o=a.activeShape,c=a.blendStroke,f=a.inactiveShape;return t.map(function(s,p){if((s==null?void 0:s.startAngle)===0&&(s==null?void 0:s.endAngle)===0&&t.length!==1)return null;var d=i.isActiveIndex(p),v=f&&i.hasActiveIndex()?f:null,A=d?o:v,m=y(y({},s),{},{stroke:c?s.fill:s.stroke,tabIndex:-1});return h.createElement(_,q({ref:function(g){g&&!i.sectorRefs.includes(g)&&i.sectorRefs.push(g)},tabIndex:-1,className:"recharts-pie-sector"},Oe(i.props,s,p),{key:"sector-".concat(s==null?void 0:s.startAngle,"-").concat(s==null?void 0:s.endAngle,"-").concat(s.midAngle,"-").concat(p)}),h.createElement(jt,q({option:A,isActive:d,shapeType:"sector"},m)))})}},{key:"renderSectorsWithAnimation",value:function(){var t=this,i=this.props,a=i.sectors,o=i.isAnimationActive,c=i.animationBegin,f=i.animationDuration,s=i.animationEasing,p=i.animationId,d=this.state,v=d.prevSectors,A=d.prevIsAnimationActive;return h.createElement(_t,{begin:c,duration:f,isActive:o,easing:s,from:{t:0},to:{t:1},key:"pie-".concat(p,"-").concat(A),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(m){var l=m.t,g=[],b=a&&a[0],x=b.startAngle;return a.forEach(function(j,B){var w=v&&v[B],N=B>0?wt(j,"paddingAngle",0):0;if(w){var X=De(w.endAngle-w.startAngle,j.endAngle-j.startAngle),P=y(y({},j),{},{startAngle:x+N,endAngle:x+X(l)+N});g.push(P),x=P.endAngle}else{var K=j.endAngle,T=j.startAngle,te=De(0,K-T),ne=te(l),R=y(y({},j),{},{startAngle:x+N,endAngle:x+ne+N});g.push(R),x=R.endAngle}}),h.createElement(_,null,t.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(t){var i=this;t.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[c].focus(),i.setState({sectorToFocus:c});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var t=this.props,i=t.sectors,a=t.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!Tt(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var t=this,i=this.props,a=i.hide,o=i.sectors,c=i.className,f=i.label,s=i.cx,p=i.cy,d=i.innerRadius,v=i.outerRadius,A=i.isAnimationActive,m=this.state.isAnimationFinished;if(a||!o||!o.length||!M(s)||!M(p)||!M(d)||!M(v))return null;var l=I("recharts-pie",c);return h.createElement(_,{tabIndex:this.props.rootTabIndex,className:l,ref:function(b){t.pieRef=b}},this.renderSectors(),f&&this.renderLabels(o),rt.renderCallByParent(this.props,null,!1),(!A||m)&&je.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(t,i){return i.prevIsAnimationActive!==t.isAnimationActive?{prevIsAnimationActive:t.isAnimationActive,prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:[],isAnimationFinished:!0}:t.isAnimationActive&&t.animationId!==i.prevAnimationId?{prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:t.sectors!==i.curSectors?{curSectors:t.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(t,i){return t>i?"start":t<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(t,i,a){if(h.isValidElement(t))return h.cloneElement(t,i);if(C(t))return t(i);var o=I("recharts-pie-label-line",typeof t!="boolean"?t.className:"");return h.createElement(Ot,q({},i,{key:a,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(t,i,a){if(h.isValidElement(t))return h.cloneElement(t,i);var o=a;if(C(t)&&(o=t(i),h.isValidElement(o)))return o;var c=I("recharts-pie-label-text",typeof t!="boolean"&&!C(t)?t.className:"");return h.createElement(Pe,q({},i,{alignmentBaseline:"middle",className:c}),o)}}])})(J.PureComponent);oe=E;O(E,"displayName","Pie");O(E,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Et.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});O(E,"parseDeltaAngle",function(n,e){var r=ae(e-n),t=Math.min(Math.abs(e-n),360);return r*t});O(E,"getRealPieData",function(n){var e=n.data,r=n.children,t=k(n,!1),i=Rt(r,_e);return e&&e.length?e.map(function(a,o){return y(y(y({payload:a},t),a),i&&i[o]&&i[o].props)}):i&&i.length?i.map(function(a){return y(y({},t),a.props)}):[]});O(E,"parseCoordinateOfPie",function(n,e){var r=e.top,t=e.left,i=e.width,a=e.height,o=It(i,a),c=t+ie(n.cx,i,i/2),f=r+ie(n.cy,a,a/2),s=ie(n.innerRadius,o,0),p=ie(n.outerRadius,o,o*.8),d=n.maxRadius||Math.sqrt(i*i+a*a)/2;return{cx:c,cy:f,innerRadius:s,outerRadius:p,maxRadius:d}});O(E,"getComposedData",function(n){var e=n.item,r=n.offset,t=e.type.defaultProps!==void 0?y(y({},e.type.defaultProps),e.props):e.props,i=oe.getRealPieData(t);if(!i||!i.length)return null;var a=t.cornerRadius,o=t.startAngle,c=t.endAngle,f=t.paddingAngle,s=t.dataKey,p=t.nameKey,d=t.valueKey,v=t.tooltipType,A=Math.abs(t.minAngle),m=oe.parseCoordinateOfPie(t,r),l=oe.parseDeltaAngle(o,c),g=Math.abs(l),b=s;W(s)&&W(d)?(Be(!1,`Use "dataKey" to specify the value of pie,
3
3
  the props "valueKey" will be deprecated in 1.1.0`),b="value"):W(s)&&(Be(!1,`Use "dataKey" to specify the value of pie,
4
4
  the props "valueKey" will be deprecated in 1.1.0`),b=d);var x=i.filter(function(P){return F(P,b,0)!==0}).length,j=(g>=360?x:x-1)*f,B=g-x*A-j,w=i.reduce(function(P,K){var T=F(K,b,0);return P+(M(T)?T:0)},0),N;if(w>0){var X;N=i.map(function(P,K){var T=F(P,b,0),te=F(P,p,K),ne=(M(T)?T:0)/w,R;K?R=X.endAngle+ae(l)*f*(T!==0?1:0):R=o;var Le=R+ae(l)*((T!==0?A:0)+ne*B),$e=(R+Le)/2,Ce=(m.innerRadius+m.outerRadius)/2,gt=[{name:te,value:T,payload:P,dataKey:b,type:v}],bt=S(m.cx,m.cy,Ce,$e);return X=y(y(y({percent:ne,cornerRadius:a,name:te,tooltipPayload:gt,midAngle:$e,middleRadius:Ce,tooltipPosition:bt},P),m),{},{value:F(P,b),startAngle:R,endAngle:Le,payload:P,paddingAngle:ae(l)*f}),X})}return y(y({},m),{},{sectors:N,data:i})});var vt=it({chartName:"BarChart",GraphicalChild:we,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Te},{axisType:"yAxis",AxisComp:Se}],formatAxisMap:Nt}),Pn=it({chartName:"PieChart",GraphicalChild:E,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:he},{axisType:"radiusAxis",AxisComp:me}],formatAxisMap:Lt,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const ht={fill:"var(--color-bg-2)"},yt={fill:"var(--color-fg-dim)",fontSize:10,fontFamily:"var(--font-mono)"},On=Ne("cost",G,n=>{var e;return(e=n[0])==null?void 0:e.color},{title:n=>ee(n)}),jn=Ne("tokens",z,n=>{var e;return(e=n[0])==null?void 0:e.color},{title:n=>ee(n)}),_n=Ne("saved",G,n=>{var e;return(e=n[0])==null?void 0:e.color},{title:n=>ee(n)});function Sn({derived:n,height:e=280,limit:r=10,metric:t="cost",periodLabel:i}){const a=Ee(),o=at("(min-width: 768px)"),c=o?124:92,f=o?60:44,s=t==="tokens",p=[...n.byModel].sort((d,v)=>s?v.tokens-d.tokens:v.cost-d.cost).slice(0,r);return u.jsx(fe,{title:s?"tokens by model":"cost by model",titleTag:i,captureName:s?"tokens-by-model":"cost-by-model",children:p.length===0?u.jsx(pe,{children:"no models in period"}):u.jsx(Re,{height:e,children:u.jsx(Ie,{children:u.jsxs(vt,{data:p,layout:"vertical",margin:{top:4,right:f,left:4,bottom:0},children:[u.jsx(ot,{...st,horizontal:!1,vertical:!0}),u.jsx(Te,{type:"number",...se,tickFormatter:s?z:Ye}),u.jsx(Se,{type:"category",dataKey:"model",...se,width:c,tickFormatter:ee}),u.jsx(ct,{content:s?jn:On,cursor:ht}),u.jsxs(we,{dataKey:s?"tokens":"cost",radius:[0,3,3,0],isAnimationActive:a,animationDuration:350,children:[p.map(d=>u.jsx(_e,{fill:d.color},d.model)),u.jsx(je,{dataKey:s?"tokens":"cost",position:"right",offset:6,...yt,formatter:d=>s?z(d):G(d)})]})]})})})})}function En({derived:n,height:e=240,limit:r=12,periodLabel:t}){const i=Ee(),a=at("(min-width: 768px)"),o=a?124:92,c=a?60:44,f=[...n.byModel].filter(s=>s.cacheSavings>0).sort((s,p)=>p.cacheSavings-s.cacheSavings).slice(0,r);return u.jsx(fe,{title:"cache savings by model",titleTag:t,captureName:"cache-savings-by-model",children:f.length===0?u.jsx(pe,{children:"no cache savings in period"}):u.jsx(Re,{height:e,children:u.jsx(Ie,{children:u.jsxs(vt,{data:f,layout:"vertical",margin:{top:4,right:c,left:4,bottom:0},children:[u.jsx(ot,{...st,horizontal:!1,vertical:!0}),u.jsx(Te,{type:"number",...se,tickFormatter:Ye}),u.jsx(Se,{type:"category",dataKey:"model",...se,width:o,tickFormatter:ee}),u.jsx(ct,{content:_n,cursor:ht}),u.jsx(we,{dataKey:"cacheSavings",radius:[0,3,3,0],fill:"var(--color-positive)",isAnimationActive:i,animationDuration:350,children:u.jsx(je,{dataKey:"cacheSavings",position:"right",offset:6,...yt,formatter:s=>G(s)})})]})})})})}function Rn({derived:n,height:e=280,periodLabel:r}){const t=Ee(),i=n.byProvider,a=n.totals.cost,[o,c]=J.useState(null),[f,s]=J.useState(null),p=f?i.findIndex(m=>m.id===f):-1,d=o??(p>=0?p:null),v=d!=null?i[d]:null,A=v&&a>0?v.cost/a:0;return u.jsx(fe,{title:"provider split",titleTag:r,captureName:"provider-split",children:i.length===0?u.jsx(pe,{children:"no spend in period"}):u.jsxs("div",{className:"relative",onMouseLeave:()=>c(null),children:[u.jsx(Re,{height:e,children:u.jsx(Ie,{children:u.jsx(Pn,{children:u.jsx(E,{data:i,dataKey:"cost",nameKey:"name",innerRadius:"60%",outerRadius:"88%",paddingAngle:i.length>1?2:0,stroke:"var(--color-bg-1)",strokeWidth:2,isAnimationActive:t,animationDuration:350,style:{cursor:"pointer"},onMouseEnter:(m,l)=>c(l),onClick:(m,l)=>s(g=>{var b,x;return g===((b=i[l])==null?void 0:b.id)?null:((x=i[l])==null?void 0:x.id)??null}),children:i.map((m,l)=>u.jsx(_e,{fill:m.color,"aria-label":`${m.name}: ${G(m.cost)}`,fillOpacity:d==null||d===l?1:.32,style:{transition:"fill-opacity 150ms ease"}},m.id))})})})}),u.jsxs("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center",children:[u.jsx("div",{className:"tnum text-xl",style:{color:v?v.color:"var(--color-fg-bright)"},children:G(v?v.cost:a)}),u.jsxs("div",{className:"font-display text-[10px] uppercase tracking-wide text-fg-faint",children:[v?`${v.name} · ${Je(A,A>0&&A<.01?1:0)}`:"total",v&&o==null&&p>=0&&u.jsx("span",{className:"text-accent",children:" · pinned"})]})]})]})})}function In({derived:n,periodLabel:e}){const r=n.tokenComposition,t=xt(r),i=[{key:"cacheRead",label:"cache read",value:r.cacheRead,color:re.cacheRead},{key:"input",label:"input",value:r.input,color:re.input},{key:"output",label:"output",value:r.output,color:re.output},{key:"cacheCreate",label:"cache write",value:r.cacheCreate,color:re.cacheCreate}];return u.jsx(fe,{title:"token composition",titleTag:e,captureName:"token-composition",right:u.jsx("span",{className:"tnum text-xs text-fg-dim",children:z(t)}),children:t===0?u.jsx(pe,{children:"no tokens in period"}):u.jsxs("div",{className:"flex flex-col gap-4 pt-1",children:[u.jsx("div",{className:"flex h-3 w-full overflow-hidden rounded-full bg-bg-3",children:i.map(a=>a.value>0&&u.jsx("div",{style:{width:`${a.value/t*100}%`,minWidth:"2px",background:a.color},title:`${a.label}: ${z(a.value)}`},a.key))}),u.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2.5",children:i.map(a=>{const o=t>0?a.value/t:0;return u.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[u.jsxs("span",{className:"flex items-center gap-1.5 text-fg-dim",children:[u.jsx("span",{className:"inline-block size-2 rounded-[2px]",style:{background:a.color}}),a.label]}),u.jsxs("span",{className:"text-fg",children:[u.jsx("span",{className:"tnum text-fg-bright",children:z(a.value)}),u.jsx("span",{className:"ml-1.5 text-fg-faint",children:Je(o,o>0&&o<.01?1:0)})]})]},a.key)})})]})})}export{En as CacheByModel,Sn as CostByModel,Rn as ProviderDonut,In as TokenComposition};
@@ -1,4 +1,4 @@
1
- import{h as Kn,g as ue,r as N,R as T,j as ot,f as Zx}from"./index-Bqe9b8BZ.js";function Lm(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Lm(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function te(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Lm(e))&&(n&&(n+=" "),n+=t);return n}var Na,oh;function Re(){if(oh)return Na;oh=1;var e=Array.isArray;return Na=e,Na}var qa,uh;function Fm(){if(uh)return qa;uh=1;var e=typeof Kn=="object"&&Kn&&Kn.Object===Object&&Kn;return qa=e,qa}var Ba,ch;function it(){if(ch)return Ba;ch=1;var e=Fm(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Ba=r,Ba}var La,sh;function Nn(){if(sh)return La;sh=1;var e=it(),t=e.Symbol;return La=t,La}var Fa,lh;function Jx(){if(lh)return Fa;lh=1;var e=Nn(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var u=r.call(o,i),c=o[i];try{o[i]=void 0;var s=!0}catch{}var f=n.call(o);return s&&(u?o[i]=c:delete o[i]),f}return Fa=a,Fa}var Ua,fh;function Qx(){if(fh)return Ua;fh=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Ua=r,Ua}var za,hh;function mt(){if(hh)return za;hh=1;var e=Nn(),t=Jx(),r=Qx(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(u){return u==null?u===void 0?i:n:a&&a in Object(u)?t(u):r(u)}return za=o,za}var Wa,ph;function bt(){if(ph)return Wa;ph=1;function e(t){return t!=null&&typeof t=="object"}return Wa=e,Wa}var Ha,dh;function $r(){if(dh)return Ha;dh=1;var e=mt(),t=bt(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return Ha=n,Ha}var Ga,vh;function Ql(){if(vh)return Ga;vh=1;var e=Re(),t=$r(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var u=typeof a;return u=="number"||u=="symbol"||u=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return Ga=i,Ga}var Ka,yh;function Tt(){if(yh)return Ka;yh=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Ka=e,Ka}var Xa,gh;function ef(){if(gh)return Xa;gh=1;var e=mt(),t=Tt(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(u){if(!t(u))return!1;var c=e(u);return c==n||c==i||c==r||c==a}return Xa=o,Xa}var Va,mh;function ew(){if(mh)return Va;mh=1;var e=it(),t=e["__core-js_shared__"];return Va=t,Va}var Ya,bh;function tw(){if(bh)return Ya;bh=1;var e=ew(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Ya=r,Ya}var Za,xh;function Um(){if(xh)return Za;xh=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Za=r,Za}var Ja,wh;function rw(){if(wh)return Ja;wh=1;var e=ef(),t=tw(),r=Tt(),n=Um(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,c=o.toString,s=u.hasOwnProperty,f=RegExp("^"+c.call(s).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(h){if(!r(h)||t(h))return!1;var d=e(h)?f:a;return d.test(n(h))}return Ja=l,Ja}var Qa,Oh;function nw(){if(Oh)return Qa;Oh=1;function e(t,r){return t==null?void 0:t[r]}return Qa=e,Qa}var eo,_h;function Vt(){if(_h)return eo;_h=1;var e=rw(),t=nw();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return eo=r,eo}var to,Sh;function ia(){if(Sh)return to;Sh=1;var e=Vt(),t=e(Object,"create");return to=t,to}var ro,Ah;function iw(){if(Ah)return ro;Ah=1;var e=ia();function t(){this.__data__=e?e(null):{},this.size=0}return ro=t,ro}var no,Ph;function aw(){if(Ph)return no;Ph=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return no=e,no}var io,Th;function ow(){if(Th)return io;Th=1;var e=ia(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var u=o[a];return u===t?void 0:u}return n.call(o,a)?o[a]:void 0}return io=i,io}var ao,Eh;function uw(){if(Eh)return ao;Eh=1;var e=ia(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return ao=n,ao}var oo,jh;function cw(){if(jh)return oo;jh=1;var e=ia(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return oo=r,oo}var uo,Mh;function sw(){if(Mh)return uo;Mh=1;var e=iw(),t=aw(),r=ow(),n=uw(),i=cw();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u<c;){var s=o[u];this.set(s[0],s[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,uo=a,uo}var co,Ch;function lw(){if(Ch)return co;Ch=1;function e(){this.__data__=[],this.size=0}return co=e,co}var so,$h;function tf(){if($h)return so;$h=1;function e(t,r){return t===r||t!==t&&r!==r}return so=e,so}var lo,Ih;function aa(){if(Ih)return lo;Ih=1;var e=tf();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return lo=t,lo}var fo,Rh;function fw(){if(Rh)return fo;Rh=1;var e=aa(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var u=a.length-1;return o==u?a.pop():r.call(a,o,1),--this.size,!0}return fo=n,fo}var ho,kh;function hw(){if(kh)return ho;kh=1;var e=aa();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return ho=t,ho}var po,Dh;function pw(){if(Dh)return po;Dh=1;var e=aa();function t(r){return e(this.__data__,r)>-1}return po=t,po}var vo,Nh;function dw(){if(Nh)return vo;Nh=1;var e=aa();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return vo=t,vo}var yo,qh;function oa(){if(qh)return yo;qh=1;var e=lw(),t=fw(),r=hw(),n=pw(),i=dw();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u<c;){var s=o[u];this.set(s[0],s[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,yo=a,yo}var go,Bh;function rf(){if(Bh)return go;Bh=1;var e=Vt(),t=it(),r=e(t,"Map");return go=r,go}var mo,Lh;function vw(){if(Lh)return mo;Lh=1;var e=sw(),t=oa(),r=rf();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return mo=n,mo}var bo,Fh;function yw(){if(Fh)return bo;Fh=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return bo=e,bo}var xo,Uh;function ua(){if(Uh)return xo;Uh=1;var e=yw();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return xo=t,xo}var wo,zh;function gw(){if(zh)return wo;zh=1;var e=ua();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return wo=t,wo}var Oo,Wh;function mw(){if(Wh)return Oo;Wh=1;var e=ua();function t(r){return e(this,r).get(r)}return Oo=t,Oo}var _o,Hh;function bw(){if(Hh)return _o;Hh=1;var e=ua();function t(r){return e(this,r).has(r)}return _o=t,_o}var So,Gh;function xw(){if(Gh)return So;Gh=1;var e=ua();function t(r,n){var i=e(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return So=t,So}var Ao,Kh;function nf(){if(Kh)return Ao;Kh=1;var e=vw(),t=gw(),r=mw(),n=bw(),i=xw();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u<c;){var s=o[u];this.set(s[0],s[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Ao=a,Ao}var Po,Xh;function zm(){if(Xh)return Po;Xh=1;var e=nf(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,u=i?i.apply(this,o):o[0],c=a.cache;if(c.has(u))return c.get(u);var s=n.apply(this,o);return a.cache=c.set(u,s)||c,s};return a.cache=new(r.Cache||e),a}return r.Cache=e,Po=r,Po}var To,Vh;function ww(){if(Vh)return To;Vh=1;var e=zm(),t=500;function r(n){var i=e(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return To=r,To}var Eo,Yh;function Ow(){if(Yh)return Eo;Yh=1;var e=ww(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,u,c,s){a.push(c?s.replace(r,"$1"):u||o)}),a});return Eo=n,Eo}var jo,Zh;function af(){if(Zh)return jo;Zh=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=Array(i);++n<i;)a[n]=r(t[n],n,t);return a}return jo=e,jo}var Mo,Jh;function _w(){if(Jh)return Mo;Jh=1;var e=Nn(),t=af(),r=Re(),n=$r(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(u){if(typeof u=="string")return u;if(r(u))return t(u,o)+"";if(n(u))return a?a.call(u):"";var c=u+"";return c=="0"&&1/u==-1/0?"-0":c}return Mo=o,Mo}var Co,Qh;function Wm(){if(Qh)return Co;Qh=1;var e=_w();function t(r){return r==null?"":e(r)}return Co=t,Co}var $o,ep;function Hm(){if(ep)return $o;ep=1;var e=Re(),t=Ql(),r=Ow(),n=Wm();function i(a,o){return e(a)?a:t(a,o)?[a]:r(n(a))}return $o=i,$o}var Io,tp;function ca(){if(tp)return Io;tp=1;var e=$r();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Io=t,Io}var Ro,rp;function of(){if(rp)return Ro;rp=1;var e=Hm(),t=ca();function r(n,i){i=e(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[t(i[a++])];return a&&a==o?n:void 0}return Ro=r,Ro}var ko,np;function Gm(){if(np)return ko;np=1;var e=of();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return ko=t,ko}var Sw=Gm();const ze=ue(Sw);var Do,ip;function Aw(){if(ip)return Do;ip=1;function e(t){return t==null}return Do=e,Do}var Pw=Aw();const Z=ue(Pw);var No,ap;function Tw(){if(ap)return No;ap=1;var e=mt(),t=Re(),r=bt(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return No=i,No}var Ew=Tw();const Ht=ue(Ew);var jw=ef();const Y=ue(jw);var Mw=Tt();const Ir=ue(Mw);var qo={exports:{}},re={};/**
1
+ import{h as Kn,g as ue,r as N,R as T,j as ot,f as Zx}from"./index-B9eW55YB.js";function Lm(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Lm(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function te(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Lm(e))&&(n&&(n+=" "),n+=t);return n}var Na,oh;function Re(){if(oh)return Na;oh=1;var e=Array.isArray;return Na=e,Na}var qa,uh;function Fm(){if(uh)return qa;uh=1;var e=typeof Kn=="object"&&Kn&&Kn.Object===Object&&Kn;return qa=e,qa}var Ba,ch;function it(){if(ch)return Ba;ch=1;var e=Fm(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Ba=r,Ba}var La,sh;function Nn(){if(sh)return La;sh=1;var e=it(),t=e.Symbol;return La=t,La}var Fa,lh;function Jx(){if(lh)return Fa;lh=1;var e=Nn(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var u=r.call(o,i),c=o[i];try{o[i]=void 0;var s=!0}catch{}var f=n.call(o);return s&&(u?o[i]=c:delete o[i]),f}return Fa=a,Fa}var Ua,fh;function Qx(){if(fh)return Ua;fh=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Ua=r,Ua}var za,hh;function mt(){if(hh)return za;hh=1;var e=Nn(),t=Jx(),r=Qx(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(u){return u==null?u===void 0?i:n:a&&a in Object(u)?t(u):r(u)}return za=o,za}var Wa,ph;function bt(){if(ph)return Wa;ph=1;function e(t){return t!=null&&typeof t=="object"}return Wa=e,Wa}var Ha,dh;function $r(){if(dh)return Ha;dh=1;var e=mt(),t=bt(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return Ha=n,Ha}var Ga,vh;function Ql(){if(vh)return Ga;vh=1;var e=Re(),t=$r(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var u=typeof a;return u=="number"||u=="symbol"||u=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return Ga=i,Ga}var Ka,yh;function Tt(){if(yh)return Ka;yh=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Ka=e,Ka}var Xa,gh;function ef(){if(gh)return Xa;gh=1;var e=mt(),t=Tt(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(u){if(!t(u))return!1;var c=e(u);return c==n||c==i||c==r||c==a}return Xa=o,Xa}var Va,mh;function ew(){if(mh)return Va;mh=1;var e=it(),t=e["__core-js_shared__"];return Va=t,Va}var Ya,bh;function tw(){if(bh)return Ya;bh=1;var e=ew(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Ya=r,Ya}var Za,xh;function Um(){if(xh)return Za;xh=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Za=r,Za}var Ja,wh;function rw(){if(wh)return Ja;wh=1;var e=ef(),t=tw(),r=Tt(),n=Um(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,c=o.toString,s=u.hasOwnProperty,f=RegExp("^"+c.call(s).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(h){if(!r(h)||t(h))return!1;var d=e(h)?f:a;return d.test(n(h))}return Ja=l,Ja}var Qa,Oh;function nw(){if(Oh)return Qa;Oh=1;function e(t,r){return t==null?void 0:t[r]}return Qa=e,Qa}var eo,_h;function Vt(){if(_h)return eo;_h=1;var e=rw(),t=nw();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return eo=r,eo}var to,Sh;function ia(){if(Sh)return to;Sh=1;var e=Vt(),t=e(Object,"create");return to=t,to}var ro,Ah;function iw(){if(Ah)return ro;Ah=1;var e=ia();function t(){this.__data__=e?e(null):{},this.size=0}return ro=t,ro}var no,Ph;function aw(){if(Ph)return no;Ph=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return no=e,no}var io,Th;function ow(){if(Th)return io;Th=1;var e=ia(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var u=o[a];return u===t?void 0:u}return n.call(o,a)?o[a]:void 0}return io=i,io}var ao,Eh;function uw(){if(Eh)return ao;Eh=1;var e=ia(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return ao=n,ao}var oo,jh;function cw(){if(jh)return oo;jh=1;var e=ia(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return oo=r,oo}var uo,Mh;function sw(){if(Mh)return uo;Mh=1;var e=iw(),t=aw(),r=ow(),n=uw(),i=cw();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u<c;){var s=o[u];this.set(s[0],s[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,uo=a,uo}var co,Ch;function lw(){if(Ch)return co;Ch=1;function e(){this.__data__=[],this.size=0}return co=e,co}var so,$h;function tf(){if($h)return so;$h=1;function e(t,r){return t===r||t!==t&&r!==r}return so=e,so}var lo,Ih;function aa(){if(Ih)return lo;Ih=1;var e=tf();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return lo=t,lo}var fo,Rh;function fw(){if(Rh)return fo;Rh=1;var e=aa(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var u=a.length-1;return o==u?a.pop():r.call(a,o,1),--this.size,!0}return fo=n,fo}var ho,kh;function hw(){if(kh)return ho;kh=1;var e=aa();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return ho=t,ho}var po,Dh;function pw(){if(Dh)return po;Dh=1;var e=aa();function t(r){return e(this.__data__,r)>-1}return po=t,po}var vo,Nh;function dw(){if(Nh)return vo;Nh=1;var e=aa();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return vo=t,vo}var yo,qh;function oa(){if(qh)return yo;qh=1;var e=lw(),t=fw(),r=hw(),n=pw(),i=dw();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u<c;){var s=o[u];this.set(s[0],s[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,yo=a,yo}var go,Bh;function rf(){if(Bh)return go;Bh=1;var e=Vt(),t=it(),r=e(t,"Map");return go=r,go}var mo,Lh;function vw(){if(Lh)return mo;Lh=1;var e=sw(),t=oa(),r=rf();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return mo=n,mo}var bo,Fh;function yw(){if(Fh)return bo;Fh=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return bo=e,bo}var xo,Uh;function ua(){if(Uh)return xo;Uh=1;var e=yw();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return xo=t,xo}var wo,zh;function gw(){if(zh)return wo;zh=1;var e=ua();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return wo=t,wo}var Oo,Wh;function mw(){if(Wh)return Oo;Wh=1;var e=ua();function t(r){return e(this,r).get(r)}return Oo=t,Oo}var _o,Hh;function bw(){if(Hh)return _o;Hh=1;var e=ua();function t(r){return e(this,r).has(r)}return _o=t,_o}var So,Gh;function xw(){if(Gh)return So;Gh=1;var e=ua();function t(r,n){var i=e(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return So=t,So}var Ao,Kh;function nf(){if(Kh)return Ao;Kh=1;var e=vw(),t=gw(),r=mw(),n=bw(),i=xw();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u<c;){var s=o[u];this.set(s[0],s[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Ao=a,Ao}var Po,Xh;function zm(){if(Xh)return Po;Xh=1;var e=nf(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,u=i?i.apply(this,o):o[0],c=a.cache;if(c.has(u))return c.get(u);var s=n.apply(this,o);return a.cache=c.set(u,s)||c,s};return a.cache=new(r.Cache||e),a}return r.Cache=e,Po=r,Po}var To,Vh;function ww(){if(Vh)return To;Vh=1;var e=zm(),t=500;function r(n){var i=e(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return To=r,To}var Eo,Yh;function Ow(){if(Yh)return Eo;Yh=1;var e=ww(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,u,c,s){a.push(c?s.replace(r,"$1"):u||o)}),a});return Eo=n,Eo}var jo,Zh;function af(){if(Zh)return jo;Zh=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=Array(i);++n<i;)a[n]=r(t[n],n,t);return a}return jo=e,jo}var Mo,Jh;function _w(){if(Jh)return Mo;Jh=1;var e=Nn(),t=af(),r=Re(),n=$r(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(u){if(typeof u=="string")return u;if(r(u))return t(u,o)+"";if(n(u))return a?a.call(u):"";var c=u+"";return c=="0"&&1/u==-1/0?"-0":c}return Mo=o,Mo}var Co,Qh;function Wm(){if(Qh)return Co;Qh=1;var e=_w();function t(r){return r==null?"":e(r)}return Co=t,Co}var $o,ep;function Hm(){if(ep)return $o;ep=1;var e=Re(),t=Ql(),r=Ow(),n=Wm();function i(a,o){return e(a)?a:t(a,o)?[a]:r(n(a))}return $o=i,$o}var Io,tp;function ca(){if(tp)return Io;tp=1;var e=$r();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Io=t,Io}var Ro,rp;function of(){if(rp)return Ro;rp=1;var e=Hm(),t=ca();function r(n,i){i=e(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[t(i[a++])];return a&&a==o?n:void 0}return Ro=r,Ro}var ko,np;function Gm(){if(np)return ko;np=1;var e=of();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return ko=t,ko}var Sw=Gm();const ze=ue(Sw);var Do,ip;function Aw(){if(ip)return Do;ip=1;function e(t){return t==null}return Do=e,Do}var Pw=Aw();const Z=ue(Pw);var No,ap;function Tw(){if(ap)return No;ap=1;var e=mt(),t=Re(),r=bt(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return No=i,No}var Ew=Tw();const Ht=ue(Ew);var jw=ef();const Y=ue(jw);var Mw=Tt();const Ir=ue(Mw);var qo={exports:{}},re={};/**
2
2
  * @license React
3
3
  * react-is.production.min.js
4
4
  *