@coorpacademy/components 11.34.2 → 11.34.3-alpha.29

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 (215) hide show
  1. package/es/atom/button-link/index.js.map +1 -1
  2. package/es/atom/button-link/style.css +2 -2
  3. package/es/atom/cta/test/fixtures/primary.d.ts +9 -0
  4. package/es/atom/cta/test/fixtures/primary.d.ts.map +1 -0
  5. package/es/atom/cta/test/fixtures/secondary.d.ts +10 -0
  6. package/es/atom/cta/test/fixtures/secondary.d.ts.map +1 -0
  7. package/es/atom/icon/index.d.ts +30 -17
  8. package/es/atom/icon/index.d.ts.map +1 -1
  9. package/es/atom/icon/index.js +4 -6
  10. package/es/atom/icon/index.js.map +1 -1
  11. package/es/atom/radio-with-title/index.d.ts +16 -3
  12. package/es/atom/radio-with-title/index.d.ts.map +1 -1
  13. package/es/atom/radio-with-title/types.d.ts +16 -2
  14. package/es/atom/radio-with-title/types.d.ts.map +1 -1
  15. package/es/atom/tag/index.d.ts +15 -1
  16. package/es/atom/tag/style.css +1 -0
  17. package/es/atom/title/index.d.ts +16 -2
  18. package/es/molecule/base-modal/style.css +0 -1
  19. package/es/molecule/cm-popin/types.d.ts +33 -6
  20. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  21. package/es/molecule/progress-wrapper/index.d.ts.map +1 -1
  22. package/es/molecule/progress-wrapper/index.js +39 -19
  23. package/es/molecule/progress-wrapper/index.js.map +1 -1
  24. package/es/molecule/progress-wrapper/style.css +37 -2
  25. package/es/molecule/skills-chart-side-information-item/index.d.ts +1 -1
  26. package/es/molecule/skills-chart-side-information-panel/index.d.ts +1 -1
  27. package/es/molecule/title-and-checkbox-wrapper/index.d.ts +16 -2
  28. package/es/molecule/title-radio-wrapper/index.d.ts +16 -3
  29. package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
  30. package/es/molecule/title-radio-wrapper/types.d.ts +16 -2
  31. package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
  32. package/es/organism/cards-grid/index.d.ts +48 -10
  33. package/es/organism/cards-grid/index.d.ts.map +1 -1
  34. package/es/organism/cards-grid/index.js +3 -2
  35. package/es/organism/cards-grid/index.js.map +1 -1
  36. package/es/organism/content-skill-modal/index.d.ts +16 -3
  37. package/es/organism/content-skill-modal/index.d.ts.map +1 -1
  38. package/es/organism/content-skill-modal/types.d.ts +15 -2
  39. package/es/organism/content-skill-modal/types.d.ts.map +1 -1
  40. package/es/organism/list-item/index.js +5 -5
  41. package/es/organism/list-item/index.js.map +1 -1
  42. package/es/organism/list-item/style.css +38 -19
  43. package/es/organism/list-items/index.d.ts +16 -2
  44. package/es/organism/rewards-form/index.d.ts +16 -2
  45. package/es/organism/select-opponents/index.d.ts +16 -3
  46. package/es/organism/select-opponents/index.d.ts.map +1 -1
  47. package/es/organism/select-opponents/types.d.ts +16 -2
  48. package/es/organism/select-opponents/types.d.ts.map +1 -1
  49. package/es/organism/sidebar/index.d.ts +2 -2
  50. package/es/organism/skill-edition/index.d.ts +76 -11
  51. package/es/organism/skill-edition/index.d.ts.map +1 -1
  52. package/es/organism/skill-edition/types.d.ts +76 -10
  53. package/es/organism/skill-edition/types.d.ts.map +1 -1
  54. package/es/organism/title-and-input/index.d.ts +31 -5
  55. package/es/organism/title-and-input/index.d.ts.map +1 -1
  56. package/es/organism/title-and-input/types.d.ts +30 -4
  57. package/es/organism/title-and-input/types.d.ts.map +1 -1
  58. package/es/organism/wizard-contents/index.d.ts +16 -2
  59. package/es/template/app-player/loading/index.d.ts +33 -6
  60. package/es/template/app-player/player/index.d.ts +65 -12
  61. package/es/template/app-player/player/slides/index.d.ts +33 -6
  62. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  63. package/es/template/app-player/popin-correction/index.d.ts +32 -6
  64. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  65. package/es/template/app-player/popin-end/index.d.ts +33 -6
  66. package/es/template/app-review/index.d.ts +33 -7
  67. package/es/template/app-review/index.d.ts.map +1 -1
  68. package/es/template/app-review/player/prop-types.d.ts +33 -6
  69. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  70. package/es/template/app-review/prop-types.d.ts +33 -6
  71. package/es/template/app-review/prop-types.d.ts.map +1 -1
  72. package/es/template/back-office/brand-update/index.d.ts +138 -20
  73. package/es/template/back-office/brand-update/utils.d.ts +1 -1
  74. package/es/template/certification-detail/style.css +5 -2
  75. package/es/template/common/dashboard/index.d.ts +65 -12
  76. package/es/template/common/search-page/index.d.ts +33 -6
  77. package/es/template/external-course/index.d.ts +33 -6
  78. package/es/template/skill-detail/all-courses.d.ts +61 -17
  79. package/es/template/skill-detail/all-courses.d.ts.map +1 -1
  80. package/es/template/skill-detail/all-courses.js +12 -11
  81. package/es/template/skill-detail/all-courses.js.map +1 -1
  82. package/es/template/skill-detail/continue-learning.d.ts +25 -12
  83. package/es/template/skill-detail/continue-learning.d.ts.map +1 -1
  84. package/es/template/skill-detail/continue-learning.js.map +1 -1
  85. package/es/template/skill-detail/index.d.ts +81 -71
  86. package/es/template/skill-detail/index.d.ts.map +1 -1
  87. package/es/template/skill-detail/index.js +93 -59
  88. package/es/template/skill-detail/index.js.map +1 -1
  89. package/es/template/skill-detail/style.css +96 -38
  90. package/es/variables/colors.d.ts +5 -1
  91. package/es/variables/colors.d.ts.map +1 -1
  92. package/es/variables/colors.js +6 -2
  93. package/es/variables/colors.js.map +1 -1
  94. package/lib/atom/button-link/index.js.map +1 -1
  95. package/lib/atom/button-link/style.css +2 -2
  96. package/lib/atom/cta/test/fixtures/primary.d.ts +9 -0
  97. package/lib/atom/cta/test/fixtures/primary.d.ts.map +1 -0
  98. package/lib/atom/cta/test/fixtures/secondary.d.ts +10 -0
  99. package/lib/atom/cta/test/fixtures/secondary.d.ts.map +1 -0
  100. package/lib/atom/icon/index.d.ts +30 -17
  101. package/lib/atom/icon/index.d.ts.map +1 -1
  102. package/lib/atom/icon/index.js +4 -6
  103. package/lib/atom/icon/index.js.map +1 -1
  104. package/lib/atom/radio-with-title/index.d.ts +16 -3
  105. package/lib/atom/radio-with-title/index.d.ts.map +1 -1
  106. package/lib/atom/radio-with-title/types.d.ts +16 -2
  107. package/lib/atom/radio-with-title/types.d.ts.map +1 -1
  108. package/lib/atom/tag/index.d.ts +15 -1
  109. package/lib/atom/tag/style.css +1 -0
  110. package/lib/atom/title/index.d.ts +16 -2
  111. package/lib/molecule/base-modal/style.css +0 -1
  112. package/lib/molecule/cm-popin/types.d.ts +33 -6
  113. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  114. package/lib/molecule/progress-wrapper/index.d.ts.map +1 -1
  115. package/lib/molecule/progress-wrapper/index.js +39 -19
  116. package/lib/molecule/progress-wrapper/index.js.map +1 -1
  117. package/lib/molecule/progress-wrapper/style.css +37 -2
  118. package/lib/molecule/skills-chart-side-information-item/index.d.ts +1 -1
  119. package/lib/molecule/skills-chart-side-information-panel/index.d.ts +1 -1
  120. package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +16 -2
  121. package/lib/molecule/title-radio-wrapper/index.d.ts +16 -3
  122. package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
  123. package/lib/molecule/title-radio-wrapper/types.d.ts +16 -2
  124. package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
  125. package/lib/organism/cards-grid/index.d.ts +48 -10
  126. package/lib/organism/cards-grid/index.d.ts.map +1 -1
  127. package/lib/organism/cards-grid/index.js +3 -2
  128. package/lib/organism/cards-grid/index.js.map +1 -1
  129. package/lib/organism/content-skill-modal/index.d.ts +16 -3
  130. package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
  131. package/lib/organism/content-skill-modal/types.d.ts +15 -2
  132. package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
  133. package/lib/organism/list-item/index.js +5 -5
  134. package/lib/organism/list-item/index.js.map +1 -1
  135. package/lib/organism/list-item/style.css +38 -19
  136. package/lib/organism/list-items/index.d.ts +16 -2
  137. package/lib/organism/rewards-form/index.d.ts +16 -2
  138. package/lib/organism/select-opponents/index.d.ts +16 -3
  139. package/lib/organism/select-opponents/index.d.ts.map +1 -1
  140. package/lib/organism/select-opponents/types.d.ts +16 -2
  141. package/lib/organism/select-opponents/types.d.ts.map +1 -1
  142. package/lib/organism/sidebar/index.d.ts +2 -2
  143. package/lib/organism/skill-edition/index.d.ts +76 -11
  144. package/lib/organism/skill-edition/index.d.ts.map +1 -1
  145. package/lib/organism/skill-edition/types.d.ts +76 -10
  146. package/lib/organism/skill-edition/types.d.ts.map +1 -1
  147. package/lib/organism/title-and-input/index.d.ts +31 -5
  148. package/lib/organism/title-and-input/index.d.ts.map +1 -1
  149. package/lib/organism/title-and-input/types.d.ts +30 -4
  150. package/lib/organism/title-and-input/types.d.ts.map +1 -1
  151. package/lib/organism/wizard-contents/index.d.ts +16 -2
  152. package/lib/template/app-player/loading/index.d.ts +33 -6
  153. package/lib/template/app-player/player/index.d.ts +65 -12
  154. package/lib/template/app-player/player/slides/index.d.ts +33 -6
  155. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  156. package/lib/template/app-player/popin-correction/index.d.ts +32 -6
  157. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  158. package/lib/template/app-player/popin-end/index.d.ts +33 -6
  159. package/lib/template/app-review/index.d.ts +33 -7
  160. package/lib/template/app-review/index.d.ts.map +1 -1
  161. package/lib/template/app-review/player/prop-types.d.ts +33 -6
  162. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  163. package/lib/template/app-review/prop-types.d.ts +33 -6
  164. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  165. package/lib/template/back-office/brand-update/index.d.ts +138 -20
  166. package/lib/template/back-office/brand-update/utils.d.ts +1 -1
  167. package/lib/template/certification-detail/style.css +5 -2
  168. package/lib/template/common/dashboard/index.d.ts +65 -12
  169. package/lib/template/common/search-page/index.d.ts +33 -6
  170. package/lib/template/external-course/index.d.ts +33 -6
  171. package/lib/template/skill-detail/all-courses.d.ts +61 -17
  172. package/lib/template/skill-detail/all-courses.d.ts.map +1 -1
  173. package/lib/template/skill-detail/all-courses.js +11 -11
  174. package/lib/template/skill-detail/all-courses.js.map +1 -1
  175. package/lib/template/skill-detail/continue-learning.d.ts +25 -12
  176. package/lib/template/skill-detail/continue-learning.d.ts.map +1 -1
  177. package/lib/template/skill-detail/continue-learning.js.map +1 -1
  178. package/lib/template/skill-detail/index.d.ts +81 -71
  179. package/lib/template/skill-detail/index.d.ts.map +1 -1
  180. package/lib/template/skill-detail/index.js +93 -59
  181. package/lib/template/skill-detail/index.js.map +1 -1
  182. package/lib/template/skill-detail/style.css +96 -38
  183. package/lib/variables/colors.d.ts +5 -1
  184. package/lib/variables/colors.d.ts.map +1 -1
  185. package/lib/variables/colors.js +6 -2
  186. package/lib/variables/colors.js.map +1 -1
  187. package/locales/bs/global.json +1 -0
  188. package/locales/cs/global.json +1 -0
  189. package/locales/de/global.json +1 -0
  190. package/locales/en/global.json +1 -0
  191. package/locales/es/global.json +1 -0
  192. package/locales/et/global.json +1 -0
  193. package/locales/fi/global.json +1 -0
  194. package/locales/fr/global.json +1 -0
  195. package/locales/hr/global.json +1 -0
  196. package/locales/hu/global.json +1 -0
  197. package/locales/hy/global.json +1 -0
  198. package/locales/it/global.json +1 -0
  199. package/locales/ja/global.json +1 -0
  200. package/locales/ko/global.json +1 -0
  201. package/locales/nl/global.json +1 -0
  202. package/locales/pl/global.json +1 -0
  203. package/locales/pt/global.json +1 -0
  204. package/locales/ro/global.json +1 -0
  205. package/locales/ru/global.json +1 -0
  206. package/locales/sk/global.json +1 -0
  207. package/locales/sl/global.json +1 -0
  208. package/locales/sv/global.json +1 -0
  209. package/locales/tl/global.json +1 -0
  210. package/locales/tr/global.json +1 -0
  211. package/locales/uk/global.json +1 -0
  212. package/locales/vi/global.json +1 -0
  213. package/locales/zh/global.json +1 -0
  214. package/locales/zh_TW/global.json +1 -0
  215. package/package.json +2 -2
@@ -1,8 +1,52 @@
1
- export default AllCourses;
2
- declare function AllCourses(props: any, context: any): JSX.Element;
3
- declare namespace AllCourses {
4
- namespace contextTypes {
5
- const skin: PropTypes.Requireable<PropTypes.InferProps<{
1
+ /// <reference types="react" />
2
+ import PropTypes from 'prop-types';
3
+ import { CardsGridProps } from '../../organism/cards-grid';
4
+ interface ProviderContext {
5
+ skin: {
6
+ common: {
7
+ primary: string;
8
+ secondary: string;
9
+ };
10
+ };
11
+ translate: (key: string, options?: any) => string;
12
+ }
13
+ interface ProviderContext {
14
+ skin: {
15
+ common: {
16
+ primary: string;
17
+ secondary: string;
18
+ };
19
+ };
20
+ translate: (key: string, options?: any) => string;
21
+ }
22
+ declare const AllCourses: {
23
+ (props: {
24
+ dataName?: string | undefined;
25
+ ariaLabel?: string | undefined;
26
+ selected?: boolean | undefined;
27
+ label?: string | undefined;
28
+ content: {
29
+ list: CardsGridProps['list'];
30
+ loading?: boolean;
31
+ };
32
+ totalContents?: number | undefined;
33
+ search: {
34
+ oldValue: string;
35
+ onChange: (value: string) => void;
36
+ };
37
+ bannerMicrolearning?: {
38
+ type: 'skill' | 'playlist';
39
+ action: () => void;
40
+ oldSwitchValue: boolean;
41
+ } | undefined;
42
+ filters: {
43
+ onChange?: ((value: string) => void) | undefined;
44
+ options?: unknown[] | undefined;
45
+ };
46
+ sorting?: unknown;
47
+ }, context: ProviderContext): JSX.Element;
48
+ contextTypes: {
49
+ skin: PropTypes.Requireable<PropTypes.InferProps<{
6
50
  common: PropTypes.Requireable<{
7
51
  [x: string]: any;
8
52
  }>;
@@ -23,18 +67,18 @@ declare namespace AllCourses {
23
67
  [x: string]: any;
24
68
  }>;
25
69
  }>>;
26
- const translate: PropTypes.Requireable<(...args: any[]) => any>;
27
- }
28
- namespace propTypes {
29
- const content: PropTypes.Requireable<PropTypes.InferProps<{
70
+ translate: PropTypes.Requireable<(...args: any[]) => any>;
71
+ };
72
+ propTypes: {
73
+ content: PropTypes.Requireable<PropTypes.InferProps<{
30
74
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
31
75
  customStyle: PropTypes.Requireable<{
32
76
  [x: string]: string | null | undefined;
33
77
  }>;
34
78
  loading: PropTypes.Requireable<boolean>;
35
79
  }>>;
36
- const totalContents: PropTypes.Requireable<number>;
37
- const filters: PropTypes.Requireable<PropTypes.InferProps<{
80
+ totalContents: PropTypes.Requireable<number>;
81
+ filters: PropTypes.Requireable<PropTypes.InferProps<{
38
82
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
39
83
  options: PropTypes.Requireable<(PropTypes.InferProps<{
40
84
  name: PropTypes.Validator<string>;
@@ -43,7 +87,7 @@ declare namespace AllCourses {
43
87
  validOption: PropTypes.Requireable<boolean>;
44
88
  }> | null | undefined)[]>;
45
89
  }>>;
46
- const sorting: PropTypes.Requireable<PropTypes.InferProps<{
90
+ sorting: PropTypes.Requireable<PropTypes.InferProps<{
47
91
  title: PropTypes.Requireable<string>;
48
92
  name: PropTypes.Requireable<string>;
49
93
  className: PropTypes.Requireable<string>;
@@ -74,16 +118,16 @@ declare namespace AllCourses {
74
118
  'aria-label': PropTypes.Requireable<string>;
75
119
  'aria-labelledby': PropTypes.Requireable<string>;
76
120
  }>>;
77
- const bannerMicrolearning: PropTypes.Requireable<PropTypes.InferProps<{
121
+ bannerMicrolearning: PropTypes.Requireable<PropTypes.InferProps<{
78
122
  type: PropTypes.Requireable<string>;
79
123
  action: PropTypes.Requireable<(...args: any[]) => any>;
80
124
  oldSwitchValue: PropTypes.Requireable<boolean>;
81
125
  }>>;
82
- const search: PropTypes.Requireable<PropTypes.InferProps<{
126
+ search: PropTypes.Requireable<PropTypes.InferProps<{
83
127
  oldValue: PropTypes.Requireable<string>;
84
128
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
85
129
  }>>;
86
- }
87
- }
88
- import PropTypes from "prop-types";
130
+ };
131
+ };
132
+ export default AllCourses;
89
133
  //# sourceMappingURL=all-courses.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AAgDA,mEA8JC"}
1
+ {"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAMnC,OAAkB,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAQpE,UAAU,eAAe;IACvB,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,OAAO,EAAE,MAAM,CAAC;YAChB,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IACF,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;CACnD;AAiDD,UAAU,eAAe;IACvB,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,OAAO,EAAE,MAAM,CAAC;YAChB,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IACF,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;CACnD;AAED,QAAA,MAAM,UAAU;;;;;;iBAMH;YACP,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;YAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;SACnB;;;sBAGW,MAAM;8BACE,MAAM,KAAK,IAAI;;;kBAG3B,OAAO,GAAG,UAAU;oBAClB,MAAM,IAAI;4BACF,OAAO;;;gCAGJ,MAAM,KAAK,IAAI;;;kBAG1B,OAAO;gBAEV,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgKzB,CAAC;AA0BF,eAAe,UAAU,CAAC"}
@@ -18,11 +18,13 @@ var _searchForm = _interopRequireDefault(require("../../molecule/search-form"));
18
18
  var _cardsGrid = _interopRequireDefault(require("../../organism/cards-grid"));
19
19
  var _inputSwitch = _interopRequireDefault(require("../../atom/input-switch"));
20
20
  var _banner = _interopRequireDefault(require("../../molecule/banner"));
21
+ var _colors = require("../../variables/colors");
21
22
  var _allCourses = _interopRequireDefault(require("./all-courses.css"));
22
23
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
23
24
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
25
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
25
26
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
27
+ // @ts-expect-error convert untypped
26
28
  const uncappedMap = _map2.default.convert({
27
29
  cap: false
28
30
  });
@@ -40,8 +42,8 @@ const FilterButton = (props, context) => {
40
42
  const primarySkinColor = (0, _get2.default)('common.primary', skin);
41
43
  const buttonProps = {
42
44
  customStyle: {
43
- backgroundColor: selected ? primarySkinColor : '#E1E1E3',
44
- color: selected ? '#FFFFFF' : '#515161',
45
+ backgroundColor: selected ? primarySkinColor : _colors.COLORS.cm_grey_150,
46
+ color: selected ? _colors.COLORS.white : _colors.COLORS.cm_grey_500,
45
47
  transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',
46
48
  width: 'fit-content'
47
49
  },
@@ -72,7 +74,7 @@ const AllCourses = (props, context) => {
72
74
  filters,
73
75
  sorting,
74
76
  totalContents,
75
- bannerMicrolearning = {},
77
+ bannerMicrolearning = undefined,
76
78
  search: {
77
79
  oldValue: oldSearchValue,
78
80
  onChange: handleSearch
@@ -86,11 +88,9 @@ const AllCourses = (props, context) => {
86
88
  list,
87
89
  loading
88
90
  } = content;
89
- const {
90
- type: bannerMessageType,
91
- action: bannerAction,
92
- oldSwitchValue
93
- } = bannerMicrolearning;
91
+ const bannerMessageType = bannerMicrolearning?.type;
92
+ const bannerAction = bannerMicrolearning?.action;
93
+ const oldSwitchValue = bannerMicrolearning?.oldSwitchValue;
94
94
  const [showCompleted, setShowCompleted] = (0, _react.useState)(true);
95
95
  const [searchValue, setSearchValue] = (0, _react.useState)(oldSearchValue || '');
96
96
  const sortView = sorting !== undefined ? /*#__PURE__*/_react.default.createElement("div", {
@@ -110,7 +110,7 @@ const AllCourses = (props, context) => {
110
110
  setSearchValue(value);
111
111
  debounceHandleSearch(value);
112
112
  }, [debounceHandleSearch]);
113
- const handleSearchReset = (0, _react.useCallback)(value => {
113
+ const handleSearchReset = (0, _react.useCallback)(() => {
114
114
  setSearchValue('');
115
115
  debounceHandleSearch('');
116
116
  }, [debounceHandleSearch]);
@@ -139,9 +139,9 @@ const AllCourses = (props, context) => {
139
139
  className: _allCourses.default.sortSection
140
140
  }, /*#__PURE__*/_react.default.createElement(_inputSwitch.default, {
141
141
  id: 'show-completed-courses-switch',
142
- type: "switch",
143
142
  name: translate('show_completed'),
144
143
  title: translate('show_completed'),
144
+ theme: "default",
145
145
  "aria-label": 'Show completed courses aria label',
146
146
  value: showCompleted,
147
147
  onChange: handleShowCompletedToggle
@@ -167,7 +167,7 @@ const AllCourses = (props, context) => {
167
167
  selected
168
168
  } = filterProps;
169
169
  function handleFilterChange() {
170
- onChange(value);
170
+ onChange && onChange(value);
171
171
  }
172
172
  return /*#__PURE__*/_react.default.createElement("div", {
173
173
  key: index,
@@ -1 +1 @@
1
- {"version":3,"file":"all-courses.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_provider","_select","_buttonLink","_searchForm","_cardsGrid","_inputSwitch","_banner","_allCourses","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","uncappedMap","_map2","convert","cap","FilterButton","props","context","dataName","ariaLabel","selected","label","onClick","skin","primarySkinColor","_get2","buttonProps","customStyle","backgroundColor","color","transition","width","createElement","contextTypes","Provider","childContextTypes","translate","propTypes","process","env","NODE_ENV","PropTypes","string","bool","func","AllCourses","content","filters","sorting","totalContents","bannerMicrolearning","search","oldValue","oldSearchValue","onChange","handleSearch","options","list","loading","type","bannerMessageType","action","bannerAction","oldSwitchValue","showCompleted","setShowCompleted","useState","searchValue","setSearchValue","sortView","undefined","filteredContent","useMemo","_filter2","course","progress","debounceHandleSearch","_debounce2","value","onSearchChange","useCallback","handleSearchReset","handleShowCompletedToggle","prevShowCompleted","Fragment","className","style","continueLearningWrapper","continueLearningTitle","continueLearningNumber","_isNil2","_size2","searchAndSortSection","searchWrapper","placeholder","onReset","dataTestId","sortSection","id","name","title","sortWrapper","_isEmpty2","bannerWrapper","message","cta","filterWrapper","filterProps","index","handleFilterChange","key","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","CardsGrid","number","arrayOf","SelectOptionPropTypes","Select","oneOf","_default","exports"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, filter, map, size, isNil, isEmpty, debounce} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid from '../../organism/cards-grid';\nimport InputSwitch from '../../atom/input-switch';\nimport Banner from '../../molecule/banner';\nimport style from './all-courses.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst FilterButton = (props, context) => {\n const {dataName, ariaLabel, selected, label, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : '#E1E1E3',\n color: selected ? '#FFFFFF' : '#515161',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label,\n onClick,\n 'data-name': dataName,\n 'aria-label': ariaLabel\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nFilterButton.propTypes = {\n dataName: PropTypes.string,\n ariaLabel: PropTypes.string,\n selected: PropTypes.bool,\n label: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {translate} = context;\n const {\n content,\n filters,\n sorting,\n totalContents,\n bannerMicrolearning = {},\n search: {oldValue: oldSearchValue, onChange: handleSearch}\n } = props;\n const {options, onChange} = filters;\n const {list, loading} = content;\n const {type: bannerMessageType, action: bannerAction, oldSwitchValue} = bannerMicrolearning;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState(oldSearchValue || '');\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n const filteredContent = useMemo(() => {\n return showCompleted ? list : filter(course => course.progress < 1, list);\n }, [list, showCompleted]);\n\n const debounceHandleSearch = useMemo(() => {\n return debounce(800, value => {\n handleSearch(value);\n });\n }, [handleSearch]);\n\n const onSearchChange = useCallback(\n value => {\n setSearchValue(value);\n debounceHandleSearch(value);\n },\n [debounceHandleSearch]\n );\n\n const handleSearchReset = useCallback(\n value => {\n setSearchValue('');\n debounceHandleSearch('');\n },\n [debounceHandleSearch]\n );\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(prevShowCompleted => !prevShowCompleted);\n }, []);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_content')}</span>\n <span className={style.continueLearningNumber}>\n {isNil(totalContents) ? size(filteredContent) : totalContents}\n </span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: onSearchChange\n }}\n onReset={handleSearchReset}\n dataTestId=\"all-courses-search-input\"\n />\n </div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n {sortView ? (\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n ) : null}\n </div>\n </div>\n {!isEmpty(bannerMicrolearning) ? (\n <div className={style.bannerWrapper}>\n <Banner\n type=\"info\"\n message={\n bannerMessageType === 'skill'\n ? translate('banner_microlearning_rule_message_skill')\n : translate('banner_microlearning_rule_message')\n }\n cta={[\n {\n type: 'switch',\n label: translate('banner_microlearning_rule_label'),\n action: bannerAction,\n oldSwitchValue\n }\n ]}\n />\n </div>\n ) : null}\n <div className={style.filterWrapper}>\n {size(options) > 2\n ? uncappedMap((filterProps, index) => {\n const {name, value, selected} = filterProps;\n\n function handleFilterChange() {\n onChange(value);\n }\n\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton\n dataName={`filter-button-${value}`}\n ariaLabel={`Filter by ${name}`}\n selected={selected}\n label={name}\n onClick={handleFilterChange}\n />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n }, options)\n : null}\n </div>\n <div>\n {size(filteredContent) ? (\n <CardsGrid\n list={filteredContent}\n loading={loading}\n customStyle={{justifyContent: 'left'}}\n />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.propTypes = {\n content: PropTypes.shape(CardsGrid.propTypes),\n totalContents: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n bannerMicrolearning: PropTypes.shape({\n type: PropTypes.oneOf(['skill', 'playlist']),\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n }),\n search: PropTypes.shape({\n oldValue: PropTypes.string,\n onChange: PropTypes.func\n })\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,WAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,UAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,YAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,OAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,WAAA,GAAAR,sBAAA,CAAAF,OAAA;AAAsC,SAAAW,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,Y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AU,CAACR,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACrBM,OAAO,EAAEL,kBAAS,CAAC6E,KAAK,CAACC,kBAAS,CAAClF,SAAS,CAAC;EAC7CY,aAAa,EAAER,kBAAS,CAAC+E,MAAM;EAC/BzE,OAAO,EAAEN,kBAAS,CAAC6E,KAAK,CAAC;IACvBhE,QAAQ,EAAEb,kBAAS,CAACG,IAAI;IACxBY,OAAO,EAAEf,kBAAS,CAACgF,OAAO,CAAChF,kBAAS,CAAC6E,KAAK,CAACI,6BAAqB,CAAC;EACnE,CAAC,CAAC;EACF1E,OAAO,EAAEP,kBAAS,CAAC6E,KAAK,CAACK,eAAM,CAACtF,SAAS,CAAC;EAC1Ca,mBAAmB,EAAET,kBAAS,CAAC6E,KAAK,CAAC;IACnC3D,IAAI,EAAElB,kBAAS,CAACmF,KAAK,CAAC,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC5C/D,MAAM,EAAEpB,kBAAS,CAACG,IAAI;IACtBmB,cAAc,EAAEtB,kBAAS,CAACE;EAC5B,CAAC,CAAC;EACFQ,MAAM,EAAEV,kBAAS,CAAC6E,KAAK,CAAC;IACtBlE,QAAQ,EAAEX,kBAAS,CAACC,MAAM;IAC1BY,QAAQ,EAAEb,kBAAS,CAACG;EACtB,CAAC;AACH,CAAC;AAAC,IAAAiF,QAAA,GAAAC,OAAA,CAAAvI,OAAA,GAEasD,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"all-courses.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_provider","_select","_buttonLink","_searchForm","_cardsGrid","_inputSwitch","_banner","_colors","_allCourses","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","uncappedMap","_map2","convert","cap","FilterButton","props","context","dataName","ariaLabel","selected","label","onClick","skin","primarySkinColor","_get2","buttonProps","customStyle","backgroundColor","COLORS","cm_grey_150","color","white","cm_grey_500","transition","width","createElement","contextTypes","Provider","childContextTypes","translate","propTypes","process","env","NODE_ENV","PropTypes","string","bool","func","AllCourses","content","filters","sorting","totalContents","bannerMicrolearning","undefined","search","oldValue","oldSearchValue","onChange","handleSearch","options","list","loading","bannerMessageType","type","bannerAction","action","oldSwitchValue","showCompleted","setShowCompleted","useState","searchValue","setSearchValue","sortView","filteredContent","useMemo","_filter2","course","progress","debounceHandleSearch","_debounce2","value","onSearchChange","useCallback","handleSearchReset","handleShowCompletedToggle","prevShowCompleted","Fragment","className","style","continueLearningWrapper","continueLearningTitle","continueLearningNumber","_isNil2","_size2","searchAndSortSection","searchWrapper","placeholder","onReset","dataTestId","sortSection","id","name","title","theme","sortWrapper","_isEmpty2","bannerWrapper","message","cta","filterWrapper","filterProps","index","handleFilterChange","key","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","CardsGrid","number","arrayOf","SelectOptionPropTypes","Select","oneOf","_default","exports"],"sources":["../../../src/template/skill-detail/all-courses.tsx"],"sourcesContent":["import React, {useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, filter, map, size, isNil, isEmpty, debounce} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid, {CardsGridProps} from '../../organism/cards-grid';\nimport InputSwitch from '../../atom/input-switch';\nimport Banner from '../../molecule/banner';\nimport {COLORS} from '../../variables/colors';\nimport style from './all-courses.css';\n\n// @ts-expect-error convert untypped\nconst uncappedMap = map.convert({cap: false});\ninterface ProviderContext {\n skin: {\n common: {\n primary: string;\n secondary: string;\n };\n };\n translate: (key: string, options?: any) => string;\n}\n\ninterface FilterOption {\n name: string;\n value: string;\n selected: boolean;\n}\n\ninterface FilterButtonProps {\n dataName?: string;\n ariaLabel?: string;\n selected?: boolean;\n label?: string;\n onClick?: () => void;\n}\nconst FilterButton = (props: FilterButtonProps, context: ProviderContext) => {\n const {dataName, ariaLabel, selected, label, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : COLORS.cm_grey_150,\n color: selected ? COLORS.white : COLORS.cm_grey_500,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label,\n onClick,\n 'data-name': dataName,\n 'aria-label': ariaLabel\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nFilterButton.propTypes = {\n dataName: PropTypes.string,\n ariaLabel: PropTypes.string,\n selected: PropTypes.bool,\n label: PropTypes.string,\n onClick: PropTypes.func\n};\n\ninterface ProviderContext {\n skin: {\n common: {\n primary: string;\n secondary: string;\n };\n };\n translate: (key: string, options?: any) => string;\n}\n\nconst AllCourses = (\n props: {\n dataName?: string;\n ariaLabel?: string;\n selected?: boolean;\n label?: string;\n content: {\n list: CardsGridProps['list'];\n loading?: boolean;\n };\n totalContents?: number;\n search: {\n oldValue: string;\n onChange: (value: string) => void;\n };\n bannerMicrolearning?: {\n type: 'skill' | 'playlist';\n action: () => void;\n oldSwitchValue: boolean;\n };\n filters: {\n onChange?: (value: string) => void;\n options?: unknown[];\n };\n sorting?: unknown;\n },\n context: ProviderContext\n) => {\n const {translate} = context;\n const {\n content,\n filters,\n sorting,\n totalContents,\n bannerMicrolearning = undefined,\n search: {oldValue: oldSearchValue, onChange: handleSearch}\n } = props;\n const {options, onChange} = filters;\n const {list, loading} = content;\n const bannerMessageType = bannerMicrolearning?.type;\n const bannerAction = bannerMicrolearning?.action;\n const oldSwitchValue = bannerMicrolearning?.oldSwitchValue;\n\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState(oldSearchValue || '');\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n const filteredContent = useMemo(() => {\n return showCompleted ? list : filter(course => course.progress < 1, list);\n }, [list, showCompleted]);\n\n const debounceHandleSearch = useMemo(() => {\n return debounce(800, value => {\n handleSearch(value);\n });\n }, [handleSearch]);\n\n const onSearchChange = useCallback(\n value => {\n setSearchValue(value);\n debounceHandleSearch(value);\n },\n [debounceHandleSearch]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n debounceHandleSearch('');\n }, [debounceHandleSearch]);\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(prevShowCompleted => !prevShowCompleted);\n }, []);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_content')}</span>\n <span className={style.continueLearningNumber}>\n {isNil(totalContents) ? size(filteredContent) : totalContents}\n </span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: onSearchChange\n }}\n onReset={handleSearchReset}\n dataTestId=\"all-courses-search-input\"\n />\n </div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n name={translate('show_completed')}\n title={translate('show_completed')}\n theme=\"default\"\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n {sortView ? (\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n ) : null}\n </div>\n </div>\n {!isEmpty(bannerMicrolearning) ? (\n <div className={style.bannerWrapper}>\n <Banner\n type=\"info\"\n message={\n bannerMessageType === 'skill'\n ? translate('banner_microlearning_rule_message_skill')\n : translate('banner_microlearning_rule_message')\n }\n cta={[\n {\n type: 'switch',\n label: translate('banner_microlearning_rule_label'),\n action: bannerAction,\n oldSwitchValue\n }\n ]}\n />\n </div>\n ) : null}\n\n <div className={style.filterWrapper}>\n {size(options) > 2\n ? uncappedMap((filterProps: FilterOption, index: number) => {\n const {name, value, selected} = filterProps;\n\n function handleFilterChange() {\n onChange && onChange(value);\n }\n\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton\n dataName={`filter-button-${value}`}\n ariaLabel={`Filter by ${name}`}\n selected={selected}\n label={name}\n onClick={handleFilterChange}\n />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n }, options)\n : null}\n </div>\n <div>\n {size(filteredContent) ? (\n <CardsGrid\n list={filteredContent}\n loading={loading}\n customStyle={{justifyContent: 'left'}}\n />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.propTypes = {\n content: PropTypes.shape(CardsGrid.propTypes),\n totalContents: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n bannerMicrolearning: PropTypes.shape({\n type: PropTypes.oneOf(['skill', 'playlist']),\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n }),\n search: PropTypes.shape({\n oldValue: PropTypes.string,\n onChange: PropTypes.func\n })\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAD,sBAAA,CA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tBoB,cAAc,EAAEvB,kBAAS,CAACE;EAC5B,CAAC,CAAC;EACFS,MAAM,EAAEX,kBAAS,CAAC8E,KAAK,CAAC;IACtBlE,QAAQ,EAAEZ,kBAAS,CAACC,MAAM;IAC1Ba,QAAQ,EAAEd,kBAAS,CAACG;EACtB,CAAC;AACH,CAAC;AAAC,IAAAkF,QAAA,GAAAC,OAAA,CAAA5I,OAAA,GAEa0D,UAAU","ignoreList":[]}
@@ -1,8 +1,21 @@
1
- export default ContinueLearning;
2
- declare function ContinueLearning(props: any, context: any): JSX.Element | null;
3
- declare namespace ContinueLearning {
4
- namespace contextTypes {
5
- const skin: PropTypes.Requireable<PropTypes.InferProps<{
1
+ /// <reference types="react" />
2
+ import PropTypes from 'prop-types';
3
+ import { CardsGridProps } from '../../organism/cards-grid';
4
+ interface ProviderContext {
5
+ skin: {
6
+ common: {
7
+ primary: string;
8
+ secondary: string;
9
+ };
10
+ };
11
+ translate: (key: string, options?: any) => string;
12
+ }
13
+ declare const ContinueLearning: {
14
+ (props: {
15
+ ongoingCourses: CardsGridProps;
16
+ }, context: ProviderContext): JSX.Element | null;
17
+ contextTypes: {
18
+ skin: PropTypes.Requireable<PropTypes.InferProps<{
6
19
  common: PropTypes.Requireable<{
7
20
  [x: string]: any;
8
21
  }>;
@@ -23,17 +36,17 @@ declare namespace ContinueLearning {
23
36
  [x: string]: any;
24
37
  }>;
25
38
  }>>;
26
- const translate: PropTypes.Requireable<(...args: any[]) => any>;
27
- }
28
- namespace propTypes {
29
- const ongoingCourses: PropTypes.Requireable<PropTypes.InferProps<{
39
+ translate: PropTypes.Requireable<(...args: any[]) => any>;
40
+ };
41
+ propTypes: {
42
+ ongoingCourses: PropTypes.Requireable<PropTypes.InferProps<{
30
43
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
31
44
  customStyle: PropTypes.Requireable<{
32
45
  [x: string]: string | null | undefined;
33
46
  }>;
34
47
  loading: PropTypes.Requireable<boolean>;
35
48
  }>>;
36
- }
37
- }
38
- import PropTypes from "prop-types";
49
+ };
50
+ };
51
+ export default ContinueLearning;
39
52
  //# sourceMappingURL=continue-learning.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"continue-learning.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/continue-learning.js"],"names":[],"mappings":";AAQA,gFA0BC"}
1
+ {"version":3,"file":"continue-learning.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/continue-learning.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,OAAkB,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAIpE,UAAU,eAAe;IACvB,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,OAAO,EAAE,MAAM,CAAC;YAChB,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IACF,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;CACnD;AAED,QAAA,MAAM,gBAAgB;YAAW;QAAC,cAAc,EAAE,cAAc,CAAA;KAAC,WAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B1F,CAAC;AAWF,eAAe,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"continue-learning.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_provider","_cardsGrid","_cardsList","_continueLearning","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ContinueLearning","props","context","ongoingCourses","translate","Title","useCallback","createElement","Fragment","className","style","continueLearningTitle","continueLearningNumber","list","length","cards","_sortBy2","course","_getOr2","title","customStyle","padding","contextTypes","skin","Provider","childContextTypes","propTypes","process","env","NODE_ENV","PropTypes","shape","CardsGrid","_default","exports"],"sources":["../../../src/template/skill-detail/continue-learning.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, sortBy} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport CardsGrid from '../../organism/cards-grid';\nimport CardsList from '../../molecule/dashboard/cards-list';\nimport style from './continue-learning.css';\n\nconst ContinueLearning = (props, context) => {\n const {ongoingCourses} = props;\n const {translate} = context;\n\n const Title = useCallback(\n () => (\n <>\n <span className={style.continueLearningTitle}>{translate('continue_learning')}</span>\n <span className={style.continueLearningNumber}>{ongoingCourses.list.length}</span>\n </>\n ),\n [ongoingCourses, translate]\n );\n\n if (ongoingCourses.list.length === 0) {\n return null;\n }\n\n return (\n <CardsList\n cards={sortBy(course => -getOr(0, ['progress'], course), ongoingCourses.list)}\n title={<Title />}\n // to override CardList wrapper padding\n customStyle={{padding: '0px'}}\n />\n );\n};\n\nContinueLearning.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearning.propTypes = {\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes)\n};\n\nexport default ContinueLearning;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,UAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,iBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAA4C,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UA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AAME,SAAS,EAAEC,yBAAK,CAACC;EAAsB,GAAEP,SAAS,CAAC,mBAAmB,CAAQ,CAAC,eACrFjC,MAAA,CAAAe,OAAA,CAAAqB,aAAA;IAAME,SAAS,EAAEC,yBAAK,CAACE;EAAuB,GAAET,cAAc,CAACU,IAAI,CAACC,MAAa,CACjF,CACH,EACD,CAACX,cAAc,EAAEC,SAAS,CAC5B,CAAC;EAED,IAAID,cAAc,CAACU,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE;IACpC,OAAO,IAAI;EACb;EAEA,oBACE3C,MAAA,CAAAe,OAAA,CAAAqB,aAAA,CAAC7B,UAAA,CAAAQ,OAAS;IACR6B,KAAK,EAAE,IAAAC,QAAA,CAAA9B,OAAA,EAAO+B,MAAM,IAAI,CAAC,IAAAC,OAAA,CAAAhC,OAAA,EAAM,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE+B,MAAM,CAAC,EAAEd,cAAc,CAACU,IAAI,CAAE;IAC9EM,KAAK,eAAEhD,MAAA,CAAAe,OAAA,CAAAqB,aAAA,CAACF,KAAK,MAAE;IACf;IAAA;IACAe,WAAW,EAAE;MAACC,OAAO,EAAE;IAAK;EAAE,CAC/B,CAAC;AAEN,CAAC;AAEDrB,gBAAgB,CAACsB,YAAY,GAAG;EAC9BC,IAAI,EAAEC,iBAAQ,CAACC,iBAAiB,CAACF,IAAI;EACrCnB,SAAS,EAAEoB,iBAAQ,CAACC,iBAAiB,CAACrB;AACxC,CAAC;AAEDJ,gBAAgB,CAAC0B,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EAC3B1B,cAAc,EAAE2B,kBAAS,CAACC,KAAK,CAACC,kBAAS,CAACN,SAAS;AACrD,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAhD,OAAA,GAEac,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"continue-learning.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_provider","_cardsGrid","_cardsList","_continueLearning","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ContinueLearning","props","context","ongoingCourses","translate","Title","useCallback","createElement","Fragment","className","style","continueLearningTitle","continueLearningNumber","list","length","cards","_sortBy2","course","_getOr2","title","customStyle","padding","contextTypes","skin","Provider","childContextTypes","propTypes","process","env","NODE_ENV","PropTypes","shape","CardsGrid","_default","exports"],"sources":["../../../src/template/skill-detail/continue-learning.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, sortBy} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport CardsGrid, {CardsGridProps} from '../../organism/cards-grid';\nimport CardsList from '../../molecule/dashboard/cards-list';\nimport style from './continue-learning.css';\n\ninterface ProviderContext {\n skin: {\n common: {\n primary: string;\n secondary: string;\n };\n };\n translate: (key: string, options?: any) => string;\n}\n\nconst ContinueLearning = (props: {ongoingCourses: CardsGridProps}, context: ProviderContext) => {\n const {ongoingCourses} = props;\n const {translate} = context;\n\n const Title = useCallback(\n () => (\n <>\n <span className={style.continueLearningTitle}>{translate('continue_learning')}</span>\n <span className={style.continueLearningNumber}>{ongoingCourses.list.length}</span>\n </>\n ),\n [ongoingCourses, translate]\n );\n\n if (ongoingCourses.list.length === 0) {\n return null;\n }\n\n return (\n <CardsList\n cards={sortBy(course => -getOr(0, ['progress'], course), ongoingCourses.list)}\n title={<Title />}\n // to override CardList wrapper padding\n customStyle={{padding: '0px'}}\n />\n );\n};\n\nContinueLearning.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearning.propTypes = {\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes)\n};\n\nexport default ContinueLearning;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAA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AEDrB,gBAAgB,CAACsB,YAAY,GAAG;EAC9BC,IAAI,EAAEC,iBAAQ,CAACC,iBAAiB,CAACF,IAAI;EACrCnB,SAAS,EAAEoB,iBAAQ,CAACC,iBAAiB,CAACrB;AACxC,CAAC;AAEDJ,gBAAgB,CAAC0B,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EAC3B1B,cAAc,EAAE2B,kBAAS,CAACC,KAAK,CAACC,kBAAS,CAACN,SAAS;AACrD,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAhD,OAAA,GAEac,gBAAgB","ignoreList":[]}
@@ -1,7 +1,23 @@
1
- export function ContinueLearningButton(props: any, context: any): JSX.Element;
2
- export namespace ContinueLearningButton {
3
- namespace contextTypes {
4
- const skin: PropTypes.Requireable<PropTypes.InferProps<{
1
+ /// <reference types="react" />
2
+ import PropTypes from 'prop-types';
3
+ import { CardsGridProps } from '../../organism/cards-grid';
4
+ interface ContinueLearningButtonProps {
5
+ ongoingCoursesAvailable?: boolean;
6
+ onClick?: () => void;
7
+ }
8
+ interface ProviderContext {
9
+ skin: {
10
+ common: {
11
+ primary: string;
12
+ secondary: string;
13
+ };
14
+ };
15
+ translate: (key: string) => string;
16
+ }
17
+ export declare const ContinueLearningButton: {
18
+ (props: ContinueLearningButtonProps, context: ProviderContext): JSX.Element;
19
+ contextTypes: {
20
+ skin: PropTypes.Requireable<PropTypes.InferProps<{
5
21
  common: PropTypes.Requireable<{
6
22
  [x: string]: any;
7
23
  }>;
@@ -22,19 +38,49 @@ export namespace ContinueLearningButton {
22
38
  [x: string]: any;
23
39
  }>;
24
40
  }>>;
25
- const translate: PropTypes.Requireable<(...args: any[]) => any>;
26
- }
27
- namespace propTypes {
28
- const ongoingCoursesAvailable: PropTypes.Requireable<boolean>;
29
- const onClick: PropTypes.Requireable<(...args: any[]) => any>;
30
- }
41
+ translate: PropTypes.Requireable<(...args: any[]) => any>;
42
+ };
43
+ propTypes: {
44
+ ongoingCoursesAvailable: PropTypes.Requireable<boolean>;
45
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
46
+ };
47
+ };
48
+ interface Metrics {
49
+ score?: number;
50
+ questionsToReview?: number;
51
+ totalContents?: number;
31
52
  }
32
- export default SkillDetail;
33
- import PropTypes from "prop-types";
34
- declare function SkillDetail(props: any, context: any): JSX.Element;
35
- declare namespace SkillDetail {
36
- export namespace contextTypes_1 {
37
- const skin_1: PropTypes.Requireable<PropTypes.InferProps<{
53
+ declare type BannerMicrolearning = Record<string, never> | {
54
+ action: () => void;
55
+ oldSwitchValue: boolean;
56
+ };
57
+ interface SkillDetailProps {
58
+ title: string;
59
+ skillRef: string;
60
+ description?: string;
61
+ metrics?: Metrics;
62
+ focused?: boolean;
63
+ availableForReview?: boolean;
64
+ ongoingCoursesAvailable?: boolean;
65
+ skillIncludedCourses: CardsGridProps;
66
+ filters: {
67
+ onChange?: () => void;
68
+ options?: unknown[];
69
+ };
70
+ onBackClick?: () => void;
71
+ onReviewClick?: () => void;
72
+ onContinueLearningClick?: () => void;
73
+ search: {
74
+ oldValue: string;
75
+ onChange: () => void;
76
+ };
77
+ bannerMicrolearning?: BannerMicrolearning;
78
+ }
79
+ declare const SkillDetail: {
80
+ (props: SkillDetailProps, context: ProviderContext): JSX.Element;
81
+ contextTypes: {
82
+ translate: PropTypes.Requireable<(...args: any[]) => any>;
83
+ skin: PropTypes.Requireable<PropTypes.InferProps<{
38
84
  common: PropTypes.Requireable<{
39
85
  [x: string]: any;
40
86
  }>;
@@ -55,32 +101,27 @@ declare namespace SkillDetail {
55
101
  [x: string]: any;
56
102
  }>;
57
103
  }>>;
58
- export { skin_1 as skin };
59
- const translate_1: PropTypes.Requireable<(...args: any[]) => any>;
60
- export { translate_1 as translate };
61
- }
62
- export { contextTypes_1 as contextTypes };
63
- export namespace propTypes_1 {
64
- export const title: PropTypes.Validator<string>;
65
- export const skillRef: PropTypes.Validator<string>;
66
- export const description: PropTypes.Requireable<string>;
67
- export const metrics: PropTypes.Requireable<PropTypes.InferProps<{
104
+ };
105
+ propTypes: {
106
+ title: PropTypes.Validator<string>;
107
+ skillRef: PropTypes.Validator<string>;
108
+ description: PropTypes.Requireable<string>;
109
+ metrics: PropTypes.Requireable<PropTypes.InferProps<{
68
110
  score: PropTypes.Requireable<number>;
69
111
  questionsToReview: PropTypes.Requireable<number>;
70
112
  totalContents: PropTypes.Requireable<number>;
71
113
  }>>;
72
- export const focused: PropTypes.Requireable<boolean>;
73
- export const availableForReview: PropTypes.Requireable<boolean>;
74
- const ongoingCoursesAvailable_1: PropTypes.Requireable<boolean>;
75
- export { ongoingCoursesAvailable_1 as ongoingCoursesAvailable };
76
- export const skillIncludedCourses: PropTypes.Requireable<PropTypes.InferProps<{
114
+ focused: PropTypes.Requireable<boolean>;
115
+ availableForReview: PropTypes.Requireable<boolean>;
116
+ ongoingCoursesAvailable: PropTypes.Requireable<boolean>;
117
+ skillIncludedCourses: PropTypes.Requireable<PropTypes.InferProps<{
77
118
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
78
119
  customStyle: PropTypes.Requireable<{
79
120
  [x: string]: string | null | undefined;
80
121
  }>;
81
122
  loading: PropTypes.Requireable<boolean>;
82
123
  }>>;
83
- export const filters: PropTypes.Requireable<PropTypes.InferProps<{
124
+ filters: PropTypes.Requireable<PropTypes.InferProps<{
84
125
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
85
126
  options: PropTypes.Requireable<(PropTypes.InferProps<{
86
127
  name: PropTypes.Validator<string>;
@@ -89,49 +130,18 @@ declare namespace SkillDetail {
89
130
  validOption: PropTypes.Requireable<boolean>;
90
131
  }> | null | undefined)[]>;
91
132
  }>>;
92
- export const sorting: PropTypes.Requireable<PropTypes.InferProps<{
93
- title: PropTypes.Requireable<string>;
94
- name: PropTypes.Requireable<string>;
95
- className: PropTypes.Requireable<string>;
96
- borderClassName: PropTypes.Requireable<string>;
97
- disabled: PropTypes.Requireable<boolean>;
98
- multiple: PropTypes.Requireable<boolean>;
99
- description: PropTypes.Requireable<string>;
100
- required: PropTypes.Requireable<boolean>;
101
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
102
- theme: PropTypes.Requireable<string>;
103
- options: PropTypes.Requireable<(PropTypes.InferProps<{
104
- name: PropTypes.Validator<string>;
105
- value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
106
- selected: PropTypes.Requireable<boolean>;
107
- validOption: PropTypes.Requireable<boolean>;
108
- }> | null | undefined)[]>;
109
- optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
110
- label: PropTypes.Validator<string>;
111
- options: PropTypes.Requireable<(PropTypes.InferProps<{
112
- name: PropTypes.Validator<string>;
113
- value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
114
- selected: PropTypes.Requireable<boolean>;
115
- validOption: PropTypes.Requireable<boolean>;
116
- }> | null | undefined)[]>;
117
- }> | null | undefined)[]>;
118
- modified: PropTypes.Requireable<boolean>;
119
- error: PropTypes.Requireable<boolean>;
120
- 'aria-label': PropTypes.Requireable<string>;
121
- 'aria-labelledby': PropTypes.Requireable<string>;
122
- }>>;
123
- export const onBackClick: PropTypes.Requireable<(...args: any[]) => any>;
124
- export const onReviewClick: PropTypes.Requireable<(...args: any[]) => any>;
125
- export const onContinueLearningClick: PropTypes.Requireable<(...args: any[]) => any>;
126
- export const search: PropTypes.Requireable<PropTypes.InferProps<{
133
+ onBackClick: PropTypes.Requireable<(...args: any[]) => any>;
134
+ onReviewClick: PropTypes.Requireable<(...args: any[]) => any>;
135
+ onContinueLearningClick: PropTypes.Requireable<(...args: any[]) => any>;
136
+ search: PropTypes.Requireable<PropTypes.InferProps<{
127
137
  oldValue: PropTypes.Requireable<string>;
128
138
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
129
139
  }>>;
130
- export const bannerMicrolearning: PropTypes.Requireable<PropTypes.InferProps<{
140
+ bannerMicrolearning: PropTypes.Requireable<PropTypes.InferProps<{
131
141
  action: PropTypes.Requireable<(...args: any[]) => any>;
132
142
  oldSwitchValue: PropTypes.Requireable<boolean>;
133
143
  }>>;
134
- }
135
- export { propTypes_1 as propTypes };
136
- }
144
+ };
145
+ };
146
+ export default SkillDetail;
137
147
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":"AAeO,8EA+BN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYD,oEAgKC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAUnC,OAAkB,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAOpE,UAAU,2BAA2B;IACnC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AACD,UAAU,eAAe;IACvB,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,OAAO,EAAE,MAAM,CAAC;YAChB,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IACF,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC;AAED,eAAO,MAAM,sBAAsB;YAC1B,2BAA2B,WACzB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BzB,CAAC;AAYF,UAAU,OAAO;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,aAAK,mBAAmB,GACpB,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACrB;IACE,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AACN,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,E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