@chatsystem/client 1.1.29 → 1.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export declare function App({ appToken, displayMode, agentId, }: AppProps): JSX_
4
4
 
5
5
  declare type AppProps = {
6
6
  appToken: string;
7
- agentId: number;
7
+ agentId?: number;
8
8
  displayMode?: DisplayModesTypes;
9
9
  };
10
10
 
package/dist/index.mjs CHANGED
@@ -4076,16 +4076,23 @@ un.__WIDGET_ASSET_CACHE__ || (un.__WIDGET_ASSET_CACHE__ = {
4076
4076
  un.__WIDGET_PRELOAD_KEYS__ || (un.__WIDGET_PRELOAD_KEYS__ = /* @__PURE__ */ new Set());
4077
4077
  const Yr = un.__WIDGET_PRELOAD_KEYS__, Ot = un.__WIDGET_ASSET_CACHE__, yf = "widget-assets-v1";
4078
4078
  async function Cr(e, t) {
4079
- const n = await caches.open(yf), r = await n.match(e, { ignoreSearch: !1 });
4080
- if (r) return r.clone();
4081
- const a = await fetch(e, {
4082
- cache: "force-cache",
4083
- mode: "cors",
4084
- keepalive: !0,
4085
- ...t
4086
- });
4087
- if (!a.ok) throw new Error(`HTTP ${a.status} for ${e}`);
4088
- return n.put(e, a.clone()), a;
4079
+ try {
4080
+ const n = await caches.open(yf), r = await n.match(e, { ignoreSearch: !1 });
4081
+ if (r) return r.clone();
4082
+ const a = await fetch(e, {
4083
+ cache: "force-cache",
4084
+ mode: "cors",
4085
+ keepalive: !0,
4086
+ ...t
4087
+ });
4088
+ if (!a.ok) throw new Error(`HTTP ${a.status} for ${e}`);
4089
+ return n.put(e, a.clone()), a;
4090
+ } catch (n) {
4091
+ return console.log("error while fetching", n), new Response(null, {
4092
+ status: 520,
4093
+ statusText: "Error in client - Fetch failed"
4094
+ });
4095
+ }
4089
4096
  }
4090
4097
  async function $s(e) {
4091
4098
  const t = Ot.svg.get(e);