{"version":3,"file":"index-veoKqzVA.js","sources":["../../node_modules/react-dom/client.js","../../src/env.ts","../../src/providers/ui.provider.tsx","../../src/router/DefaultRoute.tsx","../../src/services/env.service.ts","../../src/integrations/ampli/base/index.ts","../../src/integrations/ampli/experimentClients.ts","../../src/integrations/ampli/index.ts","../../src/services/analytics/analytics.ts","../../src/services/analytics/analyticsWrapper.ts","../../src/utils/testIds.ts","../../src/utils/utils.ts","../../src/utils/uxTexts.ts","../../node_modules/clsx/dist/clsx.mjs","../../src/components/Chat/Chat.styles.ts","../../src/components/Chat/Chat.tsx","../../node_modules/@tanstack/query-core/build/modern/subscribable.js","../../node_modules/@tanstack/query-core/build/modern/utils.js","../../node_modules/@tanstack/query-core/build/modern/focusManager.js","../../node_modules/@tanstack/query-core/build/modern/onlineManager.js","../../node_modules/@tanstack/query-core/build/modern/thenable.js","../../node_modules/@tanstack/query-core/build/modern/retryer.js","../../node_modules/@tanstack/query-core/build/modern/notifyManager.js","../../node_modules/@tanstack/query-core/build/modern/removable.js","../../node_modules/@tanstack/query-core/build/modern/query.js","../../node_modules/@tanstack/query-core/build/modern/queryCache.js","../../node_modules/@tanstack/query-core/build/modern/mutation.js","../../node_modules/@tanstack/query-core/build/modern/mutationCache.js","../../node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","../../node_modules/@tanstack/query-core/build/modern/queryClient.js","../../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js","../../src/hooks/useChatServiceConfig.hook.tsx","../../src/contexts/ChatService.context.tsx","../../src/components/Chat/Chat.helper.ts","../../src/components/Chat/Chat.controller.tsx","../../src/assets/logo.svg?react","../../src/router/constants.ts","../../src/router/Routes.ts","../../src/components/TopBar/AccountDropdownMenu/AccountDropdownMenu.styles.ts","../../src/components/TopBar/AccountDropdownMenu/AccountDropdownMenu.tsx","../../src/components/TopBar/TopBar.styles.ts","../../node_modules/lodash.debounce/index.js","../../node_modules/usehooks-ts/dist/index.js","../../src/constants/ui.ts","../../src/constants/chat.ts","../../src/components/SelectModelDropdown/SelectModelDropdown.styles.ts","../../src/components/SelectModelDropdown/SelectModelDropdown.constants.ts","../../node_modules/zustand/esm/vanilla.mjs","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js","../../node_modules/use-sync-external-store/shim/index.js","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js","../../node_modules/use-sync-external-store/shim/with-selector.js","../../node_modules/zustand/esm/index.mjs","../../src/services/featureFlags/featureFlags.store.ts","../../src/services/featureFlags/featureFlags.consts.ts","../../src/services/featureFlags/featureFlags.service.ts","../../src/components/SelectModelDropdown/SelectModelDropdown.tsx","../../src/components/TopBar/TopBar.tsx","../../node_modules/react-use-intercom/dist/index.mjs","../../src/components/SideBar/SideBar.styles.ts","../../src/components/SideBar/SideBar.tsx","../../src/components/modals/NewChatConfirmModal.tsx","../../src/hooks/useDefaultModel.tsx","../../src/components/ChatAppContainer/ChatAppContainer.styles.ts","../../src/components/ChatAppContainer/ChatAppContainer.tsx","../../src/providers/intercom.provider.tsx","../../src/hooks/userSetup.hook.tsx","../../src/providers/business.provider.tsx","../../src/router/NavigateToUrl.tsx","../../src/router/Router.tsx","../../src/App.tsx","../../src/integrations/index.ts","../../src/main.tsx"],"sourcesContent":["'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n","// filter only relevant process.env variables\nconst filteredProcessEnv = Object.keys(process.env).reduce((cur, key) => {\n if (key.startsWith(\"VITE_\")) {\n cur = {\n ...cur,\n [key]: process.env[key],\n };\n }\n\n return cur;\n}, {});\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nwindow.__env__ = { ...filteredProcessEnv, ...window.deploymentEnvVars };\n","import { FC, PropsWithChildren } from \"react\";\nimport { BrowserRouter } from \"react-router-dom\";\n\nexport const UiProvider: FC = ({ children }) => {\n return {children};\n};\n","import { Navigate } from \"react-router-dom\";\n\nfunction DefaultRoute() {\n return ;\n}\n\nexport default DefaultRoute;\n","export const getEnvVar = (key: EnvVarKey, defaultValue = \"\"): string => {\n return window.__env__?.[`${key}`] || defaultValue;\n};\n\nexport enum EnvVarKey {\n apiServerUrl = \"VITE_API_SERVER_URL\",\n amplitudeExperimentProxyUrl = \"VITE_AMPLITUDE_EXPERIMENT_PROXY_URL\",\n amplitudeExperimentApiKey = \"VITE_AMPLITUDE_EXPERIMENT_API_KEY\",\n identityServerUrl = \"VITE_IDENTITY_SERVER_URL\",\n sessionReplaySampleRate = \"VITE_SESSION_REPLAY_SAMPLE_RATE\",\n intercomAppId = \"VITE_INTERCOM_APP_ID\",\n studioAppUrl = \"VITE_STUDIO_APP_URL\",\n redirectToLoginURL = \"VITE_REDIRECT_TO_LOGIN_URL\",\n emailValidationRedirectUrl = \"VITE_EMAIL_VALIDATION_REDIRECT_URL\",\n}\n","/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n/**\n * Ampli - A strong typed wrapper for your Analytics\n *\n * This file is generated by Amplitude.\n * To update run 'ampli pull studio-web'\n *\n * Required dependencies: @amplitude/analytics-browser@^1.3.0\n * Tracking Plan Version: 3\n * Build: 1.0.0\n * Runtime: browser:typescript-ampli-v2\n *\n * [View Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest)\n *\n * [Full Setup Instructions](https://data.amplitude.com/ai21/language-studio/implementation/studio-web)\n */\n\nimport * as amplitude from '@amplitude/analytics-browser';\n\nexport type Environment = 'default';\n\nexport const ApiKey: Record = {\n default: 'be0223327acdb089744156d19857f1ac'\n};\n\n/**\n * Default Amplitude configuration options. Contains tracking plan information.\n */\nexport const DefaultConfiguration: BrowserOptions = {\n plan: {\n version: '3',\n branch: 'main',\n source: 'studio-web',\n versionId: 'c298b71d-9bd6-49bf-8326-1c2dbaa7215b'\n },\n ...{\n ingestionMetadata: {\n sourceName: 'browser-typescript-ampli',\n sourceVersion: '2.0.0'\n }\n }\n};\n\nexport interface LoadOptionsBase { disabled?: boolean }\n\nexport type LoadOptionsWithEnvironment = LoadOptionsBase & { environment: Environment; client?: { configuration?: BrowserOptions; }; };\nexport type LoadOptionsWithApiKey = LoadOptionsBase & { client: { apiKey: string; configuration?: BrowserOptions; } };\nexport type LoadOptionsWithClientInstance = LoadOptionsBase & { client: { instance: BrowserClient; } };\n\nexport type LoadOptions = LoadOptionsWithEnvironment | LoadOptionsWithApiKey | LoadOptionsWithClientInstance;\n\nexport interface IdentifyProperties {\n initial_referrer?: string;\n initial_referring_domain?: string;\n initial_utm_campaign?: string;\n initial_utm_medium?: string;\n initial_utm_source?: string;\n initial_utm_term?: any;\n JxContactForm?: {\n /**\n * the attribution answer to the Jx Contact form\n */\n attributionAnswer?: string;\n /**\n * The user Company Size from the Jx Contact Form\n */\n companySize?: string;\n /**\n * The user country from the Jx Contact Form\n */\n country?: string;\n /**\n * if the user is a Journalist or Creator based on Jx Contact Form\n */\n isJournalistOrContentCreator?: boolean;\n /**\n * The origin for the form submission\n */\n origin?: \"contactPage\";\n };\n organization_id?: string;\n organization_plan_type?: string;\n organization_properties?: {\n organization_id?: {\n [k: string]: any;\n };\n organization_plan_type?: {\n [k: string]: any;\n };\n organization_role?: {\n [k: string]: any;\n };\n };\n /**\n * | Rule | Value |\n * |---|---|\n * | Enum Values | member, admin |\n */\n organization_role?: \"member\" | \"admin\";\n origin?: {\n ad_set_name?: {\n [k: string]: any;\n };\n cookieCreationTime?: {\n [k: string]: any;\n };\n cookieLastUpdateTime?: {\n [k: string]: any;\n };\n gclid?: {\n [k: string]: any;\n };\n lpDeviceId?: {\n [k: string]: any;\n };\n referrer?: {\n [k: string]: any;\n };\n referrer_domain?: {\n [k: string]: any;\n };\n userCreationDate?: string;\n utm_campaign?: {\n [k: string]: any;\n };\n utm_medium?: {\n [k: string]: any;\n };\n utm_source?: {\n [k: string]: any;\n };\n utm_term?: {\n [k: string]: any;\n };\n };\n referrer?: any;\n referring_domain?: any;\n signupForm?: {\n accountType?: {\n [k: string]: any;\n };\n companyName?: {\n [k: string]: any;\n };\n companySize?: {\n [k: string]: any;\n };\n referralChannel?: {\n \"0\"?: {\n [k: string]: any;\n };\n \"1\"?: {\n [k: string]: any;\n };\n \"2\"?: {\n [k: string]: any;\n };\n \"3\"?: {\n [k: string]: any;\n };\n other?: {\n [k: string]: any;\n };\n };\n };\n utm_campaign?: any;\n utm_medium?: any;\n utm_source?: any;\n utm_term?: any;\n}\n\nexport interface ApiErrorProperties {\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, studio-api, studioWebApp |\n */\n app?: \"languageStudioWebapp\" | \"studio-api\" | \"studioWebApp\";\n endpoint?: string;\n errorMessage?: {\n message?: string;\n };\n origin?: string;\n page?: string;\n path?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n status?: number;\n}\n\nexport interface ApiRequestProperties {\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, studio-api, studioWebApp |\n */\n app?: \"languageStudioWebapp\" | \"studio-api\" | \"studioWebApp\";\n endpoint?: string;\n origin?: string;\n page?: string;\n path?: string;\n}\n\nexport interface ApiSuccessProperties {\n /**\n * | Rule | Value |\n * |---|---|\n * | Regex | |\n */\n app?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Regex | |\n */\n endpoint?: string;\n origin?: any;\n page?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Regex | |\n */\n path?: string;\n}\n\nexport interface AuthCompletedProperties {\n app?: string;\n authMethod?: string;\n authType?: string;\n origin?: string;\n page?: string;\n path?: string;\n}\n\nexport interface AuthProviderFailedProperties {\n app?: string;\n authMethod?: string;\n authType?: string;\n errorCode?: string;\n errorMessage?: string;\n origin?: string;\n page?: string;\n path?: string;\n}\n\nexport interface AuthProviderSucceededProperties {\n app?: string;\n authMethod?: string;\n authType?: string;\n origin?: string;\n page?: string;\n path?: string;\n}\n\nexport interface AuthStartedProperties {\n /**\n * the app firing the event\n */\n app?: string;\n authMethod?: string;\n authType?: string;\n origin?: string;\n page?: string;\n path?: string;\n}\n\nexport interface ButtonPressedProperties {\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, studioWebApp |\n */\n app?: \"languageStudioWebapp\" | \"studioWebApp\";\n buttonText?: string;\n destination?: string;\n entity?: string;\n itemId?: string;\n origin?: string;\n page?: string;\n path?: string;\n source?: string;\n testId?: string;\n}\n\nexport interface ChatErrorProperties {\n /**\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, studio-api, studioWebApp |\n */\n app: \"languageStudioWebapp\" | \"studio-api\" | \"studioWebApp\";\n errorMessage?: string;\n host?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n numStopSequences?: number;\n page?: string;\n path?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n promptLength?: number;\n}\n\nexport interface ChatGeneratedProperties {\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, studio-api, studioWebApp |\n */\n app?: \"languageStudioWebapp\" | \"studio-api\" | \"studioWebApp\";\n countPenalty?: {\n applyToEmojis?: boolean;\n applyToNumbers?: boolean;\n applyToPunctuations?: boolean;\n applyToStopwords?: boolean;\n applyToWhitespaces?: boolean;\n scale?: number;\n };\n endpoint?: string;\n epoch?: string;\n frequencyPenalty?: {\n applyToEmojis?: boolean;\n applyToNumbers?: boolean;\n applyToPunctuations?: boolean;\n applyToStopwords?: boolean;\n applyToWhitespaces?: boolean;\n scale?: number;\n };\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n generatedTextLength?: number;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n generatedTextLengthToken?: number;\n interactionId: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n maxTokens?: number;\n model?: string;\n modelId?: string;\n modelType?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n numResults?: number;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n numStopSequences?: number;\n presencePenalty?: {\n applyToEmojis?: boolean;\n applyToNumbers?: boolean;\n applyToPunctuations?: boolean;\n applyToStopwords?: boolean;\n applyToWhitespaces?: boolean;\n scale?: number;\n };\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n promptLength?: number;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n promptLengthToken?: number;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n promptTokenLength?: number;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n requestDuration?: number;\n setId?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Item Type | string |\n */\n stopSequences?: string[];\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n temperature?: number;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n topKReturn?: number;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n topP?: number;\n}\n\nexport interface ChatRequestedProperties {\n /**\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, studio-api, studioWebApp |\n */\n app: \"languageStudioWebapp\" | \"studio-api\" | \"studioWebApp\";\n countPenalty?: string;\n endpoint?: string;\n epoch?: string;\n frequencyPenalty?: string;\n hideSelectors?: string;\n host?: string;\n maxTokens?: string;\n model?: string;\n modelId?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n numOfMessages?: number;\n outputId?: string;\n page?: string;\n path?: string;\n presencePenalty?: string;\n role?: string;\n stopSequences?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n temperature?: number;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n topP?: number;\n}\n\nexport interface ConversationalRagErrorProperties {\n /**\n * the app firing the event\n */\n app?: string;\n endpoint: string;\n errorMessage: string;\n host: string;\n page?: string;\n path?: string;\n}\n\nexport interface ConversationalRagGeneratedProperties {\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, studioWebApp, studio-api |\n */\n app: \"languageStudioWebapp\" | \"studioWebApp\" | \"studio-api\";\n endpoint: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n generatedSourcesUsed: number;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n generatedTextLength: number;\n host: string;\n interactionId: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n numOfMessages: number;\n page: string;\n path: string;\n role: string;\n}\n\nexport interface ConversationalRagRequestedProperties {\n /**\n * the app firing the event\n */\n app?: string;\n endpoint: string;\n host: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n numOfMessages: number;\n page?: string;\n path?: string;\n role: string;\n}\n\nexport interface CreateUserFailedProperties {\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, studioWebApp |\n */\n app?: \"languageStudioWebapp\" | \"studioWebApp\";\n endpoint?: string;\n errorMessage?: string;\n origin?: string;\n page?: string;\n path?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n status?: number;\n}\n\nexport interface CreateUserSucceededProperties {\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | l, a, n, g, u, a, g, e, S, t, u, d, i, o, W, e, b, a, p, p |\n */\n app?: \"l\" | \"a\" | \"n\" | \"g\" | \"u\" | \"e\" | \"S\" | \"t\" | \"d\" | \"i\" | \"o\" | \"W\" | \"b\" | \"p\";\n endpoint?: string;\n origin?: string;\n page?: string;\n path?: string;\n}\n\nexport interface DialogProperties {\n action?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n actionValue?: number;\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, studio-api, studioWebApp |\n */\n app?: \"languageStudioWebapp\" | \"studio-api\" | \"studioWebApp\";\n code?: string;\n eventType?: string;\n language?: string;\n page?: string;\n path?: string;\n title?: string;\n type?: string;\n}\n\nexport interface DocumentUploadFailedProperties {\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, chatApp, faDemoApp, authApp, studio-api, studio-identity, studio-docs, studio-api, studioWebApp |\n */\n app?:\n | \"languageStudioWebapp\"\n | \"chatApp\"\n | \"faDemoApp\"\n | \"authApp\"\n | \"studio-api\"\n | \"studio-identity\"\n | \"studio-docs\"\n | \"studioWebApp\";\n documentId?: string;\n documentType?: string;\n reason?: string;\n}\n\nexport interface DocumentUploadSucceededProperties {\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, chatApp, faDemoApp, authApp, studio-api, studio-identity, studio-docs, studio-api, studioWebApp |\n */\n app?:\n | \"languageStudioWebapp\"\n | \"chatApp\"\n | \"faDemoApp\"\n | \"authApp\"\n | \"studio-api\"\n | \"studio-identity\"\n | \"studio-docs\"\n | \"studioWebApp\";\n documentId?: string;\n documentType?: string;\n reason?: string;\n}\n\nexport interface FeedbackSubmitErrorProperties {\n answer?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, studioWebApp |\n */\n app: \"languageStudioWebapp\" | \"studioWebApp\";\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n completionLength: number;\n endpoint?: string;\n errorMessage?: string;\n interactionId?: string;\n model?: string;\n origin: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n promptLength?: number;\n questionText?: string;\n reason?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n score?: number;\n type?: string;\n}\n\nexport interface FeedbackSubmittedProperties {\n answer?: string;\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | l, a, n, g, u, a, g, e, S, t, u, d, i, o, W, e, b, a, p, p |\n */\n app?: \"l\" | \"a\" | \"n\" | \"g\" | \"u\" | \"e\" | \"S\" | \"t\" | \"d\" | \"i\" | \"o\" | \"W\" | \"b\" | \"p\";\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n completionLength?: number;\n endpoint?: string;\n interactionId?: string;\n model?: string;\n origin?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n promptLength?: number;\n questionText?: string;\n reason?: string;\n requestId?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n score?: number;\n type?: string;\n}\n\nexport interface GetUserFailedProperties {\n app?: string;\n endpoint?: string;\n errorMessage?: string;\n page?: string;\n path?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n status?: number;\n}\n\nexport interface GetUserSucceededProperties {\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | l, a, n, g, u, a, g, e, S, t, u, d, i, o, W, e, b, a, p, p |\n */\n app?: \"l\" | \"a\" | \"n\" | \"g\" | \"u\" | \"e\" | \"S\" | \"t\" | \"d\" | \"i\" | \"o\" | \"W\" | \"b\" | \"p\";\n endpoint?: string;\n origin?: string;\n page?: string;\n path?: string;\n}\n\nexport interface PageEnteredProperties {\n _hsenc?: string;\n _hsmi?: string;\n ad_set_name?: string;\n /**\n * the app firing the event\n *\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, jxWebapp, studio-docs, website, studioWebApp |\n */\n app?: \"languageStudioWebapp\" | \"jxWebapp\" | \"studio-docs\" | \"website\" | \"studioWebApp\";\n curr_path?: string;\n curr_search?: string;\n gad?: string;\n gclid?: string;\n host?: string;\n navAction?: string;\n path?: string;\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n prev_durationMillis?: number;\n prev_path?: string;\n queryParams?: string;\n referrer?: string;\n utm_campaign?: string;\n utm_content?: string;\n utm_medium?: string;\n utm_source?: string;\n utm_term?: string;\n}\n\nexport interface PageExitedProperties {\n /**\n * | Rule | Value |\n * |---|---|\n * | Enum Values | languageStudioWebapp, jxWebapp, studioWebApp |\n */\n app: \"languageStudioWebapp\" | \"jxWebapp\" | \"studioWebApp\";\n /**\n * | Rule | Value |\n * |---|---|\n * | Type | number |\n */\n durationMillis?: number;\n navAction?: string;\n path?: string;\n search?: string;\n}\n\nexport interface UserLoginFailedProperties {\n app?: string;\n authMethod?: string;\n authType?: string;\n errorCode?: string;\n errorMessage?: string;\n origin?: string;\n page?: string;\n path?: string;\n}\n\nexport interface UserLoginSucceededProperties {\n app?: string;\n authMethod?: string;\n authType?: string;\n origin?: string;\n page?: string;\n path?: string;\n}\n\nexport interface UserSignUpFailedProperties {\n app?: string;\n authMethod?: string;\n authType?: string;\n errorCode?: string;\n errorMessage?: string;\n origin?: string;\n page?: string;\n path?: string;\n}\n\nexport interface UserSignUpSucceededProperties {\n app?: string;\n authMethod?: string;\n authType?: string;\n origin?: string;\n page?: string;\n path?: string;\n}\n\nexport class Identify implements BaseEvent {\n event_type = amplitude.Types.SpecialEventType.IDENTIFY;\n\n constructor(\n public event_properties?: IdentifyProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class ApiError implements BaseEvent {\n event_type = 'ApiError';\n\n constructor(\n public event_properties?: ApiErrorProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class ApiRequest implements BaseEvent {\n event_type = 'ApiRequest';\n\n constructor(\n public event_properties?: ApiRequestProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class ApiSuccess implements BaseEvent {\n event_type = 'ApiSuccess';\n\n constructor(\n public event_properties?: ApiSuccessProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class AuthCompleted implements BaseEvent {\n event_type = 'AuthCompleted';\n\n constructor(\n public event_properties?: AuthCompletedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class AuthProviderFailed implements BaseEvent {\n event_type = 'AuthProviderFailed';\n\n constructor(\n public event_properties?: AuthProviderFailedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class AuthProviderSucceeded implements BaseEvent {\n event_type = 'AuthProviderSucceeded';\n\n constructor(\n public event_properties?: AuthProviderSucceededProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class AuthStarted implements BaseEvent {\n event_type = 'AuthStarted';\n\n constructor(\n public event_properties?: AuthStartedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class ButtonPressed implements BaseEvent {\n event_type = 'ButtonPressed';\n\n constructor(\n public event_properties?: ButtonPressedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class ChatError implements BaseEvent {\n event_type = 'ChatError';\n\n constructor(\n public event_properties: ChatErrorProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class ChatGenerated implements BaseEvent {\n event_type = 'ChatGenerated';\n\n constructor(\n public event_properties: ChatGeneratedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class ChatRequested implements BaseEvent {\n event_type = 'ChatRequested';\n\n constructor(\n public event_properties: ChatRequestedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class ConversationalRagError implements BaseEvent {\n event_type = 'ConversationalRagError';\n\n constructor(\n public event_properties: ConversationalRagErrorProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class ConversationalRagGenerated implements BaseEvent {\n event_type = 'ConversationalRagGenerated';\n\n constructor(\n public event_properties: ConversationalRagGeneratedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class ConversationalRagRequested implements BaseEvent {\n event_type = 'ConversationalRagRequested';\n\n constructor(\n public event_properties: ConversationalRagRequestedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class CreateUserFailed implements BaseEvent {\n event_type = 'CreateUserFailed';\n\n constructor(\n public event_properties?: CreateUserFailedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class CreateUserSucceeded implements BaseEvent {\n event_type = 'CreateUserSucceeded';\n\n constructor(\n public event_properties?: CreateUserSucceededProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class Dialog implements BaseEvent {\n event_type = 'Dialog';\n\n constructor(\n public event_properties?: DialogProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class DocumentUploadFailed implements BaseEvent {\n event_type = 'DocumentUploadFailed';\n\n constructor(\n public event_properties?: DocumentUploadFailedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class DocumentUploadSucceeded implements BaseEvent {\n event_type = 'DocumentUploadSucceeded';\n\n constructor(\n public event_properties?: DocumentUploadSucceededProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class FeedbackSubmitError implements BaseEvent {\n event_type = 'FeedbackSubmitError';\n\n constructor(\n public event_properties: FeedbackSubmitErrorProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class FeedbackSubmitted implements BaseEvent {\n event_type = 'FeedbackSubmitted';\n\n constructor(\n public event_properties?: FeedbackSubmittedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class GetUserFailed implements BaseEvent {\n event_type = 'GetUserFailed';\n\n constructor(\n public event_properties?: GetUserFailedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class GetUserSucceeded implements BaseEvent {\n event_type = 'GetUserSucceeded';\n\n constructor(\n public event_properties?: GetUserSucceededProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class PageEntered implements BaseEvent {\n event_type = 'PageEntered';\n\n constructor(\n public event_properties?: PageEnteredProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class PageExited implements BaseEvent {\n event_type = 'PageExited';\n\n constructor(\n public event_properties: PageExitedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class UserLoginFailed implements BaseEvent {\n event_type = 'UserLoginFailed';\n\n constructor(\n public event_properties?: UserLoginFailedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class UserLoginSucceeded implements BaseEvent {\n event_type = 'UserLoginSucceeded';\n\n constructor(\n public event_properties?: UserLoginSucceededProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class UserSignUpFailed implements BaseEvent {\n event_type = 'UserSignUpFailed';\n\n constructor(\n public event_properties?: UserSignUpFailedProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport class UserSignUpSucceeded implements BaseEvent {\n event_type = 'UserSignUpSucceeded';\n\n constructor(\n public event_properties?: UserSignUpSucceededProperties,\n ) {\n this.event_properties = event_properties;\n }\n}\n\nexport type PromiseResult = { promise: Promise };\n\nconst getVoidPromiseResult = () => ({ promise: Promise.resolve() });\n\n// prettier-ignore\nexport class Ampli {\n private disabled: boolean = false;\n private amplitude?: BrowserClient;\n\n get client(): BrowserClient {\n this.isInitializedAndEnabled();\n return this.amplitude!;\n }\n\n get isLoaded(): boolean {\n return this.amplitude != null;\n }\n\n private isInitializedAndEnabled(): boolean {\n if (!this.amplitude) {\n console.error('ERROR: Ampli is not yet initialized. Have you called ampli.load() on app start?');\n return false;\n }\n return !this.disabled;\n }\n\n /**\n * Initialize the Ampli SDK. Call once when your application starts.\n *\n * @param options Configuration options to initialize the Ampli SDK with.\n */\n load(options: LoadOptions): PromiseResult {\n this.disabled = options.disabled ?? false;\n\n if (this.amplitude) {\n console.warn('WARNING: Ampli is already intialized. Ampli.load() should be called once at application startup.');\n return getVoidPromiseResult();\n }\n\n let apiKey: string | null = null;\n if (options.client && 'apiKey' in options.client) {\n apiKey = options.client.apiKey;\n } else if ('environment' in options) {\n apiKey = ApiKey[options.environment];\n }\n\n if (options.client && 'instance' in options.client) {\n this.amplitude = options.client.instance;\n } else if (apiKey) {\n this.amplitude = amplitude.createInstance();\n const configuration = (options.client && 'configuration' in options.client) ? options.client.configuration : {};\n return this.amplitude.init(apiKey, undefined, { ...DefaultConfiguration, ...configuration });\n } else {\n console.error(\"ERROR: ampli.load() requires 'environment', 'client.apiKey', or 'client.instance'\");\n }\n\n return getVoidPromiseResult();\n }\n\n /**\n * Identify a user and set user properties.\n *\n * @param userId The user's id.\n * @param properties The user properties.\n * @param options Optional event options.\n */\n identify(\n userId: string | undefined,\n properties?: IdentifyProperties,\n options?: EventOptions,\n ): PromiseResult {\n if (!this.isInitializedAndEnabled()) {\n return getVoidPromiseResult();\n }\n\n if (userId) {\n options = {...options, user_id: userId};\n }\n\n const amplitudeIdentify = new amplitude.Identify();\n const eventProperties = properties;\n if (eventProperties != null) {\n for (const [key, value] of Object.entries(eventProperties)) {\n amplitudeIdentify.set(key, value);\n }\n }\n return this.amplitude!.identify(\n amplitudeIdentify,\n options,\n );\n }\n\n /**\n * Flush the event.\n */\n flush() : PromiseResult {\n if (!this.isInitializedAndEnabled()) {\n return getVoidPromiseResult();\n }\n\n return this.amplitude!.flush();\n }\n\n /**\n * Track event\n *\n * @param event The event to track.\n * @param options Optional event options.\n */\n track(event: Event, options?: EventOptions): PromiseResult {\n if (!this.isInitializedAndEnabled()) {\n return getVoidPromiseResult();\n }\n\n return this.amplitude!.track(event, undefined, options);\n }\n\n /**\n * ApiError\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/ApiError)\n *\n * Fired upon any API error\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n apiError(\n properties?: ApiErrorProperties,\n options?: EventOptions,\n ) {\n return this.track(new ApiError(properties), options);\n }\n\n /**\n * ApiRequest\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/ApiRequest)\n *\n * Fired upon any API request\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n apiRequest(\n properties?: ApiRequestProperties,\n options?: EventOptions,\n ) {\n return this.track(new ApiRequest(properties), options);\n }\n\n /**\n * ApiSuccess\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/ApiSuccess)\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n apiSuccess(\n properties?: ApiSuccessProperties,\n options?: EventOptions,\n ) {\n return this.track(new ApiSuccess(properties), options);\n }\n\n /**\n * AuthCompleted\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/AuthCompleted)\n *\n * Fired when Authentication was completed\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n authCompleted(\n properties?: AuthCompletedProperties,\n options?: EventOptions,\n ) {\n return this.track(new AuthCompleted(properties), options);\n }\n\n /**\n * AuthProviderFailed\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/AuthProviderFailed)\n *\n * Fired when authentication failed for Auth Provider\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n authProviderFailed(\n properties?: AuthProviderFailedProperties,\n options?: EventOptions,\n ) {\n return this.track(new AuthProviderFailed(properties), options);\n }\n\n /**\n * AuthProviderSucceeded\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/AuthProviderSucceeded)\n *\n * Fired when authentication succeeded for auth provider\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n authProviderSucceeded(\n properties?: AuthProviderSucceededProperties,\n options?: EventOptions,\n ) {\n return this.track(new AuthProviderSucceeded(properties), options);\n }\n\n /**\n * AuthStarted\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/AuthStarted)\n *\n * Fired when Authentication process starting\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n authStarted(\n properties?: AuthStartedProperties,\n options?: EventOptions,\n ) {\n return this.track(new AuthStarted(properties), options);\n }\n\n /**\n * ButtonPressed\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/ButtonPressed)\n *\n * Fired upon any button pressed in the UI - generic event\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n buttonPressed(\n properties?: ButtonPressedProperties,\n options?: EventOptions,\n ) {\n return this.track(new ButtonPressed(properties), options);\n }\n\n /**\n * ChatError\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/ChatError)\n *\n * Fired when a chat request returned an error\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n chatError(\n properties: ChatErrorProperties,\n options?: EventOptions,\n ) {\n return this.track(new ChatError(properties), options);\n }\n\n /**\n * ChatGenerated\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/ChatGenerated)\n *\n * Fired when a chat result was generated for the user\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n chatGenerated(\n properties: ChatGeneratedProperties,\n options?: EventOptions,\n ) {\n return this.track(new ChatGenerated(properties), options);\n }\n\n /**\n * ChatRequested\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/ChatRequested)\n *\n * Fired when a user activates a chat with an input\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n chatRequested(\n properties: ChatRequestedProperties,\n options?: EventOptions,\n ) {\n return this.track(new ChatRequested(properties), options);\n }\n\n /**\n * ConversationalRagError\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/ConversationalRagError)\n *\n * Fired when the Conversational RAG API returned an error\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n conversationalRagError(\n properties: ConversationalRagErrorProperties,\n options?: EventOptions,\n ) {\n return this.track(new ConversationalRagError(properties), options);\n }\n\n /**\n * ConversationalRagGenerated\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/ConversationalRagGenerated)\n *\n * Fired when the Conversational RAG API generated a result\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n conversationalRagGenerated(\n properties: ConversationalRagGeneratedProperties,\n options?: EventOptions,\n ) {\n return this.track(new ConversationalRagGenerated(properties), options);\n }\n\n /**\n * ConversationalRagRequested\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/ConversationalRagRequested)\n *\n * Fired when the Conversational RAG API was activated\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n conversationalRagRequested(\n properties: ConversationalRagRequestedProperties,\n options?: EventOptions,\n ) {\n return this.track(new ConversationalRagRequested(properties), options);\n }\n\n /**\n * CreateUserFailed\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/CreateUserFailed)\n *\n * Fired when user creation was failed\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n createUserFailed(\n properties?: CreateUserFailedProperties,\n options?: EventOptions,\n ) {\n return this.track(new CreateUserFailed(properties), options);\n }\n\n /**\n * CreateUserSucceeded\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/CreateUserSucceeded)\n *\n * Fired when user creation succeeded\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n createUserSucceeded(\n properties?: CreateUserSucceededProperties,\n options?: EventOptions,\n ) {\n return this.track(new CreateUserSucceeded(properties), options);\n }\n\n /**\n * Dialog\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/Dialog)\n *\n * Fired when any dialog event happened to the user\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. action)\n * @param options Amplitude event options.\n */\n dialog(\n properties?: DialogProperties,\n options?: EventOptions,\n ) {\n return this.track(new Dialog(properties), options);\n }\n\n /**\n * DocumentUploadFailed\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/DocumentUploadFailed)\n *\n * Event has no description in tracking plan.\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n documentUploadFailed(\n properties?: DocumentUploadFailedProperties,\n options?: EventOptions,\n ) {\n return this.track(new DocumentUploadFailed(properties), options);\n }\n\n /**\n * DocumentUploadSucceeded\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/DocumentUploadSucceeded)\n *\n * Event has no description in tracking plan.\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n documentUploadSucceeded(\n properties?: DocumentUploadSucceededProperties,\n options?: EventOptions,\n ) {\n return this.track(new DocumentUploadSucceeded(properties), options);\n }\n\n /**\n * FeedbackSubmitError\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/FeedbackSubmitError)\n *\n * Fired when an error occured during feedback submission\n *\n * Owner: data@amplitude.com\n *\n * @param properties The event's properties (e.g. answer)\n * @param options Amplitude event options.\n */\n feedbackSubmitError(\n properties: FeedbackSubmitErrorProperties,\n options?: EventOptions,\n ) {\n return this.track(new FeedbackSubmitError(properties), options);\n }\n\n /**\n * FeedbackSubmitted\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/FeedbackSubmitted)\n *\n * Fired when a user submitted a feedback\n *\n * Owner: data@amplitude.com\n *\n * @param properties The event's properties (e.g. answer)\n * @param options Amplitude event options.\n */\n feedbackSubmitted(\n properties?: FeedbackSubmittedProperties,\n options?: EventOptions,\n ) {\n return this.track(new FeedbackSubmitted(properties), options);\n }\n\n /**\n * GetUserFailed\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/GetUserFailed)\n *\n * Fired when a user fetch attempt failed\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n getUserFailed(\n properties?: GetUserFailedProperties,\n options?: EventOptions,\n ) {\n return this.track(new GetUserFailed(properties), options);\n }\n\n /**\n * GetUserSucceeded\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/GetUserSucceeded)\n *\n * Fired when a user fetch attempt succeeded\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n getUserSucceeded(\n properties?: GetUserSucceededProperties,\n options?: EventOptions,\n ) {\n return this.track(new GetUserSucceeded(properties), options);\n }\n\n /**\n * PageEntered\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/PageEntered)\n *\n * Fired when the user navigated into a webpage\n *\n * Owner: data@amplitude.com\n *\n * @param properties The event's properties (e.g. _hsenc)\n * @param options Amplitude event options.\n */\n pageEntered(\n properties?: PageEnteredProperties,\n options?: EventOptions,\n ) {\n return this.track(new PageEntered(properties), options);\n }\n\n /**\n * PageExited\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/PageExited)\n *\n * Fired when the user navigated out of a webpage\n *\n * Owner: data@amplitude.com\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n pageExited(\n properties: PageExitedProperties,\n options?: EventOptions,\n ) {\n return this.track(new PageExited(properties), options);\n }\n\n /**\n * UserLoginFailed\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/UserLoginFailed)\n *\n * Fired when user login failed\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n userLoginFailed(\n properties?: UserLoginFailedProperties,\n options?: EventOptions,\n ) {\n return this.track(new UserLoginFailed(properties), options);\n }\n\n /**\n * UserLoginSucceeded\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/UserLoginSucceeded)\n *\n * Fired when user successfully logged in\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n userLoginSucceeded(\n properties?: UserLoginSucceededProperties,\n options?: EventOptions,\n ) {\n return this.track(new UserLoginSucceeded(properties), options);\n }\n\n /**\n * UserSignUpFailed\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/UserSignUpFailed)\n *\n * Fired when user signup failed\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n userSignUpFailed(\n properties?: UserSignUpFailedProperties,\n options?: EventOptions,\n ) {\n return this.track(new UserSignUpFailed(properties), options);\n }\n\n /**\n * UserSignUpSucceeded\n *\n * [View in Tracking Plan](https://data.amplitude.com/ai21/language-studio/events/main/latest/UserSignUpSucceeded)\n *\n * Fired when user successfully signed up\n *\n * Owner: Efrat Garber Aran\n *\n * @param properties The event's properties (e.g. app)\n * @param options Amplitude event options.\n */\n userSignUpSucceeded(\n properties?: UserSignUpSucceededProperties,\n options?: EventOptions,\n ) {\n return this.track(new UserSignUpSucceeded(properties), options);\n }\n}\n\nexport const ampli = new Ampli();\n\n// BASE TYPES\ntype BrowserOptions = amplitude.Types.BrowserOptions;\n\nexport type BrowserClient = amplitude.Types.BrowserClient;\nexport type BaseEvent = amplitude.Types.BaseEvent;\nexport type IdentifyEvent = amplitude.Types.IdentifyEvent;\nexport type GroupEvent = amplitude.Types.GroupIdentifyEvent;\nexport type Event = amplitude.Types.Event;\nexport type EventOptions = amplitude.Types.EventOptions;\nexport type Result = amplitude.Types.Result;\n","import { createExperimentClient } from \"@ai21/experiments\";\nimport { getEnvVar, EnvVarKey } from \"@/services/env.service\";\n\nconst amplitudeExperimentApiKey = getEnvVar(EnvVarKey.amplitudeExperimentApiKey);\nconst amplitudeExperimentProxyUrl = getEnvVar(EnvVarKey.amplitudeExperimentProxyUrl);\nconst amplitudeFlagsServerUrl = `${amplitudeExperimentProxyUrl}/experiments/flags`;\nconst amplitudeServerUrl = `${amplitudeExperimentProxyUrl}/experiments/api`;\n\nexport const experimentClient = createExperimentClient({\n clientIdentifier: \"studio-jamba-chat-app\",\n debug: window.__env__?.VITE_AMPLI_ENV === \"development\",\n // The server URLs are proxied to our local Caddy reverse proxy server\n amplitudeExperimentApiKey,\n amplitudeServerUrl,\n amplitudeFlagsServerUrl,\n trackEvent: () => undefined,\n});\n","import { EnvVarKey, getEnvVar } from \"@/services/env.service\";\nimport type { Ampli } from \"./base/index\";\nimport { ampli } from \"./base/index\";\nimport { sessionReplayPlugin } from \"@amplitude/plugin-session-replay-browser\";\n\nexport type FunctionKeys = {\n [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;\n}[keyof T];\n\nexport type AmpliFunctionKey = Exclude, \"exposure\" | \"track\" | \"load\" | \"flush\" | \"identify\">;\n\nexport type AmpliEventBaseProps = {\n app: string;\n host?: string;\n path?: string;\n referrerPageHost?: string;\n referrerPagePath?: string;\n};\n\nexport function initAmpli() {\n ampli.load({\n client: {\n apiKey: window.__env__.VITE_AMPLI_KEY,\n configuration: { defaultTracking: false },\n },\n });\n ampli.client.add(\n sessionReplayPlugin({\n sampleRate: Number(getEnvVar(EnvVarKey.sessionReplaySampleRate)) || 1,\n }),\n );\n}\n\nexport * from \"./base/index\";\nexport { experimentClient } from \"./experimentClients\";\n","import { ampli, Ampli, AmpliEventBaseProps, AmpliFunctionKey } from \"../../integrations/ampli\";\n\nexport async function trackEvent(\n eventType: K,\n props: Omit[0], keyof AmpliEventBaseProps>,\n options?: Parameters[1],\n) {\n const { referrer } = document;\n const refUrl = referrer ? new URL(referrer) : null;\n\n const baseProps: AmpliEventBaseProps = {\n app: \"chatApp\",\n host: window.location.hostname,\n path: window.location.pathname,\n referrerPageHost: refUrl?.hostname,\n referrerPagePath: refUrl?.pathname,\n };\n return ampli?.[eventType]({ ...baseProps, ...props } as any, options);\n}\n","import { trackEvent } from \"./analytics\";\n\nexport const onMouseEventClickWithAnalytics = (\n handler?: (e: React.MouseEvent) => void,\n): ((e: React.MouseEvent) => void) => {\n return (e: React.MouseEvent) => {\n try {\n const entity = e.currentTarget.getAttribute(\"data-testid\");\n const buttonText = e.currentTarget.textContent || e.currentTarget.getAttribute(\"aria-label\") || \"\";\n if (entity && buttonText !== null) {\n trackEvent(\"buttonPressed\", {\n buttonText,\n entity,\n });\n }\n } catch (error) {\n console.error(\"Error tracking button click event\", error);\n } finally {\n if (handler) {\n handler(e);\n }\n }\n };\n};\n\nexport const onClickHandlerWithAnalytics =

(\n handler: (...args: P) => void,\n buttonText: string | ((...args: P) => string),\n entity: string | ((...args: P) => string),\n): ((...args: P) => void) => {\n return (...args: P) => {\n if (typeof buttonText !== \"string\") {\n buttonText = buttonText(...args);\n }\n\n if (typeof entity !== \"string\") {\n entity = entity(...args);\n }\n\n try {\n trackEvent(\"buttonPressed\", {\n buttonText,\n entity,\n });\n } catch (error) {\n console.error(\"Error tracking button click event\", error);\n } finally {\n handler(...args);\n }\n };\n};\n","export const testIds = {\n chat: {\n modals: {\n editMessageModal: {\n cancel: \"ChatEditMessageModalCancel\",\n submit: \"ChatEditMessageModalSubmit\",\n },\n regenerateModal: {\n cancel: \"ChatRegenerateModalCancel\",\n regenerate: \"ChatRegenerateModalRegenerate\",\n },\n messageInfoModal: {\n closeButton: \"ChatMessageInfoModalClose\",\n },\n messageSourcesModal: {\n sourceButton: \"ChatMessageSourcesModalSourceButton\",\n backButton: \"ChatMessageSourcesModalBackButton\",\n copyAll: \"ChatMessageSourcesModalCopyAll\",\n copy: \"ChatMessageSourcesModalCopy\",\n },\n chatFunctionModal: {\n submit: \"chatFunctionModalSubmit\",\n cancel: \"chatFunctionModalCancel\",\n delete: \"chatFunctionModalDelete\",\n },\n },\n buttons: {\n newChat: \"NewChatButton\",\n cancelNewChat: \"CancelNewChatButton\",\n newChatMobile: \"NewChatButtonMobile\",\n configuration: \"ChatConfiguration\",\n viewCode: \"ChatViewCode\",\n clear: \"ChatClear\",\n edit: \"ChatEdit\",\n userMessageCopy: \"ChatUserMessageCopy\",\n assistantMessageCopy: \"ChatAssistantMessageCopy\",\n regenerate: \"ChatRegenerateMessage\",\n source: \"ChatMessageSource\",\n info: \"ChatMessageInfo\",\n goodFeedback: \"ChatGoodFeedback\",\n badFeedback: \"ChatBadFeedback\",\n clearInput: \"ChatClearInput\",\n submitMessage: \"ChatSubmitMessage\",\n promptCard: \"ChatPromptCard\",\n uploadDocument: \"UploadDocument\",\n deleteDocument: \"DeleteDocument\",\n },\n dropdowns: {\n selectModelDropdown: {\n trigger: \"SelectModelDropdownButton\",\n items: {\n jambaMini: \"SelectModelDropdownJambaMini\",\n jambaLarge: \"SelectModelDropdownJambaLarge\",\n },\n },\n },\n },\n};\n","/**\n * Pluralizes a word based on the given count.\n * @returns {string} The appropriate form of the word based on the count.\n * @example\n * // Returns 'apple'\n * pluralize(1, 'apple');\n *\n * @example\n * // Returns 'apples'\n * pluralize(2, 'apple');\n *\n * @example\n * // Returns 'children'\n * pluralize(2, 'child', 'children');\n */\nexport const pluralize = (count: number, singular: string, plural?: string): string => {\n return count <= 1 ? singular : plural || `${singular}s`;\n};\n","import { pluralize } from \"./utils\";\n\nexport const uxTexts = {\n announcement: {\n text: '🎉 Introducing Jamba 1.6!',\n subtext: 'The best open model for private deployment.',\n linkTextPrefix: 'Try it below or',\n linkText: 'read our blog',\n },\n topBar: {\n startBuilding: \"Start building\",\n profile: \"Profile\",\n },\n accountMenu: {\n support: \"Support\",\n documentation: \"Documentation\",\n privacyPolicy: \"Privacy policy\",\n termsOfUse: \"Terms of service\",\n logout: \"Logout\",\n useDesktopBanner: \"Unlock all features on desktop.\",\n },\n chatPage: {\n actions: {\n deleteDocument: \"Delete document\",\n },\n messagesFeed: {\n generatingLoaderMessage: \"Generating...\",\n regeneratingLoaderMessage: \"Re-generating...\",\n scrollToBottomCta: \"Scroll to bottom\",\n },\n toolbar: {\n clearChatButton: \"Clear\",\n clearChatTooltip: \"Clear chat\",\n viewSdkCodeButton: \"View code\",\n modelConfigButton: \"Configuration\",\n },\n input: {\n placeholder: \"Message...\",\n loadingPlaceholder: \"Generating...\",\n submitLabel: \"Submit\",\n clearLabel: \"Clear\",\n uploadDocument: \"Upload document\",\n },\n footer: {\n technologyDisclaimer: \"Jamba can make mistakes. Please verify information.\",\n },\n emptyChat: {\n header: {\n title: \"Jamba Chat\",\n subtitle: \"How can I help you today?\",\n bannerText: \"Unlock all features on desktop.\",\n },\n suggestionCards: [\n {\n title: \"Enhance email for accuracy and clarity\",\n prompt:\n \"You are a marketing expert with great writing skills. Can you take this email draft and improve it?\\n\\nI want it to look professional and be engaging and fun. This will be sent to our user-base mailing list\\n\\n \\n\\nSubject: New languages in Socialll\\n\\n \\n\\nHi there,\\n\\n \\n\\nI just wanted to let you know that we added some new languages to Socialll. Now it supports German, Swedish, and Korean. We worked hard on this, so I hope you find it useful.\\n\\n \\n\\nIf you have users who speak those languages, they can now use our tool in their native language. It should make things easier for them. I think that's it. Let me know if there are any problems.\",\n },\n {\n title: \"Summarize text based on instructions provided\",\n prompt:\n \"I need you to summarize the text below based on the instructions provided:\\n\\nThe latest generation of anti-obesity drugs mimic a hormone called glucagon-like peptide 1 (GLP-1), which is associated with appetite regulation. Semaglutide was approved by the US Food and Drug Administration in 2017, under the name Ozempic, to treat type 2 diabetes, and later, in 2021, as Wegovy, for the treatment of obesity. Tirzepatide, marketed as Mounjaro, was approved in 2022 to treat diabetes, but is also prescribed off-label for weight loss. A research letter published last week in JAMA looked at a sample of people with obesity in a large health-insurance database. The authors found that the incidence of pancreatitis — inflammation of the pancreas — was 4.6 times higher in people taking semaglutide than in people taking a weight-loss medication that does not mimic GLP-1. The study also found that semaglutide and liraglutide, another GLP-1 medication, were associated with an increased incidence of gastroparesis, a disorder that slows or stops the movement of food from the stomach to the intestine. Clinical trials had already shown an association between GLP-1 drugs and gastrointestinal side effects, including nausea, constipation and rare cases of pancreatitis. “What’s new is that, for all of them, we actually gave an incidence number,” says Mahyar Etminan, an epidemiologist at the University of British Columbia in Vancouver, Canada, and an author of the JAMA research. Jaime Almandoz, an endocrinologist at the University of Texas Southwestern Medical Center in Dallas, says that because clinical trials tend to exclude people who are at a higher risk of developing certain conditions, epidemiological studies can provide better insight into complications that might arise in the real world. But the study has an important limitation, says Daniel Drucker, an endocrinologist at the University of Toronto in Canada. It relies on diagnoses recorded on health-care claims, which might not always be accurate. “A doctor can write down pancreatitis and there it is on the health-care claim. There’s no additional scrutiny as to whether or not that’s correct,” he says. Marilyn Tan, an endocrinologist at Stanford University in California, says that she routinely counsels patients with diabetes about the potential for gastrointestinal side effects from GLP-1 medications. She notes, however, that as more providers who are not specialists in diabetes or obesity prescribe these medications, “it’s unclear if all patients are being fully informed about the potential risks.”\\n\\nThe summary must be:\\n\\n* in bullet point form\\n\\n* written in a professional tone\\n\\n* mention all anti-obesity drugs present in the text\",\n },\n {\n title: \"Identify and extract answers from text\",\n prompt:\n 'I am required to find out the answer to the following questions from the given text.\\n\\n \\n\\nWe plotted four graphs from the data, as prescribed in the PSM procedure. Our graphing procedures yielded rounded, estimated dollar values rather than finding those values to the penny. In this way we created a reasonably solid graphical treatment of the \"value boundaries\" as perceived by our sample of planners. Because this is the first applica- tion of PSM to this market, we are not able to make categorical conclusions regarding the application of the value boundaries.\\n\\nThe graph in Exhibit 1 plots the cumulative distributions of responses for \"cheap\" and \"expensive.\" The intersection of these curves, $70, is the indifference price (IDP), or the point where an equal number of respondents fed the price is cheap as think it expensive. The indifference price percentage (IDP percentage) is the corresponding cumulative distribution percentage at the indifference price. A low IDP percentage indicates a high level of price consciousness, while a high IDP percentage indicates diffuse price consciousness. We determined the IDP percentage to be approximately 37 percent, a relatively low value that indicates a measure of price sensitivity.\\n\\nThe graph in Exhibit 2 depicts the optimal pricing point (OPP), or the point where purchase resistance due to price is at its lowest. We estimated the optimal pricing point for this sample at $52.00. Exhibit 3 combines the cumulative distributions of the planners\\' responses to four `questions regarding what is cheap, expensive, too cheap, and too expensive. We found that the optimal pricing point fell to the left of the indifference price. This finding indicates some stress in our market, since the optimal point is $18 lower than (on the \"cheap\" side of) the indifference price.\\n\\nThe key to the PSM technique is the reinterpretation of the data so that the distributions of \"cheap\" and \"expensive\" are reversed to depict the prices at which the room value is \"not cheap\" and \"not expensive.\" One of the reasons for handling the data in this way is that asking respondents to identify a price at which something is \"not cheap\" or \"not expensive\" is awkward and prone to error. Asking respondents to give a price that is \"cheap\" and then inferring that it is therefore \"not expensive\" provides a more reliable set of data. The resulting graph (Exhibit 4) combines the reversed cumulative distribution of \"cheap\" and \"expensive\" from Exhibit 1 with Exhibit 2\\'s distributions of \"too cheap\" and \"too expensive.\" The resulting area indicates the range of acceptable prices (RAP), which is the distance between the points of marginal cheapness (PMC) and marginal expensiveness (PME). The smaller this range, the greater the sensitivity to price. In analyzing Exhibit 4, the point of marginal cheapness was found to be $38.00 and the point of marginal expensiveness to be $92.00, giving a range of acceptable prices of $54.00.\\n\\nApplicable. The results of this study show that the price-sensitivity-measurement technique can most likely be applied to the hotel industry. We have no basis for comparing or interpreting our re-suits, however. Although we have been able to ascertain an indifference point, an indifference percentage, an optimum pricing point, a stress level, and a range of acceptable prices, we have no lodging-industry benchmarks with which to compare those values. We can conclude that some meeting planners have in mind threshold prices outside of which price will inhibit their decision to purchase. At this point, however, we are unable to determine the degree to which our respondents are price sensitive (compared to other buyers). We learned that the range of acceptable prices was $54.00, but without more study we cannot conclude whether this is a large or a small range. These limitations could be overcome by further applications of the model to the lodging industry.\\n\\nAdditional research would provide more data with which we could compare these results.\\n\\n \\n\\nPlease describe the key to the PSM technique and provide the differentiating points between a Low and High IDP. Answer this in 2 paragraphs, always capitalize “PSM Technique” and avoid complicated words.',\n },\n ],\n },\n assistantMessage: {\n functionInput: {\n inputPlaceholder: \"Submit output\",\n },\n },\n modals: {\n fileUploadModal: {\n infoText: \"Upload one file at a time as context for this chat session.\",\n },\n viewCodeModal: {\n title: \"View code\",\n subtitle:\n \"Use the code below to integrate the API into your application. The current prompt and configuration are applied. You can find your API key in the account page.\",\n copyButton: \"Copy code\",\n },\n editMessageModal: {\n title: \"Edit message\",\n subtitle: \"Editing a message will clear all later messages in chat history. Earlier messages will be retained.\",\n submitButton: \"Submit\",\n cancelButton: \"Cancel\",\n },\n regenerateModal: {\n title: \"Re-generate\",\n message:\n \"Re-generating a message will clear all later messages in chat history. Earlier messages will be retained.\",\n submitButton: \"Re-generate\",\n cancelButton: \"Cancel\",\n },\n messageInfoModal: {\n title: \"Output information\",\n closeButton: \"Close\",\n modelParametersTitle: \"Model parameters used\",\n modelParam: \"Model\",\n temperatureParam: \"Temperature\",\n maxTokensParam: \"Max completion length\",\n topPParam: \"Top-P\",\n responseTokensCount: \"Tokens\",\n characters: \"Characters\",\n systemInstructions: \"System instructions\",\n responseLatency: \"Latency\",\n },\n messageSourcesModal: {\n title: \"Sources\",\n subtitle: (sources: number) => `Based on ${sources} doc${sources > 1 ? \"s\" : \"\"}`,\n closeButton: \"Close\",\n sourceButton: \"MessageSourceFile\",\n backButton: \"Back\",\n copyAll: \"Copy all\",\n copy: \"Copy\",\n },\n chatFunctionModal: {\n addTitle: \"Add function\",\n addDescription:\n \"Add functions to Jamba to enhance your app’s capabilities. Jamba will choose to call these functions based on its understanding of the conversation.\",\n editTitle: \"Edit function\",\n editDescription:\n \"Add functions to Jamba to enhance your app’s capabilities. Jamba will choose to call these functions based on its understanding of the conversation.\",\n submitButton: \"Save function\",\n cancelButton: \"Cancel\",\n deleteButton: \"Delete\",\n templateButton: \"Examples\",\n },\n },\n errors: {\n outOfCredits: \"You're out of credits. To continue chatting, become a pro user.\",\n addCredites: \"Add credits\",\n generalMessage: \"Unable to complete the task at this time. Please try again in a few moments.\",\n trialEnded: \"Your free trial has come to an end. Upgrade your plan to continue building.\",\n upgrade: \"Upgrade plan\",\n },\n },\n modals: {\n addLabelsModal: {\n new: {\n title: () => \"Label your documents\",\n message: () => \"Add new or existing labels to your documents, or leave blank to skip this step.\",\n saveButton: \"Save and continue\",\n dismissButton: \"Skip\",\n inProgress: \"Updating documents...\",\n },\n add: {\n title: (rowsSelected: number) => (rowsSelected > 1 ? \"Add labels\" : \"Manage labels\"),\n inProgress: \"Update in progress...\",\n message: (rowsSelected: number) =>\n rowsSelected > 1\n ? `Add new or existing labels to the ${rowsSelected} selected documents.`\n : \"Edit labels for your documents, or leave blank to skip this step.\",\n saveButton: \"Save changes\",\n dismissButton: \"Cancel\",\n },\n },\n fileUploadModal: {\n loadingTitle: \"Uploading documents\",\n uploading: \"Uploading...\",\n title: (isMultiple: boolean) => `Upload document${isMultiple ? \"s\" : \"\"}`,\n alertBannerInfoMessage: \"Uploaded files will be added to your organization's RAG.\",\n infoText: \"We support PDF, DOCX, TXT, HTML and Markdown\",\n fileNotSupportedText: \"File type not supported, please try again.\",\n uploadButton: (isMultiple: boolean) => `Select file${isMultiple ? \"s\" : \"\"}`,\n footerText: \"Upload up to 50 files of up to 100MB each and a total of 1GB. For further details read the \",\n footerLink: {\n text: \"docs.\",\n url: \"https://docs.ai21.com/docs/rag-engine-overview\",\n },\n cancelButton: \"Cancel\",\n cancelling: \"Cancelling...\",\n },\n clearLabelsModal: {\n title: \"Clear labels?\",\n clearLabelsInProgress: \"Clearing labels in progress...\",\n message: (documentCount: number) =>\n `Are you sure you want to remove the labels from the ${documentCount > 1 ? documentCount : \"\"} selected ${pluralize(documentCount, \"document\")}${documentCount > 1 ? \"?\" : \" \"}`,\n submitButton: (documentCount: number) => `Clear from ${documentCount} ${pluralize(documentCount, \"document\")}`,\n cancelButton: \"Cancel\",\n },\n deleteDocumentModal: {\n title: (documentCount: number) => `Delete ${pluralize(documentCount, \"document\")}?`,\n deleteInProgress: (documentCount: number) => `Deleting ${pluralize(documentCount, \"document\")}...`,\n firstMessagePart: (documentCount: number) =>\n `Are you sure you want to delete the ${documentCount > 1 ? documentCount : \"\"} selected ${pluralize(documentCount, \"document\")}`,\n\n secondMessagePart: \"? Models will no longer use this data to generate responses.\",\n submitButton: (documentCount: number) => `Delete ${documentCount} ${pluralize(documentCount, \"document\")}`,\n cancelButton: \"Cancel\",\n },\n newChatModal: {\n title: \"Start new chat?\",\n content:\n \"Starting a new chat will clear your current session, including all saved context and conversation history. Are you sure you want to proceed?\",\n submitButton: \"New chat\",\n cancelButton: \"Cancel\",\n },\n },\n dropzone: {\n title: \"Drag files here to add to this conversation\",\n subtitle: \"Upload files up to a total of 10MB. We support .txt .html .md .docx and .pdf\",\n fileNotSupportedText: \"File type not supported, please try again.\",\n },\n terms: {\n signing: `By signing up you agree to the `,\n termsAndConditions: \"terms and conditions\",\n and: ` and `,\n privacyPolicy: \"privacy policy.\",\n },\n actions: {\n newChat: \"New chat\",\n },\n TermsOfUsePage: {\n BackToChat: \"Back to chat\",\n },\n selectModelDropdown: {\n iconButton: {\n label: \"Select Model\",\n },\n },\n};\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t\n [\n {\n \"gap-300\": isEmptyChat,\n },\n \"h-full\",\n \"pb-300\",\n ].concat(smChatRootClasses);\n\nexport const chatBottomClasses = [\"gap-025\", \"max-w-[730px]\"].concat(\n lgChatBottomClasses,\n mdChatBottomClasses,\n smChatBottomClasses,\n);\n","import { FC, useMemo } from \"react\";\nimport {\n ChatError,\n ChatFooter,\n ChatMessage,\n ChatMessageFeed,\n EmptyChatExampleCards,\n EmptyChatHeader,\n} from \"@studio/chat-ui\";\nimport { ChatInputField, ChatInputFieldProps, Flex } from \"@studio/design-system\";\nimport { ChatProps } from \"./Chat.types\";\nimport { onClickHandlerWithAnalytics, onMouseEventClickWithAnalytics } from \"@/services/analytics/analyticsWrapper\";\nimport { trackEvent } from \"@/services/analytics/analytics\";\nimport { testIds } from \"@/utils/testIds\";\nimport { uxTexts } from \"@/utils/uxTexts\";\nimport clsx from \"clsx\";\nimport { chatBottomClasses, chatRootClasses } from \"./Chat.styles\";\n\nexport const Chat: FC = ({\n callbacks: {\n assignFeedback,\n clearChatError,\n deleteDocument,\n editMessage,\n onAddDocument,\n regenerateMessage,\n sendMessage,\n showMessageInfo,\n toggleAiTypingEffect,\n stopGeneratingMessage,\n },\n chatFooterLink,\n errors: { chatError },\n messages,\n uiState: { isGeneratingMessage, isRegeneratingMessage, showAiTypingEffect },\n userName,\n}) => {\n const isEmpty = useMemo(\n () => !isGeneratingMessage && (!messages || messages.length === 0),\n [isGeneratingMessage, messages],\n );\n\n const handleMessage: ChatInputFieldProps[\"onSubmit\"] = ({ text, type }) => {\n sendMessage(text);\n if (type === \"keypress\") return;\n\n trackEvent(\"buttonPressed\", {\n buttonText: uxTexts.chatPage.input.submitLabel,\n entity: `newChat`,\n });\n };\n\n const styleClasses = useMemo(() => {\n return {\n root: clsx(chatRootClasses(isEmpty)),\n bottom: clsx(chatBottomClasses),\n };\n }, [isEmpty]);\n\n const stopGeneratingButtonProps = useMemo(\n () => ({\n onClick: stopGeneratingMessage,\n }),\n [stopGeneratingMessage],\n );\n\n return (\n \n {isEmpty && (\n <>\n \n prompt, testIds.chat.buttons.promptCard)}\n className=\"!max-w-[730px]\"\n />\n \n )}\n\n {!isEmpty && (\n \n )}\n\n \n {chatError && }\n \n \n \n \n );\n};\n","// src/subscribable.ts\nvar Subscribable = class {\n constructor() {\n this.listeners = /* @__PURE__ */ new Set();\n this.subscribe = this.subscribe.bind(this);\n }\n subscribe(listener) {\n this.listeners.add(listener);\n this.onSubscribe();\n return () => {\n this.listeners.delete(listener);\n this.onUnsubscribe();\n };\n }\n hasListeners() {\n return this.listeners.size > 0;\n }\n onSubscribe() {\n }\n onUnsubscribe() {\n }\n};\nexport {\n Subscribable\n};\n//# sourceMappingURL=subscribable.js.map","// src/utils.ts\nvar isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {\n}\nfunction functionalUpdate(updater, input) {\n return typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n return typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction resolveStaleTime(staleTime, query) {\n return typeof staleTime === \"function\" ? staleTime(query) : staleTime;\n}\nfunction resolveEnabled(enabled, query) {\n return typeof enabled === \"function\" ? enabled(query) : enabled;\n}\nfunction matchQuery(filters, query) {\n const {\n type = \"all\",\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale\n } = filters;\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false;\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false;\n }\n }\n if (type !== \"all\") {\n const isActive = query.isActive();\n if (type === \"active\" && !isActive) {\n return false;\n }\n if (type === \"inactive\" && isActive) {\n return false;\n }\n }\n if (typeof stale === \"boolean\" && query.isStale() !== stale) {\n return false;\n }\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false;\n }\n if (predicate && !predicate(query)) {\n return false;\n }\n return true;\n}\nfunction matchMutation(filters, mutation) {\n const { exact, status, predicate, mutationKey } = filters;\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false;\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false;\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false;\n }\n }\n if (status && mutation.state.status !== status) {\n return false;\n }\n if (predicate && !predicate(mutation)) {\n return false;\n }\n return true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n const hashFn = options?.queryKeyHashFn || hashKey;\n return hashFn(queryKey);\n}\nfunction hashKey(queryKey) {\n return JSON.stringify(\n queryKey,\n (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n result[key] = val[key];\n return result;\n }, {}) : val\n );\n}\nfunction partialMatchKey(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (a && b && typeof a === \"object\" && typeof b === \"object\") {\n return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key]));\n }\n return false;\n}\nfunction replaceEqualDeep(a, b) {\n if (a === b) {\n return a;\n }\n const array = isPlainArray(a) && isPlainArray(b);\n if (array || isPlainObject(a) && isPlainObject(b)) {\n const aItems = array ? a : Object.keys(a);\n const aSize = aItems.length;\n const bItems = array ? b : Object.keys(b);\n const bSize = bItems.length;\n const copy = array ? [] : {};\n let equalItems = 0;\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i];\n if ((!array && aItems.includes(key) || array) && a[key] === void 0 && b[key] === void 0) {\n copy[key] = void 0;\n equalItems++;\n } else {\n copy[key] = replaceEqualDeep(a[key], b[key]);\n if (copy[key] === a[key] && a[key] !== void 0) {\n equalItems++;\n }\n }\n }\n return aSize === bSize && equalItems === aSize ? a : copy;\n }\n return b;\n}\nfunction shallowEqualObjects(a, b) {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\nfunction isPlainArray(value) {\n return Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n const ctor = o.constructor;\n if (ctor === void 0) {\n return true;\n }\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n return false;\n }\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false;\n }\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(timeout) {\n return new Promise((resolve) => {\n setTimeout(resolve, timeout);\n });\n}\nfunction replaceData(prevData, data, options) {\n if (typeof options.structuralSharing === \"function\") {\n return options.structuralSharing(prevData, data);\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== \"production\") {\n try {\n return replaceEqualDeep(prevData, data);\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`\n );\n }\n }\n return replaceEqualDeep(prevData, data);\n }\n return data;\n}\nfunction keepPreviousData(previousData) {\n return previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n const newItems = [...items, item];\n return max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n const newItems = [item, ...items];\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\nvar skipToken = Symbol();\nfunction ensureQueryFn(options, fetchOptions) {\n if (process.env.NODE_ENV !== \"production\") {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`\n );\n }\n }\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise;\n }\n if (!options.queryFn || options.queryFn === skipToken) {\n return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`));\n }\n return options.queryFn;\n}\nexport {\n addToEnd,\n addToStart,\n ensureQueryFn,\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n isPlainArray,\n isPlainObject,\n isServer,\n isValidTimeout,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceData,\n replaceEqualDeep,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n skipToken,\n sleep,\n timeUntilStale\n};\n//# sourceMappingURL=utils.js.map","// src/focusManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar FocusManager = class extends Subscribable {\n #focused;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onFocus) => {\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus();\n window.addEventListener(\"visibilitychange\", listener, false);\n return () => {\n window.removeEventListener(\"visibilitychange\", listener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup((focused) => {\n if (typeof focused === \"boolean\") {\n this.setFocused(focused);\n } else {\n this.onFocus();\n }\n });\n }\n setFocused(focused) {\n const changed = this.#focused !== focused;\n if (changed) {\n this.#focused = focused;\n this.onFocus();\n }\n }\n onFocus() {\n const isFocused = this.isFocused();\n this.listeners.forEach((listener) => {\n listener(isFocused);\n });\n }\n isFocused() {\n if (typeof this.#focused === \"boolean\") {\n return this.#focused;\n }\n return globalThis.document?.visibilityState !== \"hidden\";\n }\n};\nvar focusManager = new FocusManager();\nexport {\n FocusManager,\n focusManager\n};\n//# sourceMappingURL=focusManager.js.map","// src/onlineManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar OnlineManager = class extends Subscribable {\n #online = true;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onOnline) => {\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true);\n const offlineListener = () => onOnline(false);\n window.addEventListener(\"online\", onlineListener, false);\n window.addEventListener(\"offline\", offlineListener, false);\n return () => {\n window.removeEventListener(\"online\", onlineListener);\n window.removeEventListener(\"offline\", offlineListener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup(this.setOnline.bind(this));\n }\n setOnline(online) {\n const changed = this.#online !== online;\n if (changed) {\n this.#online = online;\n this.listeners.forEach((listener) => {\n listener(online);\n });\n }\n }\n isOnline() {\n return this.#online;\n }\n};\nvar onlineManager = new OnlineManager();\nexport {\n OnlineManager,\n onlineManager\n};\n//# sourceMappingURL=onlineManager.js.map","// src/thenable.ts\nfunction pendingThenable() {\n let resolve;\n let reject;\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n thenable.status = \"pending\";\n thenable.catch(() => {\n });\n function finalize(data) {\n Object.assign(thenable, data);\n delete thenable.resolve;\n delete thenable.reject;\n }\n thenable.resolve = (value) => {\n finalize({\n status: \"fulfilled\",\n value\n });\n resolve(value);\n };\n thenable.reject = (reason) => {\n finalize({\n status: \"rejected\",\n reason\n });\n reject(reason);\n };\n return thenable;\n}\nexport {\n pendingThenable\n};\n//# sourceMappingURL=thenable.js.map","// src/retryer.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { pendingThenable } from \"./thenable.js\";\nimport { isServer, sleep } from \"./utils.js\";\nfunction defaultRetryDelay(failureCount) {\n return Math.min(1e3 * 2 ** failureCount, 3e4);\n}\nfunction canFetch(networkMode) {\n return (networkMode ?? \"online\") === \"online\" ? onlineManager.isOnline() : true;\n}\nvar CancelledError = class extends Error {\n constructor(options) {\n super(\"CancelledError\");\n this.revert = options?.revert;\n this.silent = options?.silent;\n }\n};\nfunction isCancelledError(value) {\n return value instanceof CancelledError;\n}\nfunction createRetryer(config) {\n let isRetryCancelled = false;\n let failureCount = 0;\n let isResolved = false;\n let continueFn;\n const thenable = pendingThenable();\n const cancel = (cancelOptions) => {\n if (!isResolved) {\n reject(new CancelledError(cancelOptions));\n config.abort?.();\n }\n };\n const cancelRetry = () => {\n isRetryCancelled = true;\n };\n const continueRetry = () => {\n isRetryCancelled = false;\n };\n const canContinue = () => focusManager.isFocused() && (config.networkMode === \"always\" || onlineManager.isOnline()) && config.canRun();\n const canStart = () => canFetch(config.networkMode) && config.canRun();\n const resolve = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onSuccess?.(value);\n continueFn?.();\n thenable.resolve(value);\n }\n };\n const reject = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onError?.(value);\n continueFn?.();\n thenable.reject(value);\n }\n };\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved || canContinue()) {\n continueResolve(value);\n }\n };\n config.onPause?.();\n }).then(() => {\n continueFn = void 0;\n if (!isResolved) {\n config.onContinue?.();\n }\n });\n };\n const run = () => {\n if (isResolved) {\n return;\n }\n let promiseOrValue;\n const initialPromise = failureCount === 0 ? config.initialPromise : void 0;\n try {\n promiseOrValue = initialPromise ?? config.fn();\n } catch (error) {\n promiseOrValue = Promise.reject(error);\n }\n Promise.resolve(promiseOrValue).then(resolve).catch((error) => {\n if (isResolved) {\n return;\n }\n const retry = config.retry ?? (isServer ? 0 : 3);\n const retryDelay = config.retryDelay ?? defaultRetryDelay;\n const delay = typeof retryDelay === \"function\" ? retryDelay(failureCount, error) : retryDelay;\n const shouldRetry = retry === true || typeof retry === \"number\" && failureCount < retry || typeof retry === \"function\" && retry(failureCount, error);\n if (isRetryCancelled || !shouldRetry) {\n reject(error);\n return;\n }\n failureCount++;\n config.onFail?.(failureCount, error);\n sleep(delay).then(() => {\n return canContinue() ? void 0 : pause();\n }).then(() => {\n if (isRetryCancelled) {\n reject(error);\n } else {\n run();\n }\n });\n });\n };\n return {\n promise: thenable,\n cancel,\n continue: () => {\n continueFn?.();\n return thenable;\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n if (canStart()) {\n run();\n } else {\n pause().then(run);\n }\n return thenable;\n }\n };\n}\nexport {\n CancelledError,\n canFetch,\n createRetryer,\n isCancelledError\n};\n//# sourceMappingURL=retryer.js.map","// src/notifyManager.ts\nfunction createNotifyManager() {\n let queue = [];\n let transactions = 0;\n let notifyFn = (callback) => {\n callback();\n };\n let batchNotifyFn = (callback) => {\n callback();\n };\n let scheduleFn = (cb) => setTimeout(cb, 0);\n const schedule = (callback) => {\n if (transactions) {\n queue.push(callback);\n } else {\n scheduleFn(() => {\n notifyFn(callback);\n });\n }\n };\n const flush = () => {\n const originalQueue = queue;\n queue = [];\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback);\n });\n });\n });\n }\n };\n return {\n batch: (callback) => {\n let result;\n transactions++;\n try {\n result = callback();\n } finally {\n transactions--;\n if (!transactions) {\n flush();\n }\n }\n return result;\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: (callback) => {\n return (...args) => {\n schedule(() => {\n callback(...args);\n });\n };\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn) => {\n notifyFn = fn;\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn) => {\n batchNotifyFn = fn;\n },\n setScheduler: (fn) => {\n scheduleFn = fn;\n }\n };\n}\nvar notifyManager = createNotifyManager();\nexport {\n createNotifyManager,\n notifyManager\n};\n//# sourceMappingURL=notifyManager.js.map","// src/removable.ts\nimport { isServer, isValidTimeout } from \"./utils.js\";\nvar Removable = class {\n #gcTimeout;\n destroy() {\n this.clearGcTimeout();\n }\n scheduleGc() {\n this.clearGcTimeout();\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = setTimeout(() => {\n this.optionalRemove();\n }, this.gcTime);\n }\n }\n updateGcTime(newGcTime) {\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3)\n );\n }\n clearGcTimeout() {\n if (this.#gcTimeout) {\n clearTimeout(this.#gcTimeout);\n this.#gcTimeout = void 0;\n }\n }\n};\nexport {\n Removable\n};\n//# sourceMappingURL=removable.js.map","// src/query.ts\nimport {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n skipToken,\n timeUntilStale\n} from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { canFetch, createRetryer, isCancelledError } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nvar Query = class extends Removable {\n #initialState;\n #revertState;\n #cache;\n #retryer;\n #defaultOptions;\n #abortSignalConsumed;\n constructor(config) {\n super();\n this.#abortSignalConsumed = false;\n this.#defaultOptions = config.defaultOptions;\n this.setOptions(config.options);\n this.observers = [];\n this.#cache = config.cache;\n this.queryKey = config.queryKey;\n this.queryHash = config.queryHash;\n this.#initialState = getDefaultState(this.options);\n this.state = config.state ?? this.#initialState;\n this.scheduleGc();\n }\n get meta() {\n return this.options.meta;\n }\n get promise() {\n return this.#retryer?.promise;\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n }\n optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === \"idle\") {\n this.#cache.remove(this);\n }\n }\n setData(newData, options) {\n const data = replaceData(this.state.data, newData, this.options);\n this.#dispatch({\n data,\n type: \"success\",\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual\n });\n return data;\n }\n setState(state, setStateOptions) {\n this.#dispatch({ type: \"setState\", state, setStateOptions });\n }\n cancel(options) {\n const promise = this.#retryer?.promise;\n this.#retryer?.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n }\n destroy() {\n super.destroy();\n this.cancel({ silent: true });\n }\n reset() {\n this.destroy();\n this.setState(this.#initialState);\n }\n isActive() {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false\n );\n }\n isDisabled() {\n if (this.getObserversCount() > 0) {\n return !this.isActive();\n }\n return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;\n }\n isStale() {\n if (this.state.isInvalidated) {\n return true;\n }\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale\n );\n }\n return this.state.data === void 0;\n }\n isStaleByTime(staleTime = 0) {\n return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n }\n onFocus() {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n onOnline() {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n addObserver(observer) {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer);\n this.clearGcTimeout();\n this.#cache.notify({ type: \"observerAdded\", query: this, observer });\n }\n }\n removeObserver(observer) {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer);\n if (!this.observers.length) {\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true });\n } else {\n this.#retryer.cancelRetry();\n }\n }\n this.scheduleGc();\n }\n this.#cache.notify({ type: \"observerRemoved\", query: this, observer });\n }\n }\n getObserversCount() {\n return this.observers.length;\n }\n invalidate() {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: \"invalidate\" });\n }\n }\n fetch(options, fetchOptions) {\n if (this.state.fetchStatus !== \"idle\") {\n if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) {\n this.cancel({ silent: true });\n } else if (this.#retryer) {\n this.#retryer.continueRetry();\n return this.#retryer.promise;\n }\n }\n if (options) {\n this.setOptions(options);\n }\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn);\n if (observer) {\n this.setOptions(observer.options);\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`\n );\n }\n }\n const abortController = new AbortController();\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true;\n return abortController.signal;\n }\n });\n };\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions);\n const queryFnContext = {\n queryKey: this.queryKey,\n meta: this.meta\n };\n addSignalProperty(queryFnContext);\n this.#abortSignalConsumed = false;\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this\n );\n }\n return queryFn(queryFnContext);\n };\n const context = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn\n };\n addSignalProperty(context);\n this.options.behavior?.onFetch(\n context,\n this\n );\n this.#revertState = this.state;\n if (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) {\n this.#dispatch({ type: \"fetch\", meta: context.fetchOptions?.meta });\n }\n const onError = (error) => {\n if (!(isCancelledError(error) && error.silent)) {\n this.#dispatch({\n type: \"error\",\n error\n });\n }\n if (!isCancelledError(error)) {\n this.#cache.config.onError?.(\n error,\n this\n );\n this.#cache.config.onSettled?.(\n this.state.data,\n error,\n this\n );\n }\n this.scheduleGc();\n };\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise,\n fn: context.fetchFn,\n abort: abortController.abort.bind(abortController),\n onSuccess: (data) => {\n if (data === void 0) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`\n );\n }\n onError(new Error(`${this.queryHash} data is undefined`));\n return;\n }\n try {\n this.setData(data);\n } catch (error) {\n onError(error);\n return;\n }\n this.#cache.config.onSuccess?.(data, this);\n this.#cache.config.onSettled?.(\n data,\n this.state.error,\n this\n );\n this.scheduleGc();\n },\n onError,\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true\n });\n return this.#retryer.start();\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n fetchStatus: \"paused\"\n };\n case \"continue\":\n return {\n ...state,\n fetchStatus: \"fetching\"\n };\n case \"fetch\":\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: \"success\",\n ...!action.manual && {\n fetchStatus: \"idle\",\n fetchFailureCount: 0,\n fetchFailureReason: null\n }\n };\n case \"error\":\n const error = action.error;\n if (isCancelledError(error) && error.revert && this.#revertState) {\n return { ...this.#revertState, fetchStatus: \"idle\" };\n }\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: \"idle\",\n status: \"error\"\n };\n case \"invalidate\":\n return {\n ...state,\n isInvalidated: true\n };\n case \"setState\":\n return {\n ...state,\n ...action.state\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate();\n });\n this.#cache.notify({ query: this, type: \"updated\", action });\n });\n }\n};\nfunction fetchState(data, options) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n ...data === void 0 && {\n error: null,\n status: \"pending\"\n }\n };\n}\nfunction getDefaultState(options) {\n const data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n const hasData = data !== void 0;\n const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? \"success\" : \"pending\",\n fetchStatus: \"idle\"\n };\n}\nexport {\n Query,\n fetchState\n};\n//# sourceMappingURL=query.js.map","// src/queryCache.ts\nimport { hashQueryKeyByOptions, matchQuery } from \"./utils.js\";\nimport { Query } from \"./query.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar QueryCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#queries = /* @__PURE__ */ new Map();\n }\n #queries;\n build(client, options, state) {\n const queryKey = options.queryKey;\n const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);\n let query = this.get(queryHash);\n if (!query) {\n query = new Query({\n cache: this,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey)\n });\n this.add(query);\n }\n return query;\n }\n add(query) {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query);\n this.notify({\n type: \"added\",\n query\n });\n }\n }\n remove(query) {\n const queryInMap = this.#queries.get(query.queryHash);\n if (queryInMap) {\n query.destroy();\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash);\n }\n this.notify({ type: \"removed\", query });\n }\n }\n clear() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query);\n });\n });\n }\n get(queryHash) {\n return this.#queries.get(queryHash);\n }\n getAll() {\n return [...this.#queries.values()];\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.getAll().find(\n (query) => matchQuery(defaultedFilters, query)\n );\n }\n findAll(filters = {}) {\n const queries = this.getAll();\n return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n onFocus() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus();\n });\n });\n }\n onOnline() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline();\n });\n });\n }\n};\nexport {\n QueryCache\n};\n//# sourceMappingURL=queryCache.js.map","// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #observers;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.mutationId = config.mutationId;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = options;\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this)\n });\n const restored = this.state.status === \"pending\";\n const isPaused = !this.#retryer.canStart();\n try {\n if (!restored) {\n this.#dispatch({ type: \"pending\", variables, isPaused });\n await this.#mutationCache.config.onMutate?.(\n variables,\n this\n );\n const context = await this.options.onMutate?.(variables);\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables,\n isPaused\n });\n }\n }\n const data = await this.#retryer.start();\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this\n );\n await this.options.onSuccess?.(data, variables, this.state.context);\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(data, null, variables, this.state.context);\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this\n );\n await this.options.onError?.(\n error,\n variables,\n this.state.context\n );\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context\n );\n throw error;\n } finally {\n this.#dispatch({ type: \"error\", error });\n }\n } finally {\n this.#mutationCache.runNext(this);\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.js.map","// src/mutationCache.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Mutation } from \"./mutation.js\";\nimport { matchMutation, noop } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar MutationCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#mutations = /* @__PURE__ */ new Map();\n this.#mutationId = Date.now();\n }\n #mutations;\n #mutationId;\n build(client, options, state) {\n const mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state\n });\n this.add(mutation);\n return mutation;\n }\n add(mutation) {\n const scope = scopeFor(mutation);\n const mutations = this.#mutations.get(scope) ?? [];\n mutations.push(mutation);\n this.#mutations.set(scope, mutations);\n this.notify({ type: \"added\", mutation });\n }\n remove(mutation) {\n const scope = scopeFor(mutation);\n if (this.#mutations.has(scope)) {\n const mutations = this.#mutations.get(scope)?.filter((x) => x !== mutation);\n if (mutations) {\n if (mutations.length === 0) {\n this.#mutations.delete(scope);\n } else {\n this.#mutations.set(scope, mutations);\n }\n }\n }\n this.notify({ type: \"removed\", mutation });\n }\n canRun(mutation) {\n const firstPendingMutation = this.#mutations.get(scopeFor(mutation))?.find((m) => m.state.status === \"pending\");\n return !firstPendingMutation || firstPendingMutation === mutation;\n }\n runNext(mutation) {\n const foundMutation = this.#mutations.get(scopeFor(mutation))?.find((m) => m !== mutation && m.state.isPaused);\n return foundMutation?.continue() ?? Promise.resolve();\n }\n clear() {\n notifyManager.batch(() => {\n this.getAll().forEach((mutation) => {\n this.remove(mutation);\n });\n });\n }\n getAll() {\n return [...this.#mutations.values()].flat();\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.getAll().find(\n (mutation) => matchMutation(defaultedFilters, mutation)\n );\n }\n findAll(filters = {}) {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation));\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n resumePausedMutations() {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused);\n return notifyManager.batch(\n () => Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop))\n )\n );\n }\n};\nfunction scopeFor(mutation) {\n return mutation.options.scope?.id ?? String(mutation.mutationId);\n}\nexport {\n MutationCache\n};\n//# sourceMappingURL=mutationCache.js.map","// src/infiniteQueryBehavior.ts\nimport { addToEnd, addToStart, ensureQueryFn } from \"./utils.js\";\nfunction infiniteQueryBehavior(pages) {\n return {\n onFetch: (context, query) => {\n const options = context.options;\n const direction = context.fetchOptions?.meta?.fetchMore?.direction;\n const oldPages = context.state.data?.pages || [];\n const oldPageParams = context.state.data?.pageParams || [];\n let result = { pages: [], pageParams: [] };\n let currentPage = 0;\n const fetchFn = async () => {\n let cancelled = false;\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n if (context.signal.aborted) {\n cancelled = true;\n } else {\n context.signal.addEventListener(\"abort\", () => {\n cancelled = true;\n });\n }\n return context.signal;\n }\n });\n };\n const queryFn = ensureQueryFn(context.options, context.fetchOptions);\n const fetchPage = async (data, param, previous) => {\n if (cancelled) {\n return Promise.reject();\n }\n if (param == null && data.pages.length) {\n return Promise.resolve(data);\n }\n const queryFnContext = {\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? \"backward\" : \"forward\",\n meta: context.options.meta\n };\n addSignalProperty(queryFnContext);\n const page = await queryFn(\n queryFnContext\n );\n const { maxPages } = context.options;\n const addTo = previous ? addToStart : addToEnd;\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages)\n };\n };\n if (direction && oldPages.length) {\n const previous = direction === \"backward\";\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams\n };\n const param = pageParamFn(options, oldData);\n result = await fetchPage(oldData, param, previous);\n } else {\n const remainingPages = pages ?? oldPages.length;\n do {\n const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);\n if (currentPage > 0 && param == null) {\n break;\n }\n result = await fetchPage(result, param);\n currentPage++;\n } while (currentPage < remainingPages);\n }\n return result;\n };\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn,\n {\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal\n },\n query\n );\n };\n } else {\n context.fetchFn = fetchFn;\n }\n }\n };\n}\nfunction getNextPageParam(options, { pages, pageParams }) {\n const lastIndex = pages.length - 1;\n return pages.length > 0 ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams\n ) : void 0;\n}\nfunction getPreviousPageParam(options, { pages, pageParams }) {\n return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;\n}\nfunction hasNextPage(options, data) {\n if (!data)\n return false;\n return getNextPageParam(options, data) != null;\n}\nfunction hasPreviousPage(options, data) {\n if (!data || !options.getPreviousPageParam)\n return false;\n return getPreviousPageParam(options, data) != null;\n}\nexport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior\n};\n//# sourceMappingURL=infiniteQueryBehavior.js.map","// src/queryClient.ts\nimport {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken\n} from \"./utils.js\";\nimport { QueryCache } from \"./queryCache.js\";\nimport { MutationCache } from \"./mutationCache.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { infiniteQueryBehavior } from \"./infiniteQueryBehavior.js\";\nvar QueryClient = class {\n #queryCache;\n #mutationCache;\n #defaultOptions;\n #queryDefaults;\n #mutationDefaults;\n #mountCount;\n #unsubscribeFocus;\n #unsubscribeOnline;\n constructor(config = {}) {\n this.#queryCache = config.queryCache || new QueryCache();\n this.#mutationCache = config.mutationCache || new MutationCache();\n this.#defaultOptions = config.defaultOptions || {};\n this.#queryDefaults = /* @__PURE__ */ new Map();\n this.#mutationDefaults = /* @__PURE__ */ new Map();\n this.#mountCount = 0;\n }\n mount() {\n this.#mountCount++;\n if (this.#mountCount !== 1)\n return;\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations();\n this.#queryCache.onFocus();\n }\n });\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations();\n this.#queryCache.onOnline();\n }\n });\n }\n unmount() {\n this.#mountCount--;\n if (this.#mountCount !== 0)\n return;\n this.#unsubscribeFocus?.();\n this.#unsubscribeFocus = void 0;\n this.#unsubscribeOnline?.();\n this.#unsubscribeOnline = void 0;\n }\n isFetching(filters) {\n return this.#queryCache.findAll({ ...filters, fetchStatus: \"fetching\" }).length;\n }\n isMutating(filters) {\n return this.#mutationCache.findAll({ ...filters, status: \"pending\" }).length;\n }\n getQueryData(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state.data;\n }\n ensureQueryData(options) {\n const cachedData = this.getQueryData(options.queryKey);\n if (cachedData === void 0)\n return this.fetchQuery(options);\n else {\n const defaultedOptions = this.defaultQueryOptions(options);\n const query = this.#queryCache.build(this, defaultedOptions);\n if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) {\n void this.prefetchQuery(defaultedOptions);\n }\n return Promise.resolve(cachedData);\n }\n }\n getQueriesData(filters) {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data;\n return [queryKey, data];\n });\n }\n setQueryData(queryKey, updater, options) {\n const defaultedOptions = this.defaultQueryOptions({ queryKey });\n const query = this.#queryCache.get(\n defaultedOptions.queryHash\n );\n const prevData = query?.state.data;\n const data = functionalUpdate(updater, prevData);\n if (data === void 0) {\n return void 0;\n }\n return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });\n }\n setQueriesData(filters, updater, options) {\n return notifyManager.batch(\n () => this.#queryCache.findAll(filters).map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options)\n ])\n );\n }\n getQueryState(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state;\n }\n removeQueries(filters) {\n const queryCache = this.#queryCache;\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query);\n });\n });\n }\n resetQueries(filters, options) {\n const queryCache = this.#queryCache;\n const refetchFilters = {\n type: \"active\",\n ...filters\n };\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset();\n });\n return this.refetchQueries(refetchFilters, options);\n });\n }\n cancelQueries(filters = {}, cancelOptions = {}) {\n const defaultedCancelOptions = { revert: true, ...cancelOptions };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions))\n );\n return Promise.all(promises).then(noop).catch(noop);\n }\n invalidateQueries(filters = {}, options = {}) {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate();\n });\n if (filters.refetchType === \"none\") {\n return Promise.resolve();\n }\n const refetchFilters = {\n ...filters,\n type: filters.refetchType ?? filters.type ?? \"active\"\n };\n return this.refetchQueries(refetchFilters, options);\n });\n }\n refetchQueries(filters = {}, options) {\n const fetchOptions = {\n ...options,\n cancelRefetch: options?.cancelRefetch ?? true\n };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => {\n let promise = query.fetch(void 0, fetchOptions);\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop);\n }\n return query.state.fetchStatus === \"paused\" ? Promise.resolve() : promise;\n })\n );\n return Promise.all(promises).then(noop);\n }\n fetchQuery(options) {\n const defaultedOptions = this.defaultQueryOptions(options);\n if (defaultedOptions.retry === void 0) {\n defaultedOptions.retry = false;\n }\n const query = this.#queryCache.build(this, defaultedOptions);\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query)\n ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n }\n prefetchQuery(options) {\n return this.fetchQuery(options).then(noop).catch(noop);\n }\n fetchInfiniteQuery(options) {\n options.behavior = infiniteQueryBehavior(options.pages);\n return this.fetchQuery(options);\n }\n prefetchInfiniteQuery(options) {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop);\n }\n ensureInfiniteQueryData(options) {\n options.behavior = infiniteQueryBehavior(options.pages);\n return this.ensureQueryData(options);\n }\n resumePausedMutations() {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations();\n }\n return Promise.resolve();\n }\n getQueryCache() {\n return this.#queryCache;\n }\n getMutationCache() {\n return this.#mutationCache;\n }\n getDefaultOptions() {\n return this.#defaultOptions;\n }\n setDefaultOptions(options) {\n this.#defaultOptions = options;\n }\n setQueryDefaults(queryKey, options) {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options\n });\n }\n getQueryDefaults(queryKey) {\n const defaults = [...this.#queryDefaults.values()];\n let result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n result = { ...result, ...queryDefault.defaultOptions };\n }\n });\n return result;\n }\n setMutationDefaults(mutationKey, options) {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options\n });\n }\n getMutationDefaults(mutationKey) {\n const defaults = [...this.#mutationDefaults.values()];\n let result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n result = { ...result, ...queryDefault.defaultOptions };\n }\n });\n return result;\n }\n defaultQueryOptions(options) {\n if (options._defaulted) {\n return options;\n }\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true\n };\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions\n );\n }\n if (defaultedOptions.refetchOnReconnect === void 0) {\n defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== \"always\";\n }\n if (defaultedOptions.throwOnError === void 0) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense;\n }\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = \"offlineFirst\";\n }\n if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false;\n }\n return defaultedOptions;\n }\n defaultMutationOptions(options) {\n if (options?._defaulted) {\n return options;\n }\n return {\n ...this.#defaultOptions.mutations,\n ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),\n ...options,\n _defaulted: true\n };\n }\n clear() {\n this.#queryCache.clear();\n this.#mutationCache.clear();\n }\n};\nexport {\n QueryClient\n};\n//# sourceMappingURL=queryClient.js.map","\"use client\";\n\n// src/QueryClientProvider.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar QueryClientContext = React.createContext(\n void 0\n);\nvar useQueryClient = (queryClient) => {\n const client = React.useContext(QueryClientContext);\n if (queryClient) {\n return queryClient;\n }\n if (!client) {\n throw new Error(\"No QueryClient set, use QueryClientProvider to set one\");\n }\n return client;\n};\nvar QueryClientProvider = ({\n client,\n children\n}) => {\n React.useEffect(() => {\n client.mount();\n return () => {\n client.unmount();\n };\n }, [client]);\n return /* @__PURE__ */ jsx(QueryClientContext.Provider, { value: client, children });\n};\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient\n};\n//# sourceMappingURL=QueryClientProvider.js.map","import { trackEvent } from \"@/services/analytics\";\nimport { EnvVarKey, getEnvVar } from \"@/services/env.service\";\nimport { useIdToken } from \"@ai21/platform-auth-sdk\";\nimport { ChatServiceAPI, useHttpService } from \"@studio/chat-ui\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\nconst identityApiUrl = getEnvVar(EnvVarKey.identityServerUrl);\nconst studioApiUrl = `${getEnvVar(EnvVarKey.apiServerUrl)}/studio/v1`;\n\nexport const useChatServiceConfig = () => {\n const idToken = useIdToken() || undefined;\n const httpService = useHttpService({\n identityApiUrl,\n studioApiUrl,\n idToken,\n });\n\n const queryClient = useQueryClient();\n const chatServicePayload: ChatServiceAPI = {\n httpService,\n onChatError: (errorMessage) => trackEvent(\"chatError\", { errorMessage }),\n onChatGenerated: (eventParams, interactionId, generatedTextLength) =>\n trackEvent(\"chatGenerated\", {\n ...eventParams,\n interactionId,\n generatedTextLength,\n }),\n onChatRequested: (eventParams) => trackEvent(\"chatRequested\", eventParams),\n onSubmitFeedbackError: (path, params, errorMessage) =>\n trackEvent(\"feedbackSubmitError\", {\n ...params,\n endpoint: path,\n reason: errorMessage,\n origin: \"\",\n completionLength: 0,\n }),\n onSubmitFeedbackSuccess: (path, params) =>\n trackEvent(\"feedbackSubmitted\", {\n ...params,\n endpoint: path,\n }),\n queryClient,\n };\n\n return chatServicePayload;\n};\n","import React, { createContext, useContext, ReactNode } from \"react\";\nimport { ChatService, useChatService } from \"@studio/chat-ui\";\nimport { useChatServiceConfig } from \"@/hooks/useChatServiceConfig.hook\";\n\nconst ChatServiceContext = createContext(null);\n\nexport const ChatServiceProvider: React.FC<{ children: ReactNode }> = ({ children }) => {\n const chatServicePayload = useChatServiceConfig();\n const chatService = useChatService(chatServicePayload);\n\n return {children};\n};\n\nexport const useChatServiceContext = (): ChatService => {\n const context = useContext(ChatServiceContext);\n if (!context) {\n throw new Error(\"useChatServiceContext must be used within a ChatServiceProvider\");\n }\n\n return context;\n};\n","import { DocumentUploadSucceededProperties, DocumentUploadFailedProperties } from \"@/integrations/ampli/base\";\nimport { trackEvent } from \"@/services/analytics\";\nimport { onSuccessData, onErrorData } from \"@studio/chat-ui\";\n\nexport function onSendDocumentSuccess(data: onSuccessData) {\n trackEvent(\"documentUploadSucceeded\", {\n documentType: data.documentType,\n documentId: data.documentId,\n } as DocumentUploadSucceededProperties);\n}\n\nexport function onSendDocumentError(data: onErrorData) {\n trackEvent(\"documentUploadFailed\", {\n documentType: data.documentType,\n reason: data.reason,\n } as DocumentUploadFailedProperties);\n}\n","import {\n ChatMessageId,\n DeleteDocumentModal,\n EditMessageModal,\n MessageInfoModal,\n RegenerateModal,\n ChatStoreMessage,\n} from \"@studio/chat-ui\";\nimport { Chat } from \"./Chat\";\nimport { useState } from \"react\";\nimport { uxTexts } from \"@/utils/uxTexts\";\nimport { FileDropZone, fileTypeMappings, FileUploadModal, Flex, Spinner } from \"@studio/design-system\";\nimport { onMouseEventClickWithAnalytics } from \"@/services/analytics/analyticsWrapper\";\nimport { useUserService } from \"@ai21/platform-auth-sdk\";\nimport clsx from \"clsx\";\nimport { useChatServiceContext } from \"@/contexts/ChatService.context\";\nimport { onSendDocumentSuccess, onSendDocumentError } from \"./Chat.helper\";\n\nconst chatFooterLink = {\n apiDocsUrl: \"https://docs.ai21.com/docs/jamba-models\",\n};\n\nconst isLastMessage = (messages: ChatStoreMessage[], messageId: string): boolean => {\n return messages[messages.length - 1].id === messageId;\n};\n\nconst isMultiple = false;\n\n// const chatControllerClasses = [\"w-full\", \"h-full\", \"m-auto\"];\nconst chatControllerClasses = [\"w-full\", \"m-auto\"];\n// temporary centering classes - to be removed when sidebar will be fully implemented\nconst tmpCentering = [\"absolute\", \"left-0\", \"right-0\", \"bottom-0\", \"md:top-0\", \"h-[calc(100vh-62px)]\", \"md:h-full\"];\n\nexport const ChatController = () => {\n const { user } = useUserService();\n\n const [isDropzone, setIsDropzone] = useState(false);\n const [messageToDelete, setMessageToDelete] = useState(null);\n const [messageToEdit, setMessageToEdit] = useState(null);\n const [regenerateMessageId, setRegenerateMessageId] = useState(null);\n const [messageInfo, setMessageInfo] = useState(null);\n const [showAddDocumentModal, setShowAddDocumentModal] = useState(false);\n\n const {\n assignMessageFeedback,\n chatError,\n clearChatError,\n deleteDocument,\n editMessage,\n feedbackErrors,\n messages,\n regenerateMessage,\n sendDocument,\n sendMessage,\n toggleAiTypingEffect,\n uiState,\n stopGeneratingMessage,\n } = useChatServiceContext();\n\n // Chat callbacks logic\n\n const onDeleteDocument = (messageId: ChatMessageId) => {\n const message = messages.find((m) => m.id === messageId);\n if (message) {\n setMessageToDelete(message);\n } else {\n setMessageToDelete(null);\n }\n };\n\n const onEditMessage = (messageId: ChatMessageId) => {\n const message = messages.find((m) => m.id === messageId);\n if (message) {\n setMessageToEdit(message);\n } else {\n setMessageToEdit(null);\n }\n };\n\n const onRegenerateMessage = (messageId: ChatMessageId) => {\n const lastMessage = isLastMessage(messages, messageId);\n if (lastMessage) {\n regenerateMessage(messageId);\n } else {\n setRegenerateMessageId(messageId);\n }\n };\n\n const showMessageInfoModal = (messageId: ChatMessageId) => {\n const message = messages.find((m) => m.id === messageId);\n if (message) {\n setMessageInfo(message);\n } else {\n setMessageInfo(null);\n }\n };\n\n const chatCallbacks = {\n stopGeneratingMessage,\n assignFeedback: assignMessageFeedback,\n clearChatError,\n deleteDocument: onDeleteDocument,\n editMessage: onEditMessage,\n onAddDocument: (e: React.MouseEvent) => {\n e.stopPropagation(); // Prevents the input focus - so in mobile it doesn't open the keyboard\n setShowAddDocumentModal(true);\n },\n regenerateMessage: onRegenerateMessage,\n sendMessage,\n showMessageInfo: showMessageInfoModal,\n toggleAiTypingEffect,\n };\n\n // End of Chat callbacks logic\n\n // Modals logic\n\n const onSubmitDeleteMessage = () => {\n if (!messageToDelete) return;\n\n deleteDocument(messageToDelete.id);\n setMessageToDelete(null);\n };\n\n const onCancelDeleteMessage = () => {\n setMessageToDelete(null);\n };\n\n const onSubmitRegenerateMessage = (messageId: string) => {\n regenerateMessage(messageId);\n setRegenerateMessageId(null);\n };\n\n const onSubmitEditMessage = (content: string) => {\n if (!messageToEdit || !content) return;\n\n editMessage(messageToEdit.id, content);\n setMessageToEdit(null);\n };\n\n const onCancelEditMessage = () => {\n setMessageToEdit(null);\n };\n\n // End of Modals logic\n\n // Dropzone logic\n\n const handleDragEnter = (event: React.DragEvent) => {\n event.preventDefault();\n setIsDropzone(true);\n };\n\n const handleDragLeave = (event: React.DragEvent) => {\n event.preventDefault();\n if (event.currentTarget.contains(event.relatedTarget as Node)) return;\n\n setIsDropzone(false);\n };\n\n // End of Dropzone logic\n\n if (!user || !user.userName) {\n return (\n \n \n \n );\n }\n\n return (\n \n {messageToDelete && (\n \n )}\n {showAddDocumentModal && (\n {\n setShowAddDocumentModal(false);\n }}\n isMultiple={isMultiple}\n isOpen={!!showAddDocumentModal}\n handleFileUpload={(files) => {\n setShowAddDocumentModal(false);\n sendDocument(files[0], {\n onSuccess: onSendDocumentSuccess,\n onError: onSendDocumentError,\n });\n }}\n cancelUploadButtonProps={{\n text: uxTexts.modals.fileUploadModal.cancelButton,\n ariaLabel: uxTexts.modals.fileUploadModal.cancelButton,\n }}\n modalProps={{\n title: uxTexts.modals.fileUploadModal.title(isMultiple),\n }}\n fileDropZoneProps={{\n mainTitle: uxTexts.modals.fileUploadModal.infoText,\n fileNotSupportedText: uxTexts.modals.fileUploadModal.fileNotSupportedText,\n uploadButtonText: uxTexts.modals.fileUploadModal.uploadButton(isMultiple),\n }}\n footerLinkProps={{\n url: uxTexts.modals.fileUploadModal.footerLink.url,\n text: uxTexts.modals.fileUploadModal.footerLink.text,\n }}\n />\n )}\n {messageInfo && messageInfo.parameters && (\n {\n if (!isOpened) {\n setMessageInfo(null);\n }\n }}\n response={{\n responseTokensCount: messageInfo.metadata?.tokens,\n responseLatency: messageInfo.metadata?.latency,\n }}\n parameters={[\n {\n key: \"temperature\",\n displayName: uxTexts.chatPage.modals.messageInfoModal.temperatureParam,\n value: messageInfo.parameters.temperature,\n },\n {\n key: \"maxTokens\",\n displayName: uxTexts.chatPage.modals.messageInfoModal.maxTokensParam,\n value: messageInfo.parameters.maxTokens,\n },\n {\n key: \"topP\",\n displayName: uxTexts.chatPage.modals.messageInfoModal.topPParam,\n value: messageInfo.parameters.topP,\n },\n ]}\n model={messageInfo.parameters.model}\n />\n )}\n {regenerateMessageId && (\n setRegenerateMessageId(null)}\n onClickEvent={onMouseEventClickWithAnalytics}\n />\n )}\n {messageToEdit && messageToEdit.content && (\n \n )}\n\n {isDropzone ? (\n {\n setIsDropzone(false);\n sendDocument(files[0], {\n onSuccess: onSendDocumentSuccess,\n onError: onSendDocumentError,\n });\n },\n onDropRejected: () => setIsDropzone(false),\n multiple: isMultiple,\n accept: fileTypeMappings,\n }}\n />\n ) : (\n \n )}\n \n );\n};\n","import * as React from \"react\";\nimport { forwardRef } from \"react\";\nconst SvgLogo = ({\n title,\n titleId,\n ...props\n}, ref) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: 86, height: 18, viewBox: \"0 0 86 18\", fill: \"none\", ref, \"aria-labelledby\": titleId, ...props }, title ? /* @__PURE__ */ React.createElement(\"title\", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement(\"g\", { id: \"Vector\" }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M11.9091 17.286L11.2745 15.2794H5.41946L4.78463 17.286H0.718506L6.59645 0.76356H10.0997L16.0482 17.286H11.9091ZM8.35993 5.48362L6.33783 12.2818H10.3349L8.35993 5.48362Z\", fill: \"#252525\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M16.5014 0.76356H20.3572V17.286H16.5014V0.76356Z\", fill: \"#252525\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M21.3965 13.9104C21.5696 13.0947 21.8754 12.3131 22.3016 11.5972C22.6723 10.9922 23.1367 10.4503 23.6772 9.99205C24.2294 9.53218 24.8148 9.11414 25.4287 8.74137C25.9144 8.45788 26.365 8.1864 26.7806 7.92693C27.1639 7.69072 27.5293 7.42645 27.8738 7.13625C28.1714 6.88796 28.4223 6.58815 28.6146 6.25102C28.7981 5.91494 28.8913 5.53666 28.8849 5.15343C28.8849 4.49257 28.7047 4.01656 28.3442 3.7254C27.962 3.42717 27.4879 3.27266 27.0041 3.28867C26.4535 3.27195 25.918 3.47091 25.5109 3.84347C25.1113 4.21333 24.9115 4.831 24.9115 5.69647H21.1259C21.1191 4.97752 21.2509 4.26404 21.5141 3.59533C21.7664 2.95915 22.1557 2.38685 22.6542 1.91942C23.185 1.42962 23.8088 1.05232 24.4882 0.810074C25.2885 0.52942 26.132 0.393493 26.9796 0.408606C27.707 0.405234 28.4313 0.504594 29.1311 0.703766C29.782 0.885141 30.3924 1.18958 30.9297 1.60075C31.4575 2.01521 31.8805 2.54898 32.164 3.1586C32.4843 3.86564 32.641 4.63631 32.6224 5.41282C32.6309 6.06968 32.4774 6.71844 32.1757 7.30134C31.8867 7.85577 31.5183 8.36469 31.0824 8.81191C30.6567 9.24795 30.1881 9.6395 29.6837 9.98054C29.1816 10.3191 28.7269 10.6062 28.3198 10.842C27.7551 11.2197 27.2888 11.5463 26.9209 11.8218C26.6052 12.0509 26.3102 12.3076 26.0394 12.5887C25.8367 12.7974 25.6804 13.0469 25.5807 13.3206C25.4899 13.6025 25.4462 13.8976 25.4514 14.1938H32.505V17.286H21.079C21.0589 16.1524 21.1654 15.0202 21.3965 13.9104Z\", fill: \"#252525\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M33.2333 3.66517C33.8922 3.67865 34.5505 3.61926 35.1964 3.48807C35.6278 3.40583 36.0344 3.22404 36.3838 2.95703C36.6643 2.72342 36.8689 2.4111 36.9716 2.06005C37.0891 1.63767 37.1445 1.20031 37.136 0.761844H40.4995V17.2861H36.6203V6.35688H33.2333V3.66517Z\", fill: \"#252525\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M44.8626 0.76356H48.4593V17.286H44.8626V0.76356Z\", fill: \"#E91E63\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M61.741 5.89968V17.2773H58.1438V15.6717C57.9962 15.9481 57.8057 16.199 57.5794 16.4151C57.3375 16.6484 57.0646 16.847 56.7685 17.0052C56.4509 17.1747 56.1158 17.3089 55.7691 17.4054C55.4174 17.5063 55.0534 17.5579 54.6876 17.5587C53.915 17.5676 53.1495 17.4107 52.4422 17.0985C51.7797 16.8057 51.1837 16.3801 50.6907 15.8478C50.1925 15.3004 49.8088 14.6582 49.5621 13.9593C49.0292 12.423 49.0292 10.751 49.5621 9.21472C49.8088 8.5158 50.1925 7.87363 50.6907 7.3262C51.1837 6.79394 51.7797 6.36835 52.4422 6.07552C53.1497 5.76362 53.9154 5.60704 54.6881 5.61627C55.0539 5.61712 55.4179 5.66872 55.7696 5.76961C56.1179 5.86705 56.4534 6.00577 56.769 6.18283C57.0659 6.34928 57.3387 6.55572 57.5799 6.79641C57.8003 7.01338 57.9902 7.25953 58.1443 7.52806V5.89968H61.741ZM55.44 14.4918C55.8213 14.4976 56.199 14.417 56.545 14.256C56.8655 14.1054 57.1533 13.8929 57.3921 13.6306C57.6328 13.3617 57.8204 13.0492 57.9447 12.7099C58.0785 12.3514 58.146 11.9715 58.144 11.5888C58.1495 10.8424 57.8817 10.1199 57.3916 9.55866C57.1554 9.29051 56.8671 9.07363 56.5445 8.92131C56.1967 8.76579 55.8202 8.68542 55.4395 8.68542C55.0588 8.68542 54.6823 8.76579 54.3345 8.92131C54.0119 9.07372 53.7237 9.29059 53.4874 9.55866C52.9975 10.12 52.7299 10.8424 52.7352 11.5888C52.733 11.9715 52.8006 12.3515 52.9346 12.7099C53.0588 13.0492 53.2463 13.3617 53.4869 13.6306C53.7257 13.8928 54.0136 14.1053 54.334 14.256C54.6803 14.4172 55.0584 14.4979 55.44 14.4918Z\", fill: \"#E91E63\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M66.1123 17.286H62.5149V0.76356H66.1123V7.53698C66.2664 7.26846 66.4563 7.0223 66.6767 6.80534C66.9203 6.56264 67.1972 6.35603 67.4989 6.19175C67.8157 6.01731 68.1509 5.87872 68.4982 5.77853C68.8536 5.67601 69.2217 5.62439 69.5915 5.6252C70.364 5.61637 71.1295 5.77329 71.8368 6.08545C72.4993 6.37833 73.0953 6.80391 73.5883 7.33612C74.0864 7.88367 74.4701 8.5258 74.717 9.22465C75.2498 10.7609 75.2498 12.4329 74.717 13.9692C74.4701 14.6681 74.0864 15.3102 73.5883 15.8577C73.0953 16.39 72.4993 16.8155 71.8368 17.1084C71.1295 17.4206 70.364 17.5775 69.5915 17.5687C69.2217 17.5695 68.8536 17.5179 68.4982 17.4153C68.1525 17.3161 67.8177 17.182 67.4989 17.0151C67.198 16.8591 66.9211 16.6603 66.6767 16.4251C66.4504 16.2089 66.2599 15.958 66.1123 15.6816V17.286ZM68.8398 14.5005C69.2134 14.5047 69.5831 14.424 69.9213 14.2646C70.2419 14.114 70.5297 13.9015 70.7684 13.6393C71.0092 13.3704 71.1967 13.0579 71.3211 12.7185C71.4548 12.3601 71.5224 11.9802 71.5204 11.5974C71.5258 10.851 71.2581 10.1286 70.768 9.56733C70.5318 9.29919 70.2435 9.0823 69.9208 8.92999C69.5828 8.77046 69.2133 8.68941 68.8398 8.69286C68.4548 8.68809 68.0735 8.76863 67.7231 8.92874C67.3959 9.07879 67.1036 9.29589 66.865 9.56608C66.3749 10.1274 66.1071 10.8498 66.1126 11.5962C66.1105 11.979 66.178 12.3589 66.3119 12.7173C66.436 13.0567 66.6236 13.3693 66.8645 13.638C67.1058 13.9023 67.3976 14.115 67.7226 14.2634C68.073 14.4242 68.4545 14.5052 68.8398 14.5005Z\", fill: \"#E91E63\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M81.8758 10.5822C82.3771 10.7238 82.8473 10.8772 83.2865 11.0425C83.697 11.1925 84.0847 11.3991 84.4386 11.6563C84.7647 11.8971 85.0337 12.2074 85.2261 12.565C85.4361 12.9897 85.5372 13.4602 85.5201 13.934C85.5395 14.5299 85.4016 15.1204 85.1202 15.6455C84.853 16.1107 84.4729 16.5005 84.0153 16.7786C83.5118 17.0826 82.9586 17.2944 82.3813 17.4039C81.727 17.5329 81.0615 17.5961 80.3946 17.5925C78.78 17.5925 77.5064 17.2385 76.5739 16.5304C75.6411 15.8223 75.3633 14.8073 75.3633 13.4853H78.7019C78.7019 14.0836 78.8704 14.5124 79.2074 14.7717C79.5866 15.0446 80.0461 15.1818 80.5122 15.1612C80.8846 15.1773 81.2543 15.0917 81.5821 14.9136C81.7186 14.8289 81.8293 14.7081 81.9019 14.5644C81.9744 14.4207 82.0061 14.2597 81.9934 14.0991C82.0028 13.9062 81.9399 13.7168 81.8173 13.5681C81.663 13.4082 81.4793 13.2799 81.2764 13.1904C80.9721 13.049 80.6578 12.9307 80.3361 12.8362C79.9517 12.7181 79.4932 12.5726 78.9605 12.3997C78.4904 12.258 78.0437 12.1045 77.6203 11.9394C77.2235 11.7885 76.8481 11.5861 76.5036 11.3374C76.1828 11.1022 75.9212 10.795 75.7395 10.4404C75.5372 10.0134 75.4404 9.5437 75.4572 9.07114C75.4572 7.891 75.9079 7.0177 76.8091 6.45122C77.7104 5.88475 78.929 5.60126 80.4651 5.60076C81.193 5.58854 81.9186 5.68808 82.6165 5.89592C83.1757 6.06043 83.6957 6.33745 84.1448 6.71011C84.5358 7.0447 84.8454 7.46463 85.05 7.93778C85.2546 8.41472 85.3587 8.92904 85.3557 9.44835H81.8053C81.8303 9.04889 81.6997 8.65532 81.441 8.35075C81.2921 8.21146 81.1158 8.10488 80.9235 8.03782C80.7311 7.97077 80.527 7.9447 80.3241 7.96129C79.9937 7.95319 79.6677 8.03913 79.3838 8.20918C79.2539 8.28836 79.148 8.40167 79.0775 8.53687C79.007 8.67207 78.9747 8.82403 78.9839 8.97634C78.9774 9.16382 79.045 9.34628 79.172 9.48387C79.331 9.64051 79.5187 9.76478 79.7247 9.84982C80.0191 9.97899 80.3215 10.0894 80.6298 10.1802C80.9902 10.2911 81.4056 10.4251 81.8758 10.5822Z\", fill: \"#E91E63\" })));\nconst ForwardRef = forwardRef(SvgLogo);\nexport default ForwardRef;\n","export const PRIVACY_POLICY_URL = \"https://www.ai21.com/privacy-policy\";\nexport const TERMS_OF_USE_URL = \"https://lp.ai21.com/hubfs/resources/AI21-Models-Terms-of-Service.pdf\";\n","export const Routes = {\n docsRoute: \"https://docs.ai21.com\",\n privatePolicy: \"/privacy-policy\",\n termsOfUse: \"/terms-of-use\",\n auth: \"/auth/chat?appId=chat\",\n} as const;\n","/** sm breakpoints 0-640px **/\nconst smDropDownMenuItemClasses = [\"sm:hidden\"];\nconst smAlertBannerClasses = [\"md:!flex\"];\n/** sm breakpoints 0-640px **/\n\n/** md breakpoints 641-768px **/\nconst mdDropDownMenuItemClasses = [\"md:hidden\"];\nconst mdAlertBannerClasses = [\"md:!flex\"];\n/** md breakpoints 641-768px **/\n\nexport const accountDropdownMenuRootClasses = [\"w-[220px]\", \"mr-200\", \"md:w-[272px]\"];\nexport const dropDownMenuItemClasses = [\"\"].concat(smDropDownMenuItemClasses, mdDropDownMenuItemClasses);\nexport const alertBannerClasses = [\"!hidden\", \"rounded-small\"].concat(smAlertBannerClasses, mdAlertBannerClasses);\n","import { PRIVACY_POLICY_URL, TERMS_OF_USE_URL } from \"@/router/constants\";\nimport { Routes } from \"@/router/Routes\";\nimport { uxTexts } from \"@/utils/uxTexts\";\nimport { DropdownMenu, DropdownMenuDivider, DropdownMenuItem } from \"@studio/design-system\";\nimport clsx from \"clsx\";\nimport { FC, useState } from \"react\";\nimport {\n accountDropdownMenuRootClasses,\n alertBannerClasses,\n dropDownMenuItemClasses,\n} from \"./AccountDropdownMenu.styles\";\nimport type { AccountDropdownMenuProps } from \"./AccountDropdownMenu.types\";\n\nexport const AccountDropdownMenu: FC = ({\n trigger,\n open,\n userEmail,\n onLogout,\n className,\n onShowIntercomWidget,\n testId = \"account-dropdown-menu\",\n}) => {\n const rootClasses = clsx(accountDropdownMenuRootClasses, className);\n const dropdownMenuClasses = clsx(dropDownMenuItemClasses);\n\n const [isOpen, setIsOpen] = useState(open);\n\n const handleClose = () => {\n setIsOpen(false);\n };\n\n return (\n setIsOpen(!isOpen)}\n >\n \n {/* these items are supposed to be hidden in small screens (mobile) */}\n \n \n

\n \n
\n \n \n \n \n \n \n );\n};\n","/** md breakpoints 641-768px **/\nconst mdBreadcrumbsClasses = [\"md:hidden\"];\nconst mdTopBarAvatarClasses = [\"md:relative\", \"z-[40]\"];\nconst mdTopBarLinkWrapperClasses = [\"md:justify-between\"];\nconst mdNewChatButtonClasses = [\"md:flex\"];\nconst mdLogoContainerClasses = [\"md:flex\"];\n/** md breakpoints 641-768px **/\n\n/** sm breakpoints 0-640px **/\nconst smBreadcrumbsClasses = [\"sm:hidden\"];\n/** sm breakpoints 0-640px **/\n\nexport const topBarLinkWrapperClasses = [\n \"bg-comp-nav-bg-default\",\n \"w-full\",\n \"h-[54px]\",\n \"items-center\",\n \"px-200\",\n \"flex\",\n \"row\",\n \"gap-100\",\n].concat(mdTopBarLinkWrapperClasses);\n\nexport const breadCrumbsContainerClasses = [\"grow-[1]\", \"shrink-0\"].concat(mdBreadcrumbsClasses, smBreadcrumbsClasses);\n\nexport const buttonClasses = [\"\"].concat([\"sm:hidden\", \"md:hidden\"]);\n\nexport const topBarItemsClasses = [\n \"!bg-comp-nav-bg-default\",\n \"hover:!bg-comp-nav-bg-hover\",\n \"active:!bg-comp-nav-bg-active\",\n \"aria-haspopup:aria-expanded:!bg-comp-nav-bg-active\",\n \"!border-comp-nav-border-default\",\n \"hover:!border-comp-nav-border-hover\",\n \"active:!border-comp-nav-border-active\",\n \"aria-haspopup:aria-expanded:!border-comp-nav-border-active\",\n \"!text-comp-nav-text-default\",\n \"hover:!text-comp-nav-text-hover\",\n \"active:!text-comp-nav-text-active\",\n \"aria-haspopup:aria-expanded:!text-comp-nav-text-active\",\n \"!rounded-medium\",\n \"!shrink-0\",\n];\n\nexport const topBarAvatarClasses = [\"!p-075\", \"[&_svg]:!h-300\", \"[&_svg]:!w-300\", \"cursor-pointer\"].concat(\n mdTopBarAvatarClasses,\n);\n\nexport const newChatButtonClasses = [\"hidden\"].concat(mdNewChatButtonClasses);\n\nexport const topBarLogoContainerClasses = [\"hidden\"].concat(mdLogoContainerClasses);\n\nexport const topBarLogoClasses = [\"w-[99px]\", \"h-[20px]\"];\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","import { useState, useCallback, useLayoutEffect, useEffect, useRef, useMemo } from 'react';\nimport debounce from 'lodash.debounce';\n\n// src/useBoolean/useBoolean.ts\nfunction useBoolean(defaultValue = false) {\n if (typeof defaultValue !== \"boolean\") {\n throw new Error(\"defaultValue must be `true` or `false`\");\n }\n const [value, setValue] = useState(defaultValue);\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return { value, setValue, setTrue, setFalse, toggle };\n}\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/useEventListener/useEventListener.ts\nfunction useEventListener(eventName, handler, element, options) {\n const savedHandler = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n useEffect(() => {\n const targetElement = (element == null ? void 0 : element.current) ?? window;\n if (!(targetElement && targetElement.addEventListener))\n return;\n const listener = (event) => {\n savedHandler.current(event);\n };\n targetElement.addEventListener(eventName, listener, options);\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\n// src/useClickAnyWhere/useClickAnyWhere.ts\nfunction useClickAnyWhere(handler) {\n useEventListener(\"click\", (event) => {\n handler(event);\n });\n}\nfunction useCopyToClipboard() {\n const [copiedText, setCopiedText] = useState(null);\n const copy = useCallback(async (text) => {\n if (!(navigator == null ? void 0 : navigator.clipboard)) {\n console.warn(\"Clipboard not supported\");\n return false;\n }\n try {\n await navigator.clipboard.writeText(text);\n setCopiedText(text);\n return true;\n } catch (error) {\n console.warn(\"Copy failed\", error);\n setCopiedText(null);\n return false;\n }\n }, []);\n return [copiedText, copy];\n}\nfunction useCounter(initialValue) {\n const [count, setCount] = useState(initialValue ?? 0);\n const increment = useCallback(() => {\n setCount((x) => x + 1);\n }, []);\n const decrement = useCallback(() => {\n setCount((x) => x - 1);\n }, []);\n const reset = useCallback(() => {\n setCount(initialValue ?? 0);\n }, [initialValue]);\n return {\n count,\n increment,\n decrement,\n reset,\n setCount\n };\n}\nfunction useInterval(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (delay === null) {\n return;\n }\n const id = setInterval(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearInterval(id);\n };\n }, [delay]);\n}\n\n// src/useCountdown/useCountdown.ts\nfunction useCountdown({\n countStart,\n countStop = 0,\n intervalMs = 1e3,\n isIncrement = false\n}) {\n const {\n count,\n increment,\n decrement,\n reset: resetCounter\n } = useCounter(countStart);\n const {\n value: isCountdownRunning,\n setTrue: startCountdown,\n setFalse: stopCountdown\n } = useBoolean(false);\n const resetCountdown = useCallback(() => {\n stopCountdown();\n resetCounter();\n }, [stopCountdown, resetCounter]);\n const countdownCallback = useCallback(() => {\n if (count === countStop) {\n stopCountdown();\n return;\n }\n if (isIncrement) {\n increment();\n } else {\n decrement();\n }\n }, [count, countStop, decrement, increment, isIncrement, stopCountdown]);\n useInterval(countdownCallback, isCountdownRunning ? intervalMs : null);\n return [count, { startCountdown, stopCountdown, resetCountdown }];\n}\nfunction useEventCallback(fn) {\n const ref = useRef(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n }, [fn]);\n return useCallback((...args) => {\n var _a;\n return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);\n }, [ref]);\n}\n\n// src/useLocalStorage/useLocalStorage.ts\nvar IS_SERVER = typeof window === \"undefined\";\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER) {\n return initialValueToUse;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER) {\n console.warn(\n `Tried setting localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.localStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting localStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n const removeValue = useEventCallback(() => {\n if (IS_SERVER) {\n console.warn(\n `Tried removing localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n window.localStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return [storedValue, setValue, removeValue];\n}\nvar IS_SERVER2 = typeof window === \"undefined\";\nfunction useMediaQuery(query, {\n defaultValue = false,\n initializeWithValue = true\n} = {}) {\n const getMatches = (query2) => {\n if (IS_SERVER2) {\n return defaultValue;\n }\n return window.matchMedia(query2).matches;\n };\n const [matches, setMatches] = useState(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n function handleChange() {\n setMatches(getMatches(query));\n }\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n handleChange();\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener(\"change\", handleChange);\n }\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener(\"change\", handleChange);\n }\n };\n }, [query]);\n return matches;\n}\n\n// src/useDarkMode/useDarkMode.ts\nvar COLOR_SCHEME_QUERY = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY = \"usehooks-ts-dark-mode\";\nfunction useDarkMode(options = {}) {\n const {\n defaultValue,\n localStorageKey = LOCAL_STORAGE_KEY,\n initializeWithValue = true\n } = options;\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY, {\n initializeWithValue,\n defaultValue\n });\n const [isDarkMode, setDarkMode] = useLocalStorage(\n localStorageKey,\n defaultValue ?? isDarkOS ?? false,\n { initializeWithValue }\n );\n useIsomorphicLayoutEffect(() => {\n if (isDarkOS !== isDarkMode) {\n setDarkMode(isDarkOS);\n }\n }, [isDarkOS]);\n return {\n isDarkMode,\n toggle: () => {\n setDarkMode((prev) => !prev);\n },\n enable: () => {\n setDarkMode(true);\n },\n disable: () => {\n setDarkMode(false);\n },\n set: (value) => {\n setDarkMode(value);\n }\n };\n}\nfunction useUnmount(func) {\n const funcRef = useRef(func);\n funcRef.current = func;\n useEffect(\n () => () => {\n funcRef.current();\n },\n []\n );\n}\n\n// src/useDebounceCallback/useDebounceCallback.ts\nfunction useDebounceCallback(func, delay = 500, options) {\n const debouncedFunc = useRef();\n useUnmount(() => {\n if (debouncedFunc.current) {\n debouncedFunc.current.cancel();\n }\n });\n const debounced = useMemo(() => {\n const debouncedFuncInstance = debounce(func, delay, options);\n const wrappedFunc = (...args) => {\n return debouncedFuncInstance(...args);\n };\n wrappedFunc.cancel = () => {\n debouncedFuncInstance.cancel();\n };\n wrappedFunc.isPending = () => {\n return !!debouncedFunc.current;\n };\n wrappedFunc.flush = () => {\n return debouncedFuncInstance.flush();\n };\n return wrappedFunc;\n }, [func, delay, options]);\n useEffect(() => {\n debouncedFunc.current = debounce(func, delay, options);\n }, [func, delay, options]);\n return debounced;\n}\nfunction useDebounceValue(initialValue, delay, options) {\n const eq = (options == null ? void 0 : options.equalityFn) ?? ((left, right) => left === right);\n const unwrappedInitialValue = initialValue instanceof Function ? initialValue() : initialValue;\n const [debouncedValue, setDebouncedValue] = useState(unwrappedInitialValue);\n const previousValueRef = useRef(unwrappedInitialValue);\n const updateDebouncedValue = useDebounceCallback(\n setDebouncedValue,\n delay,\n options\n );\n if (!eq(previousValueRef.current, unwrappedInitialValue)) {\n updateDebouncedValue(unwrappedInitialValue);\n previousValueRef.current = unwrappedInitialValue;\n }\n return [debouncedValue, updateDebouncedValue];\n}\nfunction useDocumentTitle(title, options = {}) {\n const { preserveTitleOnUnmount = true } = options;\n const defaultTitle = useRef(null);\n useIsomorphicLayoutEffect(() => {\n defaultTitle.current = window.document.title;\n }, []);\n useIsomorphicLayoutEffect(() => {\n window.document.title = title;\n }, [title]);\n useUnmount(() => {\n if (!preserveTitleOnUnmount && defaultTitle.current) {\n window.document.title = defaultTitle.current;\n }\n });\n}\nfunction useHover(elementRef) {\n const [value, setValue] = useState(false);\n const handleMouseEnter = () => {\n setValue(true);\n };\n const handleMouseLeave = () => {\n setValue(false);\n };\n useEventListener(\"mouseenter\", handleMouseEnter, elementRef);\n useEventListener(\"mouseleave\", handleMouseLeave, elementRef);\n return value;\n}\nfunction useIntersectionObserver({\n threshold = 0,\n root = null,\n rootMargin = \"0%\",\n freezeOnceVisible = false,\n initialIsIntersecting = false,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = useState(null);\n const [state, setState] = useState(() => ({\n isIntersecting: initialIsIntersecting,\n entry: void 0\n }));\n const callbackRef = useRef();\n callbackRef.current = onChange;\n const frozen = ((_a = state.entry) == null ? void 0 : _a.isIntersecting) && freezeOnceVisible;\n useEffect(() => {\n if (!ref)\n return;\n if (!(\"IntersectionObserver\" in window))\n return;\n if (frozen)\n return;\n let unobserve;\n const observer = new IntersectionObserver(\n (entries) => {\n const thresholds = Array.isArray(observer.thresholds) ? observer.thresholds : [observer.thresholds];\n entries.forEach((entry) => {\n const isIntersecting = entry.isIntersecting && thresholds.some((threshold2) => entry.intersectionRatio >= threshold2);\n setState({ isIntersecting, entry });\n if (callbackRef.current) {\n callbackRef.current(isIntersecting, entry);\n }\n if (isIntersecting && freezeOnceVisible && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n });\n },\n { threshold, root, rootMargin }\n );\n observer.observe(ref);\n return () => {\n observer.disconnect();\n };\n }, [\n ref,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(threshold),\n root,\n rootMargin,\n frozen,\n freezeOnceVisible\n ]);\n const prevRef = useRef(null);\n useEffect(() => {\n var _a2;\n if (!ref && ((_a2 = state.entry) == null ? void 0 : _a2.target) && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {\n prevRef.current = state.entry.target;\n setState({ isIntersecting: initialIsIntersecting, entry: void 0 });\n }\n }, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);\n const result = [\n setRef,\n !!state.isIntersecting,\n state.entry\n ];\n result.ref = result[0];\n result.isIntersecting = result[1];\n result.entry = result[2];\n return result;\n}\nfunction useIsClient() {\n const [isClient, setClient] = useState(false);\n useEffect(() => {\n setClient(true);\n }, []);\n return isClient;\n}\nfunction useIsMounted() {\n const isMounted = useRef(false);\n useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n return useCallback(() => isMounted.current, []);\n}\nfunction useMap(initialState = /* @__PURE__ */ new Map()) {\n const [map, setMap] = useState(new Map(initialState));\n const actions = {\n set: useCallback((key, value) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.set(key, value);\n return copy;\n });\n }, []),\n setAll: useCallback((entries) => {\n setMap(() => new Map(entries));\n }, []),\n remove: useCallback((key) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.delete(key);\n return copy;\n });\n }, []),\n reset: useCallback(() => {\n setMap(() => /* @__PURE__ */ new Map());\n }, [])\n };\n return [map, actions];\n}\n\n// src/useOnClickOutside/useOnClickOutside.ts\nfunction useOnClickOutside(ref, handler, eventType = \"mousedown\", eventListenerOptions = {}) {\n useEventListener(\n eventType,\n (event) => {\n const target = event.target;\n if (!target || !target.isConnected) {\n return;\n }\n const isOutside = Array.isArray(ref) ? ref.filter((r) => Boolean(r.current)).every((r) => r.current && !r.current.contains(target)) : ref.current && !ref.current.contains(target);\n if (isOutside) {\n handler(event);\n }\n },\n void 0,\n eventListenerOptions\n );\n}\nvar IS_SERVER3 = typeof window === \"undefined\";\nfunction useReadLocalStorage(key, options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER3) {\n initializeWithValue = false;\n }\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return null;\n }\n return parsed;\n },\n [options]\n );\n const readValue = useCallback(() => {\n if (IS_SERVER3) {\n return null;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : null;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return null;\n }\n }, [key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return void 0;\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return storedValue;\n}\nvar initialSize = {\n width: void 0,\n height: void 0\n};\nfunction useResizeObserver(options) {\n const { ref, box = \"content-box\" } = options;\n const [{ width, height }, setSize] = useState(initialSize);\n const isMounted = useIsMounted();\n const previousSize = useRef({ ...initialSize });\n const onResize = useRef(void 0);\n onResize.current = options.onResize;\n useEffect(() => {\n if (!ref.current)\n return;\n if (typeof window === \"undefined\" || !(\"ResizeObserver\" in window))\n return;\n const observer = new ResizeObserver(([entry]) => {\n const boxProp = box === \"border-box\" ? \"borderBoxSize\" : box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n const newWidth = extractSize(entry, boxProp, \"inlineSize\");\n const newHeight = extractSize(entry, boxProp, \"blockSize\");\n const hasChanged = previousSize.current.width !== newWidth || previousSize.current.height !== newHeight;\n if (hasChanged) {\n const newSize = { width: newWidth, height: newHeight };\n previousSize.current.width = newWidth;\n previousSize.current.height = newHeight;\n if (onResize.current) {\n onResize.current(newSize);\n } else {\n if (isMounted()) {\n setSize(newSize);\n }\n }\n }\n });\n observer.observe(ref.current, { box });\n return () => {\n observer.disconnect();\n };\n }, [box, ref, isMounted]);\n return { width, height };\n}\nfunction extractSize(entry, box, sizeType) {\n if (!entry[box]) {\n if (box === \"contentBoxSize\") {\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n return void 0;\n }\n return Array.isArray(entry[box]) ? entry[box][0][sizeType] : (\n // @ts-ignore Support Firefox's non-standard behavior\n entry[box][sizeType]\n );\n}\nvar IS_SERVER4 = typeof window === \"undefined\";\nfunction useScreen(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER4) {\n initializeWithValue = false;\n }\n const readScreen = () => {\n if (IS_SERVER4) {\n return void 0;\n }\n return window.screen;\n };\n const [screen, setScreen] = useState(() => {\n if (initializeWithValue) {\n return readScreen();\n }\n return void 0;\n });\n const debouncedSetScreen = useDebounceCallback(\n setScreen,\n options.debounceDelay\n );\n function handleSize() {\n const newScreen = readScreen();\n const setSize = options.debounceDelay ? debouncedSetScreen : setScreen;\n if (newScreen) {\n const {\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n } = newScreen;\n setSize({\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n });\n }\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return screen;\n}\nvar cachedScriptStatuses = /* @__PURE__ */ new Map();\nfunction getScriptNode(src) {\n const node = document.querySelector(\n `script[src=\"${src}\"]`\n );\n const status = node == null ? void 0 : node.getAttribute(\"data-status\");\n return {\n node,\n status\n };\n}\nfunction useScript(src, options) {\n const [status, setStatus] = useState(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return \"idle\";\n }\n if (typeof window === \"undefined\") {\n return \"loading\";\n }\n return cachedScriptStatuses.get(src) ?? \"loading\";\n });\n useEffect(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return;\n }\n const cachedScriptStatus = cachedScriptStatuses.get(src);\n if (cachedScriptStatus === \"ready\" || cachedScriptStatus === \"error\") {\n setStatus(cachedScriptStatus);\n return;\n }\n const script = getScriptNode(src);\n let scriptNode = script.node;\n if (!scriptNode) {\n scriptNode = document.createElement(\"script\");\n scriptNode.src = src;\n scriptNode.async = true;\n if (options == null ? void 0 : options.id) {\n scriptNode.id = options.id;\n }\n scriptNode.setAttribute(\"data-status\", \"loading\");\n document.body.appendChild(scriptNode);\n const setAttributeFromEvent = (event) => {\n const scriptStatus = event.type === \"load\" ? \"ready\" : \"error\";\n scriptNode == null ? void 0 : scriptNode.setAttribute(\"data-status\", scriptStatus);\n };\n scriptNode.addEventListener(\"load\", setAttributeFromEvent);\n scriptNode.addEventListener(\"error\", setAttributeFromEvent);\n } else {\n setStatus(script.status ?? cachedScriptStatus ?? \"loading\");\n }\n const setStateFromEvent = (event) => {\n const newStatus = event.type === \"load\" ? \"ready\" : \"error\";\n setStatus(newStatus);\n cachedScriptStatuses.set(src, newStatus);\n };\n scriptNode.addEventListener(\"load\", setStateFromEvent);\n scriptNode.addEventListener(\"error\", setStateFromEvent);\n return () => {\n if (scriptNode) {\n scriptNode.removeEventListener(\"load\", setStateFromEvent);\n scriptNode.removeEventListener(\"error\", setStateFromEvent);\n }\n if (scriptNode && (options == null ? void 0 : options.removeOnUnmount)) {\n scriptNode.remove();\n cachedScriptStatuses.delete(src);\n }\n };\n }, [src, options == null ? void 0 : options.shouldPreventLoad, options == null ? void 0 : options.removeOnUnmount, options == null ? void 0 : options.id]);\n return status;\n}\nvar IS_SERVER5 = typeof window === \"undefined\";\nfunction useScrollLock(options = {}) {\n const { autoLock = true, lockTarget, widthReflow = true } = options;\n const [isLocked, setIsLocked] = useState(false);\n const target = useRef(null);\n const originalStyle = useRef(null);\n const lock = () => {\n if (target.current) {\n const { overflow, paddingRight } = target.current.style;\n originalStyle.current = { overflow, paddingRight };\n if (widthReflow) {\n const offsetWidth = target.current === document.body ? window.innerWidth : target.current.offsetWidth;\n const currentPaddingRight = parseInt(window.getComputedStyle(target.current).paddingRight, 10) || 0;\n const scrollbarWidth = offsetWidth - target.current.scrollWidth;\n target.current.style.paddingRight = `${scrollbarWidth + currentPaddingRight}px`;\n }\n target.current.style.overflow = \"hidden\";\n setIsLocked(true);\n }\n };\n const unlock = () => {\n if (target.current && originalStyle.current) {\n target.current.style.overflow = originalStyle.current.overflow;\n if (widthReflow) {\n target.current.style.paddingRight = originalStyle.current.paddingRight;\n }\n }\n setIsLocked(false);\n };\n useIsomorphicLayoutEffect(() => {\n if (IS_SERVER5)\n return;\n if (lockTarget) {\n target.current = typeof lockTarget === \"string\" ? document.querySelector(lockTarget) : lockTarget;\n }\n if (!target.current) {\n target.current = document.body;\n }\n if (autoLock) {\n lock();\n }\n return () => {\n unlock();\n };\n }, [autoLock, lockTarget, widthReflow]);\n return { isLocked, lock, unlock };\n}\nvar IS_SERVER6 = typeof window === \"undefined\";\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER6) {\n return initialValueToUse;\n }\n try {\n const raw = window.sessionStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading sessionStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER6) {\n console.warn(\n `Tried setting sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.sessionStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting sessionStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n const removeValue = useEventCallback(() => {\n if (IS_SERVER6) {\n console.warn(\n `Tried removing sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n window.sessionStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"session-storage\", handleStorageChange);\n return [storedValue, setValue, removeValue];\n}\nfunction useStep(maxStep) {\n const [currentStep, setCurrentStep] = useState(1);\n const canGoToNextStep = currentStep + 1 <= maxStep;\n const canGoToPrevStep = currentStep - 1 > 0;\n const setStep = useCallback(\n (step) => {\n const newStep = step instanceof Function ? step(currentStep) : step;\n if (newStep >= 1 && newStep <= maxStep) {\n setCurrentStep(newStep);\n return;\n }\n throw new Error(\"Step not valid\");\n },\n [maxStep, currentStep]\n );\n const goToNextStep = useCallback(() => {\n if (canGoToNextStep) {\n setCurrentStep((step) => step + 1);\n }\n }, [canGoToNextStep]);\n const goToPrevStep = useCallback(() => {\n if (canGoToPrevStep) {\n setCurrentStep((step) => step - 1);\n }\n }, [canGoToPrevStep]);\n const reset = useCallback(() => {\n setCurrentStep(1);\n }, []);\n return [\n currentStep,\n {\n goToNextStep,\n goToPrevStep,\n canGoToNextStep,\n canGoToPrevStep,\n setStep,\n reset\n }\n ];\n}\n\n// src/useTernaryDarkMode/useTernaryDarkMode.ts\nvar COLOR_SCHEME_QUERY2 = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY2 = \"usehooks-ts-ternary-dark-mode\";\nfunction useTernaryDarkMode({\n defaultValue = \"system\",\n localStorageKey = LOCAL_STORAGE_KEY2,\n initializeWithValue = true\n} = {}) {\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY2, { initializeWithValue });\n const [mode, setMode] = useLocalStorage(localStorageKey, defaultValue, {\n initializeWithValue\n });\n const isDarkMode = mode === \"dark\" || mode === \"system\" && isDarkOS;\n const toggleTernaryDarkMode = () => {\n const modes = [\"light\", \"system\", \"dark\"];\n setMode((prevMode) => {\n const nextIndex = (modes.indexOf(prevMode) + 1) % modes.length;\n return modes[nextIndex];\n });\n };\n return {\n isDarkMode,\n ternaryDarkMode: mode,\n setTernaryDarkMode: setMode,\n toggleTernaryDarkMode\n };\n}\nfunction useTimeout(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (!delay && delay !== 0) {\n return;\n }\n const id = setTimeout(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearTimeout(id);\n };\n }, [delay]);\n}\nfunction useToggle(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return [value, toggle, setValue];\n}\nvar IS_SERVER7 = typeof window === \"undefined\";\nfunction useWindowSize(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER7) {\n initializeWithValue = false;\n }\n const [windowSize, setWindowSize] = useState(() => {\n if (initializeWithValue) {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n }\n return {\n width: void 0,\n height: void 0\n };\n });\n const debouncedSetWindowSize = useDebounceCallback(\n setWindowSize,\n options.debounceDelay\n );\n function handleSize() {\n const setSize = options.debounceDelay ? debouncedSetWindowSize : setWindowSize;\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return windowSize;\n}\n\nexport { useBoolean, useClickAnyWhere, useCopyToClipboard, useCountdown, useCounter, useDarkMode, useDebounceCallback, useDebounceValue, useDocumentTitle, useEventCallback, useEventListener, useHover, useIntersectionObserver, useInterval, useIsClient, useIsMounted, useIsomorphicLayoutEffect, useLocalStorage, useMap, useMediaQuery, useOnClickOutside, useReadLocalStorage, useResizeObserver, useScreen, useScript, useScrollLock, useSessionStorage, useStep, useTernaryDarkMode, useTimeout, useToggle, useUnmount, useWindowSize };\n","export const SM_MEDIA_QUERY_MOBILE_BREAKPOINT = \"(max-width: 640px)\";\n","import { ChatModels } from \"@studio/chat-ui\";\n\nexport const DEFAULT_CHAT_MODEL = ChatModels.JAMBA_1_6_LARGE;\nexport const DEFAULT_OLD_CHAT_MODEL = ChatModels.JAMBA_LARGE;\n","export const selectModelDropdownButtonStyles = (disabled?: boolean) => [\n // Prevent the case where the dropdown could be opened when disabled\n // related to bug in the DropdownMenu component\n disabled ? \"pointer-events-none\" : \"\",\n];\n","import { ChatModels } from \"@studio/chat-ui\";\n\nexport const mapSelectedModelIdToButtonText: Record = {\n [ChatModels.JAMBA_1_5]: \"Jamba-mini\",\n [ChatModels.JAMBA_LARGE]: \"Jamba-large\",\n [ChatModels.JAMBA_1_6_LARGE]: \"Jamba-large\",\n [ChatModels.JAMBA_1_6_MINI]: \"Jamba-mini\",\n [ChatModels.JAMBA_INSTRUCT]: 'Jamba instruct (deprecated)'\n};\n","const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const getInitialState = () => initialState;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const destroy = () => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.\"\n );\n }\n listeners.clear();\n };\n const api = { setState, getState, getInitialState, subscribe, destroy };\n const initialState = state = createState(setState, getState, api);\n return api;\n};\nconst createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;\nvar vanilla = (createState) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'.\"\n );\n }\n return createStore(createState);\n};\n\nexport { createStore, vanilla as default };\n","/**\n * @license React\n * use-sync-external-store-shim.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var e=require(\"react\");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k=\"function\"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d}\nfunction r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u=\"undefined\"===typeof window||\"undefined\"===typeof window.document||\"undefined\"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var h=require(\"react\"),n=require(\"use-sync-external-store/shim\");function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q=\"function\"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;\nexports.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);\nu(function(){f.hasValue=!0;f.value=d},[d]);w(d);return d};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","import { createStore } from 'zustand/vanilla';\nexport * from 'zustand/vanilla';\nimport ReactExports from 'react';\nimport useSyncExternalStoreExports from 'use-sync-external-store/shim/with-selector.js';\n\nconst { useDebugValue } = ReactExports;\nconst { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;\nlet didWarnAboutEqualityFn = false;\nconst identity = (arg) => arg;\nfunction useStore(api, selector = identity, equalityFn) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && equalityFn && !didWarnAboutEqualityFn) {\n console.warn(\n \"[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937\"\n );\n didWarnAboutEqualityFn = true;\n }\n const slice = useSyncExternalStoreWithSelector(\n api.subscribe,\n api.getState,\n api.getServerState || api.getInitialState,\n selector,\n equalityFn\n );\n useDebugValue(slice);\n return slice;\n}\nconst createImpl = (createState) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && typeof createState !== \"function\") {\n console.warn(\n \"[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.\"\n );\n }\n const api = typeof createState === \"function\" ? createStore(createState) : createState;\n const useBoundStore = (selector, equalityFn) => useStore(api, selector, equalityFn);\n Object.assign(useBoundStore, api);\n return useBoundStore;\n};\nconst create = (createState) => createState ? createImpl(createState) : createImpl;\nvar react = (createState) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`.\"\n );\n }\n return create(createState);\n};\n\nexport { create, react as default, useStore };\n","import { experimentClient } from \"@/integrations/ampli\";\nimport { type ExperimentClient, type VariantsClient } from \"@ai21/experiments\";\nimport { create } from \"zustand\";\n\ntype FeatureFlagStore = {\n isClientInitialized: boolean;\n featureFlags: VariantsClient;\n getFeatureFlag: (flag: string) => string | undefined;\n};\n\nexport const useFeatureFlagStore = create((set, get) => {\n experimentClient.fetchVariants().then((client) => {\n set((store) => ({ ...store, isClientInitialized: true, featureFlags: client }));\n });\n\n return {\n isClientInitialized: false,\n featureFlags: {} as VariantsClient,\n getFeatureFlag: (flag: string) => {\n if (!flag) {\n return;\n }\n\n const { isClientInitialized, featureFlags } = get();\n\n if (!isClientInitialized) return;\n\n return featureFlags.get(flag)?.value;\n },\n };\n});\n\nexport const refetchFeatureFlags = async (experimentClient: ExperimentClient) => {\n const featureFlags = await experimentClient.fetchVariants();\n\n useFeatureFlagStore.setState({ featureFlags, isClientInitialized: true });\n};\n","export const FeatureFlag = {\n studioTeam: \"studio-team\",\n jamba202502: \"jamba202502\",\n};\n","import { useFeatureFlagStore } from './featureFlags.store';\nimport { FeatureFlag } from './featureFlags.consts';\n\nexport const useFeatureFlag =

(flagName?: keyof typeof FeatureFlag): P => {\n const getFeatureFlag = useFeatureFlagStore((state) => state.getFeatureFlag);\n\n if (!flagName) {\n return undefined as P;\n }\n\n const flag = FeatureFlag[flagName];\n return getFeatureFlag(flag) as P;\n};\n","import { useMemo, useState } from \"react\";\nimport { Button, cn, DropdownMenu, DropdownMenuItem, IconButton } from \"@studio/design-system\";\nimport { ChatModels } from \"@studio/chat-ui\";\nimport { useMediaQuery } from \"usehooks-ts\";\n\nimport { SM_MEDIA_QUERY_MOBILE_BREAKPOINT } from \"@/constants/ui\";\nimport { DEFAULT_CHAT_MODEL } from \"@/constants/chat\";\nimport { testIds } from \"@/utils/testIds\";\nimport { uxTexts } from \"@/utils/uxTexts\";\n\nimport { selectModelDropdownButtonStyles } from \"./SelectModelDropdown.styles\";\nimport { mapSelectedModelIdToButtonText } from \"./SelectModelDropdown.constants\";\nimport type { MODEL_ID, SelectModelDropdownProps } from \"./SelectModelDropdown.types\";\nimport { useFeatureFlag } from \"@/services/featureFlags/featureFlags.service\";\n\nexport const SelectModelDropdown = ({ onSelect, disabled }: SelectModelDropdownProps) => {\n const [isOpen, setIsOpen] = useState(false);\n const [selectedModelId, setSelectedModelId] = useState(DEFAULT_CHAT_MODEL);\n const isSmallScreen = useMediaQuery(SM_MEDIA_QUERY_MOBILE_BREAKPOINT);\n const isJamba202502 = useFeatureFlag(\"jamba202502\");\n\n const jambaMini = isJamba202502 ? ChatModels.JAMBA_1_6_MINI : ChatModels.JAMBA_1_5;\n const jambaLarge = isJamba202502 ? ChatModels.JAMBA_1_6_LARGE : ChatModels.JAMBA_LARGE;\n\n const rightIcon = isOpen ? \"CaretUp\" : \"CaretDown\";\n const isSelected = {\n jambaMini: selectedModelId === jambaMini,\n jambaLarge: selectedModelId === jambaLarge,\n };\n const buttonText = mapSelectedModelIdToButtonText[selectedModelId as ChatModels];\n\n const trigger = useMemo(\n () =>\n isSmallScreen ? (\n \n ) : (\n \n ),\n [buttonText, disabled, isSmallScreen, rightIcon],\n );\n\n const handleOnOpenChange = () => setIsOpen(!isOpen);\n\n const handleSelectModel = (modelId: MODEL_ID) => () => {\n setSelectedModelId(modelId);\n\n if (modelId !== selectedModelId) {\n onSelect(modelId);\n }\n };\n\n return (\n \n \n \n \n );\n};\n","import { testIds } from \"@/utils/testIds\";\nimport { uxTexts } from \"@/utils/uxTexts\";\nimport Logo from \"@assets/logo.svg?react\";\nimport { Avatar, Button, Flex, IconButton } from \"@studio/design-system\";\nimport clsx from \"clsx\";\nimport { FC } from \"react\";\nimport { AccountDropdownMenu } from \"./AccountDropdownMenu/AccountDropdownMenu\";\nimport {\n breadCrumbsContainerClasses,\n buttonClasses,\n newChatButtonClasses,\n topBarAvatarClasses,\n topBarItemsClasses,\n topBarLinkWrapperClasses,\n topBarLogoClasses,\n topBarLogoContainerClasses,\n} from \"./TopBar.styles\";\nimport { TopBarProps } from \"./TopBar.types\";\nimport { SelectModelDropdown } from \"../SelectModelDropdown/SelectModelDropdown\";\n\nexport const TopBar: FC = ({\n isNewChatOptionDisabled,\n isNewChatOptionHidden,\n onButtonClick,\n onLogout,\n userEmail,\n userName,\n onShowIntercomWidget,\n onNewChat,\n onUpdateModel,\n}) => {\n return (\n

\n \n \n
\n \n
\n
\n \n \n \n \n {onButtonClick && (\n
\n );\n};\n\nexport default TopBar;\n","import * as t from 'react';\n\nvar ce=Object.defineProperty;var v=Object.getOwnPropertySymbols;var X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;var Q=(e,o,a)=>o in e?ce(e,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[o]=a,m=(e,o)=>{for(var a in o||(o={}))X.call(o,a)&&Q(e,a,o[a]);if(v)for(var a of v(o))Y.call(o,a)&&Q(e,a,o[a]);return e};var Z=(e,o)=>{var a={};for(var c in e)X.call(e,c)&&o.indexOf(c)<0&&(a[c]=e[c]);if(e!=null&&v)for(var c of v(e))o.indexOf(c)<0&&Y.call(e,c)&&(a[c]=e[c]);return a};var w=(e,o)=>{let a=\"[react-use-intercom]\";switch(e){case\"info\":console.log(`${a} ${o}`);break;case\"warn\":console.warn(`${a} ${o}`);break;case\"error\":console.error(`${a} ${o}`);break;default:console.log(`${a} ${o}`);}};var h=typeof window==\"undefined\",A=e=>(Object.keys(e).forEach(o=>{e[o]&&typeof e[o]==\"object\"?A(e[o]):e[o]===void 0&&delete e[o];}),e);var ie=(e,...o)=>{if(!h&&window.Intercom)return window.Intercom.apply(null,[e,...o]);w(\"error\",`${e} Intercom instance is not initalized yet`);},s=ie;var me=t.createContext(void 0),b=me;var le=(e,o=0)=>{var a=window,c=a.Intercom;if(typeof c==\"function\")c(\"reattach_activator\"),c(\"update\",a.intercomSettings);else {var f=document,l=function(){l.c(arguments);};l.q=[],l.c=function(u){l.q.push(u);},a.Intercom=l;var p=function(){setTimeout(function(){var u=f.createElement(\"script\");u.type=\"text/javascript\",u.async=!0,u.src=\"https://widget.intercom.io/widget/\"+e;var d=f.getElementsByTagName(\"script\")[0];d.parentNode.insertBefore(u,d);},o);};document.readyState===\"complete\"?p():a.attachEvent?a.attachEvent(\"onload\",p):a.addEventListener(\"load\",p,!1);}},oe=le;var ue=e=>({custom_launcher_selector:e.customLauncherSelector,alignment:e.alignment,vertical_padding:e.verticalPadding,horizontal_padding:e.horizontalPadding,hide_default_launcher:e.hideDefaultLauncher,session_duration:e.sessionDuration,action_color:e.actionColor,background_color:e.backgroundColor}),re=e=>m({company_id:e.companyId,name:e.name,created_at:e.createdAt,plan:e.plan,monthly_spend:e.monthlySpend,user_count:e.userCount,size:e.size,website:e.website,industry:e.industry},e.customAttributes),de=e=>({type:e.type,image_url:e.imageUrl}),pe=e=>{var o;return m({email:e.email,user_id:e.userId,created_at:e.createdAt,name:e.name,phone:e.phone,last_request_at:e.lastRequestAt,unsubscribed_from_emails:e.unsubscribedFromEmails,language_override:e.languageOverride,utm_campaign:e.utmCampaign,utm_content:e.utmContent,utm_medium:e.utmMedium,utm_source:e.utmSource,utm_term:e.utmTerm,avatar:e.avatar&&de(e.avatar),user_hash:e.userHash,company:e.company&&re(e.company),companies:(o=e.companies)==null?void 0:o.map(re)},e.customAttributes)},k=e=>A(m(m({},ue(e)),pe(e)));var we=ge=>{var _=ge,{appId:e,autoBoot:o=!1,autoBootProps:a,children:c,onHide:f,onShow:l,onUnreadCountChange:p,onUserEmailSupplied:u,shouldInitialize:d=!h,apiBase:C,initializeDelay:P}=_,ae=Z(_,[\"appId\",\"autoBoot\",\"autoBootProps\",\"children\",\"onHide\",\"onShow\",\"onUnreadCountChange\",\"onUserEmailSupplied\",\"shouldInitialize\",\"apiBase\",\"initializeDelay\"]);let g=t.useRef(!1),y=t.useRef(!1),[x,R]=t.useState(!1),S=Object.keys(ae).filter(r=>!r.startsWith(\"data-\"));S.length>0&&w(\"warn\",[\"some invalid props were passed to IntercomProvider. \",`Please check following props: ${S.join(\", \")}.`].join(\"\"));let D=t.useCallback(()=>{R(!1),f&&f();},[f,R]),M=t.useCallback(()=>{R(!0),l&&l();},[l,R]),I=t.useCallback(r=>{if(!window.Intercom&&!d){w(\"warn\",\"Intercom instance is not initialized because `shouldInitialize` is set to `false` in `IntercomProvider`\");return}s(\"onHide\",D),s(\"onShow\",M),s(\"onUserEmailSupplied\",u),p&&s(\"onUnreadCountChange\",p);let i=m(m({app_id:e},C&&{api_base:C}),r&&k(r));window.intercomSettings=i,s(\"boot\",i),g.current=!0;},[C,e,D,M,p,u,d]);t.useEffect(()=>{!h&&d&&!y.current&&(oe(e,P),o&&I(a),y.current=!0);},[e,o,a,I,P,d]);let n=t.useCallback((r,i)=>{if(!window.Intercom&&!d){w(\"warn\",\"Intercom instance is not initialized because `shouldInitialize` is set to `false` in `IntercomProvider`\");return}if(!g.current){w(\"warn\",[`\"${r}\" was called but Intercom has not booted yet. `,`Please call 'boot' before calling '${r}' or `,\"set 'autoBoot' to true in the IntercomProvider.\"].join(\"\"));return}return i()},[d]),T=t.useCallback(()=>{g.current&&(s(\"shutdown\"),delete window.intercomSettings,g.current=!1);},[]),E=t.useCallback(()=>{g.current&&(s(\"shutdown\"),delete window.Intercom,delete window.intercomSettings,g.current=!1);},[]),$=t.useCallback(()=>{n(\"update\",()=>{let r=Math.floor(new Date().getTime()/1e3);s(\"update\",{last_request_at:r});});},[n]),N=t.useCallback(r=>{n(\"update\",()=>{if(!r){$();return}let i=k(r);window.intercomSettings=m(m({},window.intercomSettings),i),s(\"update\",i);});},[n,$]),V=t.useCallback(()=>{n(\"hide\",()=>{s(\"hide\");});},[n]),L=t.useCallback(()=>{n(\"show\",()=>s(\"show\"));},[n]),z=t.useCallback(()=>{n(\"showMessages\",()=>{s(\"showMessages\");});},[n]),q=t.useCallback(r=>{n(\"showNewMessage\",()=>{r?s(\"showNewMessage\",r):s(\"showNewMessage\");});},[n]),O=t.useCallback(()=>n(\"getVisitorId\",()=>s(\"getVisitorId\")),[n]),W=t.useCallback(r=>{n(\"startTour\",()=>{s(\"startTour\",r);});},[n]),j=t.useCallback(r=>{n(\"startChecklist\",()=>{s(\"startChecklist\",r);});},[n]),B=t.useCallback((r,i)=>{n(\"trackEvent\",()=>{i?s(\"trackEvent\",r,i):s(\"trackEvent\",r);});},[n]),F=t.useCallback(r=>n(\"showArticle\",()=>{s(\"showArticle\",r);}),[n]),U=t.useCallback(r=>n(\"showSpace\",()=>{s(\"showSpace\",r);}),[n]),H=t.useCallback(r=>{n(\"startSurvey\",()=>{s(\"startSurvey\",r);});},[n]),K=t.useCallback(r=>n(\"showNews\",()=>{s(\"showNews\",r);}),[n]),G=t.useCallback(r=>n(\"showTicket\",()=>{s(\"showTicket\",r);}),[n]),J=t.useCallback(r=>n(\"showConversation\",()=>{s(\"showConversation\",r);}),[n]),se=t.useMemo(()=>({boot:I,shutdown:T,hardShutdown:E,update:N,hide:V,show:L,isOpen:x,showMessages:z,showNewMessage:q,getVisitorId:O,startTour:W,startChecklist:j,trackEvent:B,showArticle:F,startSurvey:H,showSpace:U,showNews:K,showTicket:G,showConversation:J}),[I,T,E,N,V,L,x,z,q,O,W,j,B,F,H,U,K,G,J]);return t.createElement(b.Provider,{value:se},c)},ne=()=>{let e=t.useContext(b);if(e===void 0)throw new Error('\"useIntercom\" must be used within `IntercomProvider`.');return e};var fe=()=>ne();\n\nexport { we as IntercomProvider, fe as useIntercom };\n//# sourceMappingURL=out.js.map\n//# sourceMappingURL=index.mjs.map","/** md breakpoints 641-768px **/\nconst mdSideBarLayoutClasses = [\"md:hidden\"];\nconst mdIconContainerClasses = [\"md:m-auto\"];\n/** md breakpoints 641-768px **/\n\n/** sm breakpoints 0-640px **/\nconst smSideBarLayoutClasses = [\"sm:hidden\"];\nconst smIconContainerClasses = [\"sm:m-auto\"];\n/** sm breakpoints 0-640px **/\n\nexport const sideBarLayoutClasses = [\n \"w-[270px]\",\n \"h-full\",\n \"bg-transparent\",\n \"text-comp-nav-text-default\",\n \"z-10\",\n].concat(mdSideBarLayoutClasses, smSideBarLayoutClasses);\n\nexport const sideBarLogoContainerClasses = [\n \"basis-[54px]\",\n \"shrink-0\",\n \"grow-0\",\n \"pl-100\",\n \"bg-comp-nav-bg-default\",\n \"py-200\",\n \"pl-300\",\n].concat(mdIconContainerClasses, smIconContainerClasses);\n\nexport const sideBarLogoClasses = [\"w-[112px]\", \"h-[24px]\"];\n","import { testIds } from \"@/utils/testIds\";\nimport { uxTexts } from \"@/utils/uxTexts\";\nimport { Button, cn, Flex } from \"@studio/design-system\";\nimport clsx from \"clsx\";\nimport { FC } from \"react\";\nimport { sideBarLayoutClasses, sideBarLogoClasses, sideBarLogoContainerClasses } from \"./SideBar.styles\";\nimport Logo from \"@assets/logo.svg?react\";\nimport { SelectModelDropdown } from \"../SelectModelDropdown/SelectModelDropdown\";\nimport type { ChatModels } from \"@studio/chat-ui\";\n\nexport interface SideBarProps {\n hideSideBar?: boolean;\n isNewChatOptionDisabled: boolean;\n isNewChatOptionHidden: boolean;\n onOpenNewChatModal: (e: React.MouseEvent) => void;\n updateModel: (modelId: ChatModels) => void;\n}\n\nexport const SideBar: FC = ({\n hideSideBar = false,\n isNewChatOptionDisabled,\n isNewChatOptionHidden,\n onOpenNewChatModal,\n updateModel,\n}) => {\n const styleClasses = {\n sideBarLayout: clsx(sideBarLayoutClasses),\n sideBarLogoContainer: clsx(sideBarLogoContainerClasses),\n sideBarLogo: clsx(sideBarLogoClasses),\n };\n\n return (\n \n \n \n \n {!hideSideBar && (\n \n \n \n \n )}\n \n );\n};\n","import { testIds } from \"@/utils/testIds\";\nimport { uxTexts } from \"@/utils/uxTexts\";\nimport { Modal, Button, Text } from \"@studio/design-system\";\nimport { FC } from \"react\";\n\ntype NewChatConfirmModalProps = {\n isOpen: boolean;\n onNewChat: (e: React.MouseEvent) => void;\n onClose: (e: React.MouseEvent) => void;\n};\n\nexport const NewChatConfirmModal: FC = ({ isOpen, onClose, onNewChat }) => {\n return (\n \n }\n secondaryAction={\n \n }\n >\n \n {uxTexts.modals.newChatModal.content}\n \n \n );\n};\n","import { useEffect } from \"react\";\nimport { ChatModels } from \"@studio/chat-ui\";\n\nimport { useChatServiceContext } from \"@/contexts/ChatService.context\";\n\n/**\n * Hook to programmatically change the model to the default model when the app loads.\n */\nexport const useDefaultModel = (model: ChatModels) => {\n const { updateModel } = useChatServiceContext();\n\n useEffect(() => {\n updateModel(model);\n }, [model, updateModel]);\n};\n","/** md breakpoints 641-768px **/\nconst mdChatAppPageContainerClasses = [\"md:relative\"];\n/** md breakpoints 641-768px **/\n\n/** sm breakpoints 0-640px **/\nconst smChatAppPageContainerClasses = [\"sm:relative\"];\n/** sm breakpoints 0-640px **/\n\nexport const chatAppContainerClass = [\"w-screen\", \"h-svh\", \"relative\"];\nexport const chatAppMainStageContainerClasses = [\"flex\", \"flex-1\"];\nexport const chatAppTopBarContainerClasses = [\"shrink-0\", \"grow-0\", \"z-10\"];\nexport const chatAppPageContainerClasses = [\"flex-1\", \"overflow-y-auto\", \"pt-100\"].concat(\n mdChatAppPageContainerClasses,\n smChatAppPageContainerClasses,\n);\n","import TopBar from \"@/components/TopBar/TopBar\";\nimport { useChatServiceContext } from \"@/contexts/ChatService.context\";\nimport { onMouseEventClickWithAnalytics } from \"@/services/analytics/analyticsWrapper\";\nimport { EnvVarKey, getEnvVar } from \"@/services/env.service\";\nimport { useLogout, useUserService } from \"@ai21/platform-auth-sdk\";\nimport { Flex } from \"@studio/design-system\";\nimport clsx from \"clsx\";\nimport { FC, useState } from \"react\";\nimport { Outlet } from \"react-router-dom\";\nimport { useIntercom } from \"react-use-intercom\";\nimport { SideBar } from \"../SideBar/SideBar\";\nimport { NewChatConfirmModal } from \"../modals/NewChatConfirmModal\";\nimport { useDefaultModel } from \"@/hooks/useDefaultModel\";\nimport { DEFAULT_CHAT_MODEL, DEFAULT_OLD_CHAT_MODEL } from \"@/constants/chat\";\nimport {\n chatAppContainerClass,\n chatAppMainStageContainerClasses,\n chatAppPageContainerClasses,\n chatAppTopBarContainerClasses,\n} from \"./ChatAppContainer.styles\";\nimport { useFeatureFlag } from \"@/services/featureFlags/featureFlags.service\";\nimport { useMediaQuery } from \"usehooks-ts\";\n\ninterface ChatAppContainerProps {\n hideSideBar?: boolean;\n}\n\nexport const ChatAppContainer: FC = ({ hideSideBar = false }) => {\n const { show } = useIntercom();\n const logout = useLogout();\n const { user } = useUserService();\n const isJamba202502 = useFeatureFlag(\"jamba202502\");\n const [isNewChatModalOpen, setIsNewChatModalOpen] = useState(false);\n\n const { clearChatError, clearMessages, messages, uiState, updateModel } = useChatServiceContext();\n\n const handleNewChat = () => {\n clearChatError();\n clearMessages();\n setIsNewChatModalOpen(false);\n };\n\n useDefaultModel(isJamba202502 ? DEFAULT_CHAT_MODEL : DEFAULT_OLD_CHAT_MODEL);\n\n const isMobile = useMediaQuery(\"(max-width: 798px)\");\n\n return (\n \n \n \n {\n setIsNewChatModalOpen(true);\n })}\n hideSideBar={hideSideBar}\n updateModel={updateModel}\n />\n \n \n
\n await logout()}\n onButtonClick={() => {\n window.location.href = getEnvVar(EnvVarKey.studioAppUrl);\n }}\n onNewChat={onMouseEventClickWithAnalytics(() => {\n setIsNewChatModalOpen(true);\n })}\n onUpdateModel={updateModel}\n />\n
\n
\n \n
\n
\n {isNewChatModalOpen && (\n setIsNewChatModalOpen(false))}\n onNewChat={onMouseEventClickWithAnalytics(handleNewChat)}\n />\n )}\n
\n
\n );\n};\n","import { FC, useEffect } from \"react\";\nimport { IntercomProvider, useIntercom } from \"react-use-intercom\";\nimport { useUserService } from \"@ai21/platform-auth-sdk\";\n\nimport { EnvVarKey, getEnvVar } from \"@/services/env.service\";\nimport type { PropsWithChildren } from \"@/types/base.types\";\n\n/**\n * A component to configure Intercom settings.\n * This component uses the useIntercom hook to update Intercom settings.\n * It hides the default Intercom launcher when mounted.\n */\nconst IntercomSetup = () => {\n const { user } = useUserService();\n const { update } = useIntercom();\n\n useEffect(() => {\n if (!user) return;\n\n update({\n userId: user.userId,\n email: user.userEmail,\n });\n }, [user, update]);\n\n return null;\n};\n\n/**\n * A component to provide Intercom context and enable its setup.\n */\nexport const IntercomSetupProvider: FC = ({ children }) => {\n const appId = getEnvVar(EnvVarKey.intercomAppId);\n const autoBootProps = { hideDefaultLauncher: true };\n\n return (\n \n \n {children}\n \n );\n};\n","import { useCallback } from 'react';\nimport { refetchFeatureFlags } from '@/services/featureFlags/featureFlags.store';\nimport { ampli, experimentClient } from '@/integrations/ampli';\nimport { User } from '@ai21/platform-auth-sdk';\n\n\n/**\n * A hook to set up user integrations upon user sign-in.\n *\n * This hook initializes various third-party integrations and services\n * with the signed-in user's information. For example, it sets up Amplitude\n * with the user's ID.\n */\nconst useSetupUserIntegrations = () => {\n const setupUserIntegrations = useCallback((user: User) => {\n ampli.identify(user.userId);\n }, []);\n\n return setupUserIntegrations;\n};\n\n/**\n * Custom hook to perform post sign-in setup tasks.\n *\n * This hook returns a function that executes necessary setup tasks after a user\n * successfully signs in. It ensures that various initialization functions are\n * properly executed to set up the user session.\n */\nconst usePostSignInSetup = () => {\n const postSignInSetup = useCallback(async () => {\n // Initialize feature flags\n await refetchFeatureFlags(experimentClient);\n }, []);\n\n return postSignInSetup;\n};\n\n/**\n * A hook to perform complete user setup tasks upon sign-in.\n *\n * This hook combines the responsibilities of setting up third-party integrations\n * and other post sign-in tasks. It returns a function that, when called, executes\n * all necessary setup steps to initialize the user's session after a successful sign-in.\n */\nexport const useCompleteUserSetup = () => {\n const setupUserIntegrations = useSetupUserIntegrations();\n const postSignInSetup = usePostSignInSetup();\n\n const completeUserSetup = useCallback(\n async (user: User) => {\n setupUserIntegrations(user);\n await postSignInSetup();\n },\n [setupUserIntegrations, postSignInSetup],\n );\n\n return completeUserSetup;\n};\n","import { EnvVarKey, getEnvVar } from \"@/services/env.service\";\nimport { AuthProvider } from \"@ai21/platform-auth-sdk\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { FC, PropsWithChildren } from \"react\";\nimport { IntercomSetupProvider } from \"./intercom.provider\";\nimport { useFeatureFlagStore } from \"@/services/featureFlags/featureFlags.store\";\nimport { useCompleteUserSetup } from \"@/hooks/userSetup.hook\";\n\nconst identityBaseUrl = getEnvVar(EnvVarKey.identityServerUrl);\n\nconst queryClient = new QueryClient();\n\nexport const BusinessLogicProvider: FC = ({ children }) => {\n const isExperimentClientReady = useFeatureFlagStore((state) => state.isClientInitialized);\n const completeUserSetup = useCompleteUserSetup();\n const emailValidationRedirectURL = getEnvVar(EnvVarKey.emailValidationRedirectUrl);\n\n if (!isExperimentClientReady) {\n return null;\n }\n\n return (\n \n \n {children}\n \n \n );\n};\n","export const NavigateToUrl = ({ url }: { url: string }) => {\n if (!url) return null;\n\n window.location.href = url;\n\n return <>;\n};\n","import { Route, Routes, useLocation } from \"react-router-dom\";\nimport DefaultRoute from \"./DefaultRoute\";\n// import LoadingGuard from \"./RouteGuards\";\nimport { ChatController } from \"@/components/Chat/Chat.controller\";\nimport { ChatAppContainer } from \"@/components/ChatAppContainer/ChatAppContainer\";\nimport { ChatServiceProvider } from \"@/contexts/ChatService.context\";\nimport { BusinessLogicProvider } from \"@/providers/business.provider\";\nimport { Routes as StudioRoutes } from \"@/router/Routes\";\nimport { useEffect, useState } from \"react\";\nimport { trackEvent } from \"../services/analytics\";\nimport { PRIVACY_POLICY_URL, TERMS_OF_USE_URL } from \"./constants\";\nimport { NavigateToUrl } from \"./NavigateToUrl\";\n\nconst sideBarHiddenPaths: string[] = [StudioRoutes.privatePolicy, StudioRoutes.termsOfUse];\n\nfunction Router() {\n const location = useLocation();\n\n const [hideSideBar, setHideSideBar] = useState(false);\n\n useEffect(() => {\n const { referrer } = document;\n const refUrl = referrer ? new URL(referrer) : null;\n\n trackEvent(\"pageEntered\", {\n pageHost: window.location.hostname,\n pagePath: window.location.pathname,\n referrerPageHost: refUrl?.hostname,\n referrerPagePath: refUrl?.pathname,\n });\n\n setHideSideBar(sideBarHiddenPaths.includes(location.pathname));\n }, [location.pathname]);\n\n return (\n \n \n \n \n \n \n }\n >\n } />\n } />\n \n } />\n } />\n \n );\n}\n\nexport default Router;\n","import { ChatUIProvider } from \"@studio/chat-ui\";\nimport { DesignSystemProvider } from \"@studio/design-system\";\nimport styles from \"./App.module.css\";\nimport { UiProvider } from \"./providers/ui.provider.tsx\";\nimport Router from \"./router/Router\";\nimport \"./services/telemetry.ts\";\n\nfunction App() {\n return (\n \n \n \n
\n \n
\n
\n
\n
\n );\n}\n\nexport default App;\n","import { initAmpli } from \"./ampli\";\nexport { experimentClient } from \"./ampli\";\n\nexport function initExternalIntegrations() {\n initAmpli();\n}\n","import React from \"react\";\nimport ReactDOM from \"react-dom/client\";\n// DO NOT move env import - should always come before App\nimport \"./env.ts\";\nimport App from \"./App.tsx\";\nimport \"@studio/design-system/index.css\";\nimport \"@studio/chat-ui/index.css\";\nimport \"./index.css\";\nimport { initExternalIntegrations } from \"./integrations\";\n\ninitExternalIntegrations();\n\n// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\nReactDOM.createRoot(document.getElementById(\"root\")!).render(\n \n \n ,\n);\n"],"names":["m","require$$0","filteredProcessEnv","define_process_env_default","cur","key","UiProvider","children","jsx","BrowserRouter","DefaultRoute","Navigate","getEnvVar","defaultValue","_a","EnvVarKey","ApiKey","DefaultConfiguration","ApiError","event_properties","__publicField","ApiRequest","ApiSuccess","AuthCompleted","AuthProviderFailed","AuthProviderSucceeded","AuthStarted","ButtonPressed","ChatError","ChatGenerated","ChatRequested","ConversationalRagError","ConversationalRagGenerated","ConversationalRagRequested","CreateUserFailed","CreateUserSucceeded","Dialog","DocumentUploadFailed","DocumentUploadSucceeded","FeedbackSubmitError","FeedbackSubmitted","GetUserFailed","GetUserSucceeded","PageEntered","PageExited","UserLoginFailed","UserLoginSucceeded","UserSignUpFailed","UserSignUpSucceeded","getVoidPromiseResult","Ampli","options","apiKey","amplitude.createInstance","configuration","userId","properties","amplitudeIdentify","amplitude.Identify","eventProperties","value","event","ampli","amplitudeExperimentApiKey","amplitudeExperimentProxyUrl","amplitudeFlagsServerUrl","amplitudeServerUrl","experimentClient","createExperimentClient","initAmpli","sessionReplayPlugin","trackEvent","eventType","props","referrer","refUrl","baseProps","onMouseEventClickWithAnalytics","handler","entity","buttonText","error","onClickHandlerWithAnalytics","args","testIds","pluralize","count","singular","plural","uxTexts","sources","rowsSelected","isMultiple","documentCount","r","e","t","f","o","clsx","lgChatBottomClasses","mdChatBottomClasses","smChatBottomClasses","smChatRootClasses","chatRootClasses","isEmptyChat","chatBottomClasses","Chat","assignFeedback","clearChatError","deleteDocument","editMessage","onAddDocument","regenerateMessage","sendMessage","showMessageInfo","toggleAiTypingEffect","stopGeneratingMessage","chatFooterLink","chatError","messages","isGeneratingMessage","isRegeneratingMessage","showAiTypingEffect","userName","isEmpty","useMemo","handleMessage","text","type","styleClasses","stopGeneratingButtonProps","jsxs","Flex","Fragment","EmptyChatHeader","EmptyChatExampleCards","prompt","ChatMessageFeed","ChatInputField","ChatFooter","Subscribable","listener","isServer","noop","functionalUpdate","updater","input","isValidTimeout","timeUntilStale","updatedAt","staleTime","resolveStaleTime","query","resolveEnabled","enabled","matchQuery","filters","exact","fetchStatus","predicate","queryKey","stale","hashQueryKeyByOptions","partialMatchKey","isActive","matchMutation","mutation","status","mutationKey","hashKey","_","val","isPlainObject","result","a","b","replaceEqualDeep","array","isPlainArray","aItems","aSize","bItems","bSize","copy","equalItems","i","hasObjectPrototype","ctor","prot","sleep","timeout","resolve","replaceData","prevData","data","addToEnd","items","item","max","newItems","addToStart","skipToken","ensureQueryFn","fetchOptions","FocusManager","__privateAdd","_focused","_cleanup","_setup","__privateSet","onFocus","__privateGet","setup","focused","isFocused","focusManager","OnlineManager","_online","onOnline","onlineListener","offlineListener","online","onlineManager","pendingThenable","reject","thenable","_resolve","_reject","finalize","reason","defaultRetryDelay","failureCount","canFetch","networkMode","CancelledError","isCancelledError","createRetryer","config","isRetryCancelled","isResolved","continueFn","cancel","cancelOptions","cancelRetry","continueRetry","canContinue","canStart","pause","continueResolve","run","promiseOrValue","initialPromise","retry","retryDelay","delay","shouldRetry","createNotifyManager","queue","transactions","notifyFn","callback","batchNotifyFn","scheduleFn","cb","schedule","flush","originalQueue","fn","notifyManager","Removable","_gcTimeout","newGcTime","Query","_Query_instances","_initialState","_revertState","_cache","_retryer","_defaultOptions","_abortSignalConsumed","getDefaultState","newData","__privateMethod","dispatch_fn","state","setStateOptions","promise","_b","observer","x","abortController","addSignalProperty","object","fetchFn","queryFn","queryFnContext","context","_c","onError","_d","action","reducer","fetchState","hasData","initialDataUpdatedAt","QueryCache","_queries","client","queryHash","queryInMap","defaultedFilters","queries","Mutation","_Mutation_instances","_observers","_mutationCache","variables","restored","isPaused","_f","_e","_h","_g","_j","_i","_l","_k","_n","_m","_p","_o","_r","_q","_t","_s","MutationCache","_mutations","_mutationId","__privateWrapper","scope","scopeFor","mutations","firstPendingMutation","foundMutation","pausedMutations","infiniteQueryBehavior","pages","direction","oldPages","oldPageParams","currentPage","cancelled","fetchPage","param","previous","page","maxPages","addTo","pageParamFn","getPreviousPageParam","getNextPageParam","oldData","remainingPages","pageParams","lastIndex","QueryClient","_queryCache","_queryDefaults","_mutationDefaults","_mountCount","_unsubscribeFocus","_unsubscribeOnline","cachedData","defaultedOptions","queryCache","refetchFilters","defaultedCancelOptions","promises","defaults","queryDefault","QueryClientContext","React.createContext","useQueryClient","queryClient","React.useContext","QueryClientProvider","React.useEffect","identityApiUrl","studioApiUrl","useChatServiceConfig","idToken","useIdToken","httpService","useHttpService","errorMessage","eventParams","interactionId","generatedTextLength","path","params","ChatServiceContext","createContext","ChatServiceProvider","chatServicePayload","chatService","useChatService","useChatServiceContext","useContext","onSendDocumentSuccess","onSendDocumentError","isLastMessage","messageId","chatControllerClasses","tmpCentering","ChatController","user","useUserService","isDropzone","setIsDropzone","useState","messageToDelete","setMessageToDelete","messageToEdit","setMessageToEdit","regenerateMessageId","setRegenerateMessageId","messageInfo","setMessageInfo","showAddDocumentModal","setShowAddDocumentModal","assignMessageFeedback","feedbackErrors","sendDocument","uiState","chatCallbacks","message","onSubmitDeleteMessage","onCancelDeleteMessage","onSubmitRegenerateMessage","onSubmitEditMessage","content","onCancelEditMessage","handleDragEnter","handleDragLeave","Spinner","DeleteDocumentModal","FileUploadModal","files","MessageInfoModal","isOpened","RegenerateModal","EditMessageModal","FileDropZone","fileTypeMappings","SvgLogo","title","titleId","ref","React.createElement","ForwardRef","forwardRef","PRIVACY_POLICY_URL","TERMS_OF_USE_URL","Routes","smDropDownMenuItemClasses","smAlertBannerClasses","mdDropDownMenuItemClasses","mdAlertBannerClasses","accountDropdownMenuRootClasses","dropDownMenuItemClasses","alertBannerClasses","AccountDropdownMenu","trigger","open","userEmail","onLogout","className","onShowIntercomWidget","testId","rootClasses","dropdownMenuClasses","isOpen","setIsOpen","handleClose","DropdownMenu","DropdownMenuItem","DropdownMenuDivider","mdBreadcrumbsClasses","mdTopBarAvatarClasses","mdTopBarLinkWrapperClasses","mdNewChatButtonClasses","mdLogoContainerClasses","smBreadcrumbsClasses","topBarLinkWrapperClasses","breadCrumbsContainerClasses","buttonClasses","topBarItemsClasses","topBarAvatarClasses","newChatButtonClasses","topBarLogoContainerClasses","topBarLogoClasses","freeGlobal","global","freeSelf","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","IS_SERVER2","useMediaQuery","initializeWithValue","getMatches","query2","matches","setMatches","handleChange","matchMedia","SM_MEDIA_QUERY_MOBILE_BREAKPOINT","DEFAULT_CHAT_MODEL","ChatModels","DEFAULT_OLD_CHAT_MODEL","selectModelDropdownButtonStyles","disabled","mapSelectedModelIdToButtonText","createStoreImpl","createState","listeners","setState","partial","replace","nextState","previousState","getState","api","initialState","__vite_import_meta_env__","createStore","h","k","l","n","p","q","d","c","g","u","useSyncExternalStoreShim_production_min","shimModule","require$$1","v","w","withSelector_production_min","withSelectorModule","useDebugValue","ReactExports","useSyncExternalStoreWithSelector","useSyncExternalStoreExports","didWarnAboutEqualityFn","identity","arg","useStore","selector","equalityFn","slice","createImpl","useBoundStore","create","useFeatureFlagStore","set","get","store","flag","isClientInitialized","featureFlags","refetchFeatureFlags","FeatureFlag","useFeatureFlag","flagName","getFeatureFlag","SelectModelDropdown","onSelect","selectedModelId","setSelectedModelId","isSmallScreen","isJamba202502","jambaMini","jambaLarge","rightIcon","isSelected","IconButton","Button","cn","handleOnOpenChange","handleSelectModel","modelId","TopBar","isNewChatOptionDisabled","isNewChatOptionHidden","onButtonClick","onNewChat","onUpdateModel","Logo","Avatar","ce","X","Y","Q","Z","A","ie","s","me","t.createContext","le","oe","ue","re","de","pe","we","ge","C","P","ae","t.useRef","R","t.useState","S","D","t.useCallback","M","I","t.useEffect","T","E","$","N","V","L","z","O","W","j","B","F","U","H","K","G","J","se","t.useMemo","t.createElement","ne","t.useContext","fe","mdSideBarLayoutClasses","mdIconContainerClasses","smSideBarLayoutClasses","smIconContainerClasses","sideBarLayoutClasses","sideBarLogoContainerClasses","sideBarLogoClasses","SideBar","hideSideBar","onOpenNewChatModal","updateModel","NewChatConfirmModal","onClose","Modal","Text","useDefaultModel","model","mdChatAppPageContainerClasses","smChatAppPageContainerClasses","chatAppContainerClass","chatAppMainStageContainerClasses","chatAppTopBarContainerClasses","chatAppPageContainerClasses","ChatAppContainer","show","useIntercom","logout","useLogout","isNewChatModalOpen","setIsNewChatModalOpen","clearMessages","handleNewChat","isMobile","Outlet","IntercomSetup","update","IntercomSetupProvider","appId","autoBootProps","IntercomProvider","useSetupUserIntegrations","useCallback","usePostSignInSetup","useCompleteUserSetup","setupUserIntegrations","postSignInSetup","identityBaseUrl","BusinessLogicProvider","isExperimentClientReady","completeUserSetup","emailValidationRedirectURL","AuthProvider","NavigateToUrl","url","sideBarHiddenPaths","StudioRoutes","Router","location","useLocation","setHideSideBar","Route","App","DesignSystemProvider","ChatUIProvider","styles","initExternalIntegrations","ReactDOM","React"],"mappings":"42DAEIA,GAAIC,iBAEeD,GAAE,0BACDA,GAAE,uCCJ1B,MAAME,GAAqB,OAAO,KAAKC,EAAW,EAAE,OAAO,CAACC,EAAKC,KAC3DA,EAAI,WAAW,OAAO,IAClBD,EAAA,CACJ,GAAGA,EACH,CAACC,CAAG,EAAGF,GAAYE,CAAG,CACxB,GAGKD,GACN,EAAE,EAIL,OAAO,QAAU,CAAE,GAAGF,GAAoB,GAAG,OAAO,iBAAkB,kDCXzDI,GAAoC,CAAC,CAAE,SAAAC,KAC1CC,EAAAA,IAAAC,GAAA,CAAc,SAAS,IAAK,SAAAF,CAAS,CAAA,ECF/C,SAASG,IAAe,CACtB,OAAQF,EAAAA,IAAAG,GAAA,CAAS,GAAG,IAAI,QAAO,GAAC,CAClC,CCJO,MAAMC,GAAY,CAACP,EAAgBQ,EAAe,KAAe,OACtE,QAAOC,EAAA,OAAO,UAAP,YAAAA,EAAiB,GAAGT,CAAG,MAAOQ,CACvC,EAEY,IAAAE,GAAAA,IACVA,EAAA,aAAe,sBACfA,EAAA,4BAA8B,sCAC9BA,EAAA,0BAA4B,oCAC5BA,EAAA,kBAAoB,2BACpBA,EAAA,wBAA0B,kCAC1BA,EAAA,cAAgB,uBAChBA,EAAA,aAAe,sBACfA,EAAA,mBAAqB,6BACrBA,EAAA,2BAA6B,qCAT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