@bigbinary/neeto-molecules 1.1.78 → 1.2.0-beta1

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 (370) hide show
  1. package/README.md +66 -52
  2. package/dist/Breadcrumbs.js +16 -19
  3. package/dist/Breadcrumbs.js.map +1 -1
  4. package/dist/BrowserSupport.js +41 -138
  5. package/dist/BrowserSupport.js.map +1 -1
  6. package/dist/Builder.js +207 -364
  7. package/dist/Builder.js.map +1 -1
  8. package/dist/CalendarView.js +40 -288
  9. package/dist/CalendarView.js.map +1 -1
  10. package/dist/Chevron-c64ff676.js +190 -0
  11. package/dist/Chevron-c64ff676.js.map +1 -0
  12. package/dist/Codeblock.js +26 -209
  13. package/dist/Codeblock.js.map +1 -1
  14. package/dist/Columns.js +16 -240
  15. package/dist/Columns.js.map +1 -1
  16. package/dist/ConfigurePageSidebar.js +97 -0
  17. package/dist/ConfigurePageSidebar.js.map +1 -0
  18. package/dist/ConfirmationModal.js +10 -10
  19. package/dist/ConfirmationModal.js.map +1 -1
  20. package/dist/Container.js +5 -1187
  21. package/dist/Container.js.map +1 -1
  22. package/dist/CopyToClipboardButton.js +26 -155
  23. package/dist/CopyToClipboardButton.js.map +1 -1
  24. package/dist/Currency.js +912 -0
  25. package/dist/Currency.js.map +1 -0
  26. package/dist/CustomDomain.js +37 -633
  27. package/dist/CustomDomain.js.map +1 -1
  28. package/dist/CustomDomainDashboard.js +69 -2192
  29. package/dist/CustomDomainDashboard.js.map +1 -1
  30. package/dist/DateFormat.js +6 -20
  31. package/dist/DateFormat.js.map +1 -1
  32. package/dist/DateRangeFilter.js +19 -75
  33. package/dist/DateRangeFilter.js.map +1 -1
  34. package/dist/DeleteArchiveModal.js +86 -0
  35. package/dist/DeleteArchiveModal.js.map +1 -0
  36. package/dist/DocumentEditor.js +43 -133
  37. package/dist/DocumentEditor.js.map +1 -1
  38. package/dist/DownloadMobileAppCallout.js +4 -4
  39. package/dist/DownloadMobileAppCallout.js.map +1 -1
  40. package/dist/DynamicVariables.js +12 -95
  41. package/dist/DynamicVariables.js.map +1 -1
  42. package/dist/EmailForm.js +79 -1741
  43. package/dist/EmailForm.js.map +1 -1
  44. package/dist/EmailPreview.js +32 -1213
  45. package/dist/EmailPreview.js.map +1 -1
  46. package/dist/EmojiPicker.js +67 -0
  47. package/dist/EmojiPicker.js.map +1 -0
  48. package/dist/EmojiReactions.js +69 -0
  49. package/dist/EmojiReactions.js.map +1 -0
  50. package/dist/ErrorPage.js +17 -26
  51. package/dist/ErrorPage.js.map +1 -1
  52. package/dist/FloatingActionMenu.js +646 -0
  53. package/dist/FloatingActionMenu.js.map +1 -0
  54. package/dist/Header.js +45 -117
  55. package/dist/Header.js.map +1 -1
  56. package/dist/HelpPopover.js +73 -0
  57. package/dist/HelpPopover.js.map +1 -0
  58. package/dist/IconPicker.js +36 -129
  59. package/dist/IconPicker.js.map +1 -1
  60. package/dist/ImageWithFallback.js +8 -144
  61. package/dist/ImageWithFallback.js.map +1 -1
  62. package/dist/InlineInput.js +22 -526
  63. package/dist/InlineInput.js.map +1 -1
  64. package/dist/Insights.js +304 -0
  65. package/dist/Insights.js.map +1 -0
  66. package/dist/IntegrationCard.js +42 -226
  67. package/dist/IntegrationCard.js.map +1 -1
  68. package/dist/IntegrationDisconnectAlert.js +6 -48
  69. package/dist/IntegrationDisconnectAlert.js.map +1 -1
  70. package/dist/IntegrationWalkthroughModal.js +10 -10
  71. package/dist/IntegrationWalkthroughModal.js.map +1 -1
  72. package/dist/IpRestriction.js +74 -221
  73. package/dist/IpRestriction.js.map +1 -1
  74. package/dist/KeyboardShortcuts.js +38 -128
  75. package/dist/KeyboardShortcuts.js.map +1 -1
  76. package/dist/LoginPage.js +39 -459
  77. package/dist/LoginPage.js.map +1 -1
  78. package/dist/MadeWith.js +32 -0
  79. package/dist/MadeWith.js.map +1 -0
  80. package/dist/MenuBar.js +34 -1295
  81. package/dist/MenuBar.js.map +1 -1
  82. package/dist/Metadata.js +65 -86
  83. package/dist/Metadata.js.map +1 -1
  84. package/dist/MoreDropdown.js +48 -107
  85. package/dist/MoreDropdown.js.map +1 -1
  86. package/dist/NavigationHeader.js +51 -730
  87. package/dist/NavigationHeader.js.map +1 -1
  88. package/dist/NeetoWidget.js +148 -316
  89. package/dist/NeetoWidget.js.map +1 -1
  90. package/dist/Onboarding.js +343 -0
  91. package/dist/Onboarding.js.map +1 -0
  92. package/dist/OptionFields.js +507 -0
  93. package/dist/OptionFields.js.map +1 -0
  94. package/dist/PageLoader.js +5 -48
  95. package/dist/PageLoader.js.map +1 -1
  96. package/dist/PhoneNumber.js +122 -201
  97. package/dist/PhoneNumber.js.map +1 -1
  98. package/dist/ProductEmbed.js +767 -0
  99. package/dist/ProductEmbed.js.map +1 -0
  100. package/dist/PublishBlock.js +19 -60
  101. package/dist/PublishBlock.js.map +1 -1
  102. package/dist/PublishYourItem.js +52 -0
  103. package/dist/PublishYourItem.js.map +1 -0
  104. package/dist/Rename.js +127 -394
  105. package/dist/Rename.js.map +1 -1
  106. package/dist/ResponsiveDevicePicker.js +7 -143
  107. package/dist/ResponsiveDevicePicker.js.map +1 -1
  108. package/dist/Schedule.js +131 -365
  109. package/dist/Schedule.js.map +1 -1
  110. package/dist/Scrollable.js +6 -89
  111. package/dist/Scrollable.js.map +1 -1
  112. package/dist/Search.js +54 -157
  113. package/dist/Search.js.map +1 -1
  114. package/dist/Security.js +72 -1567
  115. package/dist/Security.js.map +1 -1
  116. package/dist/SendToFields.js +51 -133
  117. package/dist/SendToFields.js.map +1 -1
  118. package/dist/Settings.js +141 -412
  119. package/dist/Settings.js.map +1 -1
  120. package/dist/ShareRecordingPane.js +189 -0
  121. package/dist/ShareRecordingPane.js.map +1 -0
  122. package/dist/ShareViaEmail.js +126 -551
  123. package/dist/ShareViaEmail.js.map +1 -1
  124. package/dist/ShareViaLink.js +127 -345
  125. package/dist/ShareViaLink.js.map +1 -1
  126. package/dist/Sidebar.js +161 -758
  127. package/dist/Sidebar.js.map +1 -1
  128. package/dist/SubHeader.js +63 -108
  129. package/dist/SubHeader.js.map +1 -1
  130. package/dist/SuffixedInput.js +105 -0
  131. package/dist/SuffixedInput.js.map +1 -0
  132. package/dist/TableWrapper.js +8 -9
  133. package/dist/TableWrapper.js.map +1 -1
  134. package/dist/Taxonomy.js +112 -1774
  135. package/dist/Taxonomy.js.map +1 -1
  136. package/dist/ThemeSidebar.js +159 -776
  137. package/dist/ThemeSidebar.js.map +1 -1
  138. package/dist/TimeFormat.js +8 -44
  139. package/dist/TimeFormat.js.map +1 -1
  140. package/dist/TimezoneMismatchModal.js +49 -84
  141. package/dist/TimezoneMismatchModal.js.map +1 -1
  142. package/dist/ToggleFeatureCard.js +46 -169
  143. package/dist/ToggleFeatureCard.js.map +1 -1
  144. package/dist/cjs/Breadcrumbs.js +49 -0
  145. package/dist/cjs/Breadcrumbs.js.map +1 -0
  146. package/dist/cjs/BrowserSupport.js +329 -0
  147. package/dist/cjs/BrowserSupport.js.map +1 -0
  148. package/dist/cjs/Builder.js +556 -0
  149. package/dist/cjs/Builder.js.map +1 -0
  150. package/dist/cjs/CalendarView.js +299 -0
  151. package/dist/cjs/CalendarView.js.map +1 -0
  152. package/dist/cjs/Chevron-8a4ed9cd.js +203 -0
  153. package/dist/cjs/Chevron-8a4ed9cd.js.map +1 -0
  154. package/dist/cjs/Codeblock.js +58 -0
  155. package/dist/cjs/Codeblock.js.map +1 -0
  156. package/dist/cjs/Columns.js +31 -0
  157. package/dist/cjs/Columns.js.map +1 -0
  158. package/dist/cjs/ConfigurePageSidebar.js +104 -0
  159. package/dist/cjs/ConfigurePageSidebar.js.map +1 -0
  160. package/dist/cjs/ConfirmationModal.js +120 -0
  161. package/dist/cjs/ConfirmationModal.js.map +1 -0
  162. package/dist/cjs/Container.js +36 -0
  163. package/dist/cjs/Container.js.map +1 -0
  164. package/dist/cjs/CopyToClipboardButton.js +86 -0
  165. package/dist/cjs/CopyToClipboardButton.js.map +1 -0
  166. package/dist/cjs/Currency.js +921 -0
  167. package/dist/cjs/Currency.js.map +1 -0
  168. package/dist/cjs/CustomDomain.js +125 -0
  169. package/dist/cjs/CustomDomain.js.map +1 -0
  170. package/dist/cjs/CustomDomainDashboard.js +200 -0
  171. package/dist/cjs/CustomDomainDashboard.js.map +1 -0
  172. package/dist/cjs/DateFormat.js +40 -0
  173. package/dist/cjs/DateFormat.js.map +1 -0
  174. package/dist/cjs/DateRangeFilter.js +180 -0
  175. package/dist/cjs/DateRangeFilter.js.map +1 -0
  176. package/dist/cjs/DeleteArchiveModal.js +92 -0
  177. package/dist/cjs/DeleteArchiveModal.js.map +1 -0
  178. package/dist/cjs/DocumentEditor.js +194 -0
  179. package/dist/cjs/DocumentEditor.js.map +1 -0
  180. package/dist/cjs/DownloadMobileAppCallout.js +45 -0
  181. package/dist/cjs/DownloadMobileAppCallout.js.map +1 -0
  182. package/dist/cjs/DynamicVariables.js +106 -0
  183. package/dist/cjs/DynamicVariables.js.map +1 -0
  184. package/dist/cjs/EmailForm.js +395 -0
  185. package/dist/cjs/EmailForm.js.map +1 -0
  186. package/dist/cjs/EmailPreview.js +139 -0
  187. package/dist/cjs/EmailPreview.js.map +1 -0
  188. package/dist/cjs/EmojiPicker.js +75 -0
  189. package/dist/cjs/EmojiPicker.js.map +1 -0
  190. package/dist/cjs/EmojiReactions.js +76 -0
  191. package/dist/cjs/EmojiReactions.js.map +1 -0
  192. package/dist/cjs/ErrorPage.js +179 -0
  193. package/dist/cjs/ErrorPage.js.map +1 -0
  194. package/dist/cjs/FloatingActionMenu.js +675 -0
  195. package/dist/cjs/FloatingActionMenu.js.map +1 -0
  196. package/dist/cjs/Header.js +104 -0
  197. package/dist/cjs/Header.js.map +1 -0
  198. package/dist/cjs/HelpPopover.js +80 -0
  199. package/dist/cjs/HelpPopover.js.map +1 -0
  200. package/dist/cjs/IconPicker.js +228 -0
  201. package/dist/cjs/IconPicker.js.map +1 -0
  202. package/dist/cjs/ImageWithFallback.js +52 -0
  203. package/dist/cjs/ImageWithFallback.js.map +1 -0
  204. package/dist/cjs/InlineInput.js +233 -0
  205. package/dist/cjs/InlineInput.js.map +1 -0
  206. package/dist/cjs/Insights.js +310 -0
  207. package/dist/cjs/Insights.js.map +1 -0
  208. package/dist/cjs/IntegrationCard.js +208 -0
  209. package/dist/cjs/IntegrationCard.js.map +1 -0
  210. package/dist/cjs/IntegrationDisconnectAlert.js +48 -0
  211. package/dist/cjs/IntegrationDisconnectAlert.js.map +1 -0
  212. package/dist/cjs/IntegrationWalkthroughModal.js +51 -0
  213. package/dist/cjs/IntegrationWalkthroughModal.js.map +1 -0
  214. package/dist/cjs/IpRestriction.js +525 -0
  215. package/dist/cjs/IpRestriction.js.map +1 -0
  216. package/dist/cjs/KeyboardShortcuts.js +282 -0
  217. package/dist/cjs/KeyboardShortcuts.js.map +1 -0
  218. package/dist/cjs/LoginPage.js +198 -0
  219. package/dist/cjs/LoginPage.js.map +1 -0
  220. package/dist/cjs/MadeWith.js +38 -0
  221. package/dist/cjs/MadeWith.js.map +1 -0
  222. package/dist/cjs/MenuBar.js +208 -0
  223. package/dist/cjs/MenuBar.js.map +1 -0
  224. package/dist/cjs/Metadata.js +195 -0
  225. package/dist/cjs/Metadata.js.map +1 -0
  226. package/dist/cjs/MoreDropdown.js +152 -0
  227. package/dist/cjs/MoreDropdown.js.map +1 -0
  228. package/dist/cjs/NavigationHeader.js +177 -0
  229. package/dist/cjs/NavigationHeader.js.map +1 -0
  230. package/dist/cjs/NeetoWidget.js +912 -0
  231. package/dist/cjs/NeetoWidget.js.map +1 -0
  232. package/dist/cjs/Onboarding.js +357 -0
  233. package/dist/cjs/Onboarding.js.map +1 -0
  234. package/dist/cjs/OptionFields.js +514 -0
  235. package/dist/cjs/OptionFields.js.map +1 -0
  236. package/dist/cjs/PageLoader.js +116 -0
  237. package/dist/cjs/PageLoader.js.map +1 -0
  238. package/dist/cjs/PhoneNumber.js +363 -0
  239. package/dist/cjs/PhoneNumber.js.map +1 -0
  240. package/dist/cjs/ProductEmbed.js +774 -0
  241. package/dist/cjs/ProductEmbed.js.map +1 -0
  242. package/dist/cjs/PublishBlock.js +125 -0
  243. package/dist/cjs/PublishBlock.js.map +1 -0
  244. package/dist/cjs/PublishYourItem.js +59 -0
  245. package/dist/cjs/PublishYourItem.js.map +1 -0
  246. package/dist/cjs/Rename.js +350 -0
  247. package/dist/cjs/Rename.js.map +1 -0
  248. package/dist/cjs/ResponsiveDevicePicker.js +64 -0
  249. package/dist/cjs/ResponsiveDevicePicker.js.map +1 -0
  250. package/dist/cjs/Schedule.js +889 -0
  251. package/dist/cjs/Schedule.js.map +1 -0
  252. package/dist/cjs/Scrollable.js +46 -0
  253. package/dist/cjs/Scrollable.js.map +1 -0
  254. package/dist/cjs/Search.js +117 -0
  255. package/dist/cjs/Search.js.map +1 -0
  256. package/dist/cjs/Security.js +376 -0
  257. package/dist/cjs/Security.js.map +1 -0
  258. package/dist/cjs/SendToFields.js +272 -0
  259. package/dist/cjs/SendToFields.js.map +1 -0
  260. package/dist/cjs/Settings.js +214 -0
  261. package/dist/cjs/Settings.js.map +1 -0
  262. package/dist/cjs/ShareRecordingPane.js +195 -0
  263. package/dist/cjs/ShareRecordingPane.js.map +1 -0
  264. package/dist/cjs/ShareViaEmail.js +348 -0
  265. package/dist/cjs/ShareViaEmail.js.map +1 -0
  266. package/dist/cjs/ShareViaLink.js +507 -0
  267. package/dist/cjs/ShareViaLink.js.map +1 -0
  268. package/dist/cjs/Sidebar.js +288 -0
  269. package/dist/cjs/Sidebar.js.map +1 -0
  270. package/dist/cjs/SubHeader.js +178 -0
  271. package/dist/cjs/SubHeader.js.map +1 -0
  272. package/dist/cjs/SuffixedInput.js +111 -0
  273. package/dist/cjs/SuffixedInput.js.map +1 -0
  274. package/dist/cjs/TableWrapper.js +32 -0
  275. package/dist/cjs/TableWrapper.js.map +1 -0
  276. package/dist/cjs/Taxonomy.js +442 -0
  277. package/dist/cjs/Taxonomy.js.map +1 -0
  278. package/dist/cjs/ThemeSidebar.js +1436 -0
  279. package/dist/cjs/ThemeSidebar.js.map +1 -0
  280. package/dist/cjs/TimeFormat.js +15 -0
  281. package/dist/cjs/TimeFormat.js.map +1 -0
  282. package/dist/cjs/TimezoneMismatchModal.js +143 -0
  283. package/dist/cjs/TimezoneMismatchModal.js.map +1 -0
  284. package/dist/cjs/ToggleFeatureCard.js +209 -0
  285. package/dist/cjs/ToggleFeatureCard.js.map +1 -0
  286. package/dist/cjs/defineProperty-886ed289.js +47 -0
  287. package/dist/cjs/defineProperty-886ed289.js.map +1 -0
  288. package/dist/cjs/extends-1b35a664.js +19 -0
  289. package/dist/cjs/extends-1b35a664.js.map +1 -0
  290. package/dist/cjs/index-00fdb8c2.js +542 -0
  291. package/dist/cjs/index-00fdb8c2.js.map +1 -0
  292. package/dist/cjs/index-248c4f4c.js +1186 -0
  293. package/dist/cjs/index-248c4f4c.js.map +1 -0
  294. package/dist/cjs/index-c55ad2bc.js +375 -0
  295. package/dist/cjs/index-c55ad2bc.js.map +1 -0
  296. package/dist/cjs/inject-css-80a5faa3.js +6 -0
  297. package/dist/cjs/inject-css-80a5faa3.js.map +1 -0
  298. package/dist/cjs/objectWithoutProperties-2fed2d7d.js +33 -0
  299. package/dist/cjs/objectWithoutProperties-2fed2d7d.js.map +1 -0
  300. package/dist/cjs/slicedToArray-f320d9e7.js +61 -0
  301. package/dist/cjs/slicedToArray-f320d9e7.js.map +1 -0
  302. package/dist/cjs/toConsumableArray-9abb3858.js +22 -0
  303. package/dist/cjs/toConsumableArray-9abb3858.js.map +1 -0
  304. package/dist/cjs/useColumns-a1c3668f.js +271 -0
  305. package/dist/cjs/useColumns-a1c3668f.js.map +1 -0
  306. package/dist/defineProperty-549061a7.js +43 -0
  307. package/dist/defineProperty-549061a7.js.map +1 -0
  308. package/dist/extends-093996c9.js +17 -0
  309. package/dist/extends-093996c9.js.map +1 -0
  310. package/dist/index-90c89467.js +509 -0
  311. package/dist/index-90c89467.js.map +1 -0
  312. package/dist/index-9720867c.js +372 -0
  313. package/dist/index-9720867c.js.map +1 -0
  314. package/dist/index-e5588516.js +1184 -0
  315. package/dist/index-e5588516.js.map +1 -0
  316. package/dist/inject-css-c86de496.js +4 -0
  317. package/dist/inject-css-c86de496.js.map +1 -0
  318. package/dist/objectWithoutProperties-a0edb288.js +31 -0
  319. package/dist/objectWithoutProperties-a0edb288.js.map +1 -0
  320. package/dist/slicedToArray-b4278ecd.js +57 -0
  321. package/dist/slicedToArray-b4278ecd.js.map +1 -0
  322. package/dist/toConsumableArray-1cc38429.js +20 -0
  323. package/dist/toConsumableArray-1cc38429.js.map +1 -0
  324. package/dist/useColumns-d17d1f72.js +258 -0
  325. package/dist/useColumns-d17d1f72.js.map +1 -0
  326. package/package.json +29 -17
  327. package/src/translations/de.json +7 -0
  328. package/src/translations/en.json +191 -31
  329. package/src/translations/es.json +7 -0
  330. package/src/translations/fr.json +7 -0
  331. package/src/translations/nl.json +7 -0
  332. package/src/translations/pl.json +7 -0
  333. package/src/translations/pt.json +7 -0
  334. package/types/Breadcrumbs.d.ts +1 -0
  335. package/types/Builder.d.ts +61 -12
  336. package/types/Columns.d.ts +112 -5
  337. package/types/ConfigurePageSidebar.d.ts +43 -0
  338. package/types/CopyToClipboardButton.d.ts +3 -0
  339. package/types/Currency.d.ts +48 -0
  340. package/types/CustomDomain.d.ts +2 -0
  341. package/types/CustomDomainDashboard.d.ts +14 -0
  342. package/types/DateRangeFilter.d.ts +2 -0
  343. package/types/DeleteArchiveModal.d.ts +60 -0
  344. package/types/EmailForm.d.ts +1 -1
  345. package/types/EmojiPicker.d.ts +33 -0
  346. package/types/EmojiReactions.d.ts +60 -0
  347. package/types/ErrorPage.d.ts +1 -0
  348. package/types/FloatingActionMenu.d.ts +56 -0
  349. package/types/Header.d.ts +2 -1
  350. package/types/HelpPopover.d.ts +42 -0
  351. package/types/Insights.d.ts +108 -0
  352. package/types/IntegrationCard.d.ts +2 -0
  353. package/types/KeyboardShortcuts.d.ts +2 -2
  354. package/types/MadeWith.d.ts +16 -0
  355. package/types/MoreDropdown.d.ts +4 -1
  356. package/types/NavigationHeader.d.ts +3 -1
  357. package/types/Onboarding.d.ts +63 -0
  358. package/types/OptionFields.d.ts +63 -0
  359. package/types/PhoneNumber.d.ts +6 -2
  360. package/types/ProductEmbed.d.ts +43 -0
  361. package/types/Rename.d.ts +4 -1
  362. package/types/Schedule.d.ts +2 -0
  363. package/types/Search.d.ts +2 -0
  364. package/types/Settings.d.ts +13 -10
  365. package/types/ShareRecordingPane.d.ts +50 -0
  366. package/types/ShareViaLink.d.ts +15 -4
  367. package/types/Sidebar.d.ts +16 -32
  368. package/types/SubHeader.d.ts +0 -1
  369. package/types/SuffixedInput.d.ts +43 -0
  370. package/types/ToggleFeatureCard.d.ts +8 -1
package/dist/Sidebar.js CHANGED
@@ -1,713 +1,79 @@
1
- import React, { useState, forwardRef, useEffect } from 'react';
1
+ import { _ as _slicedToArray } from './slicedToArray-b4278ecd.js';
2
+ import React__default, { useState, useEffect, useMemo } from 'react';
2
3
  import classnames from 'classnames';
4
+ import { capitalize, findBy, hyphenate, isNotPresent, isNotEmpty, isPresent } from '@bigbinary/neeto-cist';
3
5
  import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/initializers';
4
- import { useFetchNeetoApps, useLocalStorage } from '@bigbinary/neeto-commons-frontend/react-utils';
5
- import { Typography, Input, Tooltip, Spinner, Avatar, Button } from '@bigbinary/neetoui';
6
+ import useLocalStorage from '@bigbinary/neeto-commons-frontend/react-utils/useLocalStorage';
7
+ import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
8
+ import { Typography, Button } from '@bigbinary/neetoui';
9
+ import { not, is, findLast } from 'ramda';
6
10
  import { useTranslation } from 'react-i18next';
7
- import { Link, useLocation, NavLink } from 'react-router-dom';
8
- import { NeetoIcon, Search, AppSwitcher as AppSwitcher$1, ChatEmpty, Book, Gift, Keyboard, User, Settings, LeftArrow, Help, Down } from '@bigbinary/neeto-icons';
9
- import { capitalize, truncate, isPresent, findBy, isNotPresent } from '@bigbinary/neeto-cist';
10
- import * as AppIcons from '@bigbinary/neeto-icons/app-icons';
11
- import { t as t$1 } from 'i18next';
12
- import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/utils';
13
- import { toLower, all, mergeDeepLeft, curry, is, includes, __, not } from 'ramda';
14
- import KeyboardShortcuts from '@bigbinary/neeto-molecules/KeyboardShortcuts';
11
+ import { Link, useLocation, useHistory } from 'react-router-dom';
12
+ import { f as filterByPermissions, a as CheckPointNavLinks, I as Items, b as SELECTED_NAV_LINK_ROUTE_STORAGE_KEY, g as getSidebarStateLocalStorageKey, S as SelectedLink, C as Chevron } from './Chevron-c64ff676.js';
13
+ import useFetchNeetoApps from '@bigbinary/neeto-commons-frontend/react-utils/useFetchNeetoApps';
15
14
  import * as ProductTypefaceLogos from '@bigbinary/neeto-icons/typeface-logos';
16
15
  import { Neeto } from '@bigbinary/neeto-icons/typeface-logos';
17
-
18
- function _arrayWithHoles(arr) {
19
- if (Array.isArray(arr)) return arr;
20
- }
21
-
22
- function _iterableToArrayLimit(r, l) {
23
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
24
- if (null != t) {
25
- var e,
26
- n,
27
- i,
28
- u,
29
- a = [],
30
- f = !0,
31
- o = !1;
32
- try {
33
- if (i = (t = t.call(r)).next, 0 === l) {
34
- if (Object(t) !== t) return;
35
- f = !1;
36
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
37
- } catch (r) {
38
- o = !0, n = r;
39
- } finally {
40
- try {
41
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
42
- } finally {
43
- if (o) throw n;
44
- }
45
- }
46
- return a;
47
- }
48
- }
49
-
50
- function _arrayLikeToArray(arr, len) {
51
- if (len == null || len > arr.length) len = arr.length;
52
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
53
- return arr2;
54
- }
55
-
56
- function _unsupportedIterableToArray(o, minLen) {
57
- if (!o) return;
58
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
59
- var n = Object.prototype.toString.call(o).slice(8, -1);
60
- if (n === "Object" && o.constructor) n = o.constructor.name;
61
- if (n === "Map" || n === "Set") return Array.from(o);
62
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
63
- }
64
-
65
- function _nonIterableRest() {
66
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
67
- }
68
-
69
- function _slicedToArray(arr, i) {
70
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
71
- }
72
-
73
- var Chevron = function Chevron(_ref) {
74
- var style = _ref.style;
75
- return /*#__PURE__*/React.createElement("svg", {
76
- height: "16",
77
- viewBox: "0 0 16 16",
78
- width: "16",
79
- style: style
80
- }, /*#__PURE__*/React.createElement("path", {
81
- d: "M7.07031 13.8887C7.2207 14.0391 7.40527 14.1211 7.62402 14.1211C8.06836 14.1211 8.41699 13.7725 8.41699 13.3281C8.41699 13.1094 8.32812 12.9043 8.17773 12.7539L3.37207 8.05762L8.17773 3.375C8.32812 3.21777 8.41699 3.0127 8.41699 2.80078C8.41699 2.35645 8.06836 2.00781 7.62402 2.00781C7.40527 2.00781 7.2207 2.08984 7.07031 2.24023L1.73828 7.44922C1.56055 7.62012 1.46484 7.8252 1.46484 8.06445C1.46484 8.29688 1.55371 8.49512 1.73828 8.67969L7.07031 13.8887ZM13.1748 13.8887C13.3252 14.0391 13.5098 14.1211 13.7354 14.1211C14.1797 14.1211 14.5283 13.7725 14.5283 13.3281C14.5283 13.1094 14.4395 12.9043 14.2891 12.7539L9.4834 8.05762L14.2891 3.375C14.4395 3.21777 14.5283 3.0127 14.5283 2.80078C14.5283 2.35645 14.1797 2.00781 13.7354 2.00781C13.5098 2.00781 13.3252 2.08984 13.1748 2.24023L7.84961 7.44922C7.66504 7.62012 7.57617 7.8252 7.56934 8.06445C7.56934 8.29688 7.66504 8.49512 7.84961 8.67969L13.1748 13.8887Z",
82
- fill: "currentColor"
83
- }));
84
- };
85
-
86
- var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
87
-
88
- var css$1 = ".neeto-molecules-app-switcher__wrapper{align-items:flex-start;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:column;justify-content:flex-start;max-width:100%;overflow-y:auto;padding:40px;position:relative;transition:all .3s;width:100%}@media only screen and (max-width:992px){.neeto-molecules-app-switcher__wrapper{padding:32px}}.neeto-molecules-app-switcher__grid{grid-gap:24px;display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(288px,1fr))}@media only screen and (max-width:992px){.neeto-molecules-app-switcher__grid{grid-template-columns:repeat(auto-fill,minmax(248px,1fr))}}.neeto-molecules-app-switcher__header{align-items:center;display:flex;gap:32px;justify-content:space-between;margin-bottom:32px;position:relative;width:100%}@media only screen and (max-width:768px){.neeto-molecules-app-switcher__header{align-items:flex-start;flex-direction:column-reverse;gap:24px}}@media only screen and (max-width:640px){.neeto-molecules-app-switcher__header h1{font-size:28px}}.neeto-molecules-app-switcher__close-btn{position:absolute;right:12px;top:12px}.neeto-molecules-app-switcher__search-wrapper{flex-grow:1}@media only screen and (min-width:992px){.neeto-molecules-app-switcher__search-wrapper{flex-grow:0;width:296px}}.neeto-molecules-app-switcher__body{display:flex;flex-direction:column;font-size:var(--neeto-ui-text-sm);gap:12px;margin-bottom:24px;width:100%}.neeto-molecules-app-switcher-link{align-items:center;background-color:rgb(var(--neeto-ui-gray-100));border-color:rgb(var(--neeto-ui-gray-100));border-radius:var(--neeto-ui-rounded-lg);border-style:solid;border-width:2px;cursor:pointer;display:flex;gap:12px;max-width:100%;padding:12px 16px;text-decoration:none;transition:background-color .3s ease-in-out;width:100%}.neeto-molecules-app-switcher-link:focus,.neeto-molecules-app-switcher-link:focus-visible{outline:none}.neeto-molecules-app-switcher-link:focus-visible{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link:not(.neeto-molecules-app-switcher-link--active):hover{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-app-switcher-link--active{background:rgb(var(--neeto-ui-primary-100));border-color:rgb(var(--neeto-ui-primary-600))}.neeto-molecules-app-switcher-link__icon-holder{align-items:center;border-radius:var(--neeto-ui-rounded-lg);display:flex;flex-shrink:0;height:42px;justify-content:center;width:42px}.neeto-molecules-app-switcher-link__content{flex-grow:1}.neeto-molecules-app-switcher-link__content span{display:block}";
89
- n(css$1,{});
90
-
91
- function _extends() {
92
- _extends = Object.assign ? Object.assign.bind() : function (target) {
93
- for (var i = 1; i < arguments.length; i++) {
94
- var source = arguments[i];
95
- for (var key in source) {
96
- if (Object.prototype.hasOwnProperty.call(source, key)) {
97
- target[key] = source[key];
98
- }
99
- }
100
- }
101
- return target;
102
- };
103
- return _extends.apply(this, arguments);
104
- }
105
-
106
- var AppLink = function AppLink(_ref) {
107
- var name = _ref.name,
108
- description = _ref.description,
109
- url = _ref.url;
110
- var appName = "Neeto".concat(name.charAt(0)).concat(name.slice(1).toLowerCase());
111
- var AppIcon = AppIcons[appName];
112
- return /*#__PURE__*/React.createElement("a", {
113
- "data-cy": "".concat(name, "-app-link"),
114
- "data-test-id": "neetoapp-link-".concat(name),
115
- href: url,
116
- rel: "noreferrer",
117
- target: "_blank",
118
- className: classnames("neeto-molecules-app-switcher-link", {
119
- "neeto-molecules-app-switcher-link--active": capitalize(globalProps.appName) === appName
120
- })
121
- }, /*#__PURE__*/React.createElement("div", {
122
- className: classnames("neeto-molecules-app-switcher-link__icon-holder", {
123
- "neeto-ui-bg-primary-500": !AppIcon
124
- })
125
- }, AppIcon ? /*#__PURE__*/React.createElement(AppIcon, {
126
- size: 42
127
- }) : /*#__PURE__*/React.createElement(NeetoIcon, {
128
- color: "white",
129
- size: 42
130
- })), /*#__PURE__*/React.createElement("div", {
131
- className: "neeto-molecules-app-switcher-link__content"
132
- }, /*#__PURE__*/React.createElement(Typography, {
133
- component: "span",
134
- lineHeight: "relaxed",
135
- style: "h4",
136
- weight: "medium"
137
- }, name), /*#__PURE__*/React.createElement(Typography, {
138
- component: "span",
139
- style: "body3",
140
- weight: "normal"
141
- }, description)));
142
- };
143
- var AppLink$1 = /*#__PURE__*/React.memo(AppLink);
144
-
145
- var Body = function Body() {
146
- var _useTranslation = useTranslation(),
147
- t = _useTranslation.t;
148
- var _useState = useState(""),
149
- _useState2 = _slicedToArray(_useState, 2),
150
- searchTerm = _useState2[0],
151
- setSearchTerm = _useState2[1];
152
- var _useFetchNeetoApps = useFetchNeetoApps(),
153
- data = _useFetchNeetoApps.data;
154
- var substring = searchTerm.replace(/ /g, "").toLowerCase();
155
- var filteredApps = data === null || data === void 0 ? void 0 : data.neetoApps.filter(function (_ref) {
156
- var name = _ref.name;
157
- return name.toLowerCase().includes(substring);
158
- });
159
- var handleSearch = function handleSearch(e) {
160
- return setSearchTerm(e.target.value);
161
- };
162
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
163
- className: "neeto-molecules-app-switcher__header",
164
- "data-cy": "app-switcher-body-wrapper"
165
- }, /*#__PURE__*/React.createElement(Typography, {
166
- style: "h1"
167
- }, t("neetoMolecules.appSwitcher.chooseNeetoProduct")), /*#__PURE__*/React.createElement("div", {
168
- className: "neeto-molecules-app-switcher__search-wrapper"
169
- }, /*#__PURE__*/React.createElement(Input, {
170
- autoFocus: true,
171
- "data-cy": "app-switcher-search-input",
172
- placeholder: t("neetoMolecules.appSwitcher.searchProducts"),
173
- prefix: /*#__PURE__*/React.createElement(Search, null),
174
- type: "search",
175
- value: searchTerm,
176
- onChange: handleSearch
177
- }))), /*#__PURE__*/React.createElement("div", {
178
- className: "neeto-molecules-app-switcher__body"
179
- }, (filteredApps === null || filteredApps === void 0 ? void 0 : filteredApps.length) > 0 ? /*#__PURE__*/React.createElement("div", {
180
- className: "neeto-molecules-app-switcher__grid"
181
- }, filteredApps.map(function (app) {
182
- return /*#__PURE__*/React.createElement(AppLink$1, _extends({
183
- key: app.name
184
- }, app));
185
- })) : /*#__PURE__*/React.createElement(Typography, {
186
- className: "neeto-ui-text-center",
187
- style: "body1"
188
- }, t("neetoMolecules.appSwitcher.noApps"))));
189
- };
190
-
191
- var AppSwitcher = function AppSwitcher() {
192
- return /*#__PURE__*/React.createElement("div", {
193
- className: "neeto-molecules-app-switcher__wrapper",
194
- "data-cy": "switcher-wrapper",
195
- "data-testid": "switcher-wrapper",
196
- key: "switcher-wrapper"
197
- }, /*#__PURE__*/React.createElement(Body, null));
198
- };
199
-
200
- var css = ":root{--neeto-molecules-sidebar-width:240px;--neeto-molecules-sidebar-z-index:99998;--neeto-chat-primary:136,134,255;--neeto-wireframe-primary:106,103,232;--neeto-site-primary:129,118,255;--neeto-desk-primary:253,148,55;--neeto-planner-primary:82,169,198;--neeto-replay-primary:32,199,189;--neeto-course-primary:140,214,114;--neeto-ci-primary:255,133,184;--neeto-invoice-primary:70,160,211;--neeto-quiz-primary:254,99,99;--neeto-runner-primary:75,71,255;--neeto-form-primary:254,128,114;--neeto-crm-primary:96,154,240;--neeto-changelog-primary:255,135,135;--neeto-deploy-primary:20,209,164;--neeto-kb-primary:101,205,161;--neeto-cal-primary:238,77,95;--neeto-invisible-primary:121,157,250;--neeto-testify-primary:255,158,69;--neeto-monitor-primary:70,181,197;--neeto-git-primary:255,78,110}.neeto-molecules-sidebar__wrapper{display:flex;max-width:240px;max-width:var(--neeto-molecules-sidebar-width);position:relative;transition:all .15s;width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar__wrapper--collapsed{max-width:0;width:0}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{right:-36px;transform:scale(-1)}.neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-gray-100));border-right:1px solid rgb(var(--neeto-ui-gray-100));height:100vh;padding:24px 0;width:100%;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar__no-shrinkable{max-width:240px;max-width:var(--neeto-molecules-sidebar-width);width:240px;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar::-webkit-scrollbar{height:0;width:0}.neeto-molecules-sidebar::-webkit-scrollbar-thumb{background:rgb(var(--neeto-ui-gray-300));border-radius:50px}.neeto-molecules-sidebar::-webkit-scrollbar-track{background:\"transparent\"}.neeto-molecules-sidebar__toggler{position:absolute;right:8px;top:8px;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar__header{margin:14px 0 28px;padding:0 24px}.neeto-molecules-sidebar__logo svg{height:20px;max-width:100%;width:auto}.neeto-molecules-sidebar__links{margin-bottom:40px}.neeto-molecules-sidebar__link{color:rgb(var(--neeto-ui-gray-800));gap:10px;padding:12px 24px;position:relative;text-decoration:none!important;transition:var(--neeto-ui-transition);width:100%}.neeto-molecules-sidebar__link-icon{flex-shrink:0;transition:var(--neeto-ui-transition)}.neeto-molecules-sidebar__link-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-sidebar__link-icon--rotate{transform:scale(-1)}.neeto-molecules-sidebar__link-icon--caret{opacity:0;transition:opacity .3s ease-in-out}.neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__link-sub-label{flex-grow:1;text-align:left}.neeto-molecules-sidebar__link:hover{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link:focus,.neeto-molecules-sidebar__link:focus-visible,.neeto-molecules-sidebar__link[aria-expanded=true]{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));outline:none}.neeto-molecules-sidebar__link.active{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-label{font-weight:var(--neeto-ui-font-medium)}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus-visible .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:hover .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link[aria-expanded=true] .neeto-molecules-sidebar__link-icon--caret{opacity:1}.neeto-molecules-sidebar__link--button:focus{background-color:transparent}.neeto-molecules-sidebar__link--button:focus-visible{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-sidebar__link--change-log{outline:none!important}.neeto-molecules-sidebar__sublink-wrapper{background-color:rgb(var(--neeto-ui-white));padding:4px 0}.neeto-molecules-sidebar__sublink{background-color:rgb(var(--neeto-ui-white));color:rgb(var(--neeto-ui-gray-700));cursor:pointer;gap:8px;padding:8px 24px 8px 58px;text-decoration:none;transition:all .3s}.neeto-molecules-sidebar__sublink:not(:last-child){margin-bottom:4px}.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{opacity:.75}.neeto-molecules-sidebar__sublink:hover{color:rgb(var(--neeto-ui-gray-800));text-decoration:none}.neeto-molecules-sidebar__sublink:hover .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink:focus,.neeto-molecules-sidebar__sublink:focus-visible{color:rgb(var(--neeto-ui-gray-800));outline:none;text-decoration:none}.neeto-molecules-sidebar__sublink:focus .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:focus-visible .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink.active,.neeto-molecules-sidebar__sublink:active{color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);text-decoration:none}.neeto-molecules-sidebar__sublink.active .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:active .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__footer{margin-top:auto}.sidebar-featured-tooltip__content{border-radius:8px!important;box-shadow:var(--neeto-ui-shadow-sm)!important}.sidebar-featured-tooltip__content .tippy-content{padding:0}.sidebar-featured-tooltip{padding:12px;width:150px}.sidebar-featured-tooltip__icon-wrap{background-color:rgb(var(--neeto-ui-gray-100));border-radius:8px;height:40px;margin-bottom:8px;margin-left:auto;margin-right:auto;width:40px}.sidebar-featured-tooltip__title{margin-bottom:4px}.neeto-molecules-app-switcher-popup-wrapper,.neeto-molecules-help-popup-wrapper,.neeto-molecules-profile-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.2)!important;min-width:240px}.neeto-molecules-app-switcher-popup-wrapper .tippy-content,.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-app-switcher-popup-wrapper .tippy-svg-arrow,.neeto-molecules-help-popup-wrapper .tippy-svg-arrow,.neeto-molecules-profile-popup-wrapper .tippy-svg-arrow{display:none!important}.neeto-molecules-profile-popup__top-section{border-top-left-radius:var(--neeto-ui-rounded);border-top-right-radius:var(--neeto-ui-rounded)}.neeto-molecules-profile-sublist{border-top:1px solid rgb(var(--neeto-ui-gray-400))}.neeto-molecules-help-sublist,.neeto-molecules-profile-sublist{list-style:none;margin:0;padding:4px 0}.neeto-molecules-help-sublist__item,.neeto-molecules-profile-sublist__item{width:100%}.neeto-molecules-help-sublist__item-btn,.neeto-molecules-profile-sublist__item-btn{border-radius:0;justify-content:flex-end!important;min-height:40px;text-align:left}.neeto-molecules-help-sublist__item-btn.active,.neeto-molecules-profile-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-help-sublist__item-btn-icon svg path,.neeto-molecules-profile-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-help-sublist__item-btn span,.neeto-molecules-profile-sublist__item-btn span{align-items:center;display:flex;gap:8px}.neeto-molecules-sidebar__link-icon{position:relative}.neeto-molecules-sidebar__notif-count{position:absolute;right:-6px;top:-6px;z-index:1}.neeto-molecules-help-sublist__item-btn-count,.neeto-molecules-sidebar__notif-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);height:16px;justify-content:center;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.neeto-molecules-app-switcher-popup-wrapper{height:calc(100vh - 16px);margin-bottom:8px;min-width:calc(100vw - 176px);overflow-y:auto}";
201
- n(css,{});
202
-
203
- var AppSwitcherButton = function AppSwitcherButton() {
204
- var _useTranslation = useTranslation(),
205
- t = _useTranslation.t;
206
- var _useState = useState(false),
207
- _useState2 = _slicedToArray(_useState, 2),
208
- hasHovered = _useState2[0],
209
- setHasHovered = _useState2[1];
210
- var _useFetchNeetoApps = useFetchNeetoApps(),
211
- data = _useFetchNeetoApps.data,
212
- refetchNeetoApps = _useFetchNeetoApps.refetch,
213
- isStale = _useFetchNeetoApps.isStale;
214
- return /*#__PURE__*/React.createElement(Tooltip, {
215
- interactive: true,
216
- className: "neeto-molecules-app-switcher-popup-wrapper",
217
- content: /*#__PURE__*/React.createElement(AppSwitcher, null),
218
- disabled: !data,
219
- hideOnClick: false,
220
- interactiveDebounce: 20,
221
- offset: [0, -70],
222
- position: "right",
223
- theme: "light"
224
- }, /*#__PURE__*/React.createElement("button", {
225
- className: "neeto-molecules-sidebar__link neeto-molecules-sidebar__link--app-switcher neeto-molecules-sidebar__link--button neeto-ui-flex neeto-ui-w-full neeto-ui-select-none neeto-ui-items-center neeto-ui-justify-start neeto-ui-shadow-none",
226
- "data-cy": "app-switcher-button",
227
- "data-testid": "app-switcher-button",
228
- onMouseEnter: function onMouseEnter() {
229
- if (hasHovered || !isStale) return;
230
- refetchNeetoApps();
231
- setHasHovered(true);
232
- }
233
- }, /*#__PURE__*/React.createElement("span", {
234
- className: "neeto-molecules-sidebar__link-icon neeto-ui-flex neeto-ui-items-center neeto-ui-justify-center h-6 w-6"
235
- }, !data && hasHovered ? /*#__PURE__*/React.createElement("span", {
236
- "data-testid": "app-switcher-button-loader"
237
- }, /*#__PURE__*/React.createElement(Spinner, null)) : /*#__PURE__*/React.createElement(AppSwitcher$1, {
238
- size: 24
239
- })), /*#__PURE__*/React.createElement(Typography, {
240
- className: "neeto-molecules-sidebar__link-label",
241
- component: "span",
242
- style: "body2",
243
- weight: "normal"
244
- }, t("neetoMolecules.sidebar.productSwitcher"))));
245
- };
246
-
247
- var MY_PROFILE_URL = "/auth/profile/edit";
248
- var MY_ORGANIZATION_URL = "/auth/organization/edit";
249
- var CHANGELOG_WIDGET_TRIGGER_ID = "neetochangelog-trigger";
250
- var DEFAULT_HELP_LINK_PROPS = {
251
- liveChatProps: {
252
- label: t$1("neetoMolecules.sidebar.helpLinks.liveChat"),
253
- icon: ChatEmpty,
254
- "data-cy": "help-link-live-chat-button",
255
- onClick: function onClick() {
256
- var _window$NeetoChat, _window$NeetoChat$con, _window$NeetoChat2, _window$NeetoChat2$co;
257
- (_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 ? void 0 : (_window$NeetoChat$con = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat$con === void 0 ? void 0 : _window$NeetoChat$con.maximizeWidget();
258
- (_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 ? void 0 : (_window$NeetoChat2$co = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2$co === void 0 ? void 0 : _window$NeetoChat2$co.openWidget();
259
- }
260
- },
261
- helpCenterProps: {
262
- label: t$1("neetoMolecules.sidebar.helpLinks.helpArticles"),
263
- icon: Book,
264
- "data-cy": "help-link-help-center-button",
265
- href: "https://help.".concat(toLower(globalProps.appName), ".com/"),
266
- target: "_blank"
267
- },
268
- changelogProps: {
269
- id: CHANGELOG_WIDGET_TRIGGER_ID,
270
- label: t$1("neetoMolecules.sidebar.helpLinks.whatsNew"),
271
- icon: Gift,
272
- "data-cy": "help-link-changelog-button"
273
- },
274
- keyboardShortcutProps: {
275
- label: t$1("neetoMolecules.sidebar.helpLinks.keyboardShortcuts"),
276
- icon: Keyboard,
277
- "data-cy": "help-link-keyboard-shortcut-button"
278
- }
279
- };
280
-
281
- var isSubRouteActive = function isSubRouteActive(subRoute, location) {
282
- var currentBrowserUrl = new URL(location.pathname + location.search, window.location.origin);
283
- var targetUrl = new URL(subRoute, window.location.origin);
284
- if (!currentBrowserUrl.pathname.startsWith(targetUrl.pathname)) {
285
- return false;
286
- }
287
- var targetSearchParams = targetUrl.searchParams;
288
- var targetSearchKeys = Array.from(targetSearchParams.keys());
289
- return all(function (key) {
290
- return currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key);
291
- }, targetSearchKeys);
292
- };
293
- var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
294
- var _globalProps$user, _globalProps$user2;
295
- var user = ((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email) || ((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.phoneNumber);
296
- return "sidebarState-".concat(user);
297
- };
298
-
299
- var getProfileInfo = function getProfileInfo(isOwner, profileInfoOverrides) {
300
- var _globalProps$user, _globalProps$user2, _globalProps$user3, _globalProps$user4, _globalProps$user5;
301
- return mergeDeepLeft(profileInfoOverrides, {
302
- name: "".concat((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.firstName, " ").concat((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.lastName),
303
- imageUrl: (_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.profileImageUrl,
304
- email: ((_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.email) || ((_globalProps$user5 = globalProps.user) === null || _globalProps$user5 === void 0 ? void 0 : _globalProps$user5.phoneNumber),
305
- topLinks: [{
306
- label: t$1("neetoMolecules.sidebar.myProfile"),
307
- icon: User,
308
- onClick: function onClick() {
309
- return window.open(MY_PROFILE_URL, "_blank");
310
- },
311
- "data-cy": "my-profile-button"
312
- }, isOwner && {
313
- label: t$1("neetoMolecules.sidebar.myOrganization"),
314
- icon: Settings,
315
- onClick: function onClick() {
316
- return window.open(MY_ORGANIZATION_URL, "_blank");
317
- },
318
- "data-cy": "profile-organization-settings-button"
319
- }].filter(Boolean),
320
- bottomLinks: [{
321
- icon: LeftArrow,
322
- label: t$1("neetoMolecules.sidebar.logout"),
323
- onClick: function onClick() {
324
- resetAuthTokens();
325
- localStorage.removeItem(getSidebarStateLocalStorageKey());
326
- window.location.href = "/logout";
327
- },
328
- "data-cy": "profile-logout-button"
329
- }]
330
- });
331
- };
332
-
333
- var ProfileSection = function ProfileSection(_ref, ref) {
334
- var profileInfo = _ref.profileInfo;
335
- var _useState = useState(false),
336
- _useState2 = _slicedToArray(_useState, 2),
337
- hasHovered = _useState2[0],
338
- setHasHovered = _useState2[1];
339
- var _useFetchNeetoApps = useFetchNeetoApps(),
340
- data = _useFetchNeetoApps.data,
341
- refetchNeetoApps = _useFetchNeetoApps.refetch,
342
- isStale = _useFetchNeetoApps.isStale;
343
- return /*#__PURE__*/React.createElement("button", {
344
- className: "neeto-molecules-sidebar__link neeto-molecules-sidebar__link--button neeto-ui-shadow-none neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none",
345
- "data-cy": "profile-section",
346
- "data-testid": "profile-section",
347
- ref: ref,
348
- onMouseEnter: function onMouseEnter() {
349
- if (!hasHovered && isStale) {
350
- refetchNeetoApps();
351
- setHasHovered(true);
352
- }
353
- }
354
- }, !data && hasHovered ? /*#__PURE__*/React.createElement("span", {
355
- "data-testid": "profile-avatar-loader"
356
- }, /*#__PURE__*/React.createElement(Spinner, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Avatar, {
357
- className: "neeto-ui-flex-shrink-0 neeto-molecules-sidebar__profile-avatar",
358
- "data-testid": "profile-avatar",
359
- size: "small",
360
- user: profileInfo
361
- }), /*#__PURE__*/React.createElement(Typography, {
362
- className: "neeto-molecules-sidebar__link-label",
363
- component: "span",
364
- style: "body2",
365
- weight: "normal"
366
- }, truncate(profileInfo.name, 18))));
367
- };
368
- var ProfileSection$1 = /*#__PURE__*/forwardRef(ProfileSection);
369
-
370
- function _arrayWithoutHoles(arr) {
371
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
372
- }
373
-
374
- function _iterableToArray(iter) {
375
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
376
- }
377
-
378
- function _nonIterableSpread() {
379
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
380
- }
381
-
382
- function _toConsumableArray(arr) {
383
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
384
- }
385
-
386
- function _typeof(o) {
387
- "@babel/helpers - typeof";
388
-
389
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
390
- return typeof o;
391
- } : function (o) {
392
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
393
- }, _typeof(o);
394
- }
395
-
396
- function _toPrimitive(input, hint) {
397
- if (_typeof(input) !== "object" || input === null) return input;
398
- var prim = input[Symbol.toPrimitive];
399
- if (prim !== undefined) {
400
- var res = prim.call(input, hint || "default");
401
- if (_typeof(res) !== "object") return res;
402
- throw new TypeError("@@toPrimitive must return a primitive value.");
403
- }
404
- return (hint === "string" ? String : Number)(input);
405
- }
406
-
407
- function _toPropertyKey(arg) {
408
- var key = _toPrimitive(arg, "string");
409
- return _typeof(key) === "symbol" ? key : String(key);
410
- }
411
-
412
- function _defineProperty(obj, key, value) {
413
- key = _toPropertyKey(key);
414
- if (key in obj) {
415
- Object.defineProperty(obj, key, {
416
- value: value,
417
- enumerable: true,
418
- configurable: true,
419
- writable: true
420
- });
421
- } else {
422
- obj[key] = value;
423
- }
424
- return obj;
425
- }
426
-
427
- function _objectWithoutPropertiesLoose(source, excluded) {
428
- if (source == null) return {};
429
- var target = {};
430
- var sourceKeys = Object.keys(source);
431
- var key, i;
432
- for (i = 0; i < sourceKeys.length; i++) {
433
- key = sourceKeys[i];
434
- if (excluded.indexOf(key) >= 0) continue;
435
- target[key] = source[key];
436
- }
437
- return target;
438
- }
439
-
440
- function _objectWithoutProperties(source, excluded) {
441
- if (source == null) return {};
442
- var target = _objectWithoutPropertiesLoose(source, excluded);
443
- var key, i;
444
- if (Object.getOwnPropertySymbols) {
445
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
446
- for (i = 0; i < sourceSymbolKeys.length; i++) {
447
- key = sourceSymbolKeys[i];
448
- if (excluded.indexOf(key) >= 0) continue;
449
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
450
- target[key] = source[key];
451
- }
452
- }
453
- return target;
454
- }
455
-
456
- var _excluded$2 = ["onClick", "label", "icon"];
457
- function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
458
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
459
- var LinkSection = function LinkSection(_ref) {
460
- var links = _ref.links;
461
- return /*#__PURE__*/React.createElement("ul", {
462
- className: "neeto-molecules-profile-sublist"
463
- }, links.map(function (_ref2, idx) {
464
- var onClick = _ref2.onClick,
465
- label = _ref2.label,
466
- _ref2$icon = _ref2.icon,
467
- icon = _ref2$icon === void 0 ? null : _ref2$icon,
468
- otherProps = _objectWithoutProperties(_ref2, _excluded$2);
469
- return /*#__PURE__*/React.createElement("li", {
470
- className: "neeto-molecules-profile-sublist__item",
471
- key: idx
472
- }, /*#__PURE__*/React.createElement(Button, _extends({
473
- fullWidth: true,
474
- className: "neeto-molecules-profile-sublist__item-btn",
475
- iconPosition: "left",
476
- iconSize: 18,
477
- style: "text"
478
- }, _objectSpread$2({
479
- icon: icon,
480
- label: label,
481
- onClick: onClick
482
- }, otherProps))));
483
- }));
484
- };
485
-
486
- var ProfileMenu = function ProfileMenu(_ref) {
487
- var profileInfo = _ref.profileInfo,
488
- extraTopLinks = _ref.extraTopLinks;
489
- var name = profileInfo.name,
490
- email = profileInfo.email,
491
- topLinks = profileInfo.topLinks,
492
- bottomLinks = profileInfo.bottomLinks,
493
- customContent = profileInfo.customContent;
494
- return /*#__PURE__*/React.createElement("div", {
495
- className: "neeto-ui-flex neeto-ui-flex-col neeto-molecules-profile-popup",
496
- "data-cy": "profile-popup",
497
- "data-testid": "profile-popup"
498
- }, /*#__PURE__*/React.createElement("div", {
499
- className: classnames("neeto-ui-relative neeto-ui-flex neeto-ui-items-center neeto-ui-p-3 neeto-ui-bg-primary-100 neeto-molecules-profile-popup__top-section")
500
- }, /*#__PURE__*/React.createElement("div", {
501
- className: "top-0 left-0"
502
- }, /*#__PURE__*/React.createElement(Avatar, {
503
- size: "large",
504
- user: profileInfo
505
- })), /*#__PURE__*/React.createElement("div", {
506
- className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-grow neeto-ui-min-w-0 neeto-ui-pl-3"
507
- }, /*#__PURE__*/React.createElement(Typography, {
508
- className: "neeto-ui-m-0",
509
- component: "h2",
510
- lineHeight: "tight",
511
- style: "h5",
512
- title: name,
513
- weight: "semibold"
514
- }, truncate(name, 18)), email && /*#__PURE__*/React.createElement(Typography, {
515
- className: "neeto-ui-w-full neeto-ui-truncate neeto-ui-text-gray-700",
516
- lineHeight: "tight",
517
- style: "body3"
518
- }, email))), /*#__PURE__*/React.createElement("div", {
519
- className: "neeto-molecules-sidebar__profile-wrapper-custom-content"
520
- }, customContent), topLinks && /*#__PURE__*/React.createElement(LinkSection, {
521
- links: [].concat(_toConsumableArray(extraTopLinks), _toConsumableArray(topLinks))
522
- }), bottomLinks && /*#__PURE__*/React.createElement(LinkSection, {
523
- links: bottomLinks
524
- }));
525
- };
526
-
527
- var ProfileButton = function ProfileButton(_ref) {
528
- var extraTopLinks = _ref.extraTopLinks,
529
- profileInfoOverrides = _ref.profileInfoOverrides;
530
- var _useFetchNeetoApps = useFetchNeetoApps(),
531
- data = _useFetchNeetoApps.data;
532
- var profileInfo = getProfileInfo(data === null || data === void 0 ? void 0 : data.isOwner, profileInfoOverrides);
533
- return /*#__PURE__*/React.createElement(Tooltip, {
534
- interactive: true,
535
- className: "neeto-molecules-profile-popup-wrapper",
536
- content: /*#__PURE__*/React.createElement(ProfileMenu, {
537
- extraTopLinks: extraTopLinks,
538
- profileInfo: profileInfo
539
- }),
540
- disabled: !data,
541
- hideOnClick: false,
542
- interactiveDebounce: 20,
543
- offset: [0, -70],
544
- position: "right",
545
- theme: "light"
546
- }, /*#__PURE__*/React.createElement(ProfileSection$1, {
547
- profileInfo: profileInfo
548
- }));
549
- };
550
-
551
- // Rule can be enabled once the ticket - https://github.com/bigbinary/neeto-commons-frontend/issues/905 is closed.
552
- // eslint-disable-next-line @bigbinary/neeto/no-dumb-components-with-use-translation
553
- var HelpSection = function HelpSection(_ref, ref) {
554
- var changesCount = _ref.changesCount;
555
- var _useTranslation = useTranslation(),
556
- t = _useTranslation.t;
557
- return /*#__PURE__*/React.createElement("button", {
558
- className: "neeto-molecules-sidebar__link neeto-molecules-sidebar__link--button neeto-ui-shadow-none neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none",
559
- "data-cy": "help-button",
560
- ref: ref
561
- }, /*#__PURE__*/React.createElement("span", {
562
- className: "neeto-molecules-sidebar__link-icon neeto-ui-flex neeto-ui-items-center neeto-ui-justify-center"
563
- }, /*#__PURE__*/React.createElement(Help, {
564
- size: 24
565
- }), isPresent(changesCount) && /*#__PURE__*/React.createElement("span", {
566
- className: "neeto-molecules-sidebar__notif-count",
567
- "data-testid": "help-icon-changes-count"
568
- }, changesCount)), /*#__PURE__*/React.createElement(Typography, {
569
- className: "neeto-molecules-sidebar__link-label",
570
- component: "span",
571
- style: "body2",
572
- weight: "normal"
573
- }, t("neetoMolecules.sidebar.helpLinks.helpCenter")));
574
- };
575
- var HelpSection$1 = /*#__PURE__*/forwardRef(HelpSection);
576
-
577
- var _excluded$1 = ["label"];
578
- function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
579
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
580
- var HelpSectionMenu = function HelpSectionMenu(_ref) {
581
- var helpLinkOverrides = _ref.helpLinkOverrides,
582
- changesCount = _ref.changesCount;
583
- var _KeyboardShortcuts$us = KeyboardShortcuts.usePaneState(),
584
- _KeyboardShortcuts$us2 = _slicedToArray(_KeyboardShortcuts$us, 2),
585
- setIsOpen = _KeyboardShortcuts$us2[1];
586
- var helpLinks = Object.keys(DEFAULT_HELP_LINK_PROPS).map(function (key) {
587
- return _objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, DEFAULT_HELP_LINK_PROPS[key]), helpLinkOverrides[key]), key === "keyboardShortcutProps" && {
588
- onClick: function onClick() {
589
- return setIsOpen(true);
590
- }
591
- }), key === "changelogProps" && changesCount && {
592
- changesCount: changesCount
593
- });
594
- }).filter(function (_ref2) {
595
- var hide = _ref2.hide;
596
- return !hide;
597
- });
598
- return /*#__PURE__*/React.createElement("ul", {
599
- className: "neeto-molecules-help-sublist"
600
- }, helpLinks.map(function (_ref3, idx) {
601
- var label = _ref3.label,
602
- buttonProps = _objectWithoutProperties(_ref3, _excluded$1);
603
- return /*#__PURE__*/React.createElement("li", {
604
- className: "neeto-molecules-help-sublist__item",
605
- key: idx
606
- }, /*#__PURE__*/React.createElement(Button, _extends({
607
- fullWidth: true,
608
- className: "neeto-molecules-help-sublist__item-btn",
609
- iconPosition: "left",
610
- iconSize: 18,
611
- style: "text"
612
- }, buttonProps), label, isPresent(buttonProps.changesCount) && /*#__PURE__*/React.createElement("span", {
613
- className: "neeto-molecules-help-sublist__item-btn-count",
614
- "data-testid": "help-section-menu-changes-count"
615
- }, buttonProps.changesCount)));
616
- }));
617
- };
618
-
619
- var Footer = function Footer(_ref) {
620
- var extraTopLinks = _ref.extraTopLinks,
621
- helpLinkOverrides = _ref.helpLinkOverrides,
622
- profileInfoOverrides = _ref.profileInfoOverrides,
623
- _ref$showAppSwitcher = _ref.showAppSwitcher,
624
- showAppSwitcher = _ref$showAppSwitcher === void 0 ? false : _ref$showAppSwitcher;
625
- var _useState = useState(null),
626
- _useState2 = _slicedToArray(_useState, 2),
627
- changesCount = _useState2[0],
628
- setChangesCount = _useState2[1];
629
- useEffect(function () {
630
- var Nv = {
631
- onReceiveData: function onReceiveData(data) {
632
- if (!data.unreadCount) return;
633
- setChangesCount(data.unreadCount);
634
- },
635
- onShow: function onShow() {
636
- setChangesCount(null);
637
- }
638
- };
639
- window.Nv = window.Nv ? Object.assign(window.Nv, Nv) : Nv;
640
- }, []);
641
- return /*#__PURE__*/React.createElement("div", {
642
- className: "neeto-molecules-sidebar__footer neeto-molecules-sidebar__no-shrinkable"
643
- }, /*#__PURE__*/React.createElement(Tooltip, {
644
- interactive: true,
645
- className: "neeto-molecules-help-popup-wrapper",
646
- content: /*#__PURE__*/React.createElement(HelpSectionMenu, {
647
- changesCount: changesCount,
648
- helpLinkOverrides: helpLinkOverrides
649
- }),
650
- hideOnClick: false,
651
- interactiveDebounce: 20,
652
- offset: [0, -70],
653
- position: "right",
654
- theme: "light"
655
- }, /*#__PURE__*/React.createElement(HelpSection$1, {
656
- changesCount: changesCount
657
- })), showAppSwitcher && /*#__PURE__*/React.createElement(AppSwitcherButton, null), /*#__PURE__*/React.createElement(ProfileButton, {
658
- extraTopLinks: extraTopLinks,
659
- profileInfoOverrides: profileInfoOverrides
660
- }));
661
- };
16
+ import { _ as _extends } from './extends-093996c9.js';
17
+ import { _ as _defineProperty } from './defineProperty-549061a7.js';
18
+ import { _ as _objectWithoutProperties } from './objectWithoutProperties-a0edb288.js';
19
+ import { Down } from '@bigbinary/neeto-icons';
20
+ import '@bigbinary/neeto-commons-frontend/utils/general';
21
+ import '@bigbinary/neeto-filters-frontend';
22
+ import '@bigbinary/neeto-commons-frontend/react-utils/useRegisterNavigationCheckpoint';
23
+ import './inject-css-c86de496.js';
662
24
 
663
25
  var Header = function Header(_ref) {
664
26
  var _ProductTypefaceLogos;
665
- var customLogo = _ref.customLogo;
27
+ var customLogo = _ref.customLogo,
28
+ clearSettingsNav = _ref.clearSettingsNav,
29
+ homePath = _ref.homePath;
666
30
  var productName = globalProps.appName.substr(5);
667
31
  var logoName = "Neeto".concat(capitalize(productName.toLowerCase()));
668
32
  var ProductTypefaceLogo = (_ProductTypefaceLogos = ProductTypefaceLogos[logoName]) !== null && _ProductTypefaceLogos !== void 0 ? _ProductTypefaceLogos : Neeto;
669
33
  var LogoComponent = customLogo !== null && customLogo !== void 0 ? customLogo : ProductTypefaceLogo;
670
34
  var _useFetchNeetoApps = useFetchNeetoApps(),
671
35
  data = _useFetchNeetoApps.data;
672
- var homePath = "/";
36
+ var appHomePath = homePath;
673
37
  if (data !== null && data !== void 0 && data.neetoApps) {
674
38
  var thisApp = findBy({
675
39
  name: productName
676
40
  }, data.neetoApps);
677
41
  if (thisApp !== null && thisApp !== void 0 && thisApp.url) {
678
- homePath = new URL(thisApp === null || thisApp === void 0 ? void 0 : thisApp.url).pathname;
42
+ appHomePath = new URL(thisApp === null || thisApp === void 0 ? void 0 : thisApp.url).pathname;
679
43
  }
680
44
  }
681
- return /*#__PURE__*/React.createElement("div", {
45
+ return /*#__PURE__*/React__default.createElement("div", {
682
46
  className: "neeto-molecules-sidebar__header neeto-molecules-sidebar__no-shrinkable",
683
47
  "data-cy": "sidebar-info"
684
- }, /*#__PURE__*/React.createElement(Link, {
48
+ }, /*#__PURE__*/React__default.createElement(Link, {
685
49
  className: "neeto-molecules-sidebar__logo neeto-ui-w-full",
686
- to: homePath
687
- }, /*#__PURE__*/React.createElement(LogoComponent, null)));
50
+ to: appHomePath,
51
+ onClick: clearSettingsNav
52
+ }, /*#__PURE__*/React__default.createElement(LogoComponent, null)));
688
53
  };
689
- var Header$1 = /*#__PURE__*/React.memo(Header);
54
+ var Header$1 = /*#__PURE__*/React__default.memo(Header);
690
55
 
691
- var _excluded = ["label", "to", "icon", "items"],
692
- _excluded2 = ["label", "to", "count", "dataCy"];
56
+ var _excluded = ["label", "to", "icon", "items", "isConfigureNavLink", "isCountsLoading"];
693
57
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
694
58
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
695
59
  var Links = function Links(_ref) {
696
- var navLinks = _ref.navLinks;
60
+ var navLinks = _ref.navLinks,
61
+ isCountsLoadingDeprecated = _ref.isCountsLoading,
62
+ setSelectedNavLinkRoute = _ref.setSelectedNavLinkRoute;
697
63
  var location = useLocation();
698
64
  var _useState = useState(true),
699
65
  _useState2 = _slicedToArray(_useState, 2),
700
66
  isActiveLinkExpanded = _useState2[0],
701
67
  setIsActiveLinkExpanded = _useState2[1];
702
- var filterByPermissions = curry(function (_ref2) {
703
- var permissions = _ref2.permissions;
704
- if (permissions) {
705
- return is(Array, permissions) ? permissions.some(includes(__, globalProps$1.permissions)) : globalProps$1.permissions.includes(permissions);
706
- }
707
- return true;
708
- });
709
- var handleNavLinkClick = function handleNavLinkClick(event, isActive, items) {
68
+ var handleNavLinkClick = function handleNavLinkClick(_ref2) {
69
+ var event = _ref2.event,
70
+ isActive = _ref2.isActive,
71
+ items = _ref2.items,
72
+ navLink = _ref2.navLink;
710
73
  if (isNotPresent(items)) return;
74
+ if (navLink.isConfigureNavLink && isNotEmpty(navLink.items)) {
75
+ setSelectedNavLinkRoute(navLink.to);
76
+ }
711
77
  if (isActive()) {
712
78
  setIsActiveLinkExpanded(not);
713
79
  event.preventDefault();
@@ -715,141 +81,178 @@ var Links = function Links(_ref) {
715
81
  }
716
82
  setIsActiveLinkExpanded(true);
717
83
  };
718
- return /*#__PURE__*/React.createElement("div", {
84
+ return /*#__PURE__*/React__default.createElement("div", {
719
85
  className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__no-shrinkable"
720
- }, navLinks.filter(filterByPermissions).map(function (_ref3, mainIndex) {
721
- var label = _ref3.label,
722
- to = _ref3.to,
723
- icon = _ref3.icon,
724
- items = _ref3.items,
725
- otherProps = _objectWithoutProperties(_ref3, _excluded);
86
+ }, navLinks.filter(filterByPermissions).map(function (navLink, index) {
87
+ var label = navLink.label,
88
+ to = navLink.to,
89
+ icon = navLink.icon,
90
+ items = navLink.items,
91
+ isConfigureNavLink = navLink.isConfigureNavLink,
92
+ _navLink$isCountsLoad = navLink.isCountsLoading,
93
+ isCountsLoading = _navLink$isCountsLoad === void 0 ? false : _navLink$isCountsLoad,
94
+ otherProps = _objectWithoutProperties(navLink, _excluded);
726
95
  var IconSVG = icon;
727
96
  var url = new URL(to, window.location.href);
728
97
  var isActive = function isActive() {
729
98
  return is(Function, otherProps.isActive) ? otherProps.isActive() : location.pathname.startsWith(url.pathname);
730
99
  };
731
- var isMenuExpanded = isActive() && isActiveLinkExpanded;
732
- return /*#__PURE__*/React.createElement(React.Fragment, {
733
- key: mainIndex
734
- }, /*#__PURE__*/React.createElement(NavLink, _extends({
100
+ var isMenuExpanded = isActive() && isActiveLinkExpanded && !isCountsLoadingDeprecated;
101
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
102
+ key: index
103
+ }, /*#__PURE__*/React__default.createElement(CheckPointNavLinks, _extends({
735
104
  activeClassName: "active",
736
105
  className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-ui-select-none neeto-molecules-sidebar__link",
106
+ "data-testid": "navlink-".concat(hyphenate(label)),
737
107
  onClick: function onClick(event) {
738
- return handleNavLinkClick(event, isActive, items);
108
+ return handleNavLinkClick({
109
+ event: event,
110
+ isActive: isActive,
111
+ items: items,
112
+ navLink: navLink
113
+ });
739
114
  }
740
115
  }, _objectSpread({
741
116
  isActive: isActive,
742
117
  to: to
743
- }, otherProps)), icon && /*#__PURE__*/React.createElement("span", {
118
+ }, otherProps)), icon && /*#__PURE__*/React__default.createElement("span", {
744
119
  className: "neeto-molecules-sidebar__link-icon",
745
120
  "data-testid": label
746
- }, /*#__PURE__*/React.createElement(IconSVG, null)), /*#__PURE__*/React.createElement(Typography, {
121
+ }, /*#__PURE__*/React__default.createElement(IconSVG, null)), /*#__PURE__*/React__default.createElement(Typography, {
747
122
  className: "neeto-molecules-sidebar__link-label",
748
123
  component: "span",
749
- style: "body2",
750
- weight: "normal"
751
- }, label), items && /*#__PURE__*/React.createElement("span", {
124
+ style: "body2"
125
+ }, label), items && !isConfigureNavLink && /*#__PURE__*/React__default.createElement("span", {
752
126
  className: classnames("neeto-molecules-sidebar__link-icon neeto-molecules-sidebar__link-icon--caret", {
753
127
  "neeto-molecules-sidebar__link-icon--rotate": isMenuExpanded
754
128
  })
755
- }, /*#__PURE__*/React.createElement(Down, {
129
+ }, /*#__PURE__*/React__default.createElement(Down, {
756
130
  size: 16
757
- }))), items && isMenuExpanded && /*#__PURE__*/React.createElement("div", {
758
- className: "neeto-molecules-sidebar__sublink-wrapper",
759
- "data-cy": "sidebar-sub-link-wrapper"
760
- }, items.filter(filterByPermissions).map(function (_ref4, subIndex) {
761
- var subLabel = _ref4.label,
762
- subRoute = _ref4.to,
763
- count = _ref4.count,
764
- dataCy = _ref4.dataCy,
765
- otherProps = _objectWithoutProperties(_ref4, _excluded2);
766
- return /*#__PURE__*/React.createElement(NavLink, _extends({
767
- activeClassName: "active",
768
- className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
769
- "data-cy": "".concat(dataCy, "-sub-link"),
770
- isActive: function isActive() {
771
- return isSubRouteActive(subRoute, location);
772
- },
773
- key: subIndex,
774
- to: subRoute
775
- }, otherProps), /*#__PURE__*/React.createElement(Typography, {
776
- className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
777
- component: "span",
778
- "data-cy": "".concat(dataCy, "-sub-link-label"),
779
- style: "body2"
780
- }, subLabel), /*#__PURE__*/React.createElement(Typography, {
781
- className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
782
- component: "span",
783
- "data-cy": "".concat(dataCy, "-sub-link-count"),
784
- style: "body2"
785
- }, count > 999 ? "999+" : count));
786
- })));
131
+ }))), items && !isConfigureNavLink && isMenuExpanded && /*#__PURE__*/React__default.createElement(Items, _objectSpread({
132
+ isCountsLoading: isCountsLoading,
133
+ items: items
134
+ }, otherProps)));
787
135
  }));
788
136
  };
789
137
 
790
138
  var Sidebar = function Sidebar(_ref) {
791
139
  var navLinks = _ref.navLinks,
792
140
  customLogo = _ref.customLogo,
793
- _ref$profileInfoOverr = _ref.profileInfoOverrides,
794
- profileInfoOverrides = _ref$profileInfoOverr === void 0 ? {} : _ref$profileInfoOverr,
795
- _ref$helpLinkOverride = _ref.helpLinkOverrides,
796
- helpLinkOverrides = _ref$helpLinkOverride === void 0 ? {} : _ref$helpLinkOverride,
797
- _ref$extraTopLinks = _ref.extraTopLinks,
798
- extraTopLinks = _ref$extraTopLinks === void 0 ? [] : _ref$extraTopLinks,
799
- _ref$showAppSwitcher = _ref.showAppSwitcher,
800
- showAppSwitcher = _ref$showAppSwitcher === void 0 ? true : _ref$showAppSwitcher;
141
+ _ref$isCountsLoading = _ref.isCountsLoading,
142
+ isCountsLoading = _ref$isCountsLoading === void 0 ? false : _ref$isCountsLoading,
143
+ _ref$homePath = _ref.homePath,
144
+ homePath = _ref$homePath === void 0 ? "/" : _ref$homePath;
145
+ var productName = globalProps$1.appName.substr(5).toLowerCase();
801
146
  var _useState = useState(false),
802
147
  _useState2 = _slicedToArray(_useState, 2),
803
- isAppSwitcherOpen = _useState2[0],
804
- setIsAppSwitcherOpen = _useState2[1];
805
- var _useLocalStorage = useLocalStorage(getSidebarStateLocalStorageKey(), false),
148
+ isSidebarPaneOpen = _useState2[0],
149
+ setIsSidebarPaneOpen = _useState2[1];
150
+ var _useLocalStorage = useLocalStorage(SELECTED_NAV_LINK_ROUTE_STORAGE_KEY, null),
806
151
  _useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
807
- isSidebarCollapsed = _useLocalStorage2[0],
808
- setIsSidebarCollapsed = _useLocalStorage2[1];
152
+ selectedNavLinkRoute = _useLocalStorage2[0],
153
+ setSelectedNavLinkRoute = _useLocalStorage2[1];
154
+ var _useLocalStorage3 = useLocalStorage(getSidebarStateLocalStorageKey(), false),
155
+ _useLocalStorage4 = _slicedToArray(_useLocalStorage3, 2),
156
+ isSidebarCollapsed = _useLocalStorage4[0],
157
+ setIsSidebarCollapsed = _useLocalStorage4[1];
809
158
  var location = useLocation();
159
+ var history = useHistory();
810
160
  var _useTranslation = useTranslation(),
811
161
  t = _useTranslation.t;
162
+ var isLargerScreen = function isLargerScreen() {
163
+ return window.innerWidth > 768;
164
+ };
165
+ var isSidebarClosed = isLargerScreen() ? isSidebarCollapsed : not(isSidebarPaneOpen);
812
166
  useEffect(function () {
813
- isAppSwitcherOpen && setIsAppSwitcherOpen(false);
814
- // eslint-disable-next-line react-hooks/exhaustive-deps
815
- }, [location]);
816
- var productName = globalProps$1.appName.substr(5).toLowerCase();
817
- return /*#__PURE__*/React.createElement("div", {
167
+ if (!isPresent(navLinks)) return;
168
+ var currentLink = findLast(function (_ref2) {
169
+ var to = _ref2.to,
170
+ isActive = _ref2.isActive;
171
+ var url = new URL(to, window.location.href);
172
+ return is(Function, isActive) ? isActive() : location.pathname.includes(url.pathname);
173
+ })(navLinks);
174
+ if (isPresent(currentLink)) {
175
+ setSelectedNavLinkRoute(currentLink.isConfigureNavLink ? currentLink.to : null);
176
+ }
177
+ }, []);
178
+ useEffect(function () {
179
+ var handleResize = function handleResize() {
180
+ if (isLargerScreen()) return;
181
+ setIsSidebarPaneOpen(false);
182
+ setIsSidebarCollapsed(true);
183
+ };
184
+ window.addEventListener("resize", handleResize);
185
+ return function () {
186
+ return window.removeEventListener("resize", handleResize);
187
+ };
188
+ }, []);
189
+ var handleGoBack = function handleGoBack(event) {
190
+ event.preventDefault();
191
+ setSelectedNavLinkRoute(null);
192
+ var settingsNavLink = navLinks.find(function (link) {
193
+ return isPresent(link.isConfigureNavLink) && link.isConfigureNavLink;
194
+ });
195
+ if (settingsNavLink.to) {
196
+ history.push(buildUrl(settingsNavLink.to));
197
+ }
198
+ };
199
+ var activeLink = useMemo(function () {
200
+ return navLinks.find(function (link) {
201
+ if (is(Function, link.isActive)) return link.isActive();
202
+ var url = new URL(link.to, window.location.href);
203
+ return location.pathname.startsWith(url.pathname);
204
+ });
205
+ }, [location.pathname, navLinks]);
206
+ var isSelectedNavLinkVisible = selectedNavLinkRoute && (activeLink === null || activeLink === void 0 ? void 0 : activeLink.to) === selectedNavLinkRoute && isNotEmpty(navLinks);
207
+ return /*#__PURE__*/React__default.createElement("div", {
818
208
  "data-testid": "sidebar-container",
819
209
  className: classnames("neeto-molecules-sidebar__wrapper", {
820
- "neeto-molecules-sidebar__wrapper--collapsed": isSidebarCollapsed
210
+ "neeto-molecules-sidebar__wrapper--collapsed": isLargerScreen() ? isSidebarCollapsed : not(isSidebarPaneOpen)
821
211
  })
822
- }, /*#__PURE__*/React.createElement("div", {
823
- className: "neeto-molecules-sidebar neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-shrink-0 neeto-ui-overflow-y-auto neeto-ui-overflow-x-hidden",
212
+ }, /*#__PURE__*/React__default.createElement("div", {
213
+ className: "neeto-molecules-sidebar__backdrop",
214
+ onClick: function onClick() {
215
+ setIsSidebarPaneOpen(false);
216
+ setSelectedNavLinkRoute(null);
217
+ }
218
+ }), /*#__PURE__*/React__default.createElement("div", {
824
219
  "data-cy": "sidebar-wrapper",
825
- "data-testid": "sidebar"
826
- }, /*#__PURE__*/React.createElement(Header$1, {
827
- customLogo: customLogo
828
- }), /*#__PURE__*/React.createElement(Links, {
829
- navLinks: navLinks
830
- }), /*#__PURE__*/React.createElement(Footer, {
831
- extraTopLinks: extraTopLinks,
832
- helpLinkOverrides: helpLinkOverrides,
833
- profileInfoOverrides: profileInfoOverrides,
834
- showAppSwitcher: showAppSwitcher
835
- })), /*#__PURE__*/React.createElement(Button, {
220
+ "data-testid": "sidebar",
221
+ className: classnames("neeto-molecules-sidebar neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-shrink-0 neeto-ui-overflow-y-auto neeto-ui-overflow-x-hidden", {
222
+ "neeto-molecules-sidebar--focus-mode": isPresent(selectedNavLinkRoute)
223
+ })
224
+ }, /*#__PURE__*/React__default.createElement(Header$1, {
225
+ customLogo: customLogo,
226
+ homePath: homePath,
227
+ clearSettingsNav: function clearSettingsNav() {
228
+ return setSelectedNavLinkRoute(null);
229
+ }
230
+ }), isSelectedNavLinkVisible ? /*#__PURE__*/React__default.createElement(SelectedLink, {
231
+ handleGoBack: handleGoBack,
232
+ navLink: activeLink
233
+ }) : /*#__PURE__*/React__default.createElement(Links, {
234
+ isCountsLoading: isCountsLoading,
235
+ navLinks: navLinks,
236
+ setSelectedNavLinkRoute: setSelectedNavLinkRoute
237
+ })), /*#__PURE__*/React__default.createElement(Button, {
836
238
  className: "neeto-molecules-sidebar__toggler",
837
239
  "data-cy": "neeto-molecules-sidebar-toggler",
838
240
  "data-testid": "sidebar-toggleButton",
839
- style: "text",
241
+ style: isLargerScreen() ? "text" : "secondary",
840
242
  icon: function icon() {
841
- return /*#__PURE__*/React.createElement(Chevron, {
243
+ return /*#__PURE__*/React__default.createElement(Chevron, {
842
244
  style: {
843
245
  color: "rgb(var(--neeto-".concat(productName, "-primary))")
844
246
  }
845
247
  });
846
248
  },
847
249
  tooltipProps: {
848
- content: isSidebarCollapsed ? t("neetoMolecules.sidebar.showMenu") : t("neetoMolecules.sidebar.hideMenu"),
250
+ content: isSidebarClosed ? t("neetoMolecules.sidebar.showMenu") : t("neetoMolecules.sidebar.hideMenu"),
849
251
  position: "bottom"
850
252
  },
851
253
  onClick: function onClick() {
852
254
  setIsSidebarCollapsed(!isSidebarCollapsed);
255
+ setIsSidebarPaneOpen(not);
853
256
  }
854
257
  }));
855
258
  };