@chrryai/chrry 1.5.42 → 1.5.45

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.js CHANGED
@@ -773,7 +773,7 @@ var init_siteConfig = __esm({
773
773
  favicon: "focus",
774
774
  mode: "focus",
775
775
  slug: "focus",
776
- version: "26.10.46",
776
+ version: "26.10.48",
777
777
  storeSlug: "blossom",
778
778
  name: "Focus",
779
779
  domain: "focus.chrry.ai",
@@ -2093,7 +2093,7 @@ var init_utils = __esm({
2093
2093
  };
2094
2094
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
2095
2095
  config = getSiteConfig(getClientHostname());
2096
- VERSION = config.version || "1.5.42";
2096
+ VERSION = config.version || "1.5.45";
2097
2097
  getSlugFromPathname = (path) => {
2098
2098
  return getAppAndStoreSlugs(path, {
2099
2099
  defaultAppSlug: config.slug,
@@ -23594,17 +23594,15 @@ function AuthProvider({
23594
23594
  sessionData?.app?.store?.apps || []
23595
23595
  );
23596
23596
  const getAppSlug = (targetApp, defaultSlug = "/") => {
23597
- const localeMatch = locales.find(
23598
- (loc) => pathname === `/${loc}` || pathname.startsWith(`/${loc}/`)
23599
- );
23597
+ const localeMatch = locales.find((loc) => {
23598
+ return pathname === `/${loc}` || pathname.startsWith(`/${loc}/`);
23599
+ });
23600
23600
  const localePrefix = localeMatch ? `/${localeMatch}` : "";
23601
23601
  let computedSlug = defaultSlug;
23602
23602
  if (targetApp) {
23603
23603
  if (targetApp.id === baseApp?.id) {
23604
23604
  computedSlug = defaultSlug;
23605
- } else if (baseApp?.id === chrry?.id && targetApp.id === chrry?.id) {
23606
- computedSlug = defaultSlug;
23607
- } else if (targetApp.id === chrry?.id || baseApp?.store?.apps.some((app2) => app2.id === targetApp.id)) {
23605
+ } else if (targetApp.id === app?.id && targetApp.store?.slug === baseApp?.store?.slug && baseApp?.store?.apps.some((app2) => app2.id === targetApp.id)) {
23608
23606
  computedSlug = `/${targetApp.slug}`;
23609
23607
  } else {
23610
23608
  computedSlug = `/${targetApp.store?.slug}/${targetApp.slug}`;
@@ -23629,9 +23627,6 @@ function AuthProvider({
23629
23627
  if (siteConfig.slug === item.slug && item.store?.slug === siteConfig.storeSlug) {
23630
23628
  return true;
23631
23629
  }
23632
- if (item.id !== item.store?.appId) return false;
23633
- if (!item?.store?.domain) return false;
23634
- return getAlterNativeDomains(item.store).includes(chrryUrl) || item.store.domain === chrryUrl;
23635
23630
  });
23636
23631
  const [threadId, setThreadId] = (0, import_react19.useState)(getThreadId(pathname));
23637
23632
  const [app, setAppInternal] = (0, import_react19.useState)(session2?.app || baseApp);
@@ -23825,17 +23820,17 @@ function AuthProvider({
23825
23820
  setShowFocus(canShowFocus);
23826
23821
  }, [canShowFocus]);
23827
23822
  const [store, setStore] = (0, import_react19.useState)(app?.store);
23828
- const base = storeApps.find(
23829
- (a) => a.store?.appId === a.id && a.store.id === app?.store?.id
23830
- );
23831
23823
  const storeAppInternal = app?.store?.apps.find(
23832
- (item) => item.id === app?.store?.appId
23824
+ (item) => app?.store?.appId && item.id === app?.store?.appId
23833
23825
  );
23834
23826
  const [storeApp, setStoreApp] = (0, import_react19.useState)(
23835
23827
  storeAppInternal
23836
23828
  );
23829
+ (0, import_react19.useEffect)(() => {
23830
+ setStoreApp(storeAppInternal);
23831
+ }, [storeAppInternal]);
23837
23832
  const apps = storeApps.filter((item) => {
23838
- return app?.store?.apps?.some((app2) => app2.id === item.id);
23833
+ return app?.store?.app?.store?.apps?.some((app2) => app2.id === item.id);
23839
23834
  });
23840
23835
  const userBaseApp = storeApps?.find(
23841
23836
  (app2) => user?.userName && app2.store?.slug === user?.userName
@@ -23845,9 +23840,6 @@ function AuthProvider({
23845
23840
  (app2) => guest?.id && app2.store?.slug === guest?.id
23846
23841
  );
23847
23842
  const guestBaseStore = guestBaseApp?.store;
23848
- (0, import_react19.useEffect)(() => {
23849
- storeAppInternal && setStoreApp(storeAppInternal);
23850
- }, [storeAppInternal]);
23851
23843
  const [slugState, setSlugState] = (0, import_react19.useState)(
23852
23844
  app && getAppSlug(app) || void 0
23853
23845
  );
@@ -23978,7 +23970,7 @@ function AuthProvider({
23978
23970
  );
23979
23971
  const setApp = (0, import_react19.useCallback)(
23980
23972
  (item) => {
23981
- ;
23973
+ if (!item) return;
23982
23974
  (item?.id !== baseApp?.id || !isExtension2) && setLastAppId(item?.id);
23983
23975
  setAppInternal((prevApp) => {
23984
23976
  const newApp2 = item ? {
@@ -24422,7 +24414,7 @@ function DataProvider({ children, ...rest }) {
24422
24414
  const [instructions, setInstructions] = (0, import_react21.useState)([]);
24423
24415
  const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
24424
24416
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
24425
- const VERSION4 = "1.5.42";
24417
+ const VERSION4 = "1.5.45";
24426
24418
  const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
24427
24419
  const {
24428
24420
  API_URL: API_URL2,
@@ -26885,6 +26877,7 @@ function ChatProvider({
26885
26877
  value && setDebateAgent(null);
26886
26878
  };
26887
26879
  const setSelectedAgent = (agent) => {
26880
+ if (selectedAgent?.name === agent?.name) return;
26888
26881
  if (agent === null) {
26889
26882
  setAgentName("");
26890
26883
  setSelectedAgentInternal(null);
@@ -36088,7 +36081,7 @@ function App({
36088
36081
  ...styles4.appsGrid.style
36089
36082
  }
36090
36083
  },
36091
- /* @__PURE__ */ import_react55.default.createElement(Div, { style: { ...styles4.apps.style } }, appsState.filter((item) => item.id !== popcorn2?.id).slice(0, 5)?.map((item, index) => {
36084
+ /* @__PURE__ */ import_react55.default.createElement(Div, { style: { ...styles4.apps.style } }, appsState.slice(0, 5)?.map((item, index) => {
36092
36085
  const showAtlasHere = index === 1 && app?.id === chrry?.id;
36093
36086
  const showFocusHere = focus2 && !showAtlasHere && index === 1;
36094
36087
  const showPacmanHere = app?.store?.id !== popcorn2?.store?.id && index === 2;
@@ -36167,9 +36160,7 @@ function App({
36167
36160
  size: 24
36168
36161
  }
36169
36162
  ) : /* @__PURE__ */ import_react55.default.createElement(Loading, { size: 24 })
36170
- ), showPacmanHere ? popcorn2 && store && store?.appId !== popcorn2?.id && store?.apps?.some(
36171
- (app2) => app2.id === popcorn2.id
36172
- ) ? /* @__PURE__ */ import_react55.default.createElement(
36163
+ ), showPacmanHere ? popcorn2 && store && store?.appId !== popcorn2?.id && store?.apps?.some((app2) => app2.id === popcorn2.id) ? /* @__PURE__ */ import_react55.default.createElement(
36173
36164
  Anchor,
36174
36165
  {
36175
36166
  preventDefault: true,
@@ -36212,9 +36203,7 @@ function App({
36212
36203
  height: 26
36213
36204
  }
36214
36205
  )
36215
- ) : null, slug && index === appsState.findIndex(
36216
- (a) => getAppSlug(a) === slug
36217
- ) ? /* @__PURE__ */ import_react55.default.createElement(import_react55.default.Fragment, null, /* @__PURE__ */ import_react55.default.createElement(StoreApp, { key: "vex" })) : item.id !== app?.id && /* @__PURE__ */ import_react55.default.createElement(
36206
+ ) : null, slug && getAppSlug(item) === slug ? /* @__PURE__ */ import_react55.default.createElement(import_react55.default.Fragment, null, /* @__PURE__ */ import_react55.default.createElement(StoreApp, { key: "vex" })) : item.id !== app?.id && /* @__PURE__ */ import_react55.default.createElement(
36218
36207
  Anchor,
36219
36208
  {
36220
36209
  preventDefault: true,
@@ -41192,6 +41181,7 @@ function Menu({
41192
41181
  goToThreads
41193
41182
  } = useNavigationContext();
41194
41183
  const { app } = useApp();
41184
+ app && console.log("ssskacsnckjfnckjjdfc kjf c", getAppSlug(app, ""));
41195
41185
  const { viewPortHeight, isStandalone: isStandalone2 } = usePlatform();
41196
41186
  const [loadingThreadId, setLoadingThreadId] = (0, import_react62.useState)(null);
41197
41187
  (0, import_react62.useEffect)(() => {
@@ -41424,7 +41414,7 @@ function Menu({
41424
41414
  /* @__PURE__ */ import_react62.default.createElement(
41425
41415
  Anchor,
41426
41416
  {
41427
- href: isStandalone2 ? void 0 : `${app ? getAppSlug(app, "") : ""}/threads`,
41417
+ href: `${app ? getAppSlug(app, "") : ""}/threads`,
41428
41418
  onClick: (e) => {
41429
41419
  track({
41430
41420
  name: "threads-click-menu"
@@ -41700,33 +41690,40 @@ function Menu({
41700
41690
  )
41701
41691
  ))
41702
41692
  ), !threads?.totalCount && /* @__PURE__ */ import_react62.default.createElement(import_react62.default.Fragment, null, /* @__PURE__ */ import_react62.default.createElement(Div, { style: styles4.noThreadsContainer.style }, t5("Nothing here yet"))), threads?.threads.length ? (() => {
41703
- const url = `/threads${collaborationStatus ? `?collaborationStatus=${collaborationStatus}` : ""}`;
41704
- return /* @__PURE__ */ import_react62.default.createElement(Div, { style: styles4.loadMoreButtonContainer.style }, /* @__PURE__ */ import_react62.default.createElement(
41705
- Anchor,
41693
+ const url = `${app ? getAppSlug(app, "") : ""}/threads${collaborationStatus ? `?collaborationStatus=${collaborationStatus}` : ""}`;
41694
+ return /* @__PURE__ */ import_react62.default.createElement(
41695
+ Div,
41706
41696
  {
41707
- href: url,
41708
- "data-testid": "load-more-threads-menu",
41709
- onClick: (e) => {
41710
- addHapticFeedback();
41711
- track({
41712
- name: "load-more-threads-menu"
41713
- });
41714
- if (e.metaKey || e.ctrlKey) {
41715
- return;
41716
- }
41717
- e.preventDefault();
41718
- isSmallDevice ? toggleMenu() : null;
41719
- collaborationStatus ? goToThreads({
41720
- collaborationStatus
41721
- }) : goToThreads();
41722
- },
41723
- className: "button transparent small",
41724
- style: styles4.loadMoreButton.style
41697
+ suppressHydrationWarning: true,
41698
+ style: styles4.loadMoreButtonContainer.style
41725
41699
  },
41726
- /* @__PURE__ */ import_react62.default.createElement(icons_exports.LoaderCircle, { size: 14 }),
41727
- " ",
41728
- t5("Load more")
41729
- ));
41700
+ /* @__PURE__ */ import_react62.default.createElement(
41701
+ Anchor,
41702
+ {
41703
+ href: url,
41704
+ "data-testid": "load-more-threads-menu",
41705
+ onClick: (e) => {
41706
+ addHapticFeedback();
41707
+ track({
41708
+ name: "load-more-threads-menu"
41709
+ });
41710
+ if (e.metaKey || e.ctrlKey) {
41711
+ return;
41712
+ }
41713
+ e.preventDefault();
41714
+ isSmallDevice ? toggleMenu() : null;
41715
+ collaborationStatus ? goToThreads({
41716
+ collaborationStatus
41717
+ }) : goToThreads();
41718
+ },
41719
+ className: "button transparent small",
41720
+ style: styles4.loadMoreButton.style
41721
+ },
41722
+ /* @__PURE__ */ import_react62.default.createElement(icons_exports.LoaderCircle, { size: 14 }),
41723
+ " ",
41724
+ t5("Load more")
41725
+ )
41726
+ );
41730
41727
  })() : null, !threads?.threads?.length || threads?.threads?.length < 2 ? /* @__PURE__ */ import_react62.default.createElement(EmptyStateTips, { style: { marginTop: 15 } }) : null)
41731
41728
  )
41732
41729
  )