<commit_before>import { Subscribe } from "@react-rxjs/core"
import { BrowserRouter, Route, Switch } from "react-router-dom"
import { Analytics } from "@/App/Analytics"
import { TileView } from "@/App/LiveRates/selectedView"
import { Trades } from "@/App/Trades"
import { Loader } from "@/components/Loader"
import { DetachableLiveRates } from "./DetachableTile/DetachableLiveRates"
import { DetachableTile } from "./DetachableTile/DetachableTile"
import { Snapshots } from "./Snapshots/Snapshots"
import { ChildWindowFrame } from "./Window/ChildWindowFrame"
import { WindowFrame } from "./Window/WindowFrame"
import { DocTitle } from "@/components/DocTitle"
import { OpenFinContactDisplay } from "@/OpenFin/Footer/ContactUsButton"

export const OpenFinApp: React.FC = () => {
  const basename = (import.meta.env.BASE_URL || "").replace(/\/$/, "")
  console.log("basename", basename)
  return (
    <BrowserRouter basename={"/branch/fix_openfin-env"}>
      <Switch>
        <Route
          path="/analytics"
          render={() => (
            <DocTitle title="Analytics">
              <Analytics hideIfMatches={null} />
            </DocTitle>
          )}
        />
        <Route
          path="/blotter"
          render={() => (
            <DocTitle title="Trades">
              <Trades />
            </DocTitle>
          )}
        />
        <Route
          path="/tiles"
          render={() => (
            <DocTitle title="Live Rates">
              <DetachableLiveRates />
            </DocTitle>
          )}
        />
        <Route path="/contact" render={() => <OpenFinContactDisplay />} />
        <Route
          path="/spot/:symbol"
          render={({
            location: { search },
            match: {
              params: { symbol },
            },
          }) => {
            const query = new URLSearchParams(search)
            const view = query.has("tileView")
              ? (query.get("tileView") as TileView)
              : TileView.Analytics

            const loader = (
              <Loader
                ariaLabel="Loading live FX exchange rates"
                minWidth="22rem"
                minHeight="22rem"
              />
            )

            return (
              <Subscribe fallback={loader}>
                <DetachableTile symbol={symbol} view={view} isTornOut={true} />
              </Subscribe>
            )
          }}
        />

        <Route
          exact
          path="/openfin-window-frame"
          render={() => <WindowFrame />}
        /><commit_msg>fix(new-client): Debugging Openfin<commit_after>import { Subscribe } from "@react-rxjs/core"
import { BrowserRouter, Route, Switch } from "react-router-dom"
import { Analytics } from "@/App/Analytics"
import { TileView } from "@/App/LiveRates/selectedView"
import { Trades } from "@/App/Trades"
import { Loader } from "@/components/Loader"
import { DetachableLiveRates } from "./DetachableTile/DetachableLiveRates"
import { DetachableTile } from "./DetachableTile/DetachableTile"
import { Snapshots } from "./Snapshots/Snapshots"
import { ChildWindowFrame } from "./Window/ChildWindowFrame"
import { WindowFrame } from "./Window/WindowFrame"
import { DocTitle } from "@/components/DocTitle"
import { OpenFinContactDisplay } from "@/OpenFin/Footer/ContactUsButton"

export const OpenFinApp: React.FC = () => {
  const [_, basename] = (import.meta.env.BASE_URL || ".com")
    .replace(/\/$/, "")
    .split(".com")
  console.log("basename", basename)
  return (
    <BrowserRouter basename={basename}>
      <Switch>
        <Route
          path="/analytics"
          render={() => (
            <DocTitle title="Analytics">
              <Analytics hideIfMatches={null} />
            </DocTitle>
          )}
        />
        <Route
          path="/blotter"
          render={() => (
            <DocTitle title="Trades">
              <Trades />
            </DocTitle>
          )}
        />
        <Route
          path="/tiles"
          render={() => (
            <DocTitle title="Live Rates">
              <DetachableLiveRates />
            </DocTitle>
          )}
        />
        <Route path="/contact" render={() => <OpenFinContactDisplay />} />
        <Route
          path="/spot/:symbol"
          render={({
            location: { search },
            match: {
              params: { symbol },
            },
          }) => {
            const query = new URLSearchParams(search)
            const view = query.has("tileView")
              ? (query.get("tileView") as TileView)
              : TileView.Analytics

            const loader = (
              <Loader
                ariaLabel="Loading live FX exchange rates"
                minWidth="22rem"
                minHeight="22rem"
              />
            )

            return (
              <Subscribe fallback={loader}>
                <DetachableTile symbol={symbol} view={view} isTornOut={true} />
              </Subscribe>
            )
          }}
        />

        <Route path="/openfin-window-frame" render={() => <WindowFrame />} />
{'fraction_non_alphanumeric': 0.14038876889848811, 'fraction_numerical': 0.0015707834282348322, 'mean_word_length': 1.7446120689655173, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4428888', 'n_tokens_mistral': 1416, 'n_tokens_neox': 1389, 'n_words': 277}