@rh-support/troubleshoot 2.6.127 → 2.6.134

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/lib/esm/components/AccountInfo/css/accountSelector.css +2 -3
  2. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  3. package/lib/esm/components/CaseEditView/Case.js +1 -1
  4. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
  5. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +1 -1
  6. package/lib/esm/components/CaseEditView/CaseOverview/CaseType.d.ts.map +1 -1
  7. package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +4 -2
  8. package/lib/esm/components/CaseEditView/CaseOverview/index.js +2 -2
  9. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftPopover.js +1 -1
  10. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  11. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +2 -4
  12. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +1 -2
  14. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +3 -2
  16. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +33 -13
  17. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +3 -3
  18. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummaryErrorMessage.js +1 -1
  19. package/lib/esm/components/CaseEditView/Tabs/RelatedTasks/RelatedTasks.js +1 -1
  20. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  21. package/lib/esm/components/CaseInformation/CaseGroup.js +1 -11
  22. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  23. package/lib/esm/components/CaseInformation/CaseInformation.js +4 -4
  24. package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
  25. package/lib/esm/components/CaseInformation/Description.js +3 -1
  26. package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
  27. package/lib/esm/components/CaseInformation/Severity.js +1 -1
  28. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  29. package/lib/esm/components/CaseInformation/SupportLevel.js +1 -1
  30. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  31. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +6 -12
  32. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  33. package/lib/esm/components/IdeaInformation/IdeaInformation.js +4 -4
  34. package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
  35. package/lib/esm/components/OpenCase/OpenCase.js +2 -8
  36. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  37. package/lib/esm/components/ProductSelector/AllProductsSelector.js +6 -19
  38. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  39. package/lib/esm/components/ProductSelector/ProductSelector.js +5 -12
  40. package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts +0 -2
  41. package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts.map +1 -1
  42. package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +13 -16
  43. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  44. package/lib/esm/components/Recommendations/ClusterRecommendations.js +4 -1
  45. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  46. package/lib/esm/components/Recommendations/Recommendations.js +39 -39
  47. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  48. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  49. package/lib/esm/components/Review/Review.js +1 -5
  50. package/lib/esm/components/Suggestions/TopContentSidebar.d.ts +3 -0
  51. package/lib/esm/components/Suggestions/TopContentSidebar.d.ts.map +1 -0
  52. package/lib/esm/components/Suggestions/TopContentSidebar.js +26 -0
  53. package/lib/esm/components/TroubleshootSection/AskRedHat.js +1 -1
  54. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts +10 -0
  55. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
  56. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +150 -44
  57. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  58. package/lib/esm/components/shared/useIsSectionValid.js +32 -71
  59. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  60. package/lib/esm/components/wizardLayout/WizardAside.js +18 -9
  61. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  62. package/lib/esm/components/wizardLayout/WizardLayout.js +4 -30
  63. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  64. package/lib/esm/components/wizardLayout/WizardMain.js +134 -71
  65. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +2 -0
  66. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  67. package/lib/esm/components/wizardLayout/WizardNavigation.js +62 -52
  68. package/lib/esm/css/AskRedHat.css +9 -2
  69. package/lib/esm/css/app.css +1 -1
  70. package/lib/esm/hooks/useAB.d.ts +22 -0
  71. package/lib/esm/hooks/useAB.d.ts.map +1 -0
  72. package/lib/esm/hooks/useAB.js +63 -0
  73. package/lib/esm/hooks/useWizard.d.ts +5 -0
  74. package/lib/esm/hooks/useWizard.d.ts.map +1 -1
  75. package/lib/esm/hooks/useWizard.js +20 -6
  76. package/lib/esm/reducers/AIResponseConstNTypes.d.ts +17 -2
  77. package/lib/esm/reducers/AIResponseConstNTypes.d.ts.map +1 -1
  78. package/lib/esm/reducers/AIResponseConstNTypes.js +3 -0
  79. package/lib/esm/reducers/AIResponseReducer.d.ts +2 -0
  80. package/lib/esm/reducers/AIResponseReducer.d.ts.map +1 -1
  81. package/lib/esm/reducers/AIResponseReducer.js +17 -0
  82. package/lib/esm/reducers/CaseConstNTypes.js +3 -3
  83. package/lib/esm/reducers/CaseDiscussionTabReducer.js +1 -1
  84. package/lib/esm/reducers/CaseHelpers.d.ts +6 -8
  85. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  86. package/lib/esm/reducers/CaseHelpers.js +10 -20
  87. package/lib/esm/reducers/CaseReducer.d.ts +0 -1
  88. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  89. package/lib/esm/reducers/CaseReducer.js +2 -37
  90. package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
  91. package/lib/esm/reducers/RouteConstNTypes.js +0 -1
  92. package/lib/esm/reducers/TopContentReducer.js +1 -1
  93. package/lib/esm/scss/_pf-overrides.scss +3 -23
  94. package/package.json +11 -9
@@ -1 +1 @@
1
- {"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAqD,MAAM,OAAO,CAAC;AAE3G,OAAO,EAAS,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAW9D,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAcpF,eAAO,MAAM,iBAAiB,aAAc,MAAM,KAAG,MAEpD,CAAC;AAEF,eAAO,MAAM,sBAAsB,kBAAmB,MAAM,YAAY,MAAM,QAAQ,MAAM,KAAG,MAqB9F,CAAC;AAGF,eAAO,MAAM,kBAAkB,kBACZ,MAAM,WACZ,MAAM,GAAG,SAAS,WAClB,MAAM,GAAG,SAAS,WAClB,MAAM,GAAG,SAAS,SACpB,MAAM,GAAG,SAAS,Y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BAAqB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBAkbhC;AACD,eAAe,UAAU,CAAC"}
@@ -22,9 +22,10 @@ import { Env } from '@cee-eng/hydrajs';
22
22
  import { getRHDirectHealthCheck, getRHDirectStatusCheck, } from '@ifd-ui/ask-redhat-core';
23
23
  import { Wizard, WizardNav, WizardNavItem, WizardStep, } from '@patternfly/react-core';
24
24
  import { LoadingIndicator } from '@rh-support/components';
25
+ import isEmpty from 'lodash/isEmpty';
25
26
  import isEqual from 'lodash/isEqual';
26
27
  import trim from 'lodash/trim';
27
- import React, { Suspense, useContext, useEffect, useRef, useState } from 'react';
28
+ import React, { Suspense, useCallback, useContext, useEffect, useRef, useState } from 'react';
28
29
  import { useTranslation } from 'react-i18next';
29
30
  import { Route } from 'react-router-dom';
30
31
  import { useAIResponseState } from '../../context/AIResponseContext';
@@ -32,6 +33,7 @@ import { useCaseSelector } from '../../context/CaseContext';
32
33
  import { RecommendationDispatchContext } from '../../context/RecommendationContext';
33
34
  import { RouteContext, RouteDispatchContext } from '../../context/RouteContext';
34
35
  import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
36
+ import { useAB } from '../../hooks/useAB';
35
37
  import { useARHResponse } from '../../hooks/useARHResponse';
36
38
  import { useWizard } from '../../hooks/useWizard';
37
39
  import { appSourceId_ARH, excludedCaseTypesforARH } from '../../reducers/CaseConstNTypes';
@@ -88,7 +90,8 @@ export const generateAIQuestion = (activeSection, product, version, summary, iss
88
90
  return `${prefix} ${baseMessageMap[lang] || baseMessageMap.en}`;
89
91
  };
90
92
  function WizardMain(props) {
91
- var _a, _b, _c;
93
+ var _a, _b, _c, _d;
94
+ const { isVariationA } = useAB();
92
95
  const [showRestFlag, setShowRestFlag] = useState(false);
93
96
  const [aiServicesAvailable, setAIServicesAvailable] = useState(false); // default to false until services are confirmed available
94
97
  const recommendationDispatch = useContext(RecommendationDispatchContext);
@@ -101,24 +104,6 @@ function WizardMain(props) {
101
104
  }), isEqual);
102
105
  const { routeState: { isCaseCreate, activeSection }, } = useContext(RouteContext);
103
106
  const aiResponseState = useAIResponseState();
104
- const config = {
105
- appSourceId: appSourceId_ARH,
106
- authToken: (_b = (_a = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _a === void 0 ? void 0 : _a.getEncodedToken()) !== null && _b !== void 0 ? _b : '',
107
- packageVersion: (_c = window === null || window === void 0 ? void 0 : window.supportVersionInfo) === null || _c === void 0 ? void 0 : _c.packageVersion,
108
- appEnv: Env.getEnvName(),
109
- };
110
- const { fetchARHResponse } = useARHResponse({
111
- activeSection,
112
- product: caseDetails.product,
113
- version: caseDetails.version,
114
- summary: caseDetails.summary,
115
- issue: caseDetails.issue,
116
- caseType: caseDetails.caseType,
117
- config,
118
- });
119
- const isTroubleshootSection = activeSection === AppRouteSections.TROUBLESHOOT;
120
- const isResourcesSection = activeSection === AppRouteSections.RESOURCES;
121
- const isSummarizeSection = activeSection === AppRouteSections.SUMMARIZE;
122
107
  const [userSeenRecommendations, setUserSeenRecommendations] = useState(false);
123
108
  const [userClickedNextonRecommendations, setUserClickedNextonRecommendations] = useState(false);
124
109
  const [userScrolledLabel, setUserScrolledLabel] = useState(false);
@@ -127,17 +112,81 @@ function WizardMain(props) {
127
112
  const isNextButtonClickedRef = useRef(false);
128
113
  const isBackButtonClickedRef = useRef(false);
129
114
  const resultsRowRef = useRef(null);
115
+ const goToPrevStepRef = useRef(null);
116
+ const goToNextStepRef = useRef(null);
117
+ const activeStepRef = useRef(null);
118
+ //to track the previous ARH fields
130
119
  const previousARHFieldsRef = useRef({
131
- product: caseDetails.product,
132
- version: caseDetails.version,
133
- summary: caseDetails.summary,
134
- issue: caseDetails.issue,
135
- caseType: caseDetails.caseType,
120
+ product: '',
121
+ version: '',
122
+ summary: '',
123
+ issue: '',
124
+ caseType: '',
136
125
  });
137
126
  const haveARHFieldsChangedRef = useRef(false);
138
127
  const handleChatWithAIClick = () => {
139
128
  props.setIsAIChatMode(true);
140
129
  };
130
+ const handleOnBackForExpandedARH = (e) => {
131
+ if (goToPrevStepRef.current) {
132
+ isBackButtonClickedRef.current = true;
133
+ goToPrevStepRef.current(e);
134
+ focusWizardMainPanel();
135
+ }
136
+ };
137
+ // Callback for TroubleshootSection to reset the flag on unmount
138
+ const resetARHFieldsChanged = useCallback(() => {
139
+ haveARHFieldsChangedRef.current = false;
140
+ }, []);
141
+ const handleSeeMoreResources = () => __awaiter(this, void 0, void 0, function* () {
142
+ var _a;
143
+ props.setIsAIChatMode(false);
144
+ if (sessionRestore.activeSessionId) {
145
+ const sessionDetails = (_a = sessionRestore.previousSessions.data[sessionRestore.activeSessionId]) === null || _a === void 0 ? void 0 : _a.sessionDetails;
146
+ const newSession = {
147
+ returnToCase: true,
148
+ };
149
+ yield updateSession(sessionRestoreDispatch, sessionRestore.activeSessionId, sessionDetails, newSession);
150
+ }
151
+ });
152
+ // Check if any of the ARH-related fields have changed
153
+ useEffect(() => {
154
+ var _a;
155
+ const prev = previousARHFieldsRef.current;
156
+ const curr = {
157
+ product: caseDetails.product,
158
+ version: caseDetails.version,
159
+ summary: trim(caseDetails.summary),
160
+ issue: trim(caseDetails.issue),
161
+ caseType: caseDetails.caseType,
162
+ };
163
+ const hasChanged = prev.product !== curr.product ||
164
+ prev.version !== curr.version ||
165
+ prev.summary !== curr.summary ||
166
+ prev.issue !== curr.issue ||
167
+ prev.caseType !== curr.caseType;
168
+ if (hasChanged) {
169
+ const previousHadValues = !isEmpty(prev.product) || !isEmpty(prev.version) || !isEmpty(prev.summary) || !isEmpty(prev.issue);
170
+ const hasExistingConversation = !isEmpty((_a = aiResponseState.aiResponse) === null || _a === void 0 ? void 0 : _a.conversationId);
171
+ if (previousHadValues && hasExistingConversation) {
172
+ haveARHFieldsChangedRef.current = true;
173
+ }
174
+ previousARHFieldsRef.current = {
175
+ product: curr.product,
176
+ version: curr.version,
177
+ summary: curr.summary,
178
+ issue: curr.issue,
179
+ caseType: curr.caseType,
180
+ };
181
+ }
182
+ }, [
183
+ caseDetails.product,
184
+ caseDetails.version,
185
+ caseDetails.summary,
186
+ caseDetails.issue,
187
+ caseDetails.caseType,
188
+ (_a = aiResponseState.aiResponse) === null || _a === void 0 ? void 0 : _a.conversationId,
189
+ ]);
141
190
  const { getStepsSequece } = useWizard(props.routeProps, {
142
191
  userSeenRecommendationsfn: setUserSeenRecommendations,
143
192
  userSeenRecommendationsValue: userSeenRecommendations,
@@ -151,47 +200,16 @@ function WizardMain(props) {
151
200
  aiServicesAvailable: aiServicesAvailable,
152
201
  isSecureSupport: props.isSecureSupport,
153
202
  hasConfirmedStatesideSupport: props.hasConfirmedStatesideSupport,
203
+ onBack: handleOnBackForExpandedARH,
204
+ haveARHFieldsChanged: haveARHFieldsChangedRef.current,
205
+ resetARHFieldsChanged,
206
+ onSeeMoreResources: handleSeeMoreResources,
154
207
  });
155
208
  const dispatchToRouteReducer = useContext(RouteDispatchContext);
156
209
  const { t } = useTranslation();
157
210
  useEffect(() => {
158
211
  setActiveSectionChanged(dispatchToRouteReducer, isCaseCreate ? AppRouteSections.GET_SUPPORT : AppRouteSections.TROUBLESHOOT, '');
159
212
  }, [isCaseCreate, dispatchToRouteReducer]);
160
- const shouldEnableARHServices = () => {
161
- // Check if the current section is relevant for AI services
162
- const isRelevantSection = isTroubleshootSection || isSummarizeSection || isResourcesSection;
163
- // Check if the case type is allowed (not in the excluded list)
164
- const isCaseTypeAllowed = !excludedCaseTypesforARH.includes(caseDetails.caseType || '');
165
- // Check if user is not a secure support or confirmed stateside support user
166
- const isNotSecureOrStatesideUser = !props.isSecureSupport && !props.hasConfirmedStatesideSupport;
167
- // Check if the ARH fields have changed
168
- const isARHFieldsChanged = haveARHFieldsChangedRef.current;
169
- // Check if user is external and has invalid entitlements
170
- const isNotUnentitledExternalUser = !(props.isUserExternal && props.hasInvalidEntitlements);
171
- return (isRelevantSection &&
172
- isCaseTypeAllowed &&
173
- isNotSecureOrStatesideUser &&
174
- isARHFieldsChanged &&
175
- isNotUnentitledExternalUser);
176
- };
177
- // Check if any of the ARH-related fields have changed
178
- useEffect(() => {
179
- const hasChanged = previousARHFieldsRef.current.product !== caseDetails.product ||
180
- previousARHFieldsRef.current.version !== caseDetails.version ||
181
- previousARHFieldsRef.current.summary !== trim(caseDetails.summary) ||
182
- previousARHFieldsRef.current.issue !== trim(caseDetails.issue) ||
183
- previousARHFieldsRef.current.caseType !== caseDetails.caseType;
184
- if (hasChanged) {
185
- previousARHFieldsRef.current = {
186
- product: caseDetails.product,
187
- version: caseDetails.version,
188
- summary: caseDetails.summary,
189
- issue: caseDetails.issue,
190
- caseType: caseDetails.caseType,
191
- };
192
- haveARHFieldsChangedRef.current = true;
193
- }
194
- }, [caseDetails.product, caseDetails.version, caseDetails.summary, caseDetails.issue, caseDetails.caseType]);
195
213
  useEffect(() => {
196
214
  if (!activeSection) {
197
215
  return;
@@ -247,10 +265,10 @@ function WizardMain(props) {
247
265
  RouteUtils.navigateToSection(props.routeProps, `${props.routeProps.location.pathname}/${step.id}`, false);
248
266
  };
249
267
  const onBack = (step, prevStep) => {
250
- // isLoadingRecommendations needs to be set to false on back when the previous step is the summary
251
- // step because it can cause the next button to be permanently disabled if the debounce is not called
268
+ // isLoadingRecommendations needs to be set to false when going back TO the summary step
269
+ // because it can cause the next button to be permanently disabled if the debounce is not called
252
270
  // before going back a step. This can be caused if navigating quickly to then away from the recommendations page.
253
- if (prevStep.id === AppRouteSections.SUMMARIZE) {
271
+ if (step.id === AppRouteSections.SUMMARIZE) {
254
272
  recommendationDispatch({
255
273
  type: RecommendationsConstants.setIsLoadingRecommendations,
256
274
  payload: { isLoadingRecommendations: false },
@@ -264,6 +282,47 @@ function WizardMain(props) {
264
282
  props.submitCaseAndNavigate(false);
265
283
  return;
266
284
  };
285
+ const config = {
286
+ appSourceId: appSourceId_ARH,
287
+ authToken: (_c = (_b = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _b === void 0 ? void 0 : _b.getEncodedToken()) !== null && _c !== void 0 ? _c : '',
288
+ packageVersion: (_d = window === null || window === void 0 ? void 0 : window.supportVersionInfo) === null || _d === void 0 ? void 0 : _d.packageVersion,
289
+ appEnv: Env.getEnvName(),
290
+ };
291
+ const { fetchARHResponse } = useARHResponse({
292
+ activeSection,
293
+ product: caseDetails.product,
294
+ version: caseDetails.version,
295
+ summary: caseDetails.summary,
296
+ issue: caseDetails.issue,
297
+ caseType: caseDetails.caseType,
298
+ config,
299
+ });
300
+ const isTroubleshootSection = activeSection === AppRouteSections.TROUBLESHOOT;
301
+ const isResourcesSection = activeSection === AppRouteSections.RESOURCES;
302
+ const isSummarizeSection = activeSection === AppRouteSections.SUMMARIZE;
303
+ const shouldEnableARHServices = () => {
304
+ // Check if the current section is relevant for AI services
305
+ const isRelevantSection = isTroubleshootSection || isSummarizeSection || isResourcesSection;
306
+ // Check if the case type is allowed (not in the excluded list)
307
+ const isCaseTypeAllowed = !excludedCaseTypesforARH.includes(caseDetails.caseType || '');
308
+ // Check if user is not a secure support or confirmed stateside support user
309
+ const isNotSecureOrStatesideUser = !props.isSecureSupport && !props.hasConfirmedStatesideSupport;
310
+ // Check if the ARH fields have changed
311
+ const isARHFieldsChanged = haveARHFieldsChangedRef.current;
312
+ // Check if user is external and has invalid entitlements
313
+ const isNotUnentitledExternalUser = !(props.isUserExternal && props.hasInvalidEntitlements);
314
+ // For variation B, check if we have valid fields to make the API call (even if fields haven't changed)
315
+ const hasValidFieldsForVariationB = !isVariationA &&
316
+ !isEmpty(caseDetails.product) &&
317
+ !isEmpty(caseDetails.version) &&
318
+ !isEmpty(trim(caseDetails.summary)) &&
319
+ !isEmpty(trim(caseDetails.issue));
320
+ return (isRelevantSection &&
321
+ isCaseTypeAllowed &&
322
+ isNotSecureOrStatesideUser &&
323
+ (isARHFieldsChanged || hasValidFieldsForVariationB) &&
324
+ isNotUnentitledExternalUser);
325
+ };
267
326
  const onCurrentStepChanged = (event, currentStep, prevStep, scope) => {
268
327
  if (isNextButtonClickedRef.current) {
269
328
  onNext(currentStep);
@@ -292,12 +351,9 @@ function WizardMain(props) {
292
351
  return (React.createElement(WizardNavItem, { key: step.id, id: step.id, content: step.name, isCurrent: activeStep.id === step.id, isDisabled: !step.canJumpTo, stepIndex: step.index, onClick: () => goToStepByIndex(step.index) }));
293
352
  })));
294
353
  const CustomFooter = (activeStep, goToNextStep, goToPrevStep) => {
295
- useEffect(() => {
296
- if (steps.length > 2 && (activeStep === null || activeStep === void 0 ? void 0 : activeStep.index) === 2 && isNextButtonClicked) {
297
- goToNextStep({});
298
- }
299
- // eslint-disable-next-line react-hooks/exhaustive-deps
300
- }, [activeStep, steps.length, isNextButtonClicked, goToNextStep]);
354
+ goToPrevStepRef.current = goToPrevStep;
355
+ goToNextStepRef.current = goToNextStep;
356
+ activeStepRef.current = activeStep;
301
357
  const handleContinueClick = () => __awaiter(this, void 0, void 0, function* () {
302
358
  // Navigate to next step first
303
359
  isNextButtonClickedRef.current = true;
@@ -305,7 +361,7 @@ function WizardMain(props) {
305
361
  goToNextStep({});
306
362
  focusWizardMainPanel();
307
363
  // Fetch ARH response if conditions are met
308
- if (shouldEnableARHServices() && aiServicesAvailable) {
364
+ if (shouldEnableARHServices() && aiServicesAvailable && !isVariationA) {
309
365
  yield fetchARHResponse();
310
366
  haveARHFieldsChangedRef.current = false;
311
367
  }
@@ -314,13 +370,20 @@ function WizardMain(props) {
314
370
  isBackButtonClickedRef.current = true;
315
371
  goToPrevStep({});
316
372
  focusWizardMainPanel();
317
- }, activeStep: activeStep, onSubmit: onSubmit, confirmSupportModal: props.confirmSupportModal, onShowRestUpdate: (flag) => setShowRestFlag(flag), userSeenRecommendations: userSeenRecommendations, setUserSeenRecommendations: setUserSeenRecommendations, userClickedNextonRecommendationsFn: setUserClickedNextonRecommendations, userClickedNextonRecommendationsValue: userClickedNextonRecommendations, setUserCanNavigateToTroubleshoot: setUserCanNavigateToTroubleshoot, resultsRowRef: resultsRowRef, setUserScrolledLabel: setUserScrolledLabel, isAIChatMode: props.isAIChatMode, setIsAIChatMode: props.setIsAIChatMode, onReturnToCaseCreation: handleReturnToCaseCreation, isLoadingARH: aiResponseState.isStreaming && aiResponseState.accumulatedResponse === '' }));
373
+ }, activeStep: activeStep, onSubmit: onSubmit, confirmSupportModal: props.confirmSupportModal, onShowRestUpdate: (flag) => setShowRestFlag(flag), userSeenRecommendations: userSeenRecommendations, setUserSeenRecommendations: setUserSeenRecommendations, userClickedNextonRecommendationsFn: setUserClickedNextonRecommendations, userClickedNextonRecommendationsValue: userClickedNextonRecommendations, setUserCanNavigateToTroubleshoot: setUserCanNavigateToTroubleshoot, resultsRowRef: resultsRowRef, setUserScrolledLabel: setUserScrolledLabel, isAIChatMode: props.isAIChatMode, setIsAIChatMode: props.setIsAIChatMode, onReturnToCaseCreation: handleReturnToCaseCreation, onSeeMoreResources: handleSeeMoreResources, isLoadingARH: aiResponseState.isStreaming && aiResponseState.accumulatedResponse === '', aiServicesAvailable: aiServicesAvailable }));
318
374
  };
319
375
  const steps = getStepsSequece(showRestFlag);
320
376
  const wizardSteps = steps.map((step) => {
321
377
  const { component } = step, rest = __rest(step, ["component"]);
322
378
  return (React.createElement(WizardStep, Object.assign({ key: step.id }, rest), component));
323
379
  });
380
+ // moved from CustomFooter to comply with React Rules of Hooks
381
+ useEffect(() => {
382
+ var _a;
383
+ if (steps.length > 2 && ((_a = activeStepRef.current) === null || _a === void 0 ? void 0 : _a.index) === 2 && isNextButtonClicked && goToNextStepRef.current) {
384
+ goToNextStepRef.current({});
385
+ }
386
+ }, [steps.length, isNextButtonClicked]);
324
387
  // To add a new step to wizard first need to add the component to appRouteConfugurations
325
388
  // in useWizard file then add it to step squences in RouteConstNTypes
326
389
  return (React.createElement(React.Fragment, null,
@@ -19,7 +19,9 @@ interface IProps {
19
19
  isAIChatMode?: boolean;
20
20
  setIsAIChatMode?: (value: boolean) => void;
21
21
  onReturnToCaseCreation?: () => void;
22
+ onSeeMoreResources?: () => void;
22
23
  isLoadingARH?: boolean;
24
+ aiServicesAvailable?: boolean;
23
25
  }
24
26
  declare function WizardNavigation(props: IProps): React.JSX.Element;
25
27
  declare namespace WizardNavigation {
@@ -1 +1 @@
1
- {"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAM3G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzD,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzD,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0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pty';
17
17
  import isEqual from 'lodash/isEqual';
18
- import React, { useContext, useEffect, useRef, useState } from 'react';
18
+ import React, { useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
19
19
  import { Trans, useTranslation } from 'react-i18next';
20
+ import { useAIResponseState } from '../../context/AIResponseContext';
20
21
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
21
22
  import { RecommendationStateContext } from '../../context/RecommendationContext';
22
23
  import { RouteContext, RouteDispatchContext } from '../../context/RouteContext';
23
24
  import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
25
+ import { useAB } from '../../hooks/useAB';
24
26
  import { excludedCaseTypesforARH } from '../../reducers/CaseConstNTypes';
25
27
  import { setCaseState } from '../../reducers/CaseReducer';
26
28
  import { AppRouteSections } from '../../reducers/RouteConstNTypes';
@@ -32,22 +34,21 @@ const defaultProps = {};
32
34
  function WizardNavigation(props) {
33
35
  var _a, _b;
34
36
  const { t } = useTranslation();
37
+ const { isVariationA } = useAB();
35
38
  const canCreateCase = useCanCreateCase();
36
39
  const { recommendationState } = useContext(RecommendationStateContext);
40
+ const aiResponseState = useAIResponseState();
37
41
  const { routeState: { activeSection, isNextBtnClickedToShowValidationError, noValidEntitlement, isSearchIntent, isCaseCreate, }, } = useContext(RouteContext);
38
42
  const { globalMetadataState: { loggedInUsersAccount, allProducts, navBarRef }, } = useContext(GlobalMetadataStateContext);
39
- const { caseState, ABTestVariation, issue, summary, product, version, caseType, manageSupportCases } = useCaseSelector((state) => ({
43
+ const { caseState, issue, summary, product, version, caseType } = useCaseSelector((state) => ({
40
44
  caseState: state,
41
45
  issue: state.caseDetails.issue,
42
46
  summary: state.caseDetails.summary,
43
- ABTestVariation: state.ABTestVariation,
44
47
  product: state.caseDetails.product,
45
48
  version: state.caseDetails.version,
46
49
  caseType: state.caseDetails.caseType,
47
50
  manageSupportCases: state.selectedOwner.data.manageSupportCases,
48
51
  }), isEqual);
49
- const isATestvariation = ABTestVariation === 'A';
50
- const isBTestvariation = ABTestVariation === 'B' || isEmpty(ABTestVariation);
51
52
  // To check if the user is entitled or not
52
53
  const isEntitledProduct = (_b = find((_a = allProducts === null || allProducts === void 0 ? void 0 : allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult, (p) => p.product === caseState.caseDetails.product)) === null || _b === void 0 ? void 0 : _b.isEntitledProduct;
53
54
  const dispatchToRouteReducer = useContext(RouteDispatchContext);
@@ -78,9 +79,19 @@ function WizardNavigation(props) {
78
79
  behavior: 'instant',
79
80
  });
80
81
  }
82
+ // Reset scroll state when navigating based on isVariationA
83
+ const resetScrollSection = isVariationA
84
+ ? AppRouteSections.RESOURCES
85
+ : isCaseCreate
86
+ ? AppRouteSections.SUMMARIZE
87
+ : AppRouteSections.TROUBLESHOOT;
88
+ if (props.activeStep.id === resetScrollSection) {
89
+ setHasUserScrolled(false);
90
+ }
81
91
  // eslint-disable-next-line react-hooks/exhaustive-deps
82
92
  }, [previousStep === null || previousStep === void 0 ? void 0 : previousStep.id, props.activeStep.id]);
83
93
  const [hasUserScrolled, setHasUserScrolled] = useState(false);
94
+ const [shouldOpenChatbot, setShouldOpenChatbot] = useState(false);
84
95
  useEffect(() => {
85
96
  var _a;
86
97
  if (activeSection !== AppRouteSections.RESOURCES && props.isAIChatMode) {
@@ -88,8 +99,22 @@ function WizardNavigation(props) {
88
99
  }
89
100
  // eslint-disable-next-line react-hooks/exhaustive-deps
90
101
  }, [activeSection]);
102
+ // to prevent flash of recommendations before AI chat mode is set
103
+ useLayoutEffect(() => {
104
+ var _a;
105
+ if (activeSection === AppRouteSections.RESOURCES && shouldOpenChatbot) {
106
+ (_a = props.setIsAIChatMode) === null || _a === void 0 ? void 0 : _a.call(props, true);
107
+ setShouldOpenChatbot(false);
108
+ }
109
+ // eslint-disable-next-line react-hooks/exhaustive-deps
110
+ }, [activeSection, shouldOpenChatbot]);
91
111
  useEffect(() => {
92
- if (props.activeStep.id !== (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT)) {
112
+ const validSteps = isVariationA
113
+ ? [AppRouteSections.RESOURCES]
114
+ : isCaseCreate
115
+ ? [AppRouteSections.SUMMARIZE]
116
+ : [AppRouteSections.TROUBLESHOOT];
117
+ if (!validSteps.includes(props.activeStep.id)) {
93
118
  return;
94
119
  }
95
120
  const observer = new IntersectionObserver(([entry]) => {
@@ -147,13 +172,21 @@ function WizardNavigation(props) {
147
172
  observer.unobserve(resultsRowElement);
148
173
  }
149
174
  };
150
- }, [recommendationState.numFound, hasUserScrolled, props, isCaseCreate]);
175
+ }, [recommendationState.numFound, hasUserScrolled, props, isCaseCreate, isVariationA]);
151
176
  const onNext = (e) => {
152
177
  var _a;
153
178
  updateisNextBtnClickedToShowValidationError(dispatchToRouteReducer, true);
154
- //handle the new changes for 13406:
155
- if (props.activeStep.id === (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT) &&
156
- recommendationState.numFound > 2) {
179
+ if (isVariationA &&
180
+ activeSection === (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT)) {
181
+ setShouldOpenChatbot(true);
182
+ }
183
+ // Handle scroll behavior based on isVariationA
184
+ const scrollSection = isVariationA
185
+ ? AppRouteSections.RESOURCES
186
+ : isCaseCreate
187
+ ? AppRouteSections.SUMMARIZE
188
+ : AppRouteSections.TROUBLESHOOT;
189
+ if (props.activeStep.id === scrollSection && recommendationState.numFound > 2) {
157
190
  if (!hasUserScrolled) {
158
191
  scrollIntoView(props.resultsRowRef, {
159
192
  navBarRef,
@@ -223,60 +256,37 @@ function WizardNavigation(props) {
223
256
  const isLoadingARH = props.isLoadingARH &&
224
257
  props.activeStep.id === AppRouteSections.RESOURCES &&
225
258
  !excludedCaseTypesforARH.includes(caseType || '');
226
- if (isBTestvariation) {
227
- let value = isLoadingARH ||
228
- ((isEmpty(summary) || isEmpty(issue) || isEmpty(product) || isEmpty(version)) &&
229
- props.activeStep.id ===
230
- (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT)) ||
231
- (!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
232
- props.activeStep.nextButtonLabel === 'Troubleshoot' ||
233
- (!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
234
- (noValidEntitlement && props.activeStep.id != AppRouteSections.TROUBLESHOOT) ||
235
- (!manageSupportCases && props.activeStep.id === AppRouteSections.GET_SUPPORT) ||
236
- recommendationState.isLoadingRecommendations;
237
- return value;
238
- }
239
- else if (isATestvariation) {
240
- let value = isLoadingARH ||
241
- ((isEmpty(summary) || isEmpty(issue) || isEmpty(product) || isEmpty(version)) &&
242
- props.activeStep.id ===
243
- (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT)) ||
244
- (!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
245
- props.activeStep.nextButtonLabel === 'Troubleshoot' ||
246
- (!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
247
- (noValidEntitlement && props.activeStep.id != AppRouteSections.TROUBLESHOOT) ||
248
- (!manageSupportCases && props.activeStep.id === AppRouteSections.GET_SUPPORT) ||
249
- recommendationState.isLoadingRecommendations;
250
- return value;
251
- }
252
- else if (isATestvariation && !isCaseCreate) {
253
- let value = isLoadingARH ||
254
- isEmpty(summary) ||
255
- isEmpty(issue) ||
256
- (!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
257
- (!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
258
- (noValidEntitlement && props.activeStep.id != AppRouteSections.TROUBLESHOOT) ||
259
- (!manageSupportCases && props.activeStep.id === AppRouteSections.GET_SUPPORT) ||
260
- recommendationState.isLoadingRecommendations;
261
- return value;
262
- }
259
+ let value = isLoadingARH ||
260
+ ((isEmpty(summary) || isEmpty(issue) || isEmpty(product) || isEmpty(version)) &&
261
+ props.activeStep.id === (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT)) ||
262
+ (!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
263
+ props.activeStep.nextButtonLabel === 'Troubleshoot' ||
264
+ (isSectionValidFn && !isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
265
+ noValidEntitlement ||
266
+ recommendationState.isLoadingRecommendations;
267
+ return value;
263
268
  };
264
269
  const isDisabledGoBack = () => {
265
- if (isBTestvariation || isEmpty(ABTestVariation))
266
- return false;
267
- if (isATestvariation && props.activeStep.id === 'get-support') {
270
+ if (props.activeStep.id === 'get-support') {
268
271
  return isEmpty(product) || isEmpty(version);
269
272
  }
273
+ return false;
270
274
  };
275
+ const shouldShowNewARHFlowFooterButtons = isVariationA && props.isAIChatMode && activeSection === AppRouteSections.RESOURCES;
276
+ const shouldShowBackToAIButton = isVariationA && !props.isAIChatMode && activeSection === AppRouteSections.RESOURCES;
271
277
  // To handle entitled products
272
278
  return (React.createElement(React.Fragment, null,
273
279
  React.createElement(WizardFooterWrapper, null,
274
- props.isAIChatMode && activeSection === AppRouteSections.RESOURCES ? (isCaseCreate ? (React.createElement("span", null,
280
+ shouldShowNewARHFlowFooterButtons ? (React.createElement(React.Fragment, null,
281
+ props.activeStep.order !== 0 && (React.createElement("button", { onClick: () => onBack({}), className: "btn btn-app btn-open-white main-nav-button", "data-tracking-id": `prev-of-${activeSection}`, type: "button" }, t('Go back'))),
282
+ React.createElement("button", { onClick: props.onSeeMoreResources, className: "btn btn-app btn-primary main-nav-button", type: "button", disabled: props.aiServicesAvailable && !aiResponseState.hasChunkReceived }, t('See more resources')))) : props.isAIChatMode && activeSection === AppRouteSections.RESOURCES ? (isCaseCreate ? (React.createElement("span", null,
275
283
  React.createElement(Trans, { i18nKey: "<span>Return to</span> <button>case creation</button>", components: {
276
284
  span: React.createElement("span", { className: "return-to-case-text" }),
277
285
  button: (React.createElement(Button, { className: "return-to-case-btn", variant: "link", component: "a", onClick: props.onReturnToCaseCreation })),
278
286
  } }))) : (React.createElement(Button, { onClick: props.onReturnToCaseCreation, variant: "link", className: "return-to-resources-btn" }, t('Back to resources')))) : (React.createElement(React.Fragment, null,
279
- props.activeStep.order !== 0 && (React.createElement("button", { onClick: () => onBack({}), className: "btn btn-app btn-open-white main-nav-button", "data-tracking-id": `prev-of-${activeSection}`, type: "button", disabled: isDisabledGoBack() }, t('Go back'))),
287
+ props.activeStep.order !== 0 && (React.createElement("button", { onClick: shouldShowBackToAIButton
288
+ ? () => { var _a; return (_a = props.setIsAIChatMode) === null || _a === void 0 ? void 0 : _a.call(props, true); }
289
+ : () => onBack({}), className: "btn btn-app btn-open-white main-nav-button", "data-tracking-id": `prev-of-${activeSection}`, type: "button", disabled: !shouldShowBackToAIButton && isDisabledGoBack() }, shouldShowBackToAIButton ? t('Back to AI') : t('Go back'))),
280
290
  React.createElement("button", { disabled: nextButtonDisabledLogic(), onClick: onNext, className: "btn btn-app btn-primary main-nav-button", "data-tracking-id": `next-of-${activeSection}`, type: "button" }, t(props.activeStep.nextButtonLabel)),
281
291
  activeSection === AppRouteSections.RESOURCES && isFileRecommendationsTriggered && (React.createElement(Button, { onClick: handleFileRecsSelfSolved, variant: ButtonVariant.secondary, className: "issue-solved-button solved-issue-button", "data-tracking-id": "troubleshoot-self-solved-issue" }, t('I solved my issue'))))),
282
292
  React.createElement(RecommendationFeedbackModal, { isModalOpen: isRecsModalVisible, handleModalToggle: onRecsFeedbackModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
@@ -331,7 +331,7 @@
331
331
  }
332
332
 
333
333
  .pf-chatbot--fullscreen .pf-chatbot-container {
334
- height: calc(100vh - 255px) !important;
334
+ height: calc(100vh - 277px) !important;
335
335
  }
336
336
 
337
337
  .fullscreen-chat-footer {
@@ -339,7 +339,7 @@
339
339
  bottom: 0 !important;
340
340
  left: 0 !important;
341
341
  right: 0 !important;
342
- height: 42px !important;
342
+ height: 57px !important;
343
343
  background: #f6f6f6 !important;
344
344
  border-top: 1px solid #d1d1d1 !important;
345
345
  align-items: center !important;
@@ -354,6 +354,13 @@ body:has(.pf-chatbot--fullscreen) .pf-v6-c-wizard__footer {
354
354
 
355
355
  body:has(.pf-chatbot--fullscreen) .fullscreen-chat-footer {
356
356
  display: flex !important;
357
+ gap: 10px;
358
+ }
359
+
360
+ .fullscreen-chat-footer .btn.btn-app {
361
+ padding: 0.375rem 1rem;
362
+ border-radius: var(--global-border-radius-pill, 999px);
363
+ border: var(--global-border-width-regular, 1px) solid var(--global-border-color-brand-default, #06c);
357
364
  }
358
365
 
359
366
  body:has(.pf-chatbot--fullscreen) .main-section {
@@ -449,7 +449,7 @@ input[type='checkbox'] {
449
449
  .comment-plaintext.reset-pre-text {
450
450
  font-family: 'Red Hat Display', 'RedHatDisplay', 'Helvetica Neue', 'Arial', 'sans-serif';
451
451
  text-rendering: auto;
452
- font-weight: 300;
452
+ font-weight: 500;
453
453
  font-size: 1.12rem;
454
454
  line-height: 1.5em;
455
455
  }
@@ -0,0 +1,22 @@
1
+ export interface IUseABOptions {
2
+ defaultVariation?: ABEnum;
3
+ }
4
+ export interface IUseABReturn {
5
+ variation: ABEnum;
6
+ isVariationA: boolean;
7
+ isVariationB: boolean;
8
+ }
9
+ export interface IUseABComponentOptions extends IUseABOptions {
10
+ A: JSX.Element | null;
11
+ B: JSX.Element | null;
12
+ }
13
+ export interface IUseABComponentReturn extends IUseABReturn {
14
+ component: JSX.Element | null;
15
+ }
16
+ export declare enum ABEnum {
17
+ A = "A",
18
+ B = "B"
19
+ }
20
+ export declare function useAB(options?: IUseABOptions): IUseABReturn;
21
+ export declare function useABComponent(options: IUseABComponentOptions): IUseABComponentReturn;
22
+ //# sourceMappingURL=useAB.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAB.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAB.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,aAAa;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,sBAAuB,SAAQ,aAAa;IACzD,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACvD,SAAS,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;CACjC;AAED,oBAAY,MAAM;IACd,CAAC,MAAM;IACP,CAAC,MAAM;CACV;AAED,wBAAgB,KAAK,CAAC,OAAO,GAAE,aAAkB,GAAG,YAAY,CA2D/D;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,sBAAsB,GAAG,qBAAqB,CAMrF"}