@mx-cartographer/experiences 5.2.8-alpha.mm2 → 5.2.8-alpha.mm4

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.
@@ -1 +1 @@
1
- export declare const AccountBanner: () => "" | import("react/jsx-runtime").JSX.Element | undefined;
1
+ export declare const AccountBanner: () => import("react/jsx-runtime").JSX.Element | null;
@@ -1,7 +1,8 @@
1
1
  export declare class Fetch {
2
2
  endpoint: string;
3
3
  headers: {};
4
- constructor(endpoint: string, token: string);
4
+ fetchOptions: {};
5
+ constructor(endpoint: string, token: string, options?: {});
5
6
  get: (url: string) => Promise<any>;
6
7
  post: (url: string, data?: any) => Promise<any>;
7
8
  put: (url: string, data: any) => Promise<any>;
package/dist/index.es.js CHANGED
@@ -843,18 +843,20 @@ const Bt = 44, Hr = (A, t) => A.find((i) => i.guid === t), Fs = (A, t) => A.find
843
843
  class _A {
844
844
  endpoint = "/";
845
845
  headers = {};
846
- constructor(t, i) {
846
+ fetchOptions = {};
847
+ constructor(t, i, n = {}) {
847
848
  this.endpoint = t, this.headers = {
848
849
  Accept: "application/json",
849
850
  "Accept-Language": ht(),
850
851
  "Content-Type": "application/json",
851
852
  "MD-Session-Token": i
852
- };
853
+ }, this.fetchOptions = n;
853
854
  }
854
855
  get = async (t) => {
855
856
  const i = {
856
857
  method: "GET",
857
- headers: this.headers
858
+ headers: this.headers,
859
+ ...this.fetchOptions
858
860
  };
859
861
  return fetch(`${this.endpoint}${t}`, i).then((n) => {
860
862
  if (n.ok)
@@ -989,11 +991,18 @@ const ic = "https://analytics.moneydesktop.com";
989
991
  class nc {
990
992
  fetchInstance;
991
993
  constructor() {
992
- this.fetchInstance = new _A(ic, "");
994
+ this.fetchInstance = new _A(ic, "", {
995
+ mode: "no-cors",
996
+ credentials: "include"
997
+ });
993
998
  }
994
999
  requestCampaignBanner = async (t) => {
995
- const i = `/banner/${t}/account_widget_banner`;
996
- return this.fetchInstance.get(i).then((n) => n.banner);
1000
+ try {
1001
+ const i = `/banner/${t}/account_widget_banner`;
1002
+ return this.fetchInstance.get(i).then((n) => n.banner);
1003
+ } catch (i) {
1004
+ return console.error("Error fetching banner:", i), null;
1005
+ }
997
1006
  };
998
1007
  }
999
1008
  class Ot {
@@ -20845,10 +20854,16 @@ const YR = ({
20845
20854
  });
20846
20855
  var zn = /* @__PURE__ */ ((A) => (A[A.Main = 0] = "Main", A[A.RightSide = 1] = "RightSide", A))(zn || {});
20847
20856
  const r3 = () => {
20848
- const A = uA(), { banner: t, loadBanner: i } = zA();
20857
+ const A = uA(), { banner: t, loadBanner: i } = zA(), [n, r] = h.useState(!1);
20849
20858
  return h.useEffect(() => {
20850
- i();
20851
- }, []), t?.redirect_url && t?.image_url && /* @__PURE__ */ e(
20859
+ (async () => {
20860
+ try {
20861
+ await i();
20862
+ } catch (I) {
20863
+ console.error("Failed to load banner:", I), r(!0);
20864
+ }
20865
+ })();
20866
+ }, [i]), n || !t?.redirect_url || !t?.image_url ? null : /* @__PURE__ */ e(
20852
20867
  O,
20853
20868
  {
20854
20869
  sx: {
@@ -20857,7 +20872,7 @@ const r3 = () => {
20857
20872
  justifyContent: "center",
20858
20873
  maxWidth: "100%"
20859
20874
  },
20860
- children: /* @__PURE__ */ e("a", { href: t?.redirect_url, rel: "noreferrer", target: "_blank", children: /* @__PURE__ */ e(
20875
+ children: /* @__PURE__ */ e("a", { href: t.redirect_url, rel: "noreferrer", target: "_blank", children: /* @__PURE__ */ e(
20861
20876
  "img",
20862
20877
  {
20863
20878
  alt: "",