@e-llm-studio/instant-learning 1.3.0-alpha.210 → 1.3.0-alpha.211

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 (292) hide show
  1. package/dist/ILMarketplaceWrapper.js +1 -1
  2. package/dist/cjs/ILMarketplaceWrapper.js +1 -1
  3. package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +1 -1
  4. package/dist/cjs/features/IL-OTJ/_components/AccordianSection.js +1 -1
  5. package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +1 -1
  6. package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatHeader.js +1 -1
  7. package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatHeader.module.css.js +1 -1
  8. package/dist/cjs/features/IL-OTJ/_components/MessageRendering/MessageRendering.js +1 -1
  9. package/dist/cjs/features/IL-OTJ/_components/hooks/usePendingEditHighlight.js +2 -0
  10. package/dist/cjs/features/IL-OTJ/_components/hooks/usePendingEditHighlight.js.map +1 -0
  11. package/dist/cjs/features/IL-OTJ/_components/hooks/useVariantEditSession.js +2 -0
  12. package/dist/cjs/features/IL-OTJ/_components/hooks/useVariantEditSession.js.map +1 -0
  13. package/dist/cjs/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js +2 -0
  14. package/dist/cjs/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js.map +1 -0
  15. package/dist/cjs/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js +2 -0
  16. package/dist/cjs/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js.map +1 -0
  17. package/dist/cjs/features/IL-OTJ/_components/templates/SchemaDriven/SchemaDrivenCreateRule.js +1 -1
  18. package/dist/cjs/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
  19. package/dist/cjs/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js +2 -0
  20. package/dist/cjs/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js.map +1 -0
  21. package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryCard.js +1 -1
  22. package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryCard.module.css.js +1 -1
  23. package/dist/cjs/features/IL-marketplace/components/ILMarketPlacePublish/PublishToMarketplaceCompnent.js +1 -1
  24. package/dist/cjs/features/IL-marketplace/components/LearningManagementWrapper.js +1 -1
  25. package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.js +2 -0
  26. package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.js.map +1 -0
  27. package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.styles.js +2 -0
  28. package/dist/cjs/features/LSCGuidelinesCart/Cart/Cart.styles.js.map +1 -0
  29. package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.js +2 -0
  30. package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.js.map +1 -0
  31. package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.styles.js +2 -0
  32. package/dist/cjs/features/LSCGuidelinesCart/GuidelineCard.styles.js.map +1 -0
  33. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.js +2 -0
  34. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.js.map +1 -0
  35. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js +2 -0
  36. package/dist/cjs/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js.map +1 -0
  37. package/dist/cjs/features/LSCGuidelinesCart/LearningManagementWrapper.js +2 -0
  38. package/dist/cjs/features/LSCGuidelinesCart/LearningManagementWrapper.js.map +1 -0
  39. package/dist/cjs/features/LSCGuidelinesCart/api.js +2 -0
  40. package/dist/cjs/features/LSCGuidelinesCart/api.js.map +1 -0
  41. package/dist/cjs/features/LSCGuidelinesCart/endpoints.js +2 -0
  42. package/dist/cjs/features/LSCGuidelinesCart/endpoints.js.map +1 -0
  43. package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -1
  44. package/dist/cjs/features/LearningManagement/LearningManagementTest.js +1 -1
  45. package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js +1 -1
  46. package/dist/cjs/features/LearningManagement/apis/scopeApis.js +1 -1
  47. package/dist/cjs/features/LearningManagement/assets/Search-result(add new).svg.js +2 -0
  48. package/dist/cjs/features/LearningManagement/assets/Search-result(add new).svg.js.map +1 -0
  49. package/dist/cjs/features/LearningManagement/components/CreateLearningSetModal.js +2 -0
  50. package/dist/cjs/features/LearningManagement/components/CreateLearningSetModal.js.map +1 -0
  51. package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +1 -1
  52. package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js +1 -1
  53. package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeNode.js +1 -1
  54. package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeNodeHeader.js +1 -1
  55. package/dist/cjs/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js +2 -0
  56. package/dist/cjs/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js.map +1 -0
  57. package/dist/cjs/features/LearningManagement/config.js +1 -1
  58. package/dist/cjs/features/LearningManagement/styles/CreateLearningSetModal.module.css.js +2 -0
  59. package/dist/cjs/features/LearningManagement/styles/CreateLearningSetModal.module.css.js.map +1 -0
  60. package/dist/cjs/features/LearningManagement/utils/resizeObserverErrorGuard.js +2 -0
  61. package/dist/cjs/features/LearningManagement/utils/resizeObserverErrorGuard.js.map +1 -0
  62. package/dist/cjs/node_modules/@e-llm-studio/audit-log/dist/styles.css.js +2 -0
  63. package/dist/cjs/node_modules/@e-llm-studio/audit-log/dist/styles.css.js.map +1 -0
  64. package/dist/cjs/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +1 -1
  65. package/dist/cjs/schema-driven/BPARenderer.js +1 -1
  66. package/dist/cjs/schema-driven/SchemaRenderer.js +2 -0
  67. package/dist/cjs/schema-driven/SchemaRenderer.js.map +1 -0
  68. package/dist/cjs/schema-driven/adapters/ConditionSectionAdapter.js +2 -0
  69. package/dist/cjs/schema-driven/adapters/ConditionSectionAdapter.js.map +1 -0
  70. package/dist/cjs/schema-driven/adapters/ConfigSectionAdapter.js +2 -0
  71. package/dist/cjs/schema-driven/adapters/ConfigSectionAdapter.js.map +1 -0
  72. package/dist/cjs/schema-driven/adapters/GlobalSetupAccordionAdapter.js +2 -0
  73. package/dist/cjs/schema-driven/adapters/GlobalSetupAccordionAdapter.js.map +1 -0
  74. package/dist/cjs/schema-driven/adapters/PromptTextEditorAdapter.js +2 -0
  75. package/dist/cjs/schema-driven/adapters/PromptTextEditorAdapter.js.map +1 -0
  76. package/dist/cjs/schema-driven/adapters/ScopeSectionAdapter.js +2 -0
  77. package/dist/cjs/schema-driven/adapters/ScopeSectionAdapter.js.map +1 -0
  78. package/dist/cjs/schema-driven/adapters/TextInputAdapter.js +2 -0
  79. package/dist/cjs/schema-driven/adapters/TextInputAdapter.js.map +1 -0
  80. package/dist/cjs/schema-driven/adapters/VariantListWrapperAdapter.js +2 -0
  81. package/dist/cjs/schema-driven/adapters/VariantListWrapperAdapter.js.map +1 -0
  82. package/dist/cjs/schema-driven/components/ConditionSectionField.js +1 -1
  83. package/dist/cjs/schema-driven/components/GlobalSetupAccordionField.js +1 -1
  84. package/dist/cjs/schema-driven/components/GroupEditRow.js +1 -1
  85. package/dist/cjs/schema-driven/components/PromptTextEditorField.js +1 -1
  86. package/dist/cjs/schema-driven/components/VariantListField.js +1 -1
  87. package/dist/cjs/schema-driven/demoSchema.js +2 -0
  88. package/dist/cjs/schema-driven/demoSchema.js.map +1 -0
  89. package/dist/cjs/schema-driven/hooks/useParentEditEnabled.js +2 -0
  90. package/dist/cjs/schema-driven/hooks/useParentEditEnabled.js.map +1 -0
  91. package/dist/cjs/schema-driven/hooks/useSectionEditSession.js +2 -0
  92. package/dist/cjs/schema-driven/hooks/useSectionEditSession.js.map +1 -0
  93. package/dist/cjs/schema-driven/primitives/Accordion.js +1 -1
  94. package/dist/cjs/schema-driven/types.js +2 -0
  95. package/dist/cjs/schema-driven/types.js.map +1 -0
  96. package/dist/cjs/schema-driven/utils/conditionText.js +2 -0
  97. package/dist/cjs/schema-driven/utils/conditionText.js.map +1 -0
  98. package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +1 -1
  99. package/dist/features/IL-OTJ/_components/AccordianSection.js +1 -1
  100. package/dist/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +1 -1
  101. package/dist/features/IL-OTJ/_components/ChatComponents/ChatHeader.js +1 -1
  102. package/dist/features/IL-OTJ/_components/ChatComponents/ChatHeader.module.css.js +1 -1
  103. package/dist/features/IL-OTJ/_components/MessageRendering/MessageRendering.js +1 -1
  104. package/dist/features/IL-OTJ/_components/hooks/usePendingEditHighlight.js +2 -0
  105. package/dist/features/IL-OTJ/_components/hooks/usePendingEditHighlight.js.map +1 -0
  106. package/dist/features/IL-OTJ/_components/hooks/useVariantEditSession.js +2 -0
  107. package/dist/features/IL-OTJ/_components/hooks/useVariantEditSession.js.map +1 -0
  108. package/dist/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js +2 -0
  109. package/dist/features/IL-OTJ/_components/templates/BaseTemplate/BaseTemplate.js.map +1 -0
  110. package/dist/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js +2 -0
  111. package/dist/features/IL-OTJ/_components/templates/CreateCategory/CreateCategory.js.map +1 -0
  112. package/dist/features/IL-OTJ/_components/templates/SchemaDriven/SchemaDrivenCreateRule.js +1 -1
  113. package/dist/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.js +1 -1
  114. package/dist/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js +2 -0
  115. package/dist/features/IL-OTJ/_components/templates/WorkflowComposer/WorkflowComposer.js.map +1 -0
  116. package/dist/features/IL-marketplace/components/GuidelineLibraryCard.js +1 -1
  117. package/dist/features/IL-marketplace/components/GuidelineLibraryCard.module.css.js +1 -1
  118. package/dist/features/IL-marketplace/components/ILMarketPlacePublish/PublishToMarketplaceCompnent.js +1 -1
  119. package/dist/features/IL-marketplace/components/LearningManagementWrapper.js +1 -1
  120. package/dist/features/LSCGuidelinesCart/Cart/Cart.js +2 -0
  121. package/dist/features/LSCGuidelinesCart/Cart/Cart.js.map +1 -0
  122. package/dist/features/LSCGuidelinesCart/Cart/Cart.styles.js +2 -0
  123. package/dist/features/LSCGuidelinesCart/Cart/Cart.styles.js.map +1 -0
  124. package/dist/features/LSCGuidelinesCart/GuidelineCard.js +2 -0
  125. package/dist/features/LSCGuidelinesCart/GuidelineCard.js.map +1 -0
  126. package/dist/features/LSCGuidelinesCart/GuidelineCard.styles.js +2 -0
  127. package/dist/features/LSCGuidelinesCart/GuidelineCard.styles.js.map +1 -0
  128. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.js +2 -0
  129. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.js.map +1 -0
  130. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js +2 -0
  131. package/dist/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.js.map +1 -0
  132. package/dist/features/LSCGuidelinesCart/LearningManagementWrapper.js +2 -0
  133. package/dist/features/LSCGuidelinesCart/LearningManagementWrapper.js.map +1 -0
  134. package/dist/features/LSCGuidelinesCart/api.js +2 -0
  135. package/dist/features/LSCGuidelinesCart/api.js.map +1 -0
  136. package/dist/features/LSCGuidelinesCart/endpoints.js +2 -0
  137. package/dist/features/LSCGuidelinesCart/endpoints.js.map +1 -0
  138. package/dist/features/LearningManagement/LearningManagement.js +1 -1
  139. package/dist/features/LearningManagement/LearningManagementTest.js +1 -1
  140. package/dist/features/LearningManagement/RuleContent/RuleContent.js +1 -1
  141. package/dist/features/LearningManagement/apis/scopeApis.js +1 -1
  142. package/dist/features/LearningManagement/assets/Search-result(add new).svg.js +2 -0
  143. package/dist/features/LearningManagement/assets/Search-result(add new).svg.js.map +1 -0
  144. package/dist/features/LearningManagement/components/CreateLearningSetModal.js +2 -0
  145. package/dist/features/LearningManagement/components/CreateLearningSetModal.js.map +1 -0
  146. package/dist/features/LearningManagement/components/InstantLearningModal.js +1 -1
  147. package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js +1 -1
  148. package/dist/features/LearningManagement/components/ScopeTree/TreeNode.js +1 -1
  149. package/dist/features/LearningManagement/components/ScopeTree/TreeNodeHeader.js +1 -1
  150. package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js +2 -0
  151. package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js.map +1 -0
  152. package/dist/features/LearningManagement/config.js +1 -1
  153. package/dist/features/LearningManagement/styles/CreateLearningSetModal.module.css.js +2 -0
  154. package/dist/features/LearningManagement/styles/CreateLearningSetModal.module.css.js.map +1 -0
  155. package/dist/features/LearningManagement/utils/resizeObserverErrorGuard.js +2 -0
  156. package/dist/features/LearningManagement/utils/resizeObserverErrorGuard.js.map +1 -0
  157. package/dist/node_modules/@e-llm-studio/audit-log/dist/styles.css.js +2 -0
  158. package/dist/node_modules/@e-llm-studio/audit-log/dist/styles.css.js.map +1 -0
  159. package/dist/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +1 -1
  160. package/dist/schema-driven/BPARenderer.js +1 -1
  161. package/dist/schema-driven/SchemaRenderer.js +2 -0
  162. package/dist/schema-driven/SchemaRenderer.js.map +1 -0
  163. package/dist/schema-driven/adapters/ConditionSectionAdapter.js +2 -0
  164. package/dist/schema-driven/adapters/ConditionSectionAdapter.js.map +1 -0
  165. package/dist/schema-driven/adapters/ConfigSectionAdapter.js +2 -0
  166. package/dist/schema-driven/adapters/ConfigSectionAdapter.js.map +1 -0
  167. package/dist/schema-driven/adapters/GlobalSetupAccordionAdapter.js +2 -0
  168. package/dist/schema-driven/adapters/GlobalSetupAccordionAdapter.js.map +1 -0
  169. package/dist/schema-driven/adapters/PromptTextEditorAdapter.js +2 -0
  170. package/dist/schema-driven/adapters/PromptTextEditorAdapter.js.map +1 -0
  171. package/dist/schema-driven/adapters/ScopeSectionAdapter.js +2 -0
  172. package/dist/schema-driven/adapters/ScopeSectionAdapter.js.map +1 -0
  173. package/dist/schema-driven/adapters/TextInputAdapter.js +2 -0
  174. package/dist/schema-driven/adapters/TextInputAdapter.js.map +1 -0
  175. package/dist/schema-driven/adapters/VariantListWrapperAdapter.js +2 -0
  176. package/dist/schema-driven/adapters/VariantListWrapperAdapter.js.map +1 -0
  177. package/dist/schema-driven/components/ConditionSectionField.js +1 -1
  178. package/dist/schema-driven/components/GlobalSetupAccordionField.js +1 -1
  179. package/dist/schema-driven/components/GroupEditRow.js +1 -1
  180. package/dist/schema-driven/components/PromptTextEditorField.js +1 -1
  181. package/dist/schema-driven/components/VariantListField.js +1 -1
  182. package/dist/schema-driven/demoSchema.js +2 -0
  183. package/dist/schema-driven/demoSchema.js.map +1 -0
  184. package/dist/schema-driven/hooks/useParentEditEnabled.js +2 -0
  185. package/dist/schema-driven/hooks/useParentEditEnabled.js.map +1 -0
  186. package/dist/schema-driven/hooks/useSectionEditSession.js +2 -0
  187. package/dist/schema-driven/hooks/useSectionEditSession.js.map +1 -0
  188. package/dist/schema-driven/primitives/Accordion.js +1 -1
  189. package/dist/schema-driven/types.js +2 -0
  190. package/dist/schema-driven/types.js.map +1 -0
  191. package/dist/schema-driven/utils/conditionText.js +2 -0
  192. package/dist/schema-driven/utils/conditionText.js.map +1 -0
  193. package/dist/types/src/ILMarketplaceMockTest.d.ts.map +1 -1
  194. package/dist/types/src/ILMarketplaceTest.d.ts +3 -0
  195. package/dist/types/src/ILMarketplaceTest.d.ts.map +1 -0
  196. package/dist/types/src/ILMarketplaceWrapper.d.ts +14 -15
  197. package/dist/types/src/ILMarketplaceWrapper.d.ts.map +1 -1
  198. package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts +11 -0
  199. package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts.map +1 -1
  200. package/dist/types/src/features/IL-OTJ/_components/AccordianSection.d.ts +8 -1
  201. package/dist/types/src/features/IL-OTJ/_components/AccordianSection.d.ts.map +1 -1
  202. package/dist/types/src/features/IL-OTJ/_components/ChatComponents/ChatHeader.d.ts.map +1 -1
  203. package/dist/types/src/features/IL-OTJ/_components/hooks/usePendingEditHighlight.d.ts +5 -0
  204. package/dist/types/src/features/IL-OTJ/_components/hooks/usePendingEditHighlight.d.ts.map +1 -0
  205. package/dist/types/src/features/IL-OTJ/_components/hooks/useVariantEditSession.d.ts +47 -0
  206. package/dist/types/src/features/IL-OTJ/_components/hooks/useVariantEditSession.d.ts.map +1 -0
  207. package/dist/types/src/features/IL-OTJ/_components/templates/SchemaDriven/SchemaDrivenCreateRule.d.ts.map +1 -1
  208. package/dist/types/src/features/IL-OTJ/_components/templates/TrafficManager/CreateRule.d.ts.map +1 -1
  209. package/dist/types/src/features/IL-marketplace/components/GuidelineLibraryCard.d.ts +4 -0
  210. package/dist/types/src/features/IL-marketplace/components/GuidelineLibraryCard.d.ts.map +1 -1
  211. package/dist/types/src/features/IL-marketplace/components/LearningManagementWrapper.d.ts +5 -1
  212. package/dist/types/src/features/IL-marketplace/components/LearningManagementWrapper.d.ts.map +1 -1
  213. package/dist/types/src/features/IL-marketplace/types.d.ts +0 -2
  214. package/dist/types/src/features/IL-marketplace/types.d.ts.map +1 -1
  215. package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.d.ts +10 -0
  216. package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.d.ts.map +1 -0
  217. package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.styles.d.ts +6 -0
  218. package/dist/types/src/features/LSCGuidelinesCart/Cart/Cart.styles.d.ts.map +1 -0
  219. package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.d.ts +11 -0
  220. package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.d.ts.map +1 -0
  221. package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.styles.d.ts +6 -0
  222. package/dist/types/src/features/LSCGuidelinesCart/GuidelineCard.styles.d.ts.map +1 -0
  223. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.d.ts +11 -0
  224. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.d.ts.map +1 -0
  225. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.d.ts +6 -0
  226. package/dist/types/src/features/LSCGuidelinesCart/GuidelinesLandingPage.styles.d.ts.map +1 -0
  227. package/dist/types/src/features/LSCGuidelinesCart/LearningManagementWrapper.d.ts +14 -0
  228. package/dist/types/src/features/LSCGuidelinesCart/LearningManagementWrapper.d.ts.map +1 -0
  229. package/dist/types/src/features/LSCGuidelinesCart/api.d.ts +3 -0
  230. package/dist/types/src/features/LSCGuidelinesCart/api.d.ts.map +1 -0
  231. package/dist/types/src/features/LSCGuidelinesCart/endpoints.d.ts +4 -0
  232. package/dist/types/src/features/LSCGuidelinesCart/endpoints.d.ts.map +1 -0
  233. package/dist/types/src/features/LSCGuidelinesCart/interfacesApi.d.ts +25 -0
  234. package/dist/types/src/features/LSCGuidelinesCart/interfacesApi.d.ts.map +1 -0
  235. package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
  236. package/dist/types/src/features/LearningManagement/LearningManagementTest.d.ts.map +1 -1
  237. package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts.map +1 -1
  238. package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts +14 -0
  239. package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts.map +1 -1
  240. package/dist/types/src/features/LearningManagement/components/InstantLearningModalDynamic.d.ts.map +1 -1
  241. package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeNode.d.ts.map +1 -1
  242. package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeNodeHeader.d.ts +2 -0
  243. package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeNodeHeader.d.ts.map +1 -1
  244. package/dist/types/src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.d.ts +12 -0
  245. package/dist/types/src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.d.ts.map +1 -0
  246. package/dist/types/src/features/LearningManagement/config.d.ts +15 -0
  247. package/dist/types/src/features/LearningManagement/config.d.ts.map +1 -1
  248. package/dist/types/src/features/LearningManagement/store/useEnvStore.d.ts +4 -0
  249. package/dist/types/src/features/LearningManagement/store/useEnvStore.d.ts.map +1 -1
  250. package/dist/types/src/features/LearningManagement/store/useLMSConfigStore.d.ts +7 -0
  251. package/dist/types/src/features/LearningManagement/store/useLMSConfigStore.d.ts.map +1 -1
  252. package/dist/types/src/features/LearningManagement/utils/resizeObserverErrorGuard.d.ts +2 -0
  253. package/dist/types/src/features/LearningManagement/utils/resizeObserverErrorGuard.d.ts.map +1 -0
  254. package/dist/types/src/plugins/ValueTypes/Default/DefaultTeachMeRenderer.d.ts.map +1 -1
  255. package/dist/types/src/routes/ErrorBoundary.d.ts +22 -0
  256. package/dist/types/src/routes/ErrorBoundary.d.ts.map +1 -0
  257. package/dist/types/src/routes/Routes.d.ts +3 -0
  258. package/dist/types/src/routes/Routes.d.ts.map +1 -0
  259. package/dist/types/src/schema-driven/BPARenderer.d.ts.map +1 -1
  260. package/dist/types/src/schema-driven/SchemaRenderer.d.ts +21 -0
  261. package/dist/types/src/schema-driven/SchemaRenderer.d.ts.map +1 -0
  262. package/dist/types/src/schema-driven/adapters/ConditionSectionAdapter.d.ts +11 -0
  263. package/dist/types/src/schema-driven/adapters/ConditionSectionAdapter.d.ts.map +1 -0
  264. package/dist/types/src/schema-driven/adapters/ConfigSectionAdapter.d.ts +13 -0
  265. package/dist/types/src/schema-driven/adapters/ConfigSectionAdapter.d.ts.map +1 -0
  266. package/dist/types/src/schema-driven/adapters/GlobalSetupAccordionAdapter.d.ts +5 -0
  267. package/dist/types/src/schema-driven/adapters/GlobalSetupAccordionAdapter.d.ts.map +1 -0
  268. package/dist/types/src/schema-driven/adapters/PromptTextEditorAdapter.d.ts +13 -0
  269. package/dist/types/src/schema-driven/adapters/PromptTextEditorAdapter.d.ts.map +1 -0
  270. package/dist/types/src/schema-driven/adapters/ScopeSectionAdapter.d.ts +5 -0
  271. package/dist/types/src/schema-driven/adapters/ScopeSectionAdapter.d.ts.map +1 -0
  272. package/dist/types/src/schema-driven/adapters/TextInputAdapter.d.ts +18 -0
  273. package/dist/types/src/schema-driven/adapters/TextInputAdapter.d.ts.map +1 -0
  274. package/dist/types/src/schema-driven/adapters/VariantListWrapperAdapter.d.ts +17 -0
  275. package/dist/types/src/schema-driven/adapters/VariantListWrapperAdapter.d.ts.map +1 -0
  276. package/dist/types/src/schema-driven/components/ConditionSectionField.d.ts.map +1 -1
  277. package/dist/types/src/schema-driven/components/GlobalSetupAccordionField.d.ts.map +1 -1
  278. package/dist/types/src/schema-driven/components/GroupEditRow.d.ts.map +1 -1
  279. package/dist/types/src/schema-driven/components/PromptTextEditorField.d.ts.map +1 -1
  280. package/dist/types/src/schema-driven/components/VariantListField.d.ts.map +1 -1
  281. package/dist/types/src/schema-driven/demoSchema.d.ts.map +1 -1
  282. package/dist/types/src/schema-driven/hooks/useParentEditEnabled.d.ts +18 -0
  283. package/dist/types/src/schema-driven/hooks/useParentEditEnabled.d.ts.map +1 -0
  284. package/dist/types/src/schema-driven/hooks/useSectionEditSession.d.ts +29 -0
  285. package/dist/types/src/schema-driven/hooks/useSectionEditSession.d.ts.map +1 -0
  286. package/dist/types/src/schema-driven/primitives/Accordion.d.ts +11 -0
  287. package/dist/types/src/schema-driven/primitives/Accordion.d.ts.map +1 -1
  288. package/dist/types/src/schema-driven/types.d.ts +13 -0
  289. package/dist/types/src/schema-driven/types.d.ts.map +1 -1
  290. package/dist/types/src/schema-driven/utils/conditionText.d.ts +8 -0
  291. package/dist/types/src/schema-driven/utils/conditionText.d.ts.map +1 -0
  292. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ import{__assign as t}from"tslib";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{BookOpen as i,Eye as n,MoreVertical as d,UserCheck as o,Compass as c,Check as l,Plus as s}from"lucide-react";import a from"./GuidelineCard.styles.js";function u(t){try{var e=new Date(t),r=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),i=e.toLocaleDateString("en-GB").replace(/\//g,"/");return"Added on - ".concat(r," | ").concat(i)}catch(e){return t}}function h(h){var p=h.guideline,y=h.inCart,f=h.onToggleCart,m=h.onExplore;return e("div",t({style:a.card},{children:[e("div",t({style:a.cardTop},{children:[e("div",t({style:a.cardTopLeft},{children:[r(i,{size:18,strokeWidth:2,color:"#6D5BFF"}),r("p",t({style:a.cardTitle},{children:p.instant_learning_title}))]})),e("div",t({style:a.cardTopIcons},{children:[r(n,{size:16,strokeWidth:2}),r(d,{size:16,strokeWidth:2}),r(o,{size:16,strokeWidth:2})]}))]})),r("p",t({style:a.cardDescription},{children:p.instant_learning_description})),r("p",t({style:a.cardDate},{children:u(p.created_at)})),e("div",t({style:a.cardActionsRow},{children:[e("button",t({type:"button",style:a.exploreButton,onClick:function(){return null==m?void 0:m(p)}},{children:[r(c,{size:15,strokeWidth:2.4}),r("span",{children:"Explore"})]})),e("button",y?t({type:"button",style:a.cardAddedButton,onClick:function(){return f(p)}},{children:[r(l,{size:16,strokeWidth:2.4}),r("span",{children:"Added to Cart"})]}):t({type:"button",style:a.cardAddButton,onClick:function(){return f(p)}},{children:[r(s,{size:16,strokeWidth:2.4}),r("span",{children:"Add to Cart"})]}))]}))]}))}export{h as GuidelineCard,h as default};
2
+ //# sourceMappingURL=GuidelineCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GuidelineCard.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ var e={card:{display:"flex",flexDirection:"column",borderRadius:10,border:"1px solid #EAECF0",background:"#ffffff",padding:20,boxShadow:"0 1px 2px rgba(16,24,40,0.04)"},cardTop:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8},cardTopLeft:{display:"flex",alignItems:"center",gap:8,minWidth:0},cardTitle:{fontSize:15,fontWeight:600,lineHeight:"24px",color:"#1F2937",margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},cardTopIcons:{display:"flex",alignItems:"center",gap:10,flexShrink:0,color:"#98A2B3"},cardDescription:{marginTop:8,fontSize:13,lineHeight:"19px",color:"#667085",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},cardDate:{marginTop:12,fontSize:12,color:"#98A2B3"},cardActions:{marginTop:16},cardAddButton:{display:"inline-flex",height:36,flex:1,alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,border:"1px solid #4438F5",background:"#ffffff",fontSize:13,fontWeight:600,color:"#4438F5",cursor:"pointer"},cardAddedButton:{display:"inline-flex",height:36,flex:1,alignItems:"center",justifyContent:"center",gap:8,borderRadius:6,border:"1px solid #EAE7FF",background:"#EDE9FE",fontSize:13,fontWeight:600,color:"#4438F5",cursor:"pointer"},exploreButton:{display:"inline-flex",height:36,flex:1,alignItems:"center",justifyContent:"center",gap:6,borderRadius:6,border:"1px solid #D0D5DD",background:"#ffffff",fontSize:13,fontWeight:600,color:"#344054",cursor:"pointer"},cardActionsRow:{display:"flex",gap:8,marginTop:16}};export{e as default};
2
+ //# sourceMappingURL=GuidelineCard.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GuidelineCard.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{__assign as n,__spreadArray as e}from"tslib";import{jsx as t,jsxs as i,Fragment as r}from"react/jsx-runtime";import{useState as o,useEffect as l}from"react";import{CircleHelp as d,Plus as a,UserCheck as s,Clock3 as u,ShoppingBag as c,ChevronDown as p,ChevronUp as h}from"lucide-react";import{fetchGuidelineInstances as m}from"./api.js";import{GuidelineCard as f}from"./GuidelineCard.js";import{Cart as y}from"./Cart/Cart.js";import{LearningManagementWrapper as g}from"./LearningManagementWrapper.js";import b from"./GuidelinesLandingPage.styles.js";function _(n,e){var t,i,r,o;return e?null!==(o=null===(r=n.mode_mappings.find(function(n){return n.mode_id===e}))||void 0===r?void 0:r.application_integration_id)&&void 0!==o?o:"":null!==(i=null===(t=n.mode_mappings[0])||void 0===t?void 0:t.application_integration_id)&&void 0!==i?i:""}function v(v){var k=v.baseUrl,S=v.token,W=v.userDetails,z=v.modeId,C=o([]),j=C[0],w=C[1],G=o(6),I=G[0],x=G[1],A=o([]),L=A[0],M=A[1],T=o(!0),B=T[0],D=T[1],E=o(null),P=E[0],R=E[1],H=o(null),K=H[0],U=H[1];l(function(){D(!0),R(null),m(k,S).then(function(n){w(n.data)}).catch(function(n){return R(n.message)}).finally(function(){return D(!1)})},[k,S]);var q=new Set(L.map(function(n){return n.instant_learning_id}));function F(n){M(function(t){return t.some(function(e){return e.instant_learning_id===n.instant_learning_id})?t.filter(function(e){return e.instant_learning_id!==n.instant_learning_id}):e(e([],t,!0),[n],!1)})}var J=j.slice(0,I),N=j.length-I,O=I>6;return t("div",n({style:b.page},{children:i("main",n({style:b.main},{children:[i("section",n({style:b.headerSection},{children:[i("div",n({style:b.intro},{children:[t("h1",n({style:b.title},{children:"Add Guidelines"})),t("p",n({style:b.description},{children:"Add guidelines that shape how your agent behaves, responds, and interprets."})),i("button",n({type:"button",style:b.debugLink},{children:[t("span",{children:"Know more about debug mode"}),t(d,{size:18,strokeWidth:2})]}))]})),i("button",n({type:"button",style:b.addButton},{children:[t(a,{size:20,strokeWidth:2.4}),t("span",{children:"Add Guideline"})]}))]})),i("section",n({style:b.bodySection},{children:[i("section",n({style:b.librarySection},{children:[i("div",n({style:b.libraryTabs},{children:[i("button",n({type:"button",style:n(n({},b.tab),b.tabActive)},{children:[t(s,{size:18,strokeWidth:2}),t("span",{children:"Saved"})]})),i("button",n({type:"button",style:b.tab},{children:[t(u,{size:18,strokeWidth:2}),t("span",{children:"Recently used"})]})),i("button",n({type:"button",style:b.tab},{children:[t(c,{size:18,strokeWidth:2}),t("span",{children:"Marketplace"})]}))]})),K?t(g,{userDetails:W,appIntegrationId:_(K,z),modeId:z,guidelineTitle:K.instant_learning_title,onBack:function(){return U(null)}}):i(r,{children:[B&&t("p",n({style:b.loadingState},{children:"Loading guidelines..."})),P&&i("p",n({style:b.errorState},{children:["Error: ",P]})),!B&&!P&&i(r,{children:[t("div",n({style:b.libraryGrid},{children:J.map(function(n){return t(f,{guideline:n,inCart:q.has(n.instant_learning_id),onToggleCart:F,onExplore:U},n.instant_learning_id)})})),i("div",n({style:{display:"flex",alignItems:"center",gap:16}},{children:[N>0&&i("button",n({type:"button",style:b.showMore,onClick:function(){return x(function(n){return n+6})}},{children:[i("span",{children:["Show more guidelines (",N,")"]}),t(p,{size:16,strokeWidth:2.4})]})),O&&i("button",n({type:"button",style:b.showMore,onClick:function(){return x(6)}},{children:[t("span",{children:"Hide"}),t(h,{size:16,strokeWidth:2.4})]}))]}))]})]})]})),t(y,{items:L,onRemove:function(n){M(function(e){return e.filter(function(e){return e.instant_learning_id!==n})})},onProceed:function(){}})]}))]}))}))}export{v as GuidelineLandingPage,v as default};
2
+ //# sourceMappingURL=GuidelinesLandingPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GuidelinesLandingPage.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ var e={page:{height:"100%",width:"100%",background:"#ffffff",fontFamily:"Inter, sans-serif"},main:{height:"100%",overflow:"auto",padding:40},headerSection:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:24,justifyContent:"space-between",alignItems:"flex-start"},intro:{minWidth:280,flex:"1 1 0%"},title:{fontSize:30,fontWeight:700,lineHeight:"38px",color:"#6D35F2",margin:0},description:{marginTop:8,fontSize:19,lineHeight:"28px",color:"#1F2937"},debugLink:{marginTop:12,display:"inline-flex",alignItems:"center",gap:8,fontSize:14,fontWeight:500,color:"#53657D",background:"none",border:"none",padding:0,cursor:"pointer"},addButton:{display:"inline-flex",height:44,minWidth:210,flexShrink:0,alignItems:"center",justifyContent:"center",gap:12,borderRadius:6,background:"#4438F5",padding:"0 20px",fontSize:15,fontWeight:600,color:"#ffffff",border:"none",boxShadow:"0 1px 2px rgba(16,24,40,0.08)",cursor:"pointer",marginLeft:"auto"},bodySection:{marginTop:48,display:"grid",width:"100%",gridTemplateColumns:"minmax(0,1fr) minmax(300px,360px)",alignItems:"start",gap:24},librarySection:{minWidth:0},libraryTabs:{display:"flex",borderBottom:"1px solid #EAECF0"},tab:{position:"relative",display:"inline-flex",height:40,alignItems:"center",gap:8,padding:"0 16px",fontSize:14,fontWeight:500,background:"none",border:"none",cursor:"pointer",color:"#B5BDC8"},tabActive:{color:"#1F2937",boxShadow:"inset 0 -3px 0 0 #6D5BFF"},libraryGrid:{marginTop:24,display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:20},showMore:{marginTop:28,display:"inline-flex",alignItems:"center",gap:8,fontSize:14,fontWeight:600,color:"#5B2CF4",background:"none",border:"none",cursor:"pointer"},loadingState:{marginTop:24,fontSize:14,color:"#667085"},errorState:{marginTop:24,fontSize:14,color:"#F04438"}};export{e as default};
2
+ //# sourceMappingURL=GuidelinesLandingPage.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GuidelinesLandingPage.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{__assign as e}from"tslib";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{ArrowLeft as t}from"lucide-react";import{QueryClient as r,QueryClientProvider as n}from"@tanstack/react-query";import o from"../LearningManagement/LearningManagement.js";var l={config:{CUSTOM_SCOPE_GROUP_NAME:"Preview",INSTANT_LEARNING_TYPE:"iL",MODEL:"claude-3.5-sonnet",CONFIG_MASTER_NAME:"preview-config",SCOPE_NAME:"Custom",ASSISTANT_NAME:"preview",ORGANIZATION_NAME:"techolution",BASE_URL:"https://devllmstudio.creativeworkspace.ai",BASE_WEBSOCKET_URL:"wss://devllmstudio.creativeworkspace.ai/graphql",CHAT_TITLE:"Preview",CHAT_TITLE_EDIT:"Preview Edit",FORM_TITLE:"Learning Details",INITIAL_CHAT_MESSAGE:"Hi",CATEGORY:"Global-Template",SOCKET_TIMEOUT:24e4},llmStudioUrl:"https://devllmstudio.creativeworkspace.ai",audacyBackendUrl:"https://dev-audacy-traffic-manager.techo.camp",auditLogConfig:{configId:"6a1825e9fb722c37637b9490"},ilLabels:{setupLabel:"Learning Setup",ruleTitle:"Learning Title",ruleDescriptionTitle:"Learning Description"},rbacConfig:{applicationName:"IL Mode - ILOTJ",applicationId:"6a22c19581f05dc3afc8ad57",moduleId:"6a22c19581f05dc3afc8ad8e",applicationModuleId:"6a22c19581f05dc3afc8ad88",applicationResourceId:"6a22c19681f05dc3afc8ad94",appsecRbacUrl:"https://dev-cw-appsec.techo.camp/granularApi",appsecBaseUrl:"https://dev-cw-appsec.techo.camp"}},c=new r,d={wrapper:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},header:{display:"flex",alignItems:"center",gap:12,padding:"10px 0",borderBottom:"1px solid #EAECF0",flexShrink:0},backButton:{display:"inline-flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",fontSize:14,fontWeight:500,color:"#344054",padding:"4px 8px",borderRadius:6},headerTitle:{fontSize:14,fontWeight:600,color:"#1F2937",margin:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},headerActions:{display:"flex",alignItems:"center",gap:8,marginLeft:"auto"},lmsContainer:{flex:1,minHeight:0,overflow:"hidden"}};function p(r){var p=r.userDetails,s=r.appIntegrationId,f=r.modeId,m=r.guidelineTitle,g=r.onBack,u=r.headerActions;return i(n,e({client:c},{children:a("div",e({style:d.wrapper},{children:[a("div",e({style:d.header},{children:[a("button",e({type:"button",style:d.backButton,onClick:g},{children:[i(t,{size:16,strokeWidth:2}),"Back"]})),m&&i("p",e({style:d.headerTitle},{children:m})),u&&i("div",e({style:d.headerActions},{children:u}))]})),i("div",e({style:d.lmsContainer},{children:i(o,e({},l,{userDetails:p,app_integration_id:s,modeId:f}),"lms-explore")}))]}))}))}export{p as LearningManagementWrapper,p as default};
2
+ //# sourceMappingURL=LearningManagementWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LearningManagementWrapper.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{__awaiter as t,__generator as n}from"tslib";import{endpoints as e}from"./endpoints.js";function i(i,o){return t(this,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,fetch(e.listInstances(i),{headers:{accept:"application/json, text/plain, */*",authorization:"Bearer ".concat(o)}})];case 1:if(!(t=n.sent()).ok)throw new Error("Failed to fetch guidelines: ".concat(t.status));return[2,t.json()]}})})}export{i as fetchGuidelineInstances};
2
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ var t={listInstances:function(t){return"".concat(t,"/instant_learning/ilotj/listInstances?createdAt=desc")}};export{t as endpoints};
2
+ //# sourceMappingURL=endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as n,__awaiter as t,__generator as r}from"tslib";import{jsx as o,jsxs as i,Fragment as s}from"react/jsx-runtime";import{useState as a,useRef as l,useCallback as c,useEffect as u}from"react";import{applyAxiosConfig as d}from"../../api/transport.js";import{BookOpen as p,Users as m,History as f}from"lucide-react";import{useLearningTemplateStore as v}from"./store/useLearningTemplateStore.js";import{Toast as g}from"primereact/toast";import h from"./styles/LearningTemplateManagement.module.css.js";import S from"./LearningTemplateLayout.js";import y from"./components/EmptyLearningState.js";import C from"./store/useAuthStore.js";import{fetchTiers as b,getILInstance as T,fetchScopes as I,inheritScope as L,inheritScopeBackwardCompatible as A,createRuleSet as E,renameScope as R,deleteRuleSet as O,requestAccess as w}from"./apis/scopeApis.js";import{useRuleTemplateQueryParams as j,setQueryParams as M,QUERY_PARAM_KEYS as N}from"./hooks/useLearningTemplateQueryParams.js";import _ from"./components/ConfirmationModal.js";import D from"./components/LearningTemplateManagementSkeleton.js";import{findNodePathById as k,findNodeById as P}from"./utils/treeUtils.js";import B from"./store/useEnvStore.js";import{useConfigStore as U}from"./store/useConfigStore.js";import{TooltipProvider as q}from"./components/ToolTip.js";import G from"./components/CreateRuleSetLegacyModal.js";import{usePermissionsStore as F}from"./store/usePermissionsStore.js";import{useAppSecRolesStore as x}from"./store/useAppSecRolesStore.js";import{useGetAppSecRolesQuery as H}from"./queries/useApprovalQueries.js";import{useLMSConfigQuery as Q}from"./queries/useLMSConfigQuery.js";import z from"./RuleContent/AddScopeModal.js";import K from"./components/RuleContentSkeleton.js";import V from"./components/ErrorStateDisplay.js";import{useLocation as W,useSearchParams as Y}from"react-router-dom";import J from"./shared/SuccessToastContent.js";import X from"./shared/ErrorToastContent.js";import Z from"./RuleContent/RenameScopeModal.js";import{dt as $,useLMSConfigStore as ee}from"./store/useLMSConfigStore.js";import{MIDDLE_DRAWER_DT_PATH as ne,MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH as te,EMPTY_STATE_DT_PATH as re}from"./constants.js";function oe(oe){var ie,se,ae,le,ce,ue,de,pe,me,fe,ve,ge=this,he=oe.userDetails,Se=oe.llmStudioUrl,ye=oe.audacyBackendUrl,Ce=oe.ilLabels,be=oe.config,Te=oe.rbacConfig,Ie=oe.auditLogConfig,Le=oe.app_integration_id,Ae=oe.backwardCompatibility,Ee=void 0!==Ae&&Ae,Re=oe.cognitiveCompareCompatibility,Oe=void 0!==Re&&Re,we=oe.enableChatLogs,je=oe.modeId,Me=oe.modeDetails,Ne=oe.pluginPayload,_e=oe.axiosConfig,De=oe.isILMarketplace,ke=oe.guidelineContentProps,Pe=oe.treeOverrides,Be=oe.selectionMode,Ue=void 0!==Be&&Be;d(_e);var qe=[{id:"learnings",label:$("".concat(ne,".treeMenu.submenu.learnings"),"Learnings"),icon:p,badgeKey:"learningsCount"},{id:"access",label:$("".concat(ne,".treeMenu.submenu.access"),"Access"),icon:m},{id:"history",label:$("".concat(ne,".treeMenu.submenu.changeHistory"),"Change History"),icon:f}],Ge=(null==Pe?void 0:Pe.sectionsConfig)?Pe.sectionsConfig.filter(function(e){return qe.some(function(n){return n.id===e.id})}):qe,Fe=new Set(Ge.map(function(e){return e.id})),xe=null!==(se=null===(ie=Ge[0])||void 0===ie?void 0:ie.id)&&void 0!==se?se:"learnings",He=j().clearLearningParams,Qe=v(function(e){return e.selectedRuleSetId}),ze=v(function(e){return e.setSelectedRuleSetId}),Ke=v(function(e){return e.setIlInstanceId}),Ve=v(function(e){return e.error}),We=v(function(e){return e.setError}),Ye=v(function(e){return e.setStations}),Je=v(function(e){return e.scopeTreeData}),Xe=v(function(e){return e.setScopeTreeData}),Ze=a({isOpen:!1,type:"GLOBAL"}),$e=Ze[0],en=Ze[1],nn=a(!1),tn=nn[0],rn=nn[1],on=a(!1),sn=on[0],an=on[1],ln=a(xe),cn=ln[0],un=ln[1],dn=a(null),pn=dn[0],mn=dn[1],fn=a(!1),vn=fn[0],gn=fn[1],hn=a(null),Sn=hn[0];hn[1];var yn=a(!1),Cn=yn[0],bn=yn[1],Tn=a(!1),In=Tn[0],Ln=Tn[1];l(null);var An=l(null),En=l(!1),Rn=l(null),On=C();On.user;var wn=On.setUser,jn=U(),Mn=jn.setConfig,Nn=jn.setIlLabels,_n=function(){try{return W()}catch(e){return{search:""}}}(),Dn=function(){try{return Y()[1]}catch(e){return null}}(),kn=c(function(e){if(Dn){var n=new URLSearchParams(window.location.search);Object.entries(e).forEach(function(e){var t=e[0],r=e[1];null==r||""===r?n.delete(t):n.set(t,r)}),Dn(n,{replace:!0})}else M(e)},[Dn]);u(function(){if(!En.current){var e=new URLSearchParams(window.location.search),n=e.get(N.RULESET_ID),t=e.get(N.SECTION),r=t&&(null==Fe?void 0:Fe.has(t))?t:xe;(null==n?void 0:n.length)&&ze&&un&&(ze(n),un(r),En.current=!0)}},[null==_n?void 0:_n.search,un,ze]),u(function(){return function(){He()}},[He]),u(function(){var e;Qe&&kn(((e={})[N.RULESET_ID]=Qe,e))},[Qe,kn]),u(function(){var n;(null==Ne?void 0:Ne.learningManagement)&&ee.getState().setLMSConfig(e(e({},Ne.learningManagement),{agents:null!==(n=Ne.agents)&&void 0!==n?n:{}}))},[Ne]);var Pn=F(function(e){return e.fetchPermissions}),Bn=F(function(e){return e.hasPermission}),Un=x(function(e){return e.setRoles}),qn=B(function(e){return e.appsecRbacUrl})===Te.appsecRbacUrl,Gn=H(Te.applicationId,qn).data,Fn=Q(null!=Le?Le:"",Ee),xn=Fn.isLoading,Hn=Fn.isError,Qn=Fn.refetch;Fn.isSuccess;var zn=a(0),Kn=zn[0],Vn=zn[1];u(function(){if(!Ee&&Le&&Se){t(ge,void 0,void 0,function(){var e,n,t,o,i,s,a;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,T(Le)];case 1:return e=r.sent(),(null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.ILInstanceId)&&Ke(e.data.ILInstanceId),"number"==typeof(n=null===(a=null===(s=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.learningManagement)||void 0===s?void 0:s.scopeAndHierarchy)||void 0===a?void 0:a.maxHierarchyLevels)&&n>0&&Vn(n-1),[3,3];case 2:return t=r.sent(),console.error("Failed to fetch IL instance for hierarchy levels:",t),[3,3];case 3:return[2]}})})}},[Le,Se]),u(function(){Gn&&Un(Gn.map(function(e){return{_id:e._id,name:e.name}}))},[Gn,Un]),u(function(){var e;console.log("userDetails",he),wn(he),console.log("llmStudioUrl",Se),console.log("audacyBackendUrl",ye),B.getState().setLlmStudioUrl(Se),B.getState().setAudacyBackendUrl(ye),B.getState().setRbacConfig(Te),B.getState().setAuditLogConfig(Ie),B.getState().setBaseModeName((null==Me?void 0:Me.modeNameFromURL)||null),Mn(be),Nn(Ce),v.getState().setAppIntegrationId(null!=Le?Le:null),v.getState().setBackwardCompatibility(Ee),v.getState().setCognitiveCompareCompatibility(null!=Oe&&Oe),v.getState().setEnableChatLogs("boolean"==typeof we?we:null),v.getState().setIsILMarketplace(null!=De&&De),v.getState().setToken(null!==(e=null==he?void 0:he.accessToken)&&void 0!==e?e:null)},[he,wn,Se,ye,Te,Ie,be,Mn,Ce,Nn,Le,Ee,Oe,we,De,Me]),u(function(){(null==he?void 0:he.accessToken)&&Se&&(De||b())},[Le,null==he?void 0:he.accessToken,Se,De]);var Wn=function(n){return void 0===n&&(n=!0),t(ge,void 0,void 0,function(){var t,o,i,s,a,l,c,u,d,p,m,f;return r(this,function(r){switch(r.label){case 0:n&&rn(!0),We(null),r.label=1;case 1:return r.trys.push([1,7,8,9]),[4,Pn(Te.applicationId)];case 2:r.sent(),t=function(n){var r=F.getState().hasPermission("ilotj.scope.view",n.id),o=n.children?n.children.map(function(e){return t(e)}).filter(function(e){return null!==e}):[];return r||0!==o.length?e(e({},n),{hasAccess:r,children:o}):null},o=void 0,r.label=3;case 3:return r.trys.push([3,5,,6]),[4,I(Le,he.accessToken)];case 4:return o=r.sent(),[3,6];case 5:if(i=r.sent(),403===(null===(m=null==i?void 0:i.response)||void 0===m?void 0:m.status))return Xe(null),mn(Te.applicationResourceId||null),gn(!0),[2];throw i;case 6:return o&&o.data&&o.data.data&&(s=o.data.data,Array.isArray(s)&&(s=s.length>0?s[0]:null),s?(a=t(s))?(mn(null),gn(!1),Xe({data:a}),An.current?(ze(An.current),un(xe),An.current=null):(l=v.getState().selectedRuleSetId,c=l?P(a,l):null,l&&c||(u=function(e){if(e.hasAccess)return e;for(var n=0,t=e.children||[];n<t.length;n++){var r=t[n],o=u(r);if(o)return o}return null},d=u(a),ze(d?d.id:a.id)))):(mn(null!==(f=s.id)&&void 0!==f?f:null),gn(!1),Xe(null)):(mn(null),gn(!1),Xe(null))),[3,9];case 7:return p=r.sent(),console.error("Failed to fetch rule sets or permissions",p),We("Failed to load data. Please try again later."),[3,9];case 8:return rn(!1),[7];case 9:return[2]}})})};u(function(){var e;(null===(e=null==he?void 0:he.accessToken)||void 0===e?void 0:e.length)&&qn?Wn(!0):console.warn("Error: Trying to fetch rules without access token",he)},[null==he?void 0:he.accessToken,We,Ye,Te.applicationId,qn]);var Yn=function(n,o,i){return t(ge,void 0,void 0,function(){var t,o,i,s,a,l,c,u;return r(this,function(r){switch(r.label){case 0:an(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,O(n,he.accessToken)];case 2:return r.sent(),v.getState().selectedRuleSetId===n&&(t=v.getState().scopeTreeData,(o=k((null==t?void 0:t.data)||null,n))&&o.length>1&&(i=o[o.length-2],ze(i),un(xe))),[4,Wn(!0)];case 3:return r.sent(),en(function(n){return e(e({},n),{isOpen:!1})}),null===(a=Rn.current)||void 0===a||a.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,6];case 4:return s=r.sent(),console.error("An error occurred during scope deletion.",s),null===(l=Rn.current)||void 0===l||l.show({severity:"error",summary:"Delete Failed",detail:(null===(u=null===(c=null==s?void 0:s.response)||void 0===c?void 0:c.data)||void 0===u?void 0:u.message)||"There was an error deleting the scope. Please try again."}),[3,6];case 5:return an(!1),[7];case 6:return[2]}})})},Jn=Je,Xn=Sn?{data:{id:Sn.stationId,name:Sn.stationName,type:"STATION",metrics:{learningsCount:Sn.learningsCount,stationsCount:0},children:[]}}:Jn,Zn=!!(null==Xn?void 0:Xn.data);null===(ae=null==Xn?void 0:Xn.data)||void 0===ae||ae.type;var $n=F(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",Te.applicationResourceId||""),et=function(e){return t(ge,void 0,void 0,function(){var n,t,i,s,a,l,c,u,d,p;return r(this,function(r){switch(r.label){case 0:if(!(n="string"==typeof e?e:(null===(l=null===(a=v.getState().scopeTreeData)||void 0===a?void 0:a.data)||void 0===l?void 0:l.id)||pn)&&!vn)return null===(c=Rn.current)||void 0===c||c.show({severity:"error",sticky:!1,className:h.errorToast,content:o(X,{message:"Unable to identify the global scope for this access request."})}),[2];bn(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,w(n,vn)];case 2:return r.sent(),Ln(!0),null===(u=Rn.current)||void 0===u||u.show({severity:"success",sticky:!1,life:3e3,className:h.successToast,content:o(J,{message:"Access request submitted successfully!"})}),[3,5];case 3:return t=r.sent(),i=null===(d=null==t?void 0:t.response)||void 0===d?void 0:d.data,s="GLOBAL_SCOPE_NOT_FOUND"===(null==i?void 0:i.code)?"Unable to identify the global scope for this access request.":(null==i?void 0:i.detail)||(null==i?void 0:i.message)||"Failed to request access. Please try again.",null===(p=Rn.current)||void 0===p||p.show({severity:"error",sticky:!1,className:h.errorToast,content:o(X,{message:s})}),[3,5];case 4:return bn(!1),[7];case 5:return[2]}})})};if(xn)return o("div",e({className:h.learningManagementContainer},{children:o(K,{})}));if(Hn)return o("div",e({className:h.learningManagementContainer},{children:o(V,{errorMessage:"Failed to load configuration. Please try again.",onRetry:function(){return Qn()},title:"Error Loading Configuration"})}));var nt=n(n([{type:"GLOBAL",label:"Global",addChildLabel:"".concat($("".concat(ne,".addScope"),"Add Scope")),addChildType:"SCOPE"}],Array.from({length:Kn},function(){return e({type:"SCOPE",label:$("".concat(ne,".scope"),"Scope")},!Ee&&{addChildLabel:$("".concat(te,".addSubScope"),"Add Subscope"),addChildType:"SUBSCOPE"})}),!0),Ee?[]:[{type:"SUBSCOPE",label:$("".concat(ne,".subScope"),"Subscope")}],!0),tt=Ue?qe.filter(function(e){return"learnings"===e.id}):qe,rt=Sn?tt.filter(function(e){return"stations"!==e.id}):tt,ot=function(e,n){void 0===e&&(e=!0),n&&(An.current=n),Wn(e)},it=function(){return ot(!0)},st=null!==(le=null==Pe?void 0:Pe.nodeTypesConfig)&&void 0!==le?le:nt,at=(null==Pe?void 0:Pe.onOpenCreateModal)?function(){return Pe.onOpenCreateModal(it)}:function(){return en({isOpen:!0,type:"GLOBAL"})},lt=(null==Pe?void 0:Pe.onAddChild)?function(e,n,t){return Pe.onAddChild(e,n,t,it)}:function(e,n,t){return en({isOpen:!0,type:n,parentId:e,parentName:t})},ct=(null==Pe?void 0:Pe.onRenameChild)?function(e,n){return Pe.onRenameChild(e,n,it)}:function(e,n){return en({isOpen:!0,type:"RENAME",scopeId:e,initialName:n})},ut=(null==Pe?void 0:Pe.onDeleteChild)?function(e,n,t){return Pe.onDeleteChild(e,n,t,it)}:function(e,n,o){return t(ge,void 0,void 0,function(){var t,i,s;return r(this,function(r){switch(r.label){case 0:return t=v.getState().scopeTreeData,i=k((null==t?void 0:t.data)||null,e),s=!!i&&3===i.length,0!==o?[3,2]:[4,Yn(e)];case 1:return r.sent(),[3,3];case 2:en({isOpen:!0,type:"DELETE",scopeId:e,initialName:n,isSubscope:s}),r.label=3;case 3:return[2]}})})},dt=null!==(ce=null==Pe?void 0:Pe.onSectionSelect)&&void 0!==ce?ce:function(e,n){var t;console.log("Section Selected:",{scopeId:e,sectionId:n}),kn(((t={})[N.SECTION]=n===xe?null:n,t)),un(n),ze(e),Ln(!1)},pt=null!==(ue=null==Pe?void 0:Pe.onRefreshRuleSets)&&void 0!==ue?ue:ot,mt=null!==(de=null==Pe?void 0:Pe.canCreateScope)&&void 0!==de?de:function(e){return Bn("ilotj.scope.create",e)},ft=null!==(pe=null==Pe?void 0:Pe.canEditScope)&&void 0!==pe?pe:function(e){return Bn("ilotj.scope.edit",e)},vt=null!==(me=null==Pe?void 0:Pe.canDeleteScope)&&void 0!==me?me:function(e){return Bn("ilotj.scope.delete",e)};return o(q,{children:i("div",e({className:[h.learningManagementContainer,Ue&&h.selectionMode].filter(Boolean).join(" ")},{children:[o("div",e({className:h.mainWrapper},{children:tn?o(D,{}):Ve?i("div",e({className:h.errorContainer},{children:[o("div",e({className:h.errorTitle},{children:"Error Loading Data"})),o("p",e({className:h.errorDesc},{children:Ve})),o("button",e({onClick:function(){return Wn(!0)},className:h.tryAgainBtn},{children:"Try Again"}))]})):Zn?o(S,{onOpenCreateModal:at,onAddChild:lt,onRenameChild:ct,onDeleteChild:ut,canDeleteScope:vt,canEditScope:ft,canCreateScope:mt,onSectionSelect:dt,activeSectionId:cn,scopeTreeData:Xn,sectionsConfig:rt,onViewStation:function(e){dt(e.stationId,xe)},onRefreshRuleSets:pt,nodeTypesConfig:st,app_integration_id:Le,token:he.accessToken,modeId:je,onRequestAccess:et,isRequestingAccess:Cn,isAccessRequested:In,selectionMode:Ue,isILMarketplace:De,guidelineContentProps:ke}):o(y,{onCreate:function(){return en({isOpen:!0,type:"GLOBAL"})},title:$("".concat(re,".title"),"No Global Scope has been added!"),desc:$("".concat(re,".desc"),"Start by creating a Global scope to define base learnings that apply across all stations."),button:$("".concat(re,".createGlobalScope"),"Create Global Scope"),canCreateRule:$n,noAccessTitle:$("".concat(re,".noAccessTitle"),"Access Restricted"),noAccessDesc:$("".concat(re,".noAccessDesc"),"You do not have access for this application."),requestAccessButton:$("".concat(re,".requestAccessButton"),"Request Access"),requestSentButton:$("".concat(re,".requestSentButton"),"Request Sent"),onRequestAccess:et,isRequestingAccess:Cn,isAccessRequested:In})})),o(g,{ref:Rn,pt:{root:{style:{zIndex:9999}}}}),Ee&&$e.isOpen&&"DELETE"!==$e.type&&"RENAME"!==$e.type?o(G,{isOpen:!0,onClose:function(){return en(e(e({},$e),{isOpen:!1}))},onSubmit:function(n){return t(ge,void 0,void 0,function(){var t,o,i,s,a,l,c,u,d,p,m,f,g,h,S,y,C,b,T,I;return r(this,function(r){switch(r.label){case 0:an(!0),t=v.getState().backwardCompatibility,r.label=1;case 1:return r.trys.push([1,12,13,14]),o=void 0,t&&"object"==typeof n?o=n:(i=n,s="SCOPE"===$e.type&&$e.parentId,a=s?"genreRuleSet":$e.type,o={topic:a,scope_reference_id:null,scopeDescription:"demo",parentScopeId:$e.parentId||null,scopeName:i,scopeReferenceMetadata:{},applicationMappingId:Le}),[4,E(o,he.accessToken)];case 2:if(l=r.sent(),!(c=null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.scopeId))return[3,10];if(An.current=c,u=t&&(null===(S=o.topic)||void 0===S?void 0:S.toLowerCase().includes("genre")),d=!t&&"GLOBAL"!==$e.type&&$e.parentId,!u&&!d)return[3,10];if(!(p=t?null===(C=null===(y=v.getState().scopeTreeData)||void 0===y?void 0:y.data)||void 0===C?void 0:C.id:$e.parentId))return[3,10];if(!Ee)return[3,7];r.label=3;case 3:return r.trys.push([3,5,,6]),[4,A({source_scope_id:p,target_scope_id:c})];case 4:return r.sent(),[3,6];case 5:return m=r.sent(),console.error("Failed to inherit rules for the new scope:",m),[3,6];case 6:return[3,10];case 7:return r.trys.push([7,9,,10]),[4,L({source_scope_id:p,target_scope_id:c,application_mapping_id:Le||"",is_copy_parent_variant_id:!1})];case 8:return r.sent(),[3,10];case 9:return f=r.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,10];case 10:return[4,Wn(!0)];case 11:return r.sent(),en(function(n){return e(e({},n),{isOpen:!1})}),[3,14];case 12:throw g=r.sent(),console.error("An error occurred during scope creation.",g),null===(b=Rn.current)||void 0===b||b.show({severity:"error",summary:"Creation Failed",detail:(null===(I=null===(T=null==g?void 0:g.response)||void 0===T?void 0:T.data)||void 0===I?void 0:I.message)||"There was an error creating the scope. Please try again."}),g;case 13:return an(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:Zn,canCreateGlobal:$n,globalScopeId:null!==(ve=null===(fe=null==Je?void 0:Je.data)||void 0===fe?void 0:fe.id)&&void 0!==ve?ve:null}):i(s,{children:[o(z,{isOpen:$e.isOpen&&"DELETE"!==$e.type&&"RENAME"!==$e.type,onClose:function(){return en(e(e({},$e),{isOpen:!1}))},onCreate:function(e){e&&(An.current=e),Wn(!0)},hasGlobalRuleSet:Zn,parentId:$e.parentId,parentName:$e.parentName,childType:"SUBSCOPE"===$e.type?"SUBSCOPE":"SCOPE",isILMarketplace:De}),o(Z,{isOpen:$e.isOpen&&"RENAME"===$e.type,onClose:function(){return en(e(e({},$e),{isOpen:!1}))},onSave:function(n){return t(ge,void 0,void 0,function(){var t,i,s,a,l,c;return r(this,function(r){switch(r.label){case 0:an(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),$e.scopeId?(t=v.getState().backwardCompatibility,i=t?{scope_id:$e.scopeId,scope_name:n}:{scope_id:$e.scopeId,scope_type:"Custom",scope_name:n,application_mapping_id:Le},[4,R(i,he.accessToken)]):[2];case 2:return r.sent(),[4,Wn(!0)];case 3:return r.sent(),en(function(n){return e(e({},n),{isOpen:!1})}),[3,6];case 4:throw s=r.sent(),console.error("An error occurred during scope rename.",s),null===(a=Rn.current)||void 0===a||a.show({severity:"error",sticky:!1,className:h.errorToast,content:o(X,{message:(null===(c=null===(l=null==s?void 0:s.response)||void 0===l?void 0:l.data)||void 0===c?void 0:c.message)||"There was an error renaming the scope. Please try again."})}),s;case 5:return an(!1),[7];case 6:return[2]}})})},initialName:$e.initialName})]}),o(_,{isOpen:$e.isOpen&&"DELETE"===$e.type,onCancel:function(){return en(e(e({},$e),{isOpen:!1}))},onConfirm:function(){return Yn($e.scopeId,$e.initialName,$e.isSubscope)},title:"Delete Scope",description:i(s,{children:["Deleting ",o("span",e({className:h.highlight},{children:$e.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:sn})]}))})}export{oe as default};
1
+ import{__assign as e,__spreadArray as n,__awaiter as t,__generator as r}from"tslib";import{jsx as o,jsxs as i,Fragment as s}from"react/jsx-runtime";import{useState as a,useRef as l,useCallback as c,useEffect as u}from"react";import{applyAxiosConfig as d}from"../../api/transport.js";import{BookOpen as p,Users as f,History as m}from"lucide-react";import{useLearningTemplateStore as v}from"./store/useLearningTemplateStore.js";import{Toast as g}from"primereact/toast";import h from"./styles/LearningTemplateManagement.module.css.js";import S from"./LearningTemplateLayout.js";import y from"./components/EmptyLearningState.js";import C from"./store/useAuthStore.js";import{DEFAULT_ACCESS_CONFIG as b}from"./config.js";import{fetchTiers as I,getILInstance as A,fetchScopes as L,inheritScope as T,inheritScopeBackwardCompatible as E,createRuleSet as R,renameScope as O,deleteRuleSet as _,requestAccess as w,grantApplicationAccess as M}from"./apis/scopeApis.js";import{useRuleTemplateQueryParams as N,setQueryParams as j,QUERY_PARAM_KEYS as D}from"./hooks/useLearningTemplateQueryParams.js";import k from"./components/ConfirmationModal.js";import P from"./components/LearningTemplateManagementSkeleton.js";import{findNodePathById as B,findNodeById as U}from"./utils/treeUtils.js";import q from"./store/useEnvStore.js";import{useConfigStore as G}from"./store/useConfigStore.js";import{TooltipProvider as F}from"./components/ToolTip.js";import x from"./components/CreateRuleSetLegacyModal.js";import{usePermissionsStore as H}from"./store/usePermissionsStore.js";import{useAppSecRolesStore as K}from"./store/useAppSecRolesStore.js";import{useGetAppSecRolesQuery as Q}from"./queries/useApprovalQueries.js";import{useLMSConfigQuery as z}from"./queries/useLMSConfigQuery.js";import V from"./RuleContent/AddScopeModal.js";import W from"./components/RuleContentSkeleton.js";import Y from"./components/ErrorStateDisplay.js";import{useLocation as J,useSearchParams as X}from"react-router-dom";import Z from"./shared/SuccessToastContent.js";import $ from"./shared/ErrorToastContent.js";import ee from"./RuleContent/RenameScopeModal.js";import{dt as ne,useLMSConfigStore as te}from"./store/useLMSConfigStore.js";import{MIDDLE_DRAWER_DT_PATH as re,MIDDLE_DRAWER_CONTEXT_MENU_DT_PATH as oe,EMPTY_STATE_DT_PATH as ie}from"./constants.js";function se(se){var ae,le,ce,ue,de,pe,fe,me,ve,ge,he,Se=this,ye=se.userDetails,Ce=se.llmStudioUrl,be=se.audacyBackendUrl,Ie=se.ilLabels,Ae=se.config,Le=se.rbacConfig,Te=se.auditLogConfig,Ee=se.app_integration_id,Re=se.backwardCompatibility,Oe=void 0!==Re&&Re,_e=se.cognitiveCompareCompatibility,we=void 0!==_e&&_e,Me=se.enableChatLogs,Ne=se.modeId,je=se.modeDetails,De=se.pluginPayload,ke=se.axiosConfig,Pe=se.isILMarketplace,Be=se.guidelineContentProps,Ue=se.treeOverrides,qe=se.selectionMode,Ge=void 0!==qe&&qe;d(ke);var Fe=[{id:"learnings",label:ne("".concat(re,".treeMenu.submenu.learnings"),"Learnings"),icon:p,badgeKey:"learningsCount"},{id:"access",label:ne("".concat(re,".treeMenu.submenu.access"),"Access"),icon:f},{id:"history",label:ne("".concat(re,".treeMenu.submenu.changeHistory"),"Change History"),icon:m}],xe=(null==Ue?void 0:Ue.sectionsConfig)?Ue.sectionsConfig.filter(function(e){return Fe.some(function(n){return n.id===e.id})}):Fe,He=new Set(xe.map(function(e){return e.id})),Ke=null!==(le=null===(ae=xe[0])||void 0===ae?void 0:ae.id)&&void 0!==le?le:"learnings",Qe=N().clearLearningParams,ze=v(function(e){return e.selectedRuleSetId}),Ve=v(function(e){return e.setSelectedRuleSetId}),We=v(function(e){return e.setIlInstanceId}),Ye=v(function(e){return e.error}),Je=v(function(e){return e.setError}),Xe=v(function(e){return e.setStations}),Ze=v(function(e){return e.scopeTreeData}),$e=v(function(e){return e.setScopeTreeData}),en=a({isOpen:!1,type:"GLOBAL"}),nn=en[0],tn=en[1],rn=a(!1),on=rn[0],sn=rn[1],an=a(!1),ln=an[0],cn=an[1],un=a(Ke),dn=un[0],pn=un[1],fn=a(null),mn=fn[0],vn=fn[1],gn=a(!1),hn=gn[0],Sn=gn[1],yn=a(null),Cn=yn[0];yn[1];var bn=a(!1),In=bn[0],An=bn[1],Ln=a(!1),Tn=Ln[0],En=Ln[1];l(null);var Rn=l(null),On=l(!1),_n=l(null),wn=l(null),Mn=C();Mn.user;var Nn=Mn.setUser,jn=G(),Dn=jn.setConfig,kn=jn.setIlLabels,Pn=function(){try{return J()}catch(e){return{search:""}}}(),Bn=function(){try{return X()[1]}catch(e){return null}}(),Un=c(function(e){if(Bn){var n=new URLSearchParams(window.location.search);Object.entries(e).forEach(function(e){var t=e[0],r=e[1];null==r||""===r?n.delete(t):n.set(t,r)}),Bn(n,{replace:!0})}else j(e)},[Bn]);u(function(){if(!On.current){var e=new URLSearchParams(window.location.search),n=e.get(D.RULESET_ID),t=e.get(D.SECTION),r=t&&(null==He?void 0:He.has(t))?t:Ke;(null==n?void 0:n.length)&&Ve&&pn&&(Ve(n),pn(r),On.current=!0)}},[null==Pn?void 0:Pn.search,pn,Ve]),u(function(){return function(){Qe()}},[Qe]),u(function(){var e;ze&&Un(((e={})[D.RULESET_ID]=ze,e))},[ze,Un]),u(function(){var n;(null==De?void 0:De.learningManagement)&&te.getState().setLMSConfig(e(e({},De.learningManagement),{agents:null!==(n=De.agents)&&void 0!==n?n:{}}))},[De]);var qn=H(function(e){return e.fetchPermissions}),Gn=H(function(e){return e.hasPermission}),Fn=K(function(e){return e.setRoles}),xn=q(function(e){return e.appsecRbacUrl})===Le.appsecRbacUrl,Hn=Q(Le.applicationId,xn).data,Kn=z(null!=Ee?Ee:"",Oe),Qn=Kn.isLoading,zn=Kn.isError,Vn=Kn.refetch;Kn.isSuccess;var Wn=a(0),Yn=Wn[0],Jn=Wn[1];u(function(){if(!Oe&&Ee&&Ce){t(Se,void 0,void 0,function(){var e,n,t,o,i,s,a;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,A(Ee)];case 1:return e=r.sent(),(null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.ILInstanceId)&&We(e.data.ILInstanceId),"number"==typeof(n=null===(a=null===(s=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.learningManagement)||void 0===s?void 0:s.scopeAndHierarchy)||void 0===a?void 0:a.maxHierarchyLevels)&&n>0&&Jn(n-1),[3,3];case 2:return t=r.sent(),console.error("Failed to fetch IL instance for hierarchy levels:",t),[3,3];case 3:return[2]}})})}},[Ee,Ce]),u(function(){Hn&&Fn(Hn.map(function(e){return{_id:e._id,name:e.name}}))},[Hn,Fn]),u(function(){var e;console.log("userDetails",ye),Nn(ye),console.log("llmStudioUrl",Ce),console.log("audacyBackendUrl",be),q.getState().setLlmStudioUrl(Ce),q.getState().setAudacyBackendUrl(be),q.getState().setRbacConfig(Le),q.getState().setAuditLogConfig(Te),q.getState().setBaseModeName((null==je?void 0:je.modeNameFromURL)||null),Dn(Ae),kn(Ie),v.getState().setAppIntegrationId(null!=Ee?Ee:null),v.getState().setBackwardCompatibility(Oe),v.getState().setCognitiveCompareCompatibility(null!=we&&we),v.getState().setEnableChatLogs("boolean"==typeof Me?Me:null),v.getState().setIsILMarketplace(null!=Pe&&Pe),v.getState().setToken(null!==(e=null==ye?void 0:ye.accessToken)&&void 0!==e?e:null)},[ye,Nn,Ce,be,Le,Te,Ae,Dn,Ie,kn,Ee,Oe,we,Me,Pe,je]),u(function(){(null==ye?void 0:ye.accessToken)&&Ce&&(Pe||I())},[Ee,null==ye?void 0:ye.accessToken,Ce,Pe]);var Xn=function(n){return void 0===n&&(n=!0),t(Se,void 0,void 0,function(){var o,i,s,a,l,c,u,d,p,f,m,g;return r(this,function(h){switch(h.label){case 0:n&&sn(!0),Je(null),h.label=1;case 1:return h.trys.push([1,10,11,12]),[4,qn(Le.applicationId)];case 2:return h.sent(),0!==H.getState().accessData.length?[3,5]:[4,t(Se,void 0,void 0,function(){var e,n,t,o,i,s;return r(this,function(r){switch(r.label){case 0:if(!Ee)return[2,!1];if(!((null===(i=Le.defaultAccessAppIntegrationIds)||void 0===i?void 0:i.length)?Le.defaultAccessAppIntegrationIds:b.FALLBACK_APP_INTEGRATION_IDS).includes(Ee))return[2,!1];if(_n.current===Ee)return[2,!1];if(e=(null==ye?void 0:ye.email)||(null===(s=C.getState().user)||void 0===s?void 0:s.email),n=Le.applicationModuleId,t=Le.applicationResourceId,!e||!n||!t)return[2,!1];_n.current=Ee,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,M({resource_type:n,resource_id:t,user_email:e,role:Le.defaultMarketPlaceRoleId||b.FALLBACK_MARKETPLACE_ROLE_ID})];case 2:return r.sent(),[2,!0];case 3:return o=r.sent(),console.error("Failed to grant default access for first-time user:",o),[2,!1];case 4:return[2]}})})];case 3:return h.sent()?[4,qn(Le.applicationId)]:[3,5];case 4:h.sent(),h.label=5;case 5:o=function(n){var t=H.getState().hasPermission("ilotj.scope.view",n.id),r=n.children?n.children.map(function(e){return o(e)}).filter(function(e){return null!==e}):[];return t||0!==r.length?e(e({},n),{hasAccess:t,children:r}):null},i=void 0,h.label=6;case 6:return h.trys.push([6,8,,9]),[4,L(Ee,ye.accessToken)];case 7:return i=h.sent(),[3,9];case 8:if(s=h.sent(),403===(null===(m=null==s?void 0:s.response)||void 0===m?void 0:m.status))return $e(null),vn(Le.applicationResourceId||null),Sn(!0),[2];throw s;case 9:return i&&i.data&&i.data.data&&(a=i.data.data,Array.isArray(a)&&(a=a.length>0?a[0]:null),a?(l=o(a))?(vn(null),Sn(!1),$e({data:l}),Rn.current?(Ve(Rn.current),pn(Ke),Rn.current=null):(c=v.getState().selectedRuleSetId,u=c?U(l,c):null,c&&u||(d=function(e){if(e.hasAccess)return e;for(var n=0,t=e.children||[];n<t.length;n++){var r=t[n],o=d(r);if(o)return o}return null},p=d(l),Ve(p?p.id:l.id)))):(vn(null!==(g=a.id)&&void 0!==g?g:null),Sn(!1),$e(null)):(vn(null),Sn(!1),$e(null))),[3,12];case 10:return f=h.sent(),console.error("Failed to fetch rule sets or permissions",f),Je("Failed to load data. Please try again later."),[3,12];case 11:return sn(!1),[7];case 12:return[2]}})})};u(function(){var e;(null===(e=null==ye?void 0:ye.accessToken)||void 0===e?void 0:e.length)&&xn?Xn(!0):console.warn("Error: Trying to fetch rules without access token",ye)},[null==ye?void 0:ye.accessToken,Je,Xe,Le.applicationId,xn]);var Zn=function(n,o,i){return t(Se,void 0,void 0,function(){var t,o,i,s,a,l,c,u;return r(this,function(r){switch(r.label){case 0:cn(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,_(n,ye.accessToken)];case 2:return r.sent(),v.getState().selectedRuleSetId===n&&(t=v.getState().scopeTreeData,(o=B((null==t?void 0:t.data)||null,n))&&o.length>1&&(i=o[o.length-2],Ve(i),pn(Ke))),[4,Xn(!0)];case 3:return r.sent(),tn(function(n){return e(e({},n),{isOpen:!1})}),null===(a=wn.current)||void 0===a||a.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,6];case 4:return s=r.sent(),console.error("An error occurred during scope deletion.",s),null===(l=wn.current)||void 0===l||l.show({severity:"error",summary:"Delete Failed",detail:(null===(u=null===(c=null==s?void 0:s.response)||void 0===c?void 0:c.data)||void 0===u?void 0:u.message)||"There was an error deleting the scope. Please try again."}),[3,6];case 5:return cn(!1),[7];case 6:return[2]}})})},$n=Ze,et=Cn?{data:{id:Cn.stationId,name:Cn.stationName,type:"STATION",metrics:{learningsCount:Cn.learningsCount,stationsCount:0},children:[]}}:$n,nt=!!(null==et?void 0:et.data);null===(ce=null==et?void 0:et.data)||void 0===ce||ce.type;var tt=H(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",Le.applicationResourceId||""),rt=function(e){return t(Se,void 0,void 0,function(){var n,t,i,s,a,l,c,u,d,p;return r(this,function(r){switch(r.label){case 0:if(!(n="string"==typeof e?e:(null===(l=null===(a=v.getState().scopeTreeData)||void 0===a?void 0:a.data)||void 0===l?void 0:l.id)||mn)&&!hn)return null===(c=wn.current)||void 0===c||c.show({severity:"error",sticky:!1,className:h.errorToast,content:o($,{message:"Unable to identify the global scope for this access request."})}),[2];An(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,w(n,hn)];case 2:return r.sent(),En(!0),null===(u=wn.current)||void 0===u||u.show({severity:"success",sticky:!1,life:3e3,className:h.successToast,content:o(Z,{message:"Access request submitted successfully!"})}),[3,5];case 3:return t=r.sent(),i=null===(d=null==t?void 0:t.response)||void 0===d?void 0:d.data,s="GLOBAL_SCOPE_NOT_FOUND"===(null==i?void 0:i.code)?"Unable to identify the global scope for this access request.":(null==i?void 0:i.detail)||(null==i?void 0:i.message)||"Failed to request access. Please try again.",null===(p=wn.current)||void 0===p||p.show({severity:"error",sticky:!1,className:h.errorToast,content:o($,{message:s})}),[3,5];case 4:return An(!1),[7];case 5:return[2]}})})};if(Qn)return o("div",e({className:h.learningManagementContainer},{children:o(W,{})}));if(zn)return o("div",e({className:h.learningManagementContainer},{children:o(Y,{errorMessage:"Failed to load configuration. Please try again.",onRetry:function(){return Vn()},title:"Error Loading Configuration"})}));var ot=n(n([{type:"GLOBAL",label:"Global",addChildLabel:"".concat(ne("".concat(re,".addScope"),"Add Scope")),addChildType:"SCOPE"}],Array.from({length:Yn},function(){return e({type:"SCOPE",label:ne("".concat(re,".scope"),"Scope")},!Oe&&{addChildLabel:ne("".concat(oe,".addSubScope"),"Add Subscope"),addChildType:"SUBSCOPE"})}),!0),Oe?[]:[{type:"SUBSCOPE",label:ne("".concat(re,".subScope"),"Subscope")}],!0),it=Ge?Fe.filter(function(e){return"learnings"===e.id}):Fe,st=Cn?it.filter(function(e){return"stations"!==e.id}):it,at=function(e,n){void 0===e&&(e=!0),n&&(Rn.current=n),Xn(e)},lt=function(){return at(!0)},ct=null!==(ue=null==Ue?void 0:Ue.nodeTypesConfig)&&void 0!==ue?ue:ot,ut=(null==Ue?void 0:Ue.onOpenCreateModal)?function(){return Ue.onOpenCreateModal(lt)}:function(){return tn({isOpen:!0,type:"GLOBAL"})},dt=(null==Ue?void 0:Ue.onAddChild)?function(e,n,t){return Ue.onAddChild(e,n,t,lt)}:function(e,n,t){return tn({isOpen:!0,type:n,parentId:e,parentName:t})},pt=(null==Ue?void 0:Ue.onRenameChild)?function(e,n){return Ue.onRenameChild(e,n,lt)}:function(e,n){return tn({isOpen:!0,type:"RENAME",scopeId:e,initialName:n})},ft=(null==Ue?void 0:Ue.onDeleteChild)?function(e,n,t){return Ue.onDeleteChild(e,n,t,lt)}:function(e,n,o){return t(Se,void 0,void 0,function(){var t,i,s;return r(this,function(r){switch(r.label){case 0:return t=v.getState().scopeTreeData,i=B((null==t?void 0:t.data)||null,e),s=!!i&&3===i.length,0!==o?[3,2]:[4,Zn(e)];case 1:return r.sent(),[3,3];case 2:tn({isOpen:!0,type:"DELETE",scopeId:e,initialName:n,isSubscope:s}),r.label=3;case 3:return[2]}})})},mt=null!==(de=null==Ue?void 0:Ue.onSectionSelect)&&void 0!==de?de:function(e,n){var t;console.log("Section Selected:",{scopeId:e,sectionId:n}),Un(((t={})[D.SECTION]=n===Ke?null:n,t)),pn(n),Ve(e),En(!1)},vt=null!==(pe=null==Ue?void 0:Ue.onRefreshRuleSets)&&void 0!==pe?pe:at,gt=null!==(fe=null==Ue?void 0:Ue.canCreateScope)&&void 0!==fe?fe:function(e){return Gn("ilotj.scope.create",e)},ht=null!==(me=null==Ue?void 0:Ue.canEditScope)&&void 0!==me?me:function(e){return Gn("ilotj.scope.edit",e)},St=null!==(ve=null==Ue?void 0:Ue.canDeleteScope)&&void 0!==ve?ve:function(e){return Gn("ilotj.scope.delete",e)};return o(F,{children:i("div",e({className:[h.learningManagementContainer,Ge&&h.selectionMode].filter(Boolean).join(" ")},{children:[o("div",e({className:h.mainWrapper},{children:on?o(P,{}):Ye?i("div",e({className:h.errorContainer},{children:[o("div",e({className:h.errorTitle},{children:"Error Loading Data"})),o("p",e({className:h.errorDesc},{children:Ye})),o("button",e({onClick:function(){return Xn(!0)},className:h.tryAgainBtn},{children:"Try Again"}))]})):nt?o(S,{onOpenCreateModal:ut,onAddChild:dt,onRenameChild:pt,onDeleteChild:ft,canDeleteScope:St,canEditScope:ht,canCreateScope:gt,onSectionSelect:mt,activeSectionId:dn,scopeTreeData:et,sectionsConfig:st,onViewStation:function(e){mt(e.stationId,Ke)},onRefreshRuleSets:vt,nodeTypesConfig:ct,app_integration_id:Ee,token:ye.accessToken,modeId:Ne,onRequestAccess:rt,isRequestingAccess:In,isAccessRequested:Tn,selectionMode:Ge,isILMarketplace:Pe,guidelineContentProps:Be}):o(y,{onCreate:function(){return tn({isOpen:!0,type:"GLOBAL"})},title:ne("".concat(ie,".title"),"No Global Scope has been added!"),desc:ne("".concat(ie,".desc"),"Start by creating a Global scope to define base learnings that apply across all stations."),button:ne("".concat(ie,".createGlobalScope"),"Create Global Scope"),canCreateRule:tt,noAccessTitle:ne("".concat(ie,".noAccessTitle"),"Access Restricted"),noAccessDesc:ne("".concat(ie,".noAccessDesc"),"You do not have access for this application."),requestAccessButton:ne("".concat(ie,".requestAccessButton"),"Request Access"),requestSentButton:ne("".concat(ie,".requestSentButton"),"Request Sent"),onRequestAccess:rt,isRequestingAccess:In,isAccessRequested:Tn})})),o(g,{ref:wn,pt:{root:{style:{zIndex:9999}}}}),Oe&&nn.isOpen&&"DELETE"!==nn.type&&"RENAME"!==nn.type?o(x,{isOpen:!0,onClose:function(){return tn(e(e({},nn),{isOpen:!1}))},onSubmit:function(n){return t(Se,void 0,void 0,function(){var t,o,i,s,a,l,c,u,d,p,f,m,g,h,S,y,C,b,I,A;return r(this,function(r){switch(r.label){case 0:cn(!0),t=v.getState().backwardCompatibility,r.label=1;case 1:return r.trys.push([1,12,13,14]),o=void 0,t&&"object"==typeof n?o=n:(i=n,s="SCOPE"===nn.type&&nn.parentId,a=s?"genreRuleSet":nn.type,o={topic:a,scope_reference_id:null,scopeDescription:"demo",parentScopeId:nn.parentId||null,scopeName:i,scopeReferenceMetadata:{},applicationMappingId:Ee}),[4,R(o,ye.accessToken)];case 2:if(l=r.sent(),!(c=null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.scopeId))return[3,10];if(Rn.current=c,u=t&&(null===(S=o.topic)||void 0===S?void 0:S.toLowerCase().includes("genre")),d=!t&&"GLOBAL"!==nn.type&&nn.parentId,!u&&!d)return[3,10];if(!(p=t?null===(C=null===(y=v.getState().scopeTreeData)||void 0===y?void 0:y.data)||void 0===C?void 0:C.id:nn.parentId))return[3,10];if(!Oe)return[3,7];r.label=3;case 3:return r.trys.push([3,5,,6]),[4,E({source_scope_id:p,target_scope_id:c})];case 4:return r.sent(),[3,6];case 5:return f=r.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,6];case 6:return[3,10];case 7:return r.trys.push([7,9,,10]),[4,T({source_scope_id:p,target_scope_id:c,application_mapping_id:Ee||"",is_copy_parent_variant_id:!1})];case 8:return r.sent(),[3,10];case 9:return m=r.sent(),console.error("Failed to inherit rules for the new scope:",m),[3,10];case 10:return[4,Xn(!0)];case 11:return r.sent(),tn(function(n){return e(e({},n),{isOpen:!1})}),[3,14];case 12:throw g=r.sent(),console.error("An error occurred during scope creation.",g),null===(b=wn.current)||void 0===b||b.show({severity:"error",summary:"Creation Failed",detail:(null===(A=null===(I=null==g?void 0:g.response)||void 0===I?void 0:I.data)||void 0===A?void 0:A.message)||"There was an error creating the scope. Please try again."}),g;case 13:return cn(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:nt,canCreateGlobal:tt,globalScopeId:null!==(he=null===(ge=null==Ze?void 0:Ze.data)||void 0===ge?void 0:ge.id)&&void 0!==he?he:null}):i(s,{children:[o(V,{isOpen:nn.isOpen&&"DELETE"!==nn.type&&"RENAME"!==nn.type,onClose:function(){return tn(e(e({},nn),{isOpen:!1}))},onCreate:function(e){e&&(Rn.current=e),Xn(!0)},hasGlobalRuleSet:nt,parentId:nn.parentId,parentName:nn.parentName,childType:"SUBSCOPE"===nn.type?"SUBSCOPE":"SCOPE",isILMarketplace:Pe}),o(ee,{isOpen:nn.isOpen&&"RENAME"===nn.type,onClose:function(){return tn(e(e({},nn),{isOpen:!1}))},onSave:function(n){return t(Se,void 0,void 0,function(){var t,i,s,a,l,c;return r(this,function(r){switch(r.label){case 0:cn(!0),r.label=1;case 1:return r.trys.push([1,4,5,6]),nn.scopeId?(t=v.getState().backwardCompatibility,i=t?{scope_id:nn.scopeId,scope_name:n}:{scope_id:nn.scopeId,scope_type:"Custom",scope_name:n,application_mapping_id:Ee},[4,O(i,ye.accessToken)]):[2];case 2:return r.sent(),[4,Xn(!0)];case 3:return r.sent(),tn(function(n){return e(e({},n),{isOpen:!1})}),[3,6];case 4:throw s=r.sent(),console.error("An error occurred during scope rename.",s),null===(a=wn.current)||void 0===a||a.show({severity:"error",sticky:!1,className:h.errorToast,content:o($,{message:(null===(c=null===(l=null==s?void 0:s.response)||void 0===l?void 0:l.data)||void 0===c?void 0:c.message)||"There was an error renaming the scope. Please try again."})}),s;case 5:return cn(!1),[7];case 6:return[2]}})})},initialName:nn.initialName})]}),o(k,{isOpen:nn.isOpen&&"DELETE"===nn.type,onCancel:function(){return tn(e(e({},nn),{isOpen:!1}))},onConfirm:function(){return Zn(nn.scopeId,nn.initialName,nn.isSubscope)},title:"Delete Scope",description:i(s,{children:["Deleting ",o("span",e({className:h.highlight},{children:nn.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:ln})]}))})}export{se as default};
2
2
  //# sourceMappingURL=LearningManagement.js.map
@@ -1,2 +1,2 @@
1
- import"tslib";import"react/jsx-runtime";import"react";import"../../api/transport.js";import"lucide-react";import"./store/useLearningTemplateStore.js";import"primereact/toast";import"./apis/scopeApis.js";import"./store/usePermissionsStore.js";import"./store/useLMSConfigStore.js";import"./components/ToolTip.js";import"./store/useAuthStore.js";import"@mui/material";import"@mui/icons-material/Check";import"@mui/icons-material/CloseRounded";import{QueryClient as t}from"@tanstack/react-query";import"./store/useEnvStore.js";import"date-fns/format";import"date-fns/isValid";import"date-fns/parseISO";import"framer-motion";import"../IL-OTJ/_components/atoms/Textarea/Textarea.js";import"../IL-OTJ/_components/InputDataReasoningCard.js";import"../IL-OTJ/_components/TooltipComponent.js";import"../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";import"../IL-OTJ/store/CitationsContext.js";import"uuid";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"../IL-OTJ/_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js";import"../IL-OTJ/_components/CitationLink.js";import"@e-llm-studio/citation";import"../../ILMarketplaceWrapper.js";import"../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";import"./store/useConfigStore.js";import"appsec-ui";import"react-dom";import"@radix-ui/react-tooltip";import"./components/StationOnboarding/InputField.js";import"./config.js";import"./store/useAppSecRolesStore.js";import"@e-llm-studio/audit-log";import"@e-llm-studio/audit-log/dist/styles.css";import"./AuditLog/ChangeLogDiff.js";import"../IL-marketplace/components/GuidelineIconButton.js";import"axios";import"./hooks/useLearningTemplateQueryParams.js";import"react-router-dom";new t;
1
+ import"tslib";import"react/jsx-runtime";import"react";import"../../api/transport.js";import"lucide-react";import"./store/useLearningTemplateStore.js";import"primereact/toast";import"./apis/scopeApis.js";import"./store/usePermissionsStore.js";import"./store/useLMSConfigStore.js";import"./components/ToolTip.js";import"./store/useAuthStore.js";import"@mui/material";import"@mui/icons-material/Check";import"@mui/icons-material/CloseRounded";import{QueryClient as t}from"@tanstack/react-query";import"./store/useEnvStore.js";import"date-fns/format";import"date-fns/isValid";import"date-fns/parseISO";import"framer-motion";import"../IL-OTJ/_components/atoms/Textarea/Textarea.js";import"../IL-OTJ/_components/InputDataReasoningCard.js";import"../IL-OTJ/_components/TooltipComponent.js";import"../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";import"../IL-OTJ/store/CitationsContext.js";import"uuid";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"../IL-OTJ/_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js";import"../IL-OTJ/_components/CitationLink.js";import"@e-llm-studio/citation";import"../../ILMarketplaceWrapper.js";import"../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";import"./store/useExternalWorkflowStore.js";import"../IL-marketplace/queryClient.js";import"./store/useConfigStore.js";import"appsec-ui";import"react-dom";import"@radix-ui/react-tooltip";import"./components/StationOnboarding/InputField.js";import"./config.js";import"./store/useAppSecRolesStore.js";import"@e-llm-studio/audit-log";import"@e-llm-studio/audit-log/dist/styles.css";import"./AuditLog/ChangeLogDiff.js";import"../IL-marketplace/components/GuidelineIconButton.js";import"axios";import"./hooks/useLearningTemplateQueryParams.js";import"react-router-dom";new t;
2
2
  //# sourceMappingURL=LearningManagementTest.js.map
@@ -1,2 +1,2 @@
1
- import{__awaiter as e,__generator as t,__spreadArray as n,__assign as r}from"tslib";import{jsx as o,jsxs as i,Fragment as l}from"react/jsx-runtime";import{useRef as a,useState as s,useEffect as u}from"react";import{useLearningTemplateStore as c}from"../store/useLearningTemplateStore.js";import d from"../components/EmptyLearningState.js";import{getRulesInRuleSetById as p,exportRuleSet as m,deleteRule as f,deleteQuestion as v,alterQuestionPriority as g}from"../apis/scopeApis.js";import h from"../components/RuleContentSkeleton.js";import{Toast as T}from"primereact/toast";import y from"./ContentLogic.js";import w from"../components/ErrorStateDisplay.js";import S from"../shared/SuccessToastContent.js";import j from"../shared/ErrorToastContent.js";import{findNodeById as C}from"../utils/treeUtils.js";import I from"../styles/LearningContent.module.css.js";import R from"../components/ConfirmationModal.js";import{dt as b}from"../store/useLMSConfigStore.js";import"../../IL-OTJ/_components/atoms/Textarea/Textarea.js";import"lucide-react";import"../../IL-OTJ/_components/InputDataReasoningCard.js";import"../../IL-OTJ/_components/TooltipComponent.js";import"../../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";import{CitationProvider as D}from"../../IL-OTJ/store/CitationsContext.js";import"@mui/material";import"uuid";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import"../../../api/transport.js";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"../../IL-OTJ/_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"../../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js";import"../../IL-OTJ/_components/CitationLink.js";import"@e-llm-studio/citation";import x from"../../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";import{LEARNING_DT_PATH as _,VARIANT_DT_PATH as L,TIER_DT_PATH as k}from"../constants.js";import{useConfigStore as O}from"../store/useConfigStore.js";import"../store/usePermissionsStore.js";import"appsec-ui";import"../store/useAuthStore.js";import"../store/useEnvStore.js";import"react-dom";import"@radix-ui/react-tooltip";import"../components/StationOnboarding/InputField.js";import"../config.js";import"../store/useAppSecRolesStore.js";import"@tanstack/react-query";import"@e-llm-studio/audit-log";import"@e-llm-studio/audit-log/dist/styles.css";import"../AuditLog/ChangeLogDiff.js";import"../../IL-marketplace/components/GuidelineIconButton.js";import"axios";import"../hooks/useLearningTemplateQueryParams.js";import"../components/ToolTip.js";import"react-router-dom";import"../../../ILMarketplaceWrapper.js";import"../LearningManagementTest.js";var M=function(M){var A,N=M.noRulesTitle,E=void 0===N?"No rules have been added !":N,V=M.noRulesDesc,F=void 0===V?"Start by adding rules that should apply across all stations.":V,P=M.noRulesButtonText,B=void 0===P?"Create New Rule":P,J=M.deleteRuleSuccessMessage,U=void 0===J?"Rule deleted successfully!":J,W=M.deleteVariantSuccessMessage,G=void 0===W?"Variant deleted successfully!":W,q=M.deleteRuleErrorMessage,H=void 0===q?"Failed to delete rule. Please try again.":q,Q=M.deleteVariantErrorMessage,$=void 0===Q?"Failed to delete variant. Please try again.":Q,z=M.deleteModalTitle,K=void 0===z?"Delete":z,X=M.deleteRuleModalWarning,Y=void 0===X?"This will permanently delete the rule configuration.":X,Z=M.deleteVariantModalWarning,ee=void 0===Z?"This will permanently delete the variant configuration.":Z,te=M.deleteConfirmText,ne=void 0===te?"Delete":te,re=M.onRefreshRuleSets,oe=M.app_integration_id,ie=M.token,le=M.modeId,ae=c(function(e){return e.selectedRuleSetId}),se=c(function(e){return e.scopeTreeData}),ue=c(function(e){return e.sidebarTab}),ce=c(function(e){return e.setInitialRules}),de=c(function(e){return e.currentRules}),pe=c(function(e){return e.setRawAuditRuleData});c(function(e){return e.createdVariantInfo});var me=c(function(e){return e.resetCreatedVariantInfo}),fe=c(function(e){return e.isILModalTriggered}),ve=c(function(e){return e.setIsILModalTriggered}),ge=a(null),he=O.getState().configuration,Te=s(!1),ye=Te[0],we=Te[1],Se=s(null),je=Se[0],Ce=Se[1],Ie=s(null),Re=Ie[0],be=Ie[1],De=s(null),xe=De[0],_e=De[1],Le=s(null),ke=Le[0],Oe=Le[1],Me=s(!1),Ae=Me[0],Ne=Me[1],Ee=s(null),Ve=Ee[0],Fe=Ee[1],Pe=s(!1),Be=Pe[0],Je=Pe[1],Ue=s(""),We=Ue[0],Ge=Ue[1],qe=s(null),He=qe[0],Qe=qe[1],$e=s(!1),ze=$e[0],Ke=$e[1],Xe=s(!1),Ye=Xe[0],Ze=Xe[1],et=s("ruleDeletion"),tt=et[0],nt=et[1],rt=s(null),ot=rt[0],it=rt[1],lt=s(!1),at=lt[0],st=lt[1],ut=s(!1),ct=ut[0],dt=ut[1],pt=c.getState().tiers,mt=s(null),ft=mt[0],vt=mt[1],gt=s(null),ht=gt[0],Tt=gt[1],yt=s(null),wt=yt[0],St=yt[1],jt=function(){Ce(null),_e(null),be(null),vt(null),Tt(null),St(null),Ge(""),we(!0),Oe(0)},Ct=function(){we(!1),ve(!1),Ce(null),be(null),_e(null),Oe(null),Ze(!1),dt(!1),It(),vt(null),Tt(null),St(null),Ge(""),re&&re(!1,ae||void 0)};u(function(){It()},[ae,ce]),u(function(){fe&&we(!0)},[fe]);var It=function(o){return void 0===o&&(o=!1),e(void 0,void 0,void 0,function(){var e,i,l,a,s,u,d,m,f,v,g,h,T,y,w,S,j,C,I;return t(this,function(t){switch(t.label){case 0:if(!ae)return ce([]),[2];o||Ne(!0),Fe(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,p(ae,ie)];case 2:return e=t.sent(),console.log("response==",e),(null==e?void 0:e.data)&&0!==Object.keys(e.data).length?(pe(e),i=e.data,console.log("rulesData==",i),l=new Set(["ruleSetName","ruleSetDesc","created_at","updated_at","created_by","updated_by"]),a=Array.isArray(i.tiers)?n([],i.tiers,!0).sort(function(e,t){var n,r;return(null!==(n=e.tier_priority)&&void 0!==n?n:0)-(null!==(r=t.tier_priority)&&void 0!==r?r:0)}).map(function(e){return[e.name,e.value]}):Object.entries(i).filter(function(e){var t=e[0],n=e[1];return!l.has(t)&&Array.isArray(n)}),s=a.map(function(e){var t=e[1];return new Set(t.flatMap(function(e){var t,n;return null!==(n=null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return e.link_id}).filter(Boolean))&&void 0!==n?n:[]}))}),u=s.flatMap(function(e){return Array.from(e)}),d=u.reduce(function(e,t){var n;return e[t]=(null!==(n=e[t])&&void 0!==n?n:0)+1,e},{}),m=new Set(Object.entries(d).filter(function(e){return e[1]>1}).map(function(e){return e[0]})),f=function(e){return e.map(function(e){var t;return r(r({},e),{variants:null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return r(r({},e),{isLinked:!!e.link_id&&m.has(e.link_id)})})})})},v=a.map(function(e,t){var n,r=e[0],o=e[1],i=pt.find(function(e){return e.tier_name===r}),l=r.replace(/tier(\d+)/i,"tier_$1");return{id:null!==(n=null==i?void 0:i.tier_id)&&void 0!==n?n:String(t+1),name:l.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),ruleCount:o.length,description:0===t?"".concat(b("tier.subtitle","These are the system-wide learnings applied across all stations.")):"These learnings apply after higher-priority tiers and may refine or relax default behavior.",isOpen:0===t,rules:f(o)}}),(g=c.getState().createdVariantInfo)&&g.length>0?(h=Object.fromEntries(a.map(function(e,t){return[e[0],String(t+1)]})),T=new Set(g.map(function(e){return h[e.tierName]}).filter(Boolean)),y=v.map(function(e){return r(r({},e),{isOpen:e.isOpen||T.has(e.id)})}),ce(y),(w=null===(I=null===(C=null===(j=g[0])||void 0===j?void 0:j.variants)||void 0===C?void 0:C[0])||void 0===I?void 0:I.id)?setTimeout(function(){var e=document.querySelector('[data-variant-id="'.concat(w,'"]'));e&&e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(function(){return me()},1e4)},500):me()):ce(v),[3,5]):(ce([]),[2]);case 3:return S=t.sent(),console.error("Failed to fetch rule details",S),404!==(null==S?void 0:S.status)&&Fe((null==S?void 0:S.message)||"Failed to load rules. Please try again."),ce([]),[3,5];case 4:return o||Ne(!1),[7];case 5:return[2]}})})},Rt=ae?C((null==se?void 0:se.data)||null,ae):null,bt=Rt?{ruleSetId:Rt.id,ruleSetName:Rt.name,ruleSetDesc:"",ruleCount:null===(A=null==Rt?void 0:Rt.metrics)||void 0===A?void 0:A.learningsCount}:void 0,Dt=Boolean(null==se?void 0:se.data),xt=Boolean(ae&&!Rt&&Dt),_t=function(){if("stations"===ue)return"custom";if(!Rt)return"global";switch(Rt.type){case"GLOBAL":default:return"global";case"SCOPE":return"genre";case"SUBSCOPE":case"Custom":return"custom"}},Lt=function(e){var t;if(!e)return o("p",{children:b("".concat(k,".deleteDialog.description"),"Are you sure you want to delete this rule? This action cannot be undone.")});var n=null==de?void 0:de.flatMap(function(e){var t;return null!==(t=e.rules)&&void 0!==t?t:[]}).find(function(t){return t.ruleId===e});return o("p",{children:b("".concat(k,".deleteDialog.description"),"Are you sure you want to delete ".concat(null==n?void 0:n.ruleTitle," rule? This action cannot be undone."),{rule_title:null!==(t=null==n?void 0:n.ruleTitle)&&void 0!==t?t:""})})},kt={editingRule:je,editingTier:Re,editingVariants:xe,focusedVariantIndex:ke,setFocusedVariantIndex:Oe,triggerAddVariant:Ye,triggerFixGaps:ct,copiedRule:ft,copiedSourceTier:ht,copiedTargetTier:wt,initialDraftMessage:We,app_integration_id:oe,modeId:le};return bt?i(l,{children:[o(T,{ref:ge}),o("div",r({className:I.container},{children:Ae?o(h,{}):Ve?o(w,{errorMessage:Ve,onRetry:It}):o(y,{onAddRule:jt,onDeleteRule:function(e){Qe(e)},onEditRule:function(e,t){Ce(e),be(t||null),_e(e.variants||null),Oe(null),Ze(!0),we(!0)},onEditVariant:function(e,t,n,r){var o,i,l,a,s=null!==(l=null===(i=null===(o=null==de?void 0:de.find(function(e){return e.name===n}))||void 0===o?void 0:o.rules)||void 0===i?void 0:i.find(function(e){return e.ruleId===t}))&&void 0!==l?l:null==de?void 0:de.flatMap(function(e){return e.rules}).find(function(e){return e.ruleId===t});if(s){var u=null===(a=s.variants)||void 0===a?void 0:a.findIndex(function(t){return t.variantId===e.variantId}),c=void 0!==u&&-1!==u?u:0;Ce(s),be(n||null),_e(s.variants||null),Oe(c),we(!0),"resolve_gaps"===r&&dt(!0)}},onDeleteVariant:function(e,t){it({variantId:e,ruleId:t})},onExportRule:function(){return e(void 0,void 0,void 0,function(){var e,n,r,i,l,a,s;return t(this,function(t){switch(t.label){case 0:if(!ae)return[2];Je(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,m(ae)];case 2:return e=t.sent(),n=window.URL.createObjectURL(e),(r=document.createElement("a")).href=n,i=(null==bt?void 0:bt.ruleSetName)?"".concat(bt.ruleSetName.replace(/\s+/g,"_"),"_rules.csv"):"ruleset_".concat(ae,".csv"),r.download=i,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n),null===(a=ge.current)||void 0===a||a.show({severity:"success",sticky:!1,life:3e3,className:I.successToast,content:o(S,{message:"Ruleset exported successfully!"})}),[3,5];case 3:return l=t.sent(),console.error("Export error:",l),null===(s=ge.current)||void 0===s||s.show({severity:"error",sticky:!1,className:I.errorToast,content:o(j,{message:l.message||"Failed to export ruleset. Please try again."})}),[3,5];case 4:return Je(!1),[7];case 5:return[2]}})})},isExporting:Be,onToggleSuccess:function(){return It(!0)},onReorderRules:function(n,r,i,l,a){return e(void 0,void 0,void 0,function(){var e,s,u;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,g(n,r,i,l,a)];case 1:return t.sent(),It(!0),null===(s=ge.current)||void 0===s||s.show({severity:"success",sticky:!1,life:3e3,className:I.successToast,content:o(S,{message:"Rule order changed successfully. Future rule applications will follow the updated order."})}),[3,3];case 2:return e=t.sent(),console.error("Failed to reorder rules:",e),It(!0),null===(u=ge.current)||void 0===u||u.show({severity:"error",sticky:!1,className:I.errorToast,content:o(j,{message:"Failed to update rule order. Please try again."})}),[3,3];case 3:return[2]}})})},onRefreshRuleSets:re,setDeleteConfirmationUsedFor:nt,onCopyToTier:function(e,t,n,r,o){var i,l,a=null===(l=null===(i=null==de?void 0:de.find(function(e){return e.name===r}))||void 0===i?void 0:i.rules)||void 0===l?void 0:l.find(function(e){return e.ruleId===t});if(a){var s=["Add a new learning with the following details:","- Rule Title: ".concat(n),"- Description: ".concat(e.description),"- When to apply: ".concat(e.whenToApply),"- When NOT to apply: ".concat(e.whenNotToApply),"- Tier information: ".concat(o)].join("\n");Ge(s),vt(a),Tt(r),St(o),Ce(null),be(null),_e(null),Oe(null),we(!0)}}})})),ye&&o(D,{children:o(x,{isOpen:ye,onClose:Ct,app_integration_id:oe,token:ie,mode:"ADD",config:he,pluginPayload:r(r({},kt),{initialScope:_t(),ruleSet:bt})})}),o(R,{isOpen:!!He,title:b("".concat(_,".deleteDialog.title"),K),description:Lt(He),warning:b("".concat(_,".deleteDialog.warningText"),Y),confirmText:b("".concat(_,".deleteDialog.deleteText"),ne),cancelText:b("".concat(_,".deleteDialog.cancelText"),"Cancel"),loadingText:b("".concat(_,".deleteDialog.loadingText"),"Deleting..."),confirmBgColor:"#EF4444",onConfirm:function(){return e(void 0,void 0,void 0,function(){var e,n,r,i,l;return t(this,function(t){switch(t.label){case 0:if(!He)return[2];Ke(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,f(He)];case 2:return t.sent(),Qe(null),null===(n=ge.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:I.successToast,content:o(S,{message:U})}),It(),re&&re(!1,ae||void 0),[3,5];case 3:return e=t.sent(),console.error("Failed to delete rule",e),null===(r=ge.current)||void 0===r||r.show({severity:"error",sticky:!1,className:I.errorToast,content:o(j,{message:(null===(l=null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.detail)||H})}),[3,5];case 4:return Ke(!1),[7];case 5:return[2]}})})},onCancel:function(){return Qe(null)},isLoading:ze}),o(R,{isOpen:!!ot,title:b("".concat(L,".deleteVariant.title"),K),description:"variantDeletion"===tt?o("span",{children:b("".concat(L,".deleteVariant.desc"),"Are you sure you want to delete this variant? This action cannot be undone.")}):Lt((null==ot?void 0:ot.ruleId)||null),warning:b("".concat(L,".deleteVariant.warningText"),"ruleDeletion"===tt?Y:ee),confirmText:b("".concat(L,".deleteDialog.deleteText"),ne),cancelText:b("".concat(L,".cancelText"),"Cancel"),loadingText:b("".concat(L,".loadingText"),"Deleting..."),confirmBgColor:"#EF4444",onConfirm:function(){return e(void 0,void 0,void 0,function(){var e,n,r,i,l;return t(this,function(t){switch(t.label){case 0:if(!ot)return[2];st(!0),t.label=1;case 1:return t.trys.push([1,6,7,8]),"ruleDeletion"!==tt?[3,3]:[4,v(ot.ruleId)];case 2:return t.sent(),[3,5];case 3:return[4,f(ot.variantId)];case 4:t.sent(),t.label=5;case 5:return it(null),null===(n=ge.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:I.successToast,content:o(S,{message:"ruleDeletion"===tt?U:G})}),It(),re&&re(!1,ae||void 0),[3,8];case 6:return e=t.sent(),console.error("Failed to delete variant",e),null===(r=ge.current)||void 0===r||r.show({severity:"error",sticky:!1,className:I.errorToast,content:o(j,{message:(null===(l=null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.detail)||("ruleDeletion"===tt?H:$)})}),[3,8];case 7:return st(!1),[7];case 8:return[2]}})})},onCancel:function(){return it(null)},isLoading:at})]}):xt?o(w,{title:"Scope Not Found",errorMessage:"The selected scope does not exist. Please refresh the page or choose a valid scope.",onRetry:function(){return null==re?void 0:re(!0)},retryButtonText:"Refresh"}):i(l,{children:[o(d,{onCreate:jt,title:E,desc:F,button:B}),ye&&o(D,{children:o(x,{isOpen:ye,onClose:Ct,app_integration_id:oe,token:ie,mode:"ADD",config:he,pluginPayload:r(r({},kt),{initialScope:_t(),ruleSet:bt})})})]})};export{M as default};
1
+ import{__awaiter as e,__generator as t,__spreadArray as n,__assign as r}from"tslib";import{jsx as o,jsxs as i,Fragment as l}from"react/jsx-runtime";import{useRef as a,useState as s,useEffect as u}from"react";import{useLearningTemplateStore as c}from"../store/useLearningTemplateStore.js";import d from"../components/EmptyLearningState.js";import{getRulesInRuleSetById as p,exportRuleSet as m,deleteRule as f,deleteQuestion as v,alterQuestionPriority as g}from"../apis/scopeApis.js";import h from"../components/RuleContentSkeleton.js";import{Toast as T}from"primereact/toast";import y from"./ContentLogic.js";import w from"../components/ErrorStateDisplay.js";import S from"../shared/SuccessToastContent.js";import C from"../shared/ErrorToastContent.js";import{findNodeById as j}from"../utils/treeUtils.js";import I from"../styles/LearningContent.module.css.js";import R from"../components/ConfirmationModal.js";import{dt as b}from"../store/useLMSConfigStore.js";import"../../IL-OTJ/_components/atoms/Textarea/Textarea.js";import"lucide-react";import"../../IL-OTJ/_components/InputDataReasoningCard.js";import"../../IL-OTJ/_components/TooltipComponent.js";import"../../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";import{CitationProvider as D}from"../../IL-OTJ/store/CitationsContext.js";import"@mui/material";import"uuid";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import"../../../api/transport.js";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"../../IL-OTJ/_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"../../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js";import"../../IL-OTJ/_components/CitationLink.js";import"@e-llm-studio/citation";import x from"../../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";import _ from"../../../ContinueWithTemplateModal.js";import{LEARNING_DT_PATH as L,VARIANT_DT_PATH as k,TIER_DT_PATH as M}from"../constants.js";import{useConfigStore as O}from"../store/useConfigStore.js";import"../store/usePermissionsStore.js";import"appsec-ui";import"../store/useAuthStore.js";import"../store/useEnvStore.js";import"react-dom";import"@radix-ui/react-tooltip";import"../components/StationOnboarding/InputField.js";import"../config.js";import"../store/useAppSecRolesStore.js";import"@tanstack/react-query";import"@e-llm-studio/audit-log";import"@e-llm-studio/audit-log/dist/styles.css";import"../AuditLog/ChangeLogDiff.js";import"../../IL-marketplace/components/GuidelineIconButton.js";import"axios";import"../hooks/useLearningTemplateQueryParams.js";import"../components/ToolTip.js";import"react-router-dom";import"../../../ILMarketplaceWrapper.js";import"../LearningManagementTest.js";var A=function(A){var N,E=A.noRulesTitle,V=void 0===E?"No rules have been added !":E,F=A.noRulesDesc,P=void 0===F?"Start by adding rules that should apply across all stations.":F,B=A.noRulesButtonText,J=void 0===B?"Create New Rule":B,U=A.deleteRuleSuccessMessage,W=void 0===U?"Rule deleted successfully!":U,G=A.deleteVariantSuccessMessage,q=void 0===G?"Variant deleted successfully!":G,H=A.deleteRuleErrorMessage,Q=void 0===H?"Failed to delete rule. Please try again.":H,$=A.deleteVariantErrorMessage,z=void 0===$?"Failed to delete variant. Please try again.":$,K=A.deleteModalTitle,X=void 0===K?"Delete":K,Y=A.deleteRuleModalWarning,Z=void 0===Y?"This will permanently delete the rule configuration.":Y,ee=A.deleteVariantModalWarning,te=void 0===ee?"This will permanently delete the variant configuration.":ee,ne=A.deleteConfirmText,re=void 0===ne?"Delete":ne,oe=A.onRefreshRuleSets,ie=A.app_integration_id,le=A.token,ae=A.modeId,se=c(function(e){return e.selectedRuleSetId}),ue=c(function(e){return e.scopeTreeData}),ce=c(function(e){return e.sidebarTab}),de=c(function(e){return e.setInitialRules}),pe=c(function(e){return e.currentRules}),me=c(function(e){return e.setRawAuditRuleData});c(function(e){return e.createdVariantInfo});var fe=c(function(e){return e.resetCreatedVariantInfo}),ve=c(function(e){return e.isILModalTriggered}),ge=c(function(e){return e.setIsILModalTriggered}),he=a(null),Te=O.getState().configuration,ye=s(!1),we=ye[0],Se=ye[1],Ce=s(null),je=Ce[0],Ie=Ce[1],Re=s(null),be=Re[0],De=Re[1],xe=s(null),_e=xe[0],Le=xe[1],ke=s(null),Me=ke[0],Oe=ke[1],Ae=s(!1),Ne=Ae[0],Ee=Ae[1],Ve=s(null),Fe=Ve[0],Pe=Ve[1],Be=s(!1),Je=Be[0],Ue=Be[1],We=s(""),Ge=We[0],qe=We[1],He=s(null),Qe=He[0],$e=He[1],ze=s(!1),Ke=ze[0],Xe=ze[1],Ye=s(!1),Ze=Ye[0],et=Ye[1],tt=s("ruleDeletion"),nt=tt[0],rt=tt[1],ot=s(null),it=ot[0],lt=ot[1],at=s(!1),st=at[0],ut=at[1],ct=s(!1),dt=ct[0],pt=ct[1],mt=c.getState().tiers,ft=s(null),vt=ft[0],gt=ft[1],ht=s(null),Tt=ht[0],yt=ht[1],wt=s(null),St=wt[0],Ct=wt[1],jt=function(){Ie(null),Le(null),De(null),gt(null),yt(null),Ct(null),qe(""),Se(!0),Oe(0)},It=function(){Se(!1),ge(!1),Ie(null),De(null),Le(null),Oe(null),et(!1),pt(!1),Rt(),gt(null),yt(null),Ct(null),qe(""),oe&&oe(!1,se||void 0)};u(function(){Rt()},[se,de]),u(function(){ve&&Se(!0)},[ve]);var Rt=function(o){return void 0===o&&(o=!1),e(void 0,void 0,void 0,function(){var e,i,l,a,s,u,d,m,f,v,g,h,T,y,w,S,C,j,I;return t(this,function(t){switch(t.label){case 0:if(!se)return de([]),[2];o||Ee(!0),Pe(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,p(se,le)];case 2:return e=t.sent(),console.log("response==",e),(null==e?void 0:e.data)&&0!==Object.keys(e.data).length?(me(e),i=e.data,console.log("rulesData==",i),l=new Set(["ruleSetName","ruleSetDesc","created_at","updated_at","created_by","updated_by"]),a=Array.isArray(i.tiers)?n([],i.tiers,!0).sort(function(e,t){var n,r;return(null!==(n=e.tier_priority)&&void 0!==n?n:0)-(null!==(r=t.tier_priority)&&void 0!==r?r:0)}).map(function(e){return[e.name,e.value]}):Object.entries(i).filter(function(e){var t=e[0],n=e[1];return!l.has(t)&&Array.isArray(n)}),s=a.map(function(e){var t=e[1];return new Set(t.flatMap(function(e){var t,n;return null!==(n=null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return e.link_id}).filter(Boolean))&&void 0!==n?n:[]}))}),u=s.flatMap(function(e){return Array.from(e)}),d=u.reduce(function(e,t){var n;return e[t]=(null!==(n=e[t])&&void 0!==n?n:0)+1,e},{}),m=new Set(Object.entries(d).filter(function(e){return e[1]>1}).map(function(e){return e[0]})),f=function(e){return e.map(function(e){var t;return r(r({},e),{variants:null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return r(r({},e),{isLinked:!!e.link_id&&m.has(e.link_id)})})})})},v=a.map(function(e,t){var n,r=e[0],o=e[1],i=mt.find(function(e){return e.tier_name===r}),l=r.replace(/tier(\d+)/i,"tier_$1");return{id:null!==(n=null==i?void 0:i.tier_id)&&void 0!==n?n:String(t+1),name:l.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),ruleCount:o.length,description:0===t?"".concat(b("tier.subtitle","These are the system-wide learnings applied across all stations.")):"These learnings apply after higher-priority tiers and may refine or relax default behavior.",isOpen:0===t,rules:f(o)}}),(g=c.getState().createdVariantInfo)&&g.length>0?(h=Object.fromEntries(a.map(function(e,t){return[e[0],String(t+1)]})),T=new Set(g.map(function(e){return h[e.tierName]}).filter(Boolean)),y=v.map(function(e){return r(r({},e),{isOpen:e.isOpen||T.has(e.id)})}),de(y),(w=null===(I=null===(j=null===(C=g[0])||void 0===C?void 0:C.variants)||void 0===j?void 0:j[0])||void 0===I?void 0:I.id)?setTimeout(function(){var e=document.querySelector('[data-variant-id="'.concat(w,'"]'));e&&e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(function(){return fe()},1e4)},500):fe()):de(v),[3,5]):(de([]),[2]);case 3:return S=t.sent(),console.error("Failed to fetch rule details",S),404!==(null==S?void 0:S.status)&&Pe((null==S?void 0:S.message)||"Failed to load rules. Please try again."),de([]),[3,5];case 4:return o||Ee(!1),[7];case 5:return[2]}})})},bt=se?j((null==ue?void 0:ue.data)||null,se):null,Dt=bt?{ruleSetId:bt.id,ruleSetName:bt.name,ruleSetDesc:"",ruleCount:null===(N=null==bt?void 0:bt.metrics)||void 0===N?void 0:N.learningsCount}:void 0,xt=Boolean(null==ue?void 0:ue.data),_t=Boolean(se&&!bt&&xt),Lt=function(){if("stations"===ce)return"custom";if(!bt)return"global";switch(bt.type){case"GLOBAL":default:return"global";case"SCOPE":return"genre";case"SUBSCOPE":case"Custom":return"custom"}},kt=function(e){var t;if(!e)return o("p",{children:b("".concat(M,".deleteDialog.description"),"Are you sure you want to delete this rule? This action cannot be undone.")});var n=null==pe?void 0:pe.flatMap(function(e){var t;return null!==(t=e.rules)&&void 0!==t?t:[]}).find(function(t){return t.ruleId===e});return o("p",{children:b("".concat(M,".deleteDialog.description"),"Are you sure you want to delete ".concat(null==n?void 0:n.ruleTitle," rule? This action cannot be undone."),{rule_title:null!==(t=null==n?void 0:n.ruleTitle)&&void 0!==t?t:""})})},Mt={editingRule:je,editingTier:be,editingVariants:_e,focusedVariantIndex:Me,setFocusedVariantIndex:Oe,triggerAddVariant:Ze,triggerFixGaps:dt,copiedRule:vt,copiedSourceTier:Tt,copiedTargetTier:St,initialDraftMessage:Ge,app_integration_id:ie,modeId:ae};return Dt?i(l,{children:[o(T,{ref:he}),o("div",r({className:I.container},{children:Ne?o(h,{}):Fe?o(w,{errorMessage:Fe,onRetry:Rt}):o(y,{onAddRule:jt,onDeleteRule:function(e){$e(e)},onEditRule:function(e,t){Ie(e),De(t||null),Le(e.variants||null),Oe(null),et(!0),Se(!0)},onEditVariant:function(e,t,n,r){var o,i,l,a,s=null!==(l=null===(i=null===(o=null==pe?void 0:pe.find(function(e){return e.name===n}))||void 0===o?void 0:o.rules)||void 0===i?void 0:i.find(function(e){return e.ruleId===t}))&&void 0!==l?l:null==pe?void 0:pe.flatMap(function(e){return e.rules}).find(function(e){return e.ruleId===t});if(s){var u=null===(a=s.variants)||void 0===a?void 0:a.findIndex(function(t){return t.variantId===e.variantId}),c=void 0!==u&&-1!==u?u:0;Ie(s),De(n||null),Le(s.variants||null),Oe(c),Se(!0),"resolve_gaps"===r&&pt(!0)}},onDeleteVariant:function(e,t){lt({variantId:e,ruleId:t})},onExportRule:function(){return e(void 0,void 0,void 0,function(){var e,n,r,i,l,a,s;return t(this,function(t){switch(t.label){case 0:if(!se)return[2];Ue(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,m(se)];case 2:return e=t.sent(),n=window.URL.createObjectURL(e),(r=document.createElement("a")).href=n,i=(null==Dt?void 0:Dt.ruleSetName)?"".concat(Dt.ruleSetName.replace(/\s+/g,"_"),"_rules.csv"):"ruleset_".concat(se,".csv"),r.download=i,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n),null===(a=he.current)||void 0===a||a.show({severity:"success",sticky:!1,life:3e3,className:I.successToast,content:o(S,{message:"Ruleset exported successfully!"})}),[3,5];case 3:return l=t.sent(),console.error("Export error:",l),null===(s=he.current)||void 0===s||s.show({severity:"error",sticky:!1,className:I.errorToast,content:o(C,{message:l.message||"Failed to export ruleset. Please try again."})}),[3,5];case 4:return Ue(!1),[7];case 5:return[2]}})})},isExporting:Je,onToggleSuccess:function(){return Rt(!0)},onReorderRules:function(n,r,i,l,a){return e(void 0,void 0,void 0,function(){var e,s,u;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,g(n,r,i,l,a)];case 1:return t.sent(),Rt(!0),null===(s=he.current)||void 0===s||s.show({severity:"success",sticky:!1,life:3e3,className:I.successToast,content:o(S,{message:"Rule order changed successfully. Future rule applications will follow the updated order."})}),[3,3];case 2:return e=t.sent(),console.error("Failed to reorder rules:",e),Rt(!0),null===(u=he.current)||void 0===u||u.show({severity:"error",sticky:!1,className:I.errorToast,content:o(C,{message:"Failed to update rule order. Please try again."})}),[3,3];case 3:return[2]}})})},onRefreshRuleSets:oe,setDeleteConfirmationUsedFor:rt,onCopyToTier:function(e,t,n,r,o){var i,l,a=null===(l=null===(i=null==pe?void 0:pe.find(function(e){return e.name===r}))||void 0===i?void 0:i.rules)||void 0===l?void 0:l.find(function(e){return e.ruleId===t});if(a){var s=["Add a new learning with the following details:","- Rule Title: ".concat(n),"- Description: ".concat(e.description),"- When to apply: ".concat(e.whenToApply),"- When NOT to apply: ".concat(e.whenNotToApply),"- Tier information: ".concat(o)].join("\n");qe(s),gt(a),yt(r),Ct(o),Ie(null),De(null),Le(null),Oe(null),Se(!0)}}})})),we&&o(D,{children:o(x,{isOpen:we,onClose:It,app_integration_id:ie,token:le,mode:"ADD",config:Te,pluginPayload:r(r({},Mt),{initialScope:Lt(),ruleSet:Dt}),renderContinueModal:!1})}),o(_,{}),o(R,{isOpen:!!Qe,title:b("".concat(L,".deleteDialog.title"),X),description:kt(Qe),warning:b("".concat(L,".deleteDialog.warningText"),Z),confirmText:b("".concat(L,".deleteDialog.deleteText"),re),cancelText:b("".concat(L,".deleteDialog.cancelText"),"Cancel"),loadingText:b("".concat(L,".deleteDialog.loadingText"),"Deleting..."),confirmBgColor:"#EF4444",onConfirm:function(){return e(void 0,void 0,void 0,function(){var e,n,r,i,l;return t(this,function(t){switch(t.label){case 0:if(!Qe)return[2];Xe(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,f(Qe)];case 2:return t.sent(),$e(null),null===(n=he.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:I.successToast,content:o(S,{message:W})}),Rt(),oe&&oe(!1,se||void 0),[3,5];case 3:return e=t.sent(),console.error("Failed to delete rule",e),null===(r=he.current)||void 0===r||r.show({severity:"error",sticky:!1,className:I.errorToast,content:o(C,{message:(null===(l=null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.detail)||Q})}),[3,5];case 4:return Xe(!1),[7];case 5:return[2]}})})},onCancel:function(){return $e(null)},isLoading:Ke}),o(R,{isOpen:!!it,title:b("".concat(k,".deleteVariant.title"),X),description:"variantDeletion"===nt?o("span",{children:b("".concat(k,".deleteVariant.desc"),"Are you sure you want to delete this variant? This action cannot be undone.")}):kt((null==it?void 0:it.ruleId)||null),warning:b("".concat(k,".deleteVariant.warningText"),"ruleDeletion"===nt?Z:te),confirmText:b("".concat(k,".deleteDialog.deleteText"),re),cancelText:b("".concat(k,".cancelText"),"Cancel"),loadingText:b("".concat(k,".loadingText"),"Deleting..."),confirmBgColor:"#EF4444",onConfirm:function(){return e(void 0,void 0,void 0,function(){var e,n,r,i,l;return t(this,function(t){switch(t.label){case 0:if(!it)return[2];ut(!0),t.label=1;case 1:return t.trys.push([1,6,7,8]),"ruleDeletion"!==nt?[3,3]:[4,v(it.ruleId)];case 2:return t.sent(),[3,5];case 3:return[4,f(it.variantId)];case 4:t.sent(),t.label=5;case 5:return lt(null),null===(n=he.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:I.successToast,content:o(S,{message:"ruleDeletion"===nt?W:q})}),Rt(),oe&&oe(!1,se||void 0),[3,8];case 6:return e=t.sent(),console.error("Failed to delete variant",e),null===(r=he.current)||void 0===r||r.show({severity:"error",sticky:!1,className:I.errorToast,content:o(C,{message:(null===(l=null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.detail)||("ruleDeletion"===nt?Q:z)})}),[3,8];case 7:return ut(!1),[7];case 8:return[2]}})})},onCancel:function(){return lt(null)},isLoading:st})]}):_t?o(w,{title:"Scope Not Found",errorMessage:"The selected scope does not exist. Please refresh the page or choose a valid scope.",onRetry:function(){return null==oe?void 0:oe(!0)},retryButtonText:"Refresh"}):i(l,{children:[o(d,{onCreate:jt,title:V,desc:P,button:J}),we&&o(D,{children:o(x,{isOpen:we,onClose:It,app_integration_id:ie,token:le,mode:"ADD",config:Te,pluginPayload:r(r({},Mt),{initialScope:Lt(),ruleSet:Dt}),renderContinueModal:!1})}),o(_,{})]})};export{A as default};
2
2
  //# sourceMappingURL=RuleContent.js.map
@@ -1,2 +1,2 @@
1
- import{__awaiter as e,__generator as t,__assign as r}from"tslib";import{createAxiosInstance as n,http as a}from"../../../api/transport.js";import{API_ENDPOINTS as o,LEGACY_API_ENDPOINTS as i}from"./apiConfig.js";import s from"../store/useAuthStore.js";import c from"../store/useEnvStore.js";import{useLearningTemplateStore as u}from"../store/useLearningTemplateStore.js";import{IL_CONFIG_CONSTANTS as l}from"../config.js";var d=!1,p=function(e){return e.interceptors.request.use(function(e){var t=s.getState().user,r=null==t?void 0:t.accessToken;return r&&(e.headers.Authorization="Bearer ".concat(r)),e}),e.interceptors.response.use(function(e){return e},function(e){var t;return 401===(null===(t=e.response)||void 0===t?void 0:t.status)&&"/login"!==window.location.pathname&&function(){if(!d){d=!0,localStorage.setItem("userActionLogout","true"),s.getState().logout();var e=c.getState().appsecBaseUrl;window.location.href="".concat(e,"/cross-signout?callback_url=").concat(window.location.origin,"/login")}}(),Promise.reject(e)}),e},g=function(e,t){return e.interceptors.request.use(function(e){return e.baseURL=t(),e}),e},v=function(e){return e.interceptors.request.use(function(e){return e.headers["x-full-url"]=window.location.href,e}),e},h=g(p(n({headers:{"Content-Type":"application/json"}})),function(){return c.getState().audacyBackendUrl||""}),f=g(v(p(n({headers:{"Content-Type":"application/json"}}))),function(){return c.getState().llmStudioUrl||""}),b=g(p(n({headers:{"Content-Type":"application/json"}})),function(){return c.getState().appsecRbacUrl||""}),w=g(p(n({headers:{"Content-Type":"application/json"}})),function(){return c.getState().appsecBaseUrl||""}),S=function(e){return g(v(p(n({headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},withCredentials:!0}))),function(){return c.getState().llmStudioUrl||""})},m=function(r,n){return e(void 0,void 0,void 0,function(){var e,n,a;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,t.label=1;case 1:return t.trys.push([1,3,,4]),n=e?i.publishFeedback:"".concat(o.publishFeedback),[4,f.post(n,r)];case 2:return[2,t.sent().data];case 3:throw a=t.sent(),console.error("Error publishing feedback to LLM Studio:",a),a;case 4:return[2]}})})},_=function(r){return e(void 0,void 0,void 0,function(){var e,n,a;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,n=e?i.submitChatFeedback:o.submitChatFeedback,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,f.post(n,r)];case 2:return[2,t.sent().data];case 3:throw a=t.sent(),console.error("Error submitting chat feedback:",a),a;case 4:return[2]}})})},y=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,f.post(o.saveInstantLearningQuestion,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error saving instant learning question:",e),e;case 3:return[2]}})})},I=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,t.label=1;case 1:if(t.trys.push([1,3,,4]),!r&&!1===e)throw new Error("App Integration ID is not provided. Falling back to legacy endpoint for fetching scopes.");return a=e?i.fetchScopes:"".concat(o.fetchScopes,"/").concat(r),[4,S(n).get(a)];case 2:return[2,t.sent().data];case 3:throw s=t.sent(),console.error("Error fetching rule sets:",s),s;case 4:return[2]}})})},k=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,t.label=1;case 1:return t.trys.push([1,3,,4]),a=e?i.renameScope:o.renameScope,[4,S(n).put(a,r)];case 2:return[2,t.sent().data];case 3:throw s=t.sent(),console.error("Error renaming scope:",s),s;case 4:return[2]}})})},C=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s,c;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,a=u.getState().app_integration_id,t.label=1;case 1:return t.trys.push([1,3,,4]),s=e?"".concat(i.getRulesInRuleSetById,"/").concat(r,"?include_config=True&sort_variant_by=createdAt"):"".concat(o.getRulesInRuleSetById,"/").concat(r,"/").concat(null!=a?a:""),console.log("this is endpoint",s),[4,S(n).get(s)];case 2:return[2,t.sent().data];case 3:return c=t.sent(),console.error("Error fetching rules in rule set:",c),[3,4];case 4:return[2]}})})},E=function(r){return e(void 0,void 0,void 0,function(){var e,n,a,s;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,n=u.getState().app_integration_id,t.label=1;case 1:return t.trys.push([1,3,,4]),a=e?"".concat(i.getRuleOverrideHistory,"/").concat(r):"".concat(o.getRuleOverrideHistory,"/").concat(r,"/").concat(null!=n?n:""),[4,f.get(a)];case 2:return[2,t.sent().data];case 3:throw s=t.sent(),console.error("Error getting rule override history:",s),s;case 4:return[2]}})})},R=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=u.getState().backwardCompatibility,a=e?i.createRuleSet:o.createRuleSet,[4,S(n).post(a,r)];case 1:return[2,t.sent().data];case 2:throw s=t.sent(),console.error("Error creating rule set:",s),s;case 3:return[2]}})})},P=function(r,n){return void 0===n&&(n=!1),e(void 0,void 0,void 0,function(){var e,a;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e="".concat(o.fetchStationsByKeyword.replace("{keyword}",r),"?allow_existing=").concat(n),[4,h.get(e)];case 1:return[2,t.sent().data];case 2:throw a=t.sent(),console.error("Error fetching station name by keyword:",a),a;case 3:return[2]}})})},T=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s,c;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,a=u.getState().app_integration_id,t.label=1;case 1:return t.trys.push([1,3,,4]),s=void 0,s=e?i.deleteRuleSet.replace("{ruleSetId}",r):o.deleteRuleSet.replace("{ruleSetId}",r).replace("{appIntegrationId}",null!=a?a:""),[4,S(n).delete(s)];case 2:return[2,t.sent().data];case 3:throw c=t.sent(),console.error("Error deleting rule set:",c),c;case 4:return[2]}})})},A=function(r){return e(void 0,void 0,void 0,function(){var e,n,a,s,c;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,n=u.getState().app_integration_id,a=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(s=i.deleteRule.replace("{ruleId}",r),[4,f.delete(s)]):[3,3];case 2:return[2,t.sent().data];case 3:return s=o.deleteRule.replace("{ruleId}",r).replace("{appIntegrationId}",null!=n?n:""),[4,S(a).delete(s)];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw c=t.sent(),console.error("Error deleting rule:",c),c;case 7:return[2]}})})},q=function(r){return e(void 0,void 0,void 0,function(){var e,n,a,s,c;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,n=u.getState().app_integration_id,a=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(s=i.deleteQuestion.replace("{questionId}",r),[4,f.delete(s)]):[3,3];case 2:return[2,t.sent().data];case 3:return s=o.deleteQuestion.replace("{questionId}",r).replace("{appIntegrationId}",null!=n?n:""),[4,S(a).delete(s)];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw c=t.sent(),console.error("Error deleting question:",c),c;case 7:return[2]}})})},U=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s,c,l;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,a=u.getState().app_integration_id,s=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(c=i.deleteTier.replace("{scopeId}",r).replace("{tierId}",n),[4,f.delete(c)]):[3,3];case 2:return[2,t.sent().data];case 3:return c=o.deleteTier.replace("{scopeId}",r).replace("{tierId}",n).replace("{appIntegrationId}",null!=a?a:""),[4,S(s).delete(c)];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw l=t.sent(),console.error("Error deleting tier:",l),l;case 7:return[2]}})})},j=function(r,n){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,f.put(o.updateVariant,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error updating variant:",e),e;case 3:return[2]}})})},B=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,f.post(i.inheritScope,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error inheriting scope:",e),e;case 3:return[2]}})})},L=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),(null==r?void 0:r.application_mapping_id)?[4,f.post(o.inheritScope,r)]:[3,2];case 1:return[2,t.sent().data];case 2:throw Error("Fatal Error: Trying to call inherit API without appintegration ID");case 3:return[3,5];case 4:throw e=t.sent(),console.error("Error inheriting scope:",e),e;case 5:return[2]}})})},x=function(r){return e(void 0,void 0,void 0,function(){var e,n,a,i,s;return t(this,function(t){switch(t.label){case 0:if(!r)throw new Error("scopeId is required for exporting rule sets");e=u.getState().backwardCompatibility,n=u.getState().app_integration_id,a=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?[4,f.post(o.exportRuleSet,{scope_id:r},{responseType:"blob"})]:[3,3];case 2:return[2,t.sent().data];case 3:return i=o.exportScope.replace("{scopeId}",r).replace("{appIntegrationId}",null!=n?n:""),[4,S(a).get(i,{responseType:"blob"})];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw s=t.sent(),console.error("Error exporting rule set:",s),s;case 7:return[2]}})})},O=function(r,n,a){return e(void 0,void 0,void 0,function(){var e,a,s,c;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,a=u.getState().app_integration_id,s=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?[4,S(s).patch(i.toggleVariant,{variant_ids:r,is_enabled:n})]:[3,3];case 2:return[2,t.sent().data];case 3:return[4,S(s).patch(o.toggleVariant,{variant_ids:r,application_mapping_id:a,is_enabled:n})];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw c=t.sent(),console.error("Error toggling variant status:",c),c;case 7:return[2]}})})},M=function(){return e(void 0,void 0,void 0,function(){var e,r,n,a,s,c,d,p;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,r=u.getState().app_integration_id,n=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(a=l.CUSTOM_SCOPE_GROUP_NAME,[4,S(n).post(i.getTiers,{tier_group_name:a})]):[3,3];case 2:return s=t.sent(),u.getState().setTiers((null===(d=s.data)||void 0===d?void 0:d.response)||[]),[3,5];case 3:return[4,S(n).get(o.getTiers.replace("{appIntegrationId}",null!=r?r:""))];case 4:s=t.sent(),"success"===(null===(p=s.data)||void 0===p?void 0:p.status)&&u.getState().setTiers(s.data.data.map(function(e){return{tier_id:e.id,tier_name:e.tier_title,tier_priority:e.tier_priority}})),t.label=5;case 5:return[3,7];case 6:throw c=t.sent(),console.error("Error fetching tiers:",c),c;case 7:return[2]}})})},F=function(r,n,a,s,c){return e(void 0,void 0,void 0,function(){var e,l,d,p,g,v;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,l=u.getState().app_integration_id,d=u.getState().token,t.label=1;case 1:return t.trys.push([1,3,,4]),p=e?i.alterRulePriority:o.alterRulePriority,g=e?{scopeId:r,tierId:n,move:{movedRuleId:a,prevRuleId:s,nextRuleId:c}}:{scope_id:r,tier_id:n,move:{moved_rule_id:a,prev_rule_id:s,next_rule_id:c},application_mapping_id:l},[4,S(d).put(p,g)];case 2:return[2,t.sent().data];case 3:throw v=t.sent(),console.error("Error altering question priority:",v),v;case 4:return[2]}})})},V=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s,c,l;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,a=u.getState().app_integration_id,s=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(c=i.fetchRulesByQuestionId.replace("{questionId}",r).replace("{scopeId}",n),[4,f.get(c)]):[3,3];case 2:return[2,t.sent().data];case 3:return c=o.fetchRulesByQuestionId.replace("{appIntegrationId}",null!=a?a:"").replace("{questionId}",r).replace("{scopeId}",n),[4,S(s).get(c)];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw l=t.sent(),console.error("Error fetching rules by question id:",l),l;case 7:return[2]}})})},z=function(r){return void 0===r&&(r={limit:"50",offset:"0"}),e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,f.post(o.retrieveGenreScopes,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error retrieving genre scopes:",e),e;case 3:return[2]}})})},D=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,f.post(o.searchScopes,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error searching scopes:",e),e;case 3:return[2]}})})},Q=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,o,i,s,c,u,l,d,p,g,v,h,f,b,S,m;return t(this,function(t){switch(t.label){case 0:a=(e=n||{}).isPopulateRoles,o=void 0!==a&&a,i=e.isPopulatePermissions,s=void 0!==i&&i,c=e.isPopulateApps,u=void 0!==c&&c,l=e.isPopulateEnvironments,d=void 0!==l&&l,p=e.isPopulateOperations,g=void 0!==p&&p,v=e.isPopulateGroups,h=void 0!==v&&v,f=e.isPopulateOrganization,b=void 0!==f&&f,S=new URLSearchParams({search:r,isPopulateRoles:String(o),isPopulatePermissions:String(s),isPopulateApps:String(u),isPopulateEnvironments:String(d),isPopulateOperations:String(g),isPopulateGroups:String(h),isPopulateOrganization:String(b)}),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,w.get("/api/user/get-by-query-v2?".concat(S.toString()))];case 2:return[2,t.sent().data];case 3:throw m=t.sent(),console.error("Failed to fetch users",m),m;case 4:return[2]}})})},G=function(r){return void 0===r&&(r={}),e(void 0,void 0,void 0,function(){var e,n,a,o,i,s,c,u,l,d,p,g,v,h,f,w;return t(this,function(t){switch(t.label){case 0:e=r.appId,n=void 0===e?"":e,a=r.name,o=void 0===a?"":a,i=r.user,s=void 0===i?"":i,c=r.isActive,u=void 0===c||c,l=r.page,d=void 0===l?1:l,p=r.limit,g=void 0===p?10:p,v=r.pagination,h=void 0===v||v,f=new URLSearchParams({appId:n,name:o,user:s,isActive:String(u),page:String(d),limit:String(g),pagination:String(h)}),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,b.get("/groups?".concat(f.toString()))];case 2:return[2,t.sent().data];case 3:throw w=t.sent(),console.error("Failed to fetch user groups",w),w;case 4:return[2]}})})},H=function(n){var a=n.variant_ids,s=n.status,l=n.feedback,d=n.scopeId,p=n.is_deleted,g=n.appsecData;return e(void 0,void 0,void 0,function(){var e,n,v,h,b,w,m;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,n=u.getState().app_integration_id,v=u.getState().token,h=c.getState().baseModeName,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(w=i.updateVariantStatus.replace("{scopeId}",d),b=r({variant_ids:a,status:s,feedback:l||"",is_deleted:null!=p&&p},g&&{appsecData:g}),[4,S(v).patch(w,b)]):[3,3];case 2:return[2,t.sent().data];case 3:return b=r({variant_ids:a,scope_id:d,application_mapping_id:n,status:s,feedback:l||"",is_deleted:null!=p&&p},g&&{appsecData:g}),w=o.updateVariantStatus,h&&(w+="?mode_name=".concat(encodeURIComponent(h))),[4,f.put(w,b)];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw m=t.sent(),console.log(m),m;case 7:return[2]}})})},N=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,b.get("/roles?appId=".concat(r))];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error(e),e;case 3:return[2]}})})},K=function(r,n){return void 0===n&&(n=!1),e(void 0,void 0,void 0,function(){var e,a,s,c,l,d,p,g,v,h,b,w;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,a=u.getState().app_integration_id,s=u.getState().token,c=u.getState().ilInstanceId,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(l=window.location.href,d=l.match(/\/mode\/([^/?#]+)/),p=d?d[1]:"",b=void 0,n?b={scope_id:null,access_type:"application",mode_learning_endpoint:p?"mode/".concat(p,"/settings/rules/access-management"):""}:(g=l.indexOf("/mode"),v=-1!==g?l.substring(g+1):(window.location.pathname+window.location.search).substring(1),b={scope_id:r,mode_learning_endpoint:"".concat(v,"&section=access")}),[4,f.post(i.requestAccess,b)]):[3,3];case 2:return[2,t.sent().data];case 3:return h="mode/".concat("Instant%20Learning%20Mode","/instant-learning/").concat(c,"/learning-management/").concat(a),b=void 0,b=n?{scope_id:null,application_mapping_id:a,mode_learning_endpoint:"".concat(h,"/access-management")}:{scope_id:r,application_mapping_id:a,mode_learning_endpoint:"".concat(h,"?rulesetid=").concat(r,"&section=access")},[4,S(s).post(o.requestAccess,b)];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw w=t.sent(),console.error("Error requesting global scope access:",w),w;case 7:return[2]}})})};function J(e,t,r){var n=o.getValueType.replace("{appIntegrationId}",t),a=r?"?config_template_id=".concat(encodeURIComponent(r)):"";return"".concat(e).concat(n).concat(a)}function W(n,o,i,s){var c,u,l,d,p;return e(this,void 0,void 0,function(){var e,g,v,h;return t(this,function(t){switch(t.label){case 0:return[4,a.get(J(n,o,s),{headers:{Authorization:"Bearer ".concat(i)}})];case 1:return e=t.sent(),!(g=e.data)||Array.isArray(g.data)&&0===g.data.length?[2,{lmsConfig:null,teachMeConfig:null,template:null}]:(v=null===(c=g.data[0])||void 0===c?void 0:c.value_type_config,[2,{lmsConfig:(h=null!==(u=null==v?void 0:v.learningManagement)&&void 0!==u?u:null)?r(r({},h),{agents:null!==(l=null==v?void 0:v.agents)&&void 0!==l?l:{}}):null,teachMeConfig:null!==(d=null==v?void 0:v.teachMe)&&void 0!==d?d:null,template:null!==(p=null==v?void 0:v.template)&&void 0!==p?p:null}])}})})}function X(r,n){var a,i;return e(this,void 0,void 0,function(){var e,s;return t(this,function(t){switch(t.label){case 0:return e=o.getRBACConfig.replace("{appIntegrationId}",r),[4,S(n).get(e)];case 1:return s=t.sent(),[2,null!==(i=null===(a=s.data)||void 0===a?void 0:a.data)&&void 0!==i?i:null]}})})}var Y=function(r){return e(void 0,void 0,void 0,function(){var e,n;return t(this,function(t){switch(t.label){case 0:e=u.getState().token,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,S(e).get("".concat(o.getILInstance).concat(r))];case 2:return[2,t.sent().data];case 3:throw n=t.sent(),console.error("Error fetching IL instance:",n),n;case 4:return[2]}})})};export{H as ApproveOrRejectVariants,N as GetAppsecRoles,F as alterQuestionPriority,b as appsecApi,w as appsecApigetUser,G as appsecGetUserGroups,Q as appsecGetUsersByQueryLite,h as audacyApi,J as buildValueTypeUrl,R as createRuleSet,f as default,q as deleteQuestion,A as deleteRule,T as deleteRuleSet,U as deleteTier,x as exportRuleSet,W as fetchLMSConfig,X as fetchRBACConfig,V as fetchRulesByQuestionId,I as fetchScopes,P as fetchStationsByKeyword,M as fetchTiers,Y as getILInstance,E as getRuleOverrideHistory,C as getRulesInRuleSetById,L as inheritScope,B as inheritScopeBackwardCompatible,S as llmApiWithToken,m as publishFeedback,k as renameScope,K as requestAccess,z as retrieveGenreScopes,y as saveInstantLearningQuestion,D as searchScopes,_ as submitChatFeedback,O as toggleVariant,j as updateVariant};
1
+ import{__awaiter as e,__generator as t,__assign as r}from"tslib";import{createAxiosInstance as n,http as a}from"../../../api/transport.js";import{API_ENDPOINTS as o,LEGACY_API_ENDPOINTS as i}from"./apiConfig.js";import s from"../store/useAuthStore.js";import c from"../store/useEnvStore.js";import{useLearningTemplateStore as u}from"../store/useLearningTemplateStore.js";import{IL_CONFIG_CONSTANTS as l}from"../config.js";var d=!1,p=function(e){return e.interceptors.request.use(function(e){var t=s.getState().user,r=null==t?void 0:t.accessToken;return r&&(e.headers.Authorization="Bearer ".concat(r)),e}),e.interceptors.response.use(function(e){return e},function(e){var t;return 401===(null===(t=e.response)||void 0===t?void 0:t.status)&&"/login"!==window.location.pathname&&function(){if(!d){d=!0,localStorage.setItem("userActionLogout","true"),s.getState().logout();var e=c.getState().appsecBaseUrl;window.location.href="".concat(e,"/cross-signout?callback_url=").concat(window.location.origin,"/login")}}(),Promise.reject(e)}),e},g=function(e,t){return e.interceptors.request.use(function(e){return e.baseURL=t(),e}),e},v=function(e){return e.interceptors.request.use(function(e){return e.headers["x-full-url"]=window.location.href,e}),e},h=g(p(n({headers:{"Content-Type":"application/json"}})),function(){return c.getState().audacyBackendUrl||""}),f=g(v(p(n({headers:{"Content-Type":"application/json"}}))),function(){return c.getState().llmStudioUrl||""}),b=g(p(n({headers:{"Content-Type":"application/json"}})),function(){return c.getState().appsecRbacUrl||""}),w=g(p(n({headers:{"Content-Type":"application/json"}})),function(){return c.getState().appsecBaseUrl||""}),S=function(e){return g(v(p(n({headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},withCredentials:!0}))),function(){return c.getState().llmStudioUrl||""})},m=function(r,n){return e(void 0,void 0,void 0,function(){var e,n,a;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,t.label=1;case 1:return t.trys.push([1,3,,4]),n=e?i.publishFeedback:"".concat(o.publishFeedback),[4,f.post(n,r)];case 2:return[2,t.sent().data];case 3:throw a=t.sent(),console.error("Error publishing feedback to LLM Studio:",a),a;case 4:return[2]}})})},_=function(r){return e(void 0,void 0,void 0,function(){var e,n,a;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,n=e?i.submitChatFeedback:o.submitChatFeedback,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,f.post(n,r)];case 2:return[2,t.sent().data];case 3:throw a=t.sent(),console.error("Error submitting chat feedback:",a),a;case 4:return[2]}})})},y=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,f.post(o.saveInstantLearningQuestion,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error saving instant learning question:",e),e;case 3:return[2]}})})},I=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,t.label=1;case 1:if(t.trys.push([1,3,,4]),!r&&!1===e)throw new Error("App Integration ID is not provided. Falling back to legacy endpoint for fetching scopes.");return a=e?i.fetchScopes:"".concat(o.fetchScopes,"/").concat(r),[4,S(n).get(a)];case 2:return[2,t.sent().data];case 3:throw s=t.sent(),console.error("Error fetching rule sets:",s),s;case 4:return[2]}})})},k=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,t.label=1;case 1:return t.trys.push([1,3,,4]),a=e?i.renameScope:o.renameScope,[4,S(n).put(a,r)];case 2:return[2,t.sent().data];case 3:throw s=t.sent(),console.error("Error renaming scope:",s),s;case 4:return[2]}})})},C=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s,c;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,a=u.getState().app_integration_id,t.label=1;case 1:return t.trys.push([1,3,,4]),s=e?"".concat(i.getRulesInRuleSetById,"/").concat(r,"?include_config=True&sort_variant_by=createdAt"):"".concat(o.getRulesInRuleSetById,"/").concat(r,"/").concat(null!=a?a:""),console.log("this is endpoint",s),[4,S(n).get(s)];case 2:return[2,t.sent().data];case 3:return c=t.sent(),console.error("Error fetching rules in rule set:",c),[3,4];case 4:return[2]}})})},E=function(r){return e(void 0,void 0,void 0,function(){var e,n,a,s;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,n=u.getState().app_integration_id,t.label=1;case 1:return t.trys.push([1,3,,4]),a=e?"".concat(i.getRuleOverrideHistory,"/").concat(r):"".concat(o.getRuleOverrideHistory,"/").concat(r,"/").concat(null!=n?n:""),[4,f.get(a)];case 2:return[2,t.sent().data];case 3:throw s=t.sent(),console.error("Error getting rule override history:",s),s;case 4:return[2]}})})},R=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=u.getState().backwardCompatibility,a=e?i.createRuleSet:o.createRuleSet,[4,S(n).post(a,r)];case 1:return[2,t.sent().data];case 2:throw s=t.sent(),console.error("Error creating rule set:",s),s;case 3:return[2]}})})},P=function(r,n){return void 0===n&&(n=!1),e(void 0,void 0,void 0,function(){var e,a;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e="".concat(o.fetchStationsByKeyword.replace("{keyword}",r),"?allow_existing=").concat(n),[4,h.get(e)];case 1:return[2,t.sent().data];case 2:throw a=t.sent(),console.error("Error fetching station name by keyword:",a),a;case 3:return[2]}})})},T=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s,c;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,a=u.getState().app_integration_id,t.label=1;case 1:return t.trys.push([1,3,,4]),s=void 0,s=e?i.deleteRuleSet.replace("{ruleSetId}",r):o.deleteRuleSet.replace("{ruleSetId}",r).replace("{appIntegrationId}",null!=a?a:""),[4,S(n).delete(s)];case 2:return[2,t.sent().data];case 3:throw c=t.sent(),console.error("Error deleting rule set:",c),c;case 4:return[2]}})})},A=function(r){return e(void 0,void 0,void 0,function(){var e,n,a,s,c;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,n=u.getState().app_integration_id,a=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(s=i.deleteRule.replace("{ruleId}",r),[4,f.delete(s)]):[3,3];case 2:return[2,t.sent().data];case 3:return s=o.deleteRule.replace("{ruleId}",r).replace("{appIntegrationId}",null!=n?n:""),[4,S(a).delete(s)];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw c=t.sent(),console.error("Error deleting rule:",c),c;case 7:return[2]}})})},q=function(r){return e(void 0,void 0,void 0,function(){var e,n,a,s,c;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,n=u.getState().app_integration_id,a=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(s=i.deleteQuestion.replace("{questionId}",r),[4,f.delete(s)]):[3,3];case 2:return[2,t.sent().data];case 3:return s=o.deleteQuestion.replace("{questionId}",r).replace("{appIntegrationId}",null!=n?n:""),[4,S(a).delete(s)];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw c=t.sent(),console.error("Error deleting question:",c),c;case 7:return[2]}})})},U=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s,c,l;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,a=u.getState().app_integration_id,s=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(c=i.deleteTier.replace("{scopeId}",r).replace("{tierId}",n),[4,f.delete(c)]):[3,3];case 2:return[2,t.sent().data];case 3:return c=o.deleteTier.replace("{scopeId}",r).replace("{tierId}",n).replace("{appIntegrationId}",null!=a?a:""),[4,S(s).delete(c)];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw l=t.sent(),console.error("Error deleting tier:",l),l;case 7:return[2]}})})},j=function(r,n){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,f.put(o.updateVariant,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error updating variant:",e),e;case 3:return[2]}})})},B=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,f.post(i.inheritScope,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error inheriting scope:",e),e;case 3:return[2]}})})},L=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),(null==r?void 0:r.application_mapping_id)?[4,f.post(o.inheritScope,r)]:[3,2];case 1:return[2,t.sent().data];case 2:throw Error("Fatal Error: Trying to call inherit API without appintegration ID");case 3:return[3,5];case 4:throw e=t.sent(),console.error("Error inheriting scope:",e),e;case 5:return[2]}})})},x=function(r){return e(void 0,void 0,void 0,function(){var e,n,a,i,s;return t(this,function(t){switch(t.label){case 0:if(!r)throw new Error("scopeId is required for exporting rule sets");e=u.getState().backwardCompatibility,n=u.getState().app_integration_id,a=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?[4,f.post(o.exportRuleSet,{scope_id:r},{responseType:"blob"})]:[3,3];case 2:return[2,t.sent().data];case 3:return i=o.exportScope.replace("{scopeId}",r).replace("{appIntegrationId}",null!=n?n:""),[4,S(a).get(i,{responseType:"blob"})];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw s=t.sent(),console.error("Error exporting rule set:",s),s;case 7:return[2]}})})},O=function(r,n,a){return e(void 0,void 0,void 0,function(){var e,a,s,c;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,a=u.getState().app_integration_id,s=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?[4,S(s).patch(i.toggleVariant,{variant_ids:r,is_enabled:n})]:[3,3];case 2:return[2,t.sent().data];case 3:return[4,S(s).patch(o.toggleVariant,{variant_ids:r,application_mapping_id:a,is_enabled:n})];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw c=t.sent(),console.error("Error toggling variant status:",c),c;case 7:return[2]}})})},M=function(){return e(void 0,void 0,void 0,function(){var e,r,n,a,s,c,d,p;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,r=u.getState().app_integration_id,n=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(a=l.CUSTOM_SCOPE_GROUP_NAME,[4,S(n).post(i.getTiers,{tier_group_name:a})]):[3,3];case 2:return s=t.sent(),u.getState().setTiers((null===(d=s.data)||void 0===d?void 0:d.response)||[]),[3,5];case 3:return[4,S(n).get(o.getTiers.replace("{appIntegrationId}",null!=r?r:""))];case 4:s=t.sent(),"success"===(null===(p=s.data)||void 0===p?void 0:p.status)&&u.getState().setTiers(s.data.data.map(function(e){return{tier_id:e.id,tier_name:e.tier_title,tier_priority:e.tier_priority}})),t.label=5;case 5:return[3,7];case 6:throw c=t.sent(),console.error("Error fetching tiers:",c),c;case 7:return[2]}})})},F=function(r,n,a,s,c){return e(void 0,void 0,void 0,function(){var e,l,d,p,g,v;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,l=u.getState().app_integration_id,d=u.getState().token,t.label=1;case 1:return t.trys.push([1,3,,4]),p=e?i.alterRulePriority:o.alterRulePriority,g=e?{scopeId:r,tierId:n,move:{movedRuleId:a,prevRuleId:s,nextRuleId:c}}:{scope_id:r,tier_id:n,move:{moved_rule_id:a,prev_rule_id:s,next_rule_id:c},application_mapping_id:l},[4,S(d).put(p,g)];case 2:return[2,t.sent().data];case 3:throw v=t.sent(),console.error("Error altering question priority:",v),v;case 4:return[2]}})})},V=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,s,c,l;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,a=u.getState().app_integration_id,s=u.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(c=i.fetchRulesByQuestionId.replace("{questionId}",r).replace("{scopeId}",n),[4,f.get(c)]):[3,3];case 2:return[2,t.sent().data];case 3:return c=o.fetchRulesByQuestionId.replace("{appIntegrationId}",null!=a?a:"").replace("{questionId}",r).replace("{scopeId}",n),[4,S(s).get(c)];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw l=t.sent(),console.error("Error fetching rules by question id:",l),l;case 7:return[2]}})})},z=function(r){return void 0===r&&(r={limit:"50",offset:"0"}),e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,f.post(o.retrieveGenreScopes,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error retrieving genre scopes:",e),e;case 3:return[2]}})})},D=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,f.post(o.searchScopes,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error searching scopes:",e),e;case 3:return[2]}})})},Q=function(r,n){return e(void 0,void 0,void 0,function(){var e,a,o,i,s,c,u,l,d,p,g,v,h,f,b,S,m;return t(this,function(t){switch(t.label){case 0:a=(e=n||{}).isPopulateRoles,o=void 0!==a&&a,i=e.isPopulatePermissions,s=void 0!==i&&i,c=e.isPopulateApps,u=void 0!==c&&c,l=e.isPopulateEnvironments,d=void 0!==l&&l,p=e.isPopulateOperations,g=void 0!==p&&p,v=e.isPopulateGroups,h=void 0!==v&&v,f=e.isPopulateOrganization,b=void 0!==f&&f,S=new URLSearchParams({search:r,isPopulateRoles:String(o),isPopulatePermissions:String(s),isPopulateApps:String(u),isPopulateEnvironments:String(d),isPopulateOperations:String(g),isPopulateGroups:String(h),isPopulateOrganization:String(b)}),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,w.get("/api/user/get-by-query-v2?".concat(S.toString()))];case 2:return[2,t.sent().data];case 3:throw m=t.sent(),console.error("Failed to fetch users",m),m;case 4:return[2]}})})},G=function(r){return void 0===r&&(r={}),e(void 0,void 0,void 0,function(){var e,n,a,o,i,s,c,u,l,d,p,g,v,h,f,w;return t(this,function(t){switch(t.label){case 0:e=r.appId,n=void 0===e?"":e,a=r.name,o=void 0===a?"":a,i=r.user,s=void 0===i?"":i,c=r.isActive,u=void 0===c||c,l=r.page,d=void 0===l?1:l,p=r.limit,g=void 0===p?10:p,v=r.pagination,h=void 0===v||v,f=new URLSearchParams({appId:n,name:o,user:s,isActive:String(u),page:String(d),limit:String(g),pagination:String(h)}),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,b.get("/groups?".concat(f.toString()))];case 2:return[2,t.sent().data];case 3:throw w=t.sent(),console.error("Failed to fetch user groups",w),w;case 4:return[2]}})})},H=function(n){var a=n.variant_ids,s=n.status,l=n.feedback,d=n.scopeId,p=n.is_deleted,g=n.appsecData;return e(void 0,void 0,void 0,function(){var e,n,v,h,b,w,m;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,n=u.getState().app_integration_id,v=u.getState().token,h=c.getState().baseModeName,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(w=i.updateVariantStatus.replace("{scopeId}",d),b=r({variant_ids:a,status:s,feedback:l||"",is_deleted:null!=p&&p},g&&{appsecData:g}),[4,S(v).patch(w,b)]):[3,3];case 2:return[2,t.sent().data];case 3:return b=r({variant_ids:a,scope_id:d,application_mapping_id:n,status:s,feedback:l||"",is_deleted:null!=p&&p},g&&{appsecData:g}),w=o.updateVariantStatus,h&&(w+="?mode_name=".concat(encodeURIComponent(h))),[4,f.put(w,b)];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw m=t.sent(),console.log(m),m;case 7:return[2]}})})},N=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,b.get("/roles?appId=".concat(r))];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error(e),e;case 3:return[2]}})})},K=function(n){return e(void 0,void 0,void 0,function(){return t(this,function(e){switch(e.label){case 0:return[4,b.post("/acl",r(r({},n),{is_inherited:!1}))];case 1:return[2,e.sent().data]}})})},J=function(r,n){return void 0===n&&(n=!1),e(void 0,void 0,void 0,function(){var e,a,s,c,l,d,p,g,v,h,b,w;return t(this,function(t){switch(t.label){case 0:e=u.getState().backwardCompatibility,a=u.getState().app_integration_id,s=u.getState().token,c=u.getState().ilInstanceId,t.label=1;case 1:return t.trys.push([1,6,,7]),e?(l=window.location.href,d=l.match(/\/mode\/([^/?#]+)/),p=d?d[1]:"",b=void 0,n?b={scope_id:null,access_type:"application",mode_learning_endpoint:p?"mode/".concat(p,"/settings/rules/access-management"):""}:(g=l.indexOf("/mode"),v=-1!==g?l.substring(g+1):(window.location.pathname+window.location.search).substring(1),b={scope_id:r,mode_learning_endpoint:"".concat(v,"&section=access")}),[4,f.post(i.requestAccess,b)]):[3,3];case 2:return[2,t.sent().data];case 3:return h="mode/".concat("Instant%20Learning%20Mode","/instant-learning/").concat(c,"/learning-management/").concat(a),b=void 0,b=n?{scope_id:null,application_mapping_id:a,mode_learning_endpoint:"".concat(h,"/access-management")}:{scope_id:r,application_mapping_id:a,mode_learning_endpoint:"".concat(h,"?rulesetid=").concat(r,"&section=access")},[4,S(s).post(o.requestAccess,b)];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw w=t.sent(),console.error("Error requesting global scope access:",w),w;case 7:return[2]}})})};function W(e,t,r){var n=o.getValueType.replace("{appIntegrationId}",t),a=r?"?config_template_id=".concat(encodeURIComponent(r)):"";return"".concat(e).concat(n).concat(a)}function X(n,o,i,s){var c,u,l,d,p;return e(this,void 0,void 0,function(){var e,g,v,h;return t(this,function(t){switch(t.label){case 0:return[4,a.get(W(n,o,s),{headers:{Authorization:"Bearer ".concat(i)}})];case 1:return e=t.sent(),!(g=e.data)||Array.isArray(g.data)&&0===g.data.length?[2,{lmsConfig:null,teachMeConfig:null,template:null}]:(v=null===(c=g.data[0])||void 0===c?void 0:c.value_type_config,[2,{lmsConfig:(h=null!==(u=null==v?void 0:v.learningManagement)&&void 0!==u?u:null)?r(r({},h),{agents:null!==(l=null==v?void 0:v.agents)&&void 0!==l?l:{}}):null,teachMeConfig:null!==(d=null==v?void 0:v.teachMe)&&void 0!==d?d:null,template:null!==(p=null==v?void 0:v.template)&&void 0!==p?p:null}])}})})}function Y(r,n){var a,i;return e(this,void 0,void 0,function(){var e,s;return t(this,function(t){switch(t.label){case 0:return e=o.getRBACConfig.replace("{appIntegrationId}",r),[4,S(n).get(e)];case 1:return s=t.sent(),[2,null!==(i=null===(a=s.data)||void 0===a?void 0:a.data)&&void 0!==i?i:null]}})})}var Z=function(r){return e(void 0,void 0,void 0,function(){var e,n;return t(this,function(t){switch(t.label){case 0:e=u.getState().token,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,S(e).get("".concat(o.getILInstance).concat(r))];case 2:return[2,t.sent().data];case 3:throw n=t.sent(),console.error("Error fetching IL instance:",n),n;case 4:return[2]}})})};export{H as ApproveOrRejectVariants,N as GetAppsecRoles,F as alterQuestionPriority,b as appsecApi,w as appsecApigetUser,G as appsecGetUserGroups,Q as appsecGetUsersByQueryLite,h as audacyApi,W as buildValueTypeUrl,R as createRuleSet,f as default,q as deleteQuestion,A as deleteRule,T as deleteRuleSet,U as deleteTier,x as exportRuleSet,X as fetchLMSConfig,Y as fetchRBACConfig,V as fetchRulesByQuestionId,I as fetchScopes,P as fetchStationsByKeyword,M as fetchTiers,Z as getILInstance,E as getRuleOverrideHistory,C as getRulesInRuleSetById,K as grantApplicationAccess,L as inheritScope,B as inheritScopeBackwardCompatible,S as llmApiWithToken,m as publishFeedback,k as renameScope,J as requestAccess,z as retrieveGenreScopes,y as saveInstantLearningQuestion,D as searchScopes,_ as submitChatFeedback,O as toggleVariant,j as updateVariant};
2
2
  //# sourceMappingURL=scopeApis.js.map
@@ -0,0 +1,2 @@
1
+ import"react";var t="data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E";export{t as default};
2
+ //# sourceMappingURL=Search-result(add new).svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Search-result(add new).svg.js","sources":["../../../../src/features/LearningManagement/assets/Search-result(add new).svg"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E\""],"names":["EmptyResultIconSVG"],"mappings":"cA0KA,IAAAA,EAAe"}
@@ -0,0 +1,2 @@
1
+ import{__assign as e,__awaiter as l,__generator as r}from"tslib";import{jsx as i,jsxs as a,Fragment as n}from"react/jsx-runtime";import{useState as s,useEffect as t}from"react";import{X as c,Loader2 as o}from"lucide-react";import d from"../styles/CreateLearningSetModal.module.css.js";var u=function(u){var m=u.isOpen,v=u.onClose,h=u.onSubmit,p=u.title,f=u.description,b=u.inputLabel,N=u.submitLabel,g=u.placeholder,C=void 0===g?"":g,y=u.initialValue,k=void 0===y?"":y,x=u.isLoading,L=void 0!==x&&x,S=s(""),B=S[0],M=S[1],j=s(null),w=j[0],E=j[1];if(t(function(){m&&(M(k),E(null))},[m,k]),!m)return null;return i("div",e({className:d.overlay},{children:a("div",e({className:d.modal},{children:[a("div",e({className:d.header},{children:[a("div",e({className:d.headerContent},{children:[i("h2",e({className:d.title},{children:p})),f&&i("p",e({className:d.description},{children:f}))]})),i("button",e({onClick:v,className:d.closeBtn,disabled:L},{children:i(c,{size:24})}))]})),i("div",e({className:d.form},{children:a("div",e({className:d.formGroup},{children:[a("label",e({className:d.label},{children:[i("span",e({className:d.asterisk},{children:"*"})),b]})),i("input",{type:"text",value:B,onChange:function(e){var l=e.target.value;if(l.length>50)return M(l.slice(0,50)),void E("Maximum 50 characters allowed");M(l),w&&E(null)},className:"".concat(d.inputField," ").concat(w?d.inputError:""),placeholder:C,disabled:L}),w&&i("p",e({className:d.errorMessage},{children:w}))]}))})),a("div",e({className:d.footer},{children:[i("button",e({onClick:v,className:d.cancelBtn,disabled:L},{children:"Cancel"})),i("button",e({onClick:function(){return l(void 0,void 0,void 0,function(){var e,l,i;return r(this,function(r){switch(r.label){case 0:if(!(B.trim()?(E(null),1):(E("".concat(b.replace("*","").trim()," is required")),0)))return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,h(B)];case 2:return r.sent(),v(),[3,4];case 3:return e=r.sent(),console.error("Error in submission",e),409===(null==e?void 0:e.status)?(E(null===(i=null===(l=null==e?void 0:e.response)||void 0===l?void 0:l.data)||void 0===i?void 0:i.message),[2]):(E((null==e?void 0:e.message)||"An error occurred. Please try again."),[3,4]);case 4:return[2]}})})},className:d.confirmBtn,disabled:L},{children:L?a(n,{children:[i(o,{className:d.spinner}),"Save"===N?"Saving...":"Creating..."]}):N}))]}))]}))}))};export{u as default};
2
+ //# sourceMappingURL=CreateLearningSetModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateLearningSetModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}