@rpcbase/agents-sdk 0.19.0 → 0.20.0

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.
@@ -56655,17 +56655,20 @@ function yB(e) {
56655
56655
  return Math.ceil(e);
56656
56656
  }
56657
56657
  function bB({ weatherAtLocation: e = vB }) {
56658
- let t = Math.max(...e.hourly.temperature_2m.slice(0, 24)), n = Math.min(...e.hourly.temperature_2m.slice(0, 24)), r = ui(new Date(e.current.time), {
56659
- start: new Date(e.daily.sunrise[0]),
56660
- end: new Date(e.daily.sunset[0])
56661
- }), [i, a] = z(!1);
56658
+ let t = e.current.time.slice(0, 10), n = e.requestedDate, r = n && e.daily.time.includes(n) ? n : t, i = Math.max(e.daily.time.indexOf(r), 0), a = e.hourly.time.flatMap((e, t) => e.slice(0, 10) === r ? [t] : []), o = e.hourly.time.slice(0, 24).map((e, t) => t), s = a.length > 0 ? a : o, c = s.map((t) => e.hourly.temperature_2m[t]), l = Math.max(...c), u = Math.min(...c), d = r === t, [f, p] = z(!1);
56662
56659
  j(() => {
56663
56660
  let e = () => {
56664
- a(window.innerWidth < 768);
56661
+ p(window.innerWidth < 768);
56665
56662
  };
56666
56663
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
56667
56664
  }, []);
56668
- let o = i ? 5 : 6, s = e.hourly.time.findIndex((t) => new Date(t) >= new Date(e.current.time)), c = e.hourly.time.slice(s, s + o), l = e.hourly.temperature_2m.slice(s, s + o), u = e.cityName || `${e.latitude?.toFixed(1)}°, ${e.longitude?.toFixed(1)}°`;
56665
+ let m = f ? 5 : 6, h = new Date(e.current.time).getHours(), g = s.find((t) => {
56666
+ let n = e.hourly.time[t];
56667
+ return d ? new Date(n) >= new Date(e.current.time) : new Date(n).getHours() >= h;
56668
+ }) ?? s[0] ?? 0, _ = Math.max(s.indexOf(g), 0), v = s.slice(_, _ + m), y = v.map((t) => e.hourly.time[t]), b = v.map((t) => e.hourly.temperature_2m[t]), x = y[0] ?? e.current.time, S = d ? e.current.temperature_2m : b[0] ?? e.current.temperature_2m, C = e.daily.sunrise[i], w = e.daily.sunset[i], T = C && w ? ui(new Date(x), {
56669
+ start: new Date(C),
56670
+ end: new Date(w)
56671
+ }) : !0, E = e.cityName || `${e.latitude?.toFixed(1)}°, ${e.longitude?.toFixed(1)}°`;
56669
56672
  return /* @__PURE__ */ H("div", {
56670
56673
  className: "relative flex w-full flex-col gap-3 overflow-hidden rounded-2xl bg-primary p-4 text-primary-foreground shadow-lg backdrop-blur-sm",
56671
56674
  children: [/* @__PURE__ */ V("div", { className: "absolute inset-0 bg-primary-foreground/10 backdrop-blur-sm" }), /* @__PURE__ */ H("div", {
@@ -56675,10 +56678,10 @@ function bB({ weatherAtLocation: e = vB }) {
56675
56678
  className: "mb-2 flex items-center justify-between",
56676
56679
  children: [/* @__PURE__ */ V("div", {
56677
56680
  className: "font-medium text-primary-foreground/80 text-xs",
56678
- children: u
56681
+ children: E
56679
56682
  }), /* @__PURE__ */ V("div", {
56680
56683
  className: "text-primary-foreground/60 text-xs",
56681
- children: sr(new Date(e.current.time), "MMM d, h:mm a")
56684
+ children: sr(new Date(x), "MMM d, h:mm a")
56682
56685
  })]
56683
56686
  }),
56684
56687
  /* @__PURE__ */ H("div", {
@@ -56687,10 +56690,10 @@ function bB({ weatherAtLocation: e = vB }) {
56687
56690
  className: "flex items-center gap-3",
56688
56691
  children: [/* @__PURE__ */ V("div", {
56689
56692
  className: "text-primary-foreground/90",
56690
- children: V(r ? hB : gB, { size: 32 })
56693
+ children: V(T ? hB : gB, { size: 32 })
56691
56694
  }), /* @__PURE__ */ H("div", {
56692
56695
  className: "font-light text-3xl text-primary-foreground",
56693
- children: [yB(e.current.temperature_2m), /* @__PURE__ */ V("span", {
56696
+ children: [yB(S), /* @__PURE__ */ V("span", {
56694
56697
  className: "text-lg text-primary-foreground/80",
56695
56698
  children: e.current_units.temperature_2m
56696
56699
  })]
@@ -56701,14 +56704,14 @@ function bB({ weatherAtLocation: e = vB }) {
56701
56704
  className: "font-medium text-primary-foreground/90 text-xs",
56702
56705
  children: [
56703
56706
  "H: ",
56704
- yB(t),
56707
+ yB(l),
56705
56708
  "°"
56706
56709
  ]
56707
56710
  }), /* @__PURE__ */ H("div", {
56708
56711
  className: "text-primary-foreground/70 text-xs",
56709
56712
  children: [
56710
56713
  "L: ",
56711
- yB(n),
56714
+ yB(u),
56712
56715
  "°"
56713
56716
  ]
56714
56717
  })]
@@ -56721,14 +56724,14 @@ function bB({ weatherAtLocation: e = vB }) {
56721
56724
  children: "Hourly Forecast"
56722
56725
  }), /* @__PURE__ */ V("div", {
56723
56726
  className: "flex justify-between gap-1",
56724
- children: c.map((e, t) => {
56725
- let n = new Date(e), r = n.getHours() === (/* @__PURE__ */ new Date()).getHours();
56727
+ children: y.map((e, t) => {
56728
+ let n = new Date(e), r = d && t === 0;
56726
56729
  return /* @__PURE__ */ H("div", {
56727
56730
  className: Ee("flex min-w-0 flex-1 flex-col items-center gap-1 rounded-md px-1 py-1.5", { "bg-primary-foreground/20": r }),
56728
56731
  children: [
56729
56732
  /* @__PURE__ */ V("div", {
56730
56733
  className: "font-medium text-primary-foreground/70 text-xs",
56731
- children: t === 0 ? "Now" : sr(n, "ha")
56734
+ children: t === 0 && d ? "Now" : sr(n, "ha")
56732
56735
  }),
56733
56736
  /* @__PURE__ */ V("div", {
56734
56737
  className: "text-primary-foreground/60",
@@ -56736,7 +56739,7 @@ function bB({ weatherAtLocation: e = vB }) {
56736
56739
  }),
56737
56740
  /* @__PURE__ */ H("div", {
56738
56741
  className: "font-medium text-primary-foreground text-xs",
56739
- children: [yB(l[t]), "°"]
56742
+ children: [yB(b[t]), "°"]
56740
56743
  })
56741
56744
  ]
56742
56745
  }, e);
@@ -56748,11 +56751,11 @@ function bB({ weatherAtLocation: e = vB }) {
56748
56751
  children: [/* @__PURE__ */ H("div", { children: [
56749
56752
  "Sunrise:",
56750
56753
  " ",
56751
- sr(new Date(e.daily.sunrise[0]), "h:mm a")
56754
+ sr(new Date(C), "h:mm a")
56752
56755
  ] }), /* @__PURE__ */ H("div", { children: [
56753
56756
  "Sunset:",
56754
56757
  " ",
56755
- sr(new Date(e.daily.sunset[0]), "h:mm a")
56758
+ sr(new Date(w), "h:mm a")
56756
56759
  ] })]
56757
56760
  })
56758
56761
  ]