@lokalise/harmony 2.0.0 → 2.0.1

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 (295) hide show
  1. package/dist/harmony102.cjs +1 -1
  2. package/dist/harmony102.mjs +1 -1
  3. package/dist/harmony103.cjs +7 -7
  4. package/dist/harmony103.mjs +7 -7
  5. package/dist/harmony105.cjs +2 -2
  6. package/dist/harmony105.mjs +2 -2
  7. package/dist/harmony106.cjs +165 -13
  8. package/dist/harmony106.cjs.map +1 -1
  9. package/dist/harmony106.mjs +165 -13
  10. package/dist/harmony106.mjs.map +1 -1
  11. package/dist/harmony107.cjs +43 -2
  12. package/dist/harmony107.cjs.map +1 -1
  13. package/dist/harmony107.mjs +44 -3
  14. package/dist/harmony107.mjs.map +1 -1
  15. package/dist/harmony108.cjs +13 -17
  16. package/dist/harmony108.cjs.map +1 -1
  17. package/dist/harmony108.mjs +13 -17
  18. package/dist/harmony108.mjs.map +1 -1
  19. package/dist/harmony109.cjs +3 -76
  20. package/dist/harmony109.cjs.map +1 -1
  21. package/dist/harmony109.mjs +3 -76
  22. package/dist/harmony109.mjs.map +1 -1
  23. package/dist/harmony110.cjs +17 -11
  24. package/dist/harmony110.cjs.map +1 -1
  25. package/dist/harmony110.mjs +17 -11
  26. package/dist/harmony110.mjs.map +1 -1
  27. package/dist/harmony111.cjs +76 -30
  28. package/dist/harmony111.cjs.map +1 -1
  29. package/dist/harmony111.mjs +76 -30
  30. package/dist/harmony111.mjs.map +1 -1
  31. package/dist/harmony112.cjs +12 -9
  32. package/dist/harmony112.cjs.map +1 -1
  33. package/dist/harmony112.mjs +12 -9
  34. package/dist/harmony112.mjs.map +1 -1
  35. package/dist/harmony113.cjs +30 -47
  36. package/dist/harmony113.cjs.map +1 -1
  37. package/dist/harmony113.mjs +30 -47
  38. package/dist/harmony113.mjs.map +1 -1
  39. package/dist/harmony114.cjs +10 -10
  40. package/dist/harmony114.cjs.map +1 -1
  41. package/dist/harmony114.mjs +9 -9
  42. package/dist/harmony114.mjs.map +1 -1
  43. package/dist/harmony115.cjs +45 -9
  44. package/dist/harmony115.cjs.map +1 -1
  45. package/dist/harmony115.mjs +47 -11
  46. package/dist/harmony115.mjs.map +1 -1
  47. package/dist/harmony116.cjs +8 -20
  48. package/dist/harmony116.cjs.map +1 -1
  49. package/dist/harmony116.mjs +8 -20
  50. package/dist/harmony116.mjs.map +1 -1
  51. package/dist/harmony117.cjs +12 -20
  52. package/dist/harmony117.cjs.map +1 -1
  53. package/dist/harmony117.mjs +12 -20
  54. package/dist/harmony117.mjs.map +1 -1
  55. package/dist/harmony118.cjs +13 -8
  56. package/dist/harmony118.cjs.map +1 -1
  57. package/dist/harmony118.mjs +12 -7
  58. package/dist/harmony118.mjs.map +1 -1
  59. package/dist/harmony119.cjs +11 -17
  60. package/dist/harmony119.cjs.map +1 -1
  61. package/dist/harmony119.mjs +11 -17
  62. package/dist/harmony119.mjs.map +1 -1
  63. package/dist/harmony120.cjs +21 -8
  64. package/dist/harmony120.cjs.map +1 -1
  65. package/dist/harmony120.mjs +20 -7
  66. package/dist/harmony120.mjs.map +1 -1
  67. package/dist/harmony121.cjs +20 -8
  68. package/dist/harmony121.cjs.map +1 -1
  69. package/dist/harmony121.mjs +20 -8
  70. package/dist/harmony121.mjs.map +1 -1
  71. package/dist/harmony122.cjs +7 -15
  72. package/dist/harmony122.cjs.map +1 -1
  73. package/dist/harmony122.mjs +7 -15
  74. package/dist/harmony122.mjs.map +1 -1
  75. package/dist/harmony123.cjs +16 -11
  76. package/dist/harmony123.cjs.map +1 -1
  77. package/dist/harmony123.mjs +16 -11
  78. package/dist/harmony123.mjs.map +1 -1
  79. package/dist/harmony124.cjs +8 -12
  80. package/dist/harmony124.cjs.map +1 -1
  81. package/dist/harmony124.mjs +7 -11
  82. package/dist/harmony124.mjs.map +1 -1
  83. package/dist/harmony125.cjs +7 -165
  84. package/dist/harmony125.cjs.map +1 -1
  85. package/dist/harmony125.mjs +7 -165
  86. package/dist/harmony125.mjs.map +1 -1
  87. package/dist/harmony126.cjs +14 -43
  88. package/dist/harmony126.cjs.map +1 -1
  89. package/dist/harmony126.mjs +14 -43
  90. package/dist/harmony126.mjs.map +1 -1
  91. package/dist/harmony127.cjs +84 -96
  92. package/dist/harmony127.cjs.map +1 -1
  93. package/dist/harmony127.mjs +84 -79
  94. package/dist/harmony127.mjs.map +1 -1
  95. package/dist/harmony128.cjs +31 -10
  96. package/dist/harmony128.cjs.map +1 -1
  97. package/dist/harmony128.mjs +30 -9
  98. package/dist/harmony128.mjs.map +1 -1
  99. package/dist/harmony129.cjs +9 -12
  100. package/dist/harmony129.cjs.map +1 -1
  101. package/dist/harmony129.mjs +8 -11
  102. package/dist/harmony129.mjs.map +1 -1
  103. package/dist/harmony130.cjs +6 -9
  104. package/dist/harmony130.cjs.map +1 -1
  105. package/dist/harmony130.mjs +8 -11
  106. package/dist/harmony130.mjs.map +1 -1
  107. package/dist/harmony131.cjs +5 -9
  108. package/dist/harmony131.cjs.map +1 -1
  109. package/dist/harmony131.mjs +5 -9
  110. package/dist/harmony131.mjs.map +1 -1
  111. package/dist/harmony132.cjs +16 -7
  112. package/dist/harmony132.cjs.map +1 -1
  113. package/dist/harmony132.mjs +18 -9
  114. package/dist/harmony132.mjs.map +1 -1
  115. package/dist/harmony133.cjs +7 -23
  116. package/dist/harmony133.cjs.map +1 -1
  117. package/dist/harmony133.mjs +8 -24
  118. package/dist/harmony133.mjs.map +1 -1
  119. package/dist/harmony134.cjs +20 -6
  120. package/dist/harmony134.cjs.map +1 -1
  121. package/dist/harmony134.mjs +21 -7
  122. package/dist/harmony134.mjs.map +1 -1
  123. package/dist/harmony135.cjs +7 -33
  124. package/dist/harmony135.cjs.map +1 -1
  125. package/dist/harmony135.mjs +9 -35
  126. package/dist/harmony135.mjs.map +1 -1
  127. package/dist/harmony136.cjs +33 -7
  128. package/dist/harmony136.cjs.map +1 -1
  129. package/dist/harmony136.mjs +35 -9
  130. package/dist/harmony136.mjs.map +1 -1
  131. package/dist/harmony137.cjs +8 -18
  132. package/dist/harmony137.cjs.map +1 -1
  133. package/dist/harmony137.mjs +8 -18
  134. package/dist/harmony137.mjs.map +1 -1
  135. package/dist/harmony138.cjs +13 -27
  136. package/dist/harmony138.cjs.map +1 -1
  137. package/dist/harmony138.mjs +14 -28
  138. package/dist/harmony138.mjs.map +1 -1
  139. package/dist/harmony139.cjs +36 -21
  140. package/dist/harmony139.cjs.map +1 -1
  141. package/dist/harmony139.mjs +35 -20
  142. package/dist/harmony139.mjs.map +1 -1
  143. package/dist/harmony140.cjs +21 -21
  144. package/dist/harmony140.cjs.map +1 -1
  145. package/dist/harmony140.mjs +20 -20
  146. package/dist/harmony140.mjs.map +1 -1
  147. package/dist/harmony141.cjs +21 -6
  148. package/dist/harmony141.cjs.map +1 -1
  149. package/dist/harmony141.mjs +20 -5
  150. package/dist/harmony141.mjs.map +1 -1
  151. package/dist/harmony142.cjs +3 -12
  152. package/dist/harmony142.cjs.map +1 -1
  153. package/dist/harmony142.mjs +3 -12
  154. package/dist/harmony142.mjs.map +1 -1
  155. package/dist/harmony143.cjs +16 -4
  156. package/dist/harmony143.cjs.map +1 -1
  157. package/dist/harmony143.mjs +15 -3
  158. package/dist/harmony143.mjs.map +1 -1
  159. package/dist/harmony144.cjs +99 -3
  160. package/dist/harmony144.cjs.map +1 -1
  161. package/dist/harmony144.mjs +82 -3
  162. package/dist/harmony144.mjs.map +1 -1
  163. package/dist/harmony145.cjs +3 -3
  164. package/dist/harmony145.cjs.map +1 -1
  165. package/dist/harmony145.mjs +3 -3
  166. package/dist/harmony145.mjs.map +1 -1
  167. package/dist/harmony146.cjs +3 -14
  168. package/dist/harmony146.cjs.map +1 -1
  169. package/dist/harmony146.mjs +3 -14
  170. package/dist/harmony146.mjs.map +1 -1
  171. package/dist/harmony147.cjs +3 -14
  172. package/dist/harmony147.cjs.map +1 -1
  173. package/dist/harmony147.mjs +3 -14
  174. package/dist/harmony147.mjs.map +1 -1
  175. package/dist/harmony148.cjs +14 -3
  176. package/dist/harmony148.cjs.map +1 -1
  177. package/dist/harmony148.mjs +14 -3
  178. package/dist/harmony148.mjs.map +1 -1
  179. package/dist/harmony149.cjs +14 -87
  180. package/dist/harmony149.cjs.map +1 -1
  181. package/dist/harmony149.mjs +14 -87
  182. package/dist/harmony149.mjs.map +1 -1
  183. package/dist/harmony150.cjs +3 -30
  184. package/dist/harmony150.cjs.map +1 -1
  185. package/dist/harmony150.mjs +3 -30
  186. package/dist/harmony150.mjs.map +1 -1
  187. package/dist/harmony151.cjs +11 -6
  188. package/dist/harmony151.cjs.map +1 -1
  189. package/dist/harmony151.mjs +10 -5
  190. package/dist/harmony151.mjs.map +1 -1
  191. package/dist/harmony152.cjs +4 -4
  192. package/dist/harmony152.mjs +4 -4
  193. package/dist/harmony153.cjs +5 -9
  194. package/dist/harmony153.cjs.map +1 -1
  195. package/dist/harmony153.mjs +5 -9
  196. package/dist/harmony153.mjs.map +1 -1
  197. package/dist/harmony154.cjs +32 -6
  198. package/dist/harmony154.cjs.map +1 -1
  199. package/dist/harmony154.mjs +31 -5
  200. package/dist/harmony154.mjs.map +1 -1
  201. package/dist/harmony155.cjs +6 -6
  202. package/dist/harmony155.mjs +6 -6
  203. package/dist/harmony156.cjs +3 -21
  204. package/dist/harmony156.cjs.map +1 -1
  205. package/dist/harmony156.mjs +3 -21
  206. package/dist/harmony156.mjs.map +1 -1
  207. package/dist/harmony157.cjs +6 -3
  208. package/dist/harmony157.cjs.map +1 -1
  209. package/dist/harmony157.mjs +6 -3
  210. package/dist/harmony157.mjs.map +1 -1
  211. package/dist/harmony158.cjs +21 -9
  212. package/dist/harmony158.cjs.map +1 -1
  213. package/dist/harmony158.mjs +21 -9
  214. package/dist/harmony158.mjs.map +1 -1
  215. package/dist/harmony159.cjs +3 -3
  216. package/dist/harmony159.mjs +3 -3
  217. package/dist/harmony160.cjs +12 -32
  218. package/dist/harmony160.cjs.map +1 -1
  219. package/dist/harmony160.mjs +11 -31
  220. package/dist/harmony160.mjs.map +1 -1
  221. package/dist/harmony161.cjs +7 -97
  222. package/dist/harmony161.cjs.map +1 -1
  223. package/dist/harmony161.mjs +6 -96
  224. package/dist/harmony161.mjs.map +1 -1
  225. package/dist/harmony162.cjs +94 -11
  226. package/dist/harmony162.cjs.map +1 -1
  227. package/dist/harmony162.mjs +94 -11
  228. package/dist/harmony162.mjs.map +1 -1
  229. package/dist/harmony163.cjs +12 -13
  230. package/dist/harmony163.cjs.map +1 -1
  231. package/dist/harmony163.mjs +12 -13
  232. package/dist/harmony163.mjs.map +1 -1
  233. package/dist/harmony164.cjs +13 -35
  234. package/dist/harmony164.cjs.map +1 -1
  235. package/dist/harmony164.mjs +13 -35
  236. package/dist/harmony164.mjs.map +1 -1
  237. package/dist/harmony165.cjs +32 -24
  238. package/dist/harmony165.cjs.map +1 -1
  239. package/dist/harmony165.mjs +32 -24
  240. package/dist/harmony165.mjs.map +1 -1
  241. package/dist/harmony166.cjs +28 -10
  242. package/dist/harmony166.cjs.map +1 -1
  243. package/dist/harmony166.mjs +28 -10
  244. package/dist/harmony166.mjs.map +1 -1
  245. package/dist/harmony167.cjs +4 -13
  246. package/dist/harmony167.cjs.map +1 -1
  247. package/dist/harmony167.mjs +4 -13
  248. package/dist/harmony167.mjs.map +1 -1
  249. package/dist/harmony168.cjs +12 -14
  250. package/dist/harmony168.cjs.map +1 -1
  251. package/dist/harmony168.mjs +12 -14
  252. package/dist/harmony168.mjs.map +1 -1
  253. package/dist/harmony169.cjs +13 -14
  254. package/dist/harmony169.cjs.map +1 -1
  255. package/dist/harmony169.mjs +13 -14
  256. package/dist/harmony169.mjs.map +1 -1
  257. package/dist/harmony17.cjs +1 -1
  258. package/dist/harmony17.mjs +1 -1
  259. package/dist/harmony170.cjs +16 -4
  260. package/dist/harmony170.cjs.map +1 -1
  261. package/dist/harmony170.mjs +16 -4
  262. package/dist/harmony170.mjs.map +1 -1
  263. package/dist/harmony176.cjs +1 -1
  264. package/dist/harmony176.mjs +1 -1
  265. package/dist/harmony20.cjs +1 -1
  266. package/dist/harmony20.mjs +1 -1
  267. package/dist/harmony28.cjs +1 -1
  268. package/dist/harmony28.mjs +1 -1
  269. package/dist/harmony29.cjs +1 -1
  270. package/dist/harmony29.mjs +1 -1
  271. package/dist/harmony32.cjs +1 -1
  272. package/dist/harmony32.mjs +1 -1
  273. package/dist/harmony33.cjs +1 -1
  274. package/dist/harmony33.mjs +1 -1
  275. package/dist/harmony34.cjs +1 -1
  276. package/dist/harmony34.mjs +1 -1
  277. package/dist/harmony39.cjs +1 -1
  278. package/dist/harmony39.mjs +1 -1
  279. package/dist/harmony40.cjs +1 -1
  280. package/dist/harmony40.mjs +1 -1
  281. package/dist/harmony41.cjs +1 -1
  282. package/dist/harmony41.mjs +1 -1
  283. package/dist/harmony42.cjs +2 -2
  284. package/dist/harmony42.mjs +2 -2
  285. package/dist/harmony43.cjs +2 -2
  286. package/dist/harmony43.mjs +2 -2
  287. package/dist/harmony44.cjs +1 -1
  288. package/dist/harmony44.mjs +1 -1
  289. package/dist/harmony94.cjs +1 -1
  290. package/dist/harmony94.mjs +1 -1
  291. package/dist/harmony96.cjs +2 -2
  292. package/dist/harmony96.mjs +2 -2
  293. package/dist/harmony98.cjs +2 -2
  294. package/dist/harmony98.mjs +2 -2
  295. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"harmony149.mjs","sources":["../src/features/navigation/utils/toolbarVisibility.ts"],"sourcesContent":["import { hasAdminRight, hasAnyAdminRight } from '@features/auth/utils/permissions'\nimport type { Project } from '@features/node'\n\ntype ToolbarVisibility = {\n\tdisabled: boolean\n\tvisible: boolean\n}\n\nexport type ToolbarVisibilityMap = {\n\tupload: ToolbarVisibility\n\tdownload: ToolbarVisibility\n\tapps: ToolbarVisibility\n\tcontentManagement: ToolbarVisibility\n\teditor: ToolbarVisibility\n\tfiles: ToolbarVisibility\n\ttasks: ToolbarVisibility\n\tworkflows: ToolbarVisibility\n\tcontributors: ToolbarVisibility\n\tscreenshots: ToolbarVisibility\n\tglossary: ToolbarVisibility\n\tmore: ToolbarVisibility\n\tsettings: ToolbarVisibility\n\tbranches: ToolbarVisibility\n\totaBundles: ToolbarVisibility\n\tautomations: ToolbarVisibility\n\tduplicateFinder: ToolbarVisibility\n\tactivity: ToolbarVisibility\n\tstatistics: ToolbarVisibility\n}\n\nexport const getProjectNavigationVisibilityMap = (\n\tproject: Project,\n\tadminRights: string[],\n\tisFeatureEnabled: (key: string) => boolean,\n): ToolbarVisibilityMap => ({\n\tupload: {\n\t\tvisible: hasAdminRight(adminRights, 'upload'),\n\t\tdisabled: false,\n\t},\n\tdownload: {\n\t\tvisible: hasAdminRight(adminRights, 'download'),\n\t\tdisabled: false,\n\t},\n\t// TODO: HOME-1009, Clean up after permission management\n\t// -- There is a plan for \"Install apps\" permission. Right..?\n\tapps: {\n\t\tvisible: true,\n\t\tdisabled: false,\n\t},\n\t// TODO: HOME-1009, Clean up after permission management\n\t// -- There is a plan for \"Install apps\" permission. Right..?\n\tcontentManagement: {\n\t\tvisible: project.project_type === 'content_integration' && hasAdminRight(adminRights, 'keys'),\n\t\tdisabled: false,\n\t},\n\teditor: {\n\t\tvisible: true,\n\t\tdisabled: false,\n\t},\n\tfiles: {\n\t\tvisible:\n\t\t\tisFeatureEnabled('lionLfcFilesManagement') &&\n\t\t\tproject.project_type === 'paged_documents' &&\n\t\t\thasAnyAdminRight(adminRights, ['upload', 'download']),\n\t\tdisabled: false,\n\t},\n\ttasks: {\n\t\tvisible: hasAdminRight(adminRights, 'tasks'),\n\t\tdisabled: false,\n\t},\n\tcontributors: {\n\t\tvisible: hasAdminRight(adminRights, 'contributors'),\n\t\tdisabled: false,\n\t},\n\tworkflows: {\n\t\tvisible: hasAdminRight(adminRights, 'settings'),\n\t\tdisabled: false,\n\t},\n\tscreenshots: {\n\t\tvisible: hasAdminRight(adminRights, 'screenshots'),\n\t\tdisabled: false,\n\t},\n\tglossary: {\n\t\tvisible: hasAdminRight(adminRights, 'glossary'),\n\t\tdisabled: false,\n\t},\n\tmore: {\n\t\tvisible: true,\n\t\tdisabled: false,\n\t},\n\tsettings: {\n\t\tvisible: hasAdminRight(adminRights, 'settings'),\n\t\tdisabled: false,\n\t},\n\tbranches: {\n\t\tvisible:\n\t\t\t!!project.settings?.branching &&\n\t\t\thasAnyAdminRight(adminRights, ['branches_create', 'create_branches', 'branches_merge']),\n\t\tdisabled: false,\n\t},\n\totaBundles: {\n\t\tvisible:\n\t\t\thasAnyAdminRight(adminRights, ['download', 'settings', 'keys']) &&\n\t\t\tproject.project_type === 'localization_files',\n\t\tdisabled: false,\n\t},\n\tautomations: {\n\t\tvisible: hasAdminRight(adminRights, 'settings'),\n\t\tdisabled: false,\n\t},\n\tduplicateFinder: {\n\t\tvisible: hasAdminRight(adminRights, 'keys') && project.project_type === 'localization_files',\n\t\tdisabled: false,\n\t},\n\tactivity: {\n\t\tvisible: !!project.settings?.offline_translation || hasAdminRight(adminRights, 'activity'),\n\t\tdisabled: false,\n\t},\n\tstatistics: {\n\t\tvisible: hasAdminRight(adminRights, 'statistics'),\n\t\tdisabled: false,\n\t},\n})\n"],"names":[],"mappings":";AA8BO,MAAM,oCAAoC,CAChD,SACA,aACA,qBAC2B;;AAAA;AAAA,IAC3B,QAAQ;AAAA,MACP,SAAS,cAAc,aAAa,QAAQ;AAAA,MAC5C,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SAAS,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA;AAAA;AAAA,IAGA,MAAM;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,IACX;AAAA;AAAA;AAAA,IAGA,mBAAmB;AAAA,MAClB,SAAS,QAAQ,iBAAiB,yBAAyB,cAAc,aAAa,MAAM;AAAA,MAC5F,UAAU;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,MACP,SAAS;AAAA,MACT,UAAU;AAAA,IACX;AAAA,IACA,OAAO;AAAA,MACN,SACC,iBAAiB,wBAAwB,KACzC,QAAQ,iBAAiB,qBACzB,iBAAiB,aAAa,CAAC,UAAU,UAAU,CAAC;AAAA,MACrD,UAAU;AAAA,IACX;AAAA,IACA,OAAO;AAAA,MACN,SAAS,cAAc,aAAa,OAAO;AAAA,MAC3C,UAAU;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACb,SAAS,cAAc,aAAa,cAAc;AAAA,MAClD,UAAU;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACV,SAAS,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA,IACA,aAAa;AAAA,MACZ,SAAS,cAAc,aAAa,aAAa;AAAA,MACjD,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SAAS,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SAAS,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SACC,CAAC,GAAC,aAAQ,aAAR,mBAAkB,cACpB,iBAAiB,aAAa,CAAC,mBAAmB,mBAAmB,gBAAgB,CAAC;AAAA,MACvF,UAAU;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACX,SACC,iBAAiB,aAAa,CAAC,YAAY,YAAY,MAAM,CAAC,KAC9D,QAAQ,iBAAiB;AAAA,MAC1B,UAAU;AAAA,IACX;AAAA,IACA,aAAa;AAAA,MACZ,SAAS,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA,IACA,iBAAiB;AAAA,MAChB,SAAS,cAAc,aAAa,MAAM,KAAK,QAAQ,iBAAiB;AAAA,MACxE,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SAAS,CAAC,GAAC,aAAQ,aAAR,mBAAkB,wBAAuB,cAAc,aAAa,UAAU;AAAA,MACzF,UAAU;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACX,SAAS,cAAc,aAAa,YAAY;AAAA,MAChD,UAAU;AAAA,IAAA;AAAA,EAEZ;AAAA;"}
1
+ {"version":3,"file":"harmony149.mjs","sources":["../src/features/permissions/action-resolvers/canUploadFiles.ts"],"sourcesContent":["import { canPerformActionByProjectType } from '@features/permissions/utils/canPerformActionByProjectType'\nimport { hasAny } from '@features/permissions/utils/hasAny'\nimport type { ActionResolver } from '../types'\nimport { has } from '../utils/has'\n\nexport const canUploadFiles: ActionResolver = ({ projectPermissions, projectType }) =>\n\tcanPerformActionByProjectType(projectType, {\n\t\tclassic: () => has(projectPermissions, 'upload'),\n\n\t\t// This is a temporary workaround for the marketing project type - upload and download permissions are not yet supported\n\t\t// so to restrict translators from accessing the upload/download page we are checking that they have any permissions at all.\n\t\t// The reason for this is that, at the moment, the Translators role will assign no permissions to the user. So we are effectively\n\t\t// simulating a check for 'is this user a translator?' (since project 'roles' don't actually exist).\n\t\t// The correct check is to check for upload permission, so when that is implemented this will continue to work as expected,\n\t\t// but will need to remove this first part of the check.\n\t\tmarketing: () =>\n\t\t\thasAny(projectPermissions, 'contributors', 'settings', 'manage_languages') ||\n\t\t\thas(projectPermissions, 'upload'),\n\t})\n"],"names":[],"mappings":";;;AAKO,MAAM,iBAAiC,CAAC,EAAE,oBAAoB,YAAY,MAChF,8BAA8B,aAAa;AAAA,EAC1C,SAAS,MAAM,IAAI,oBAAoB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ/C,WAAW,MACV,OAAO,oBAAoB,gBAAgB,YAAY,kBAAkB,KACzE,IAAI,oBAAoB,QAAQ;AAClC,CAAC;"}
@@ -1,33 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const navigationItems = [
4
- {
5
- key: "editor",
6
- labelKey: "Editor",
7
- path: ({ projectId }) => `/project/${projectId}/editor`
8
- },
9
- {
10
- key: "dashboard",
11
- labelKey: "Download",
12
- path: ({ projectId }) => `/project/${projectId}/dashboard`
13
- },
14
- {
15
- key: "contributors",
16
- labelKey: "Contributors",
17
- path: ({ projectId }) => `/project/${projectId}/contributors`
18
- },
19
- {
20
- key: "orders",
21
- labelKey: "Human proofreading",
22
- path: ({ projectId }) => `/project/${projectId}/orders`,
23
- shouldShow: ({ flags }) => flags.ap_feature_hraas === "on"
24
- },
25
- {
26
- key: "billing",
27
- labelKey: "Billing",
28
- path: ({ projectId }) => `/project/${projectId}/billing`,
29
- shouldShow: ({ flags }) => flags.ap_feature_billing === "on"
30
- }
31
- ];
32
- exports.navigationItems = navigationItems;
3
+ const hasAny = require("./harmony124.cjs");
4
+ const createProjects = ({ teamRole }) => hasAny.hasAny(teamRole, "owner", "biller", "admin");
5
+ exports.createProjects = createProjects;
33
6
  //# sourceMappingURL=harmony150.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony150.cjs","sources":["../src/features/navigation/schemas/navigationSchema.ts"],"sourcesContent":["import type { DropdownItem, NavItemIcon } from '@features/navigation/types/navigation'\n\nexport type NavKey = 'editor' | 'contributors' | 'orders' | 'billing' | 'settings' | 'dashboard'\n\nexport interface NavigationItem {\n\tkey: NavKey\n\tlabelKey: string // TODO: i18n key inside this package\n\tpath: ({ projectId }: { projectId: string }) => string\n\n\ticon?: NavItemIcon\n\tdropdown?: DropdownItem[][]\n\tbadge?: number | ((ctx: NavCtx) => number)\n\n\tshouldShow?: (ctx: NavCtx) => boolean\n\tdisabled?: boolean | ((ctx: NavCtx) => boolean)\n\tisActive?: (pathname: string) => boolean // custom match, else fallback\n}\n\n/** What the gate functions receive */\nexport interface NavCtx {\n\tflags: Record<string, string>\n\tpathname: string\n\tpermissions?: Array<string> // e.g. contributor admin_rights //TODO: Provide type for permissions\n}\n\n// TODO: Handle Translations on harmony side.\nexport const navigationItems: NavigationItem[] = [\n\t{\n\t\tkey: 'editor',\n\t\tlabelKey: 'Editor',\n\t\tpath: ({ projectId }) => `/project/${projectId}/editor`,\n\t},\n\t{\n\t\tkey: 'dashboard',\n\t\tlabelKey: 'Download',\n\t\tpath: ({ projectId }) => `/project/${projectId}/dashboard`,\n\t},\n\t{\n\t\tkey: 'contributors',\n\t\tlabelKey: 'Contributors',\n\t\tpath: ({ projectId }) => `/project/${projectId}/contributors`,\n\t},\n\n\t{\n\t\tkey: 'orders',\n\t\tlabelKey: 'Human proofreading',\n\t\tpath: ({ projectId }) => `/project/${projectId}/orders`,\n\t\tshouldShow: ({ flags }) => flags.ap_feature_hraas === 'on',\n\t},\n\t{\n\t\tkey: 'billing',\n\t\tlabelKey: 'Billing',\n\t\tpath: ({ projectId }) => `/project/${projectId}/billing`,\n\t\tshouldShow: ({ flags }) => flags.ap_feature_billing === 'on',\n\t},\n]\n"],"names":[],"mappings":";;AA0BO,MAAM,kBAAoC;AAAA,EAChD;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,EAC/C;AAAA,EACA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,EAC/C;AAAA,EACA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,EAC/C;AAAA,EAEA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,IAC9C,YAAY,CAAC,EAAE,YAAY,MAAM,qBAAqB;AAAA,EACvD;AAAA,EACA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,IAC9C,YAAY,CAAC,EAAE,YAAY,MAAM,uBAAuB;AAAA,EAAA;AAE1D;;"}
1
+ {"version":3,"file":"harmony150.cjs","sources":["../src/features/permissions/action-resolvers/createProjects.ts"],"sourcesContent":["import { hasAny } from '@features/permissions/utils/hasAny'\nimport type { ActionResolver } from '../types'\n\nexport const createProjects: ActionResolver = ({ teamRole }) =>\n\thasAny(teamRole, 'owner', 'biller', 'admin')\n"],"names":["hasAny"],"mappings":";;;AAGa,MAAA,iBAAiC,CAAC,EAAE,eAChDA,OAAO,OAAA,UAAU,SAAS,UAAU,OAAO;;"}
@@ -1,33 +1,6 @@
1
- const navigationItems = [
2
- {
3
- key: "editor",
4
- labelKey: "Editor",
5
- path: ({ projectId }) => `/project/${projectId}/editor`
6
- },
7
- {
8
- key: "dashboard",
9
- labelKey: "Download",
10
- path: ({ projectId }) => `/project/${projectId}/dashboard`
11
- },
12
- {
13
- key: "contributors",
14
- labelKey: "Contributors",
15
- path: ({ projectId }) => `/project/${projectId}/contributors`
16
- },
17
- {
18
- key: "orders",
19
- labelKey: "Human proofreading",
20
- path: ({ projectId }) => `/project/${projectId}/orders`,
21
- shouldShow: ({ flags }) => flags.ap_feature_hraas === "on"
22
- },
23
- {
24
- key: "billing",
25
- labelKey: "Billing",
26
- path: ({ projectId }) => `/project/${projectId}/billing`,
27
- shouldShow: ({ flags }) => flags.ap_feature_billing === "on"
28
- }
29
- ];
1
+ import { hasAny } from "./harmony124.mjs";
2
+ const createProjects = ({ teamRole }) => hasAny(teamRole, "owner", "biller", "admin");
30
3
  export {
31
- navigationItems
4
+ createProjects
32
5
  };
33
6
  //# sourceMappingURL=harmony150.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony150.mjs","sources":["../src/features/navigation/schemas/navigationSchema.ts"],"sourcesContent":["import type { DropdownItem, NavItemIcon } from '@features/navigation/types/navigation'\n\nexport type NavKey = 'editor' | 'contributors' | 'orders' | 'billing' | 'settings' | 'dashboard'\n\nexport interface NavigationItem {\n\tkey: NavKey\n\tlabelKey: string // TODO: i18n key inside this package\n\tpath: ({ projectId }: { projectId: string }) => string\n\n\ticon?: NavItemIcon\n\tdropdown?: DropdownItem[][]\n\tbadge?: number | ((ctx: NavCtx) => number)\n\n\tshouldShow?: (ctx: NavCtx) => boolean\n\tdisabled?: boolean | ((ctx: NavCtx) => boolean)\n\tisActive?: (pathname: string) => boolean // custom match, else fallback\n}\n\n/** What the gate functions receive */\nexport interface NavCtx {\n\tflags: Record<string, string>\n\tpathname: string\n\tpermissions?: Array<string> // e.g. contributor admin_rights //TODO: Provide type for permissions\n}\n\n// TODO: Handle Translations on harmony side.\nexport const navigationItems: NavigationItem[] = [\n\t{\n\t\tkey: 'editor',\n\t\tlabelKey: 'Editor',\n\t\tpath: ({ projectId }) => `/project/${projectId}/editor`,\n\t},\n\t{\n\t\tkey: 'dashboard',\n\t\tlabelKey: 'Download',\n\t\tpath: ({ projectId }) => `/project/${projectId}/dashboard`,\n\t},\n\t{\n\t\tkey: 'contributors',\n\t\tlabelKey: 'Contributors',\n\t\tpath: ({ projectId }) => `/project/${projectId}/contributors`,\n\t},\n\n\t{\n\t\tkey: 'orders',\n\t\tlabelKey: 'Human proofreading',\n\t\tpath: ({ projectId }) => `/project/${projectId}/orders`,\n\t\tshouldShow: ({ flags }) => flags.ap_feature_hraas === 'on',\n\t},\n\t{\n\t\tkey: 'billing',\n\t\tlabelKey: 'Billing',\n\t\tpath: ({ projectId }) => `/project/${projectId}/billing`,\n\t\tshouldShow: ({ flags }) => flags.ap_feature_billing === 'on',\n\t},\n]\n"],"names":[],"mappings":"AA0BO,MAAM,kBAAoC;AAAA,EAChD;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,EAC/C;AAAA,EACA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,EAC/C;AAAA,EACA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,EAC/C;AAAA,EAEA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,IAC9C,YAAY,CAAC,EAAE,YAAY,MAAM,qBAAqB;AAAA,EACvD;AAAA,EACA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,IAC9C,YAAY,CAAC,EAAE,YAAY,MAAM,uBAAuB;AAAA,EAAA;AAE1D;"}
1
+ {"version":3,"file":"harmony150.mjs","sources":["../src/features/permissions/action-resolvers/createProjects.ts"],"sourcesContent":["import { hasAny } from '@features/permissions/utils/hasAny'\nimport type { ActionResolver } from '../types'\n\nexport const createProjects: ActionResolver = ({ teamRole }) =>\n\thasAny(teamRole, 'owner', 'biller', 'admin')\n"],"names":[],"mappings":";AAGa,MAAA,iBAAiC,CAAC,EAAE,eAChD,OAAO,UAAU,SAAS,UAAU,OAAO;"}
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const _commonjsHelpers = require("./harmony175.cjs");
4
- const debounce$1 = require("./harmony161.cjs");
5
- var debounceExports = debounce$1.__require();
6
- const debounce = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(debounceExports);
7
- exports.default = debounce;
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const hasAdminRight = (adminRights, right) => {
4
+ if (!Array.isArray(adminRights)) return false;
5
+ return adminRights.includes(right);
6
+ };
7
+ const hasAnyAdminRight = (adminRights, rights) => {
8
+ if (!Array.isArray(adminRights)) return false;
9
+ return rights.some((right) => adminRights.includes(right));
10
+ };
11
+ exports.hasAdminRight = hasAdminRight;
12
+ exports.hasAnyAdminRight = hasAnyAdminRight;
8
13
  //# sourceMappingURL=harmony151.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony151.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
1
+ {"version":3,"file":"harmony151.cjs","sources":["../src/features/auth/utils/permissions.ts"],"sourcesContent":["// Helper function to check if user has a specific admin right\nexport const hasAdminRight = (adminRights: string[], right: string): boolean => {\n\tif (!Array.isArray(adminRights)) return false\n\treturn adminRights.includes(right)\n}\n\n// Helper function to check if user has any of the specified admin rights\nexport const hasAnyAdminRight = (adminRights: string[], rights: string[]): boolean => {\n\tif (!Array.isArray(adminRights)) return false\n\treturn rights.some((right) => adminRights.includes(right))\n}\n"],"names":[],"mappings":";;AACa,MAAA,gBAAgB,CAAC,aAAuB,UAA2B;AAC/E,MAAI,CAAC,MAAM,QAAQ,WAAW,EAAU,QAAA;AACjC,SAAA,YAAY,SAAS,KAAK;AAClC;AAGa,MAAA,mBAAmB,CAAC,aAAuB,WAA8B;AACrF,MAAI,CAAC,MAAM,QAAQ,WAAW,EAAU,QAAA;AACxC,SAAO,OAAO,KAAK,CAAC,UAAU,YAAY,SAAS,KAAK,CAAC;AAC1D;;;"}
@@ -1,8 +1,13 @@
1
- import { getDefaultExportFromCjs } from "./harmony175.mjs";
2
- import { __require as requireDebounce } from "./harmony161.mjs";
3
- var debounceExports = requireDebounce();
4
- const debounce = /* @__PURE__ */ getDefaultExportFromCjs(debounceExports);
1
+ const hasAdminRight = (adminRights, right) => {
2
+ if (!Array.isArray(adminRights)) return false;
3
+ return adminRights.includes(right);
4
+ };
5
+ const hasAnyAdminRight = (adminRights, rights) => {
6
+ if (!Array.isArray(adminRights)) return false;
7
+ return rights.some((right) => adminRights.includes(right));
8
+ };
5
9
  export {
6
- debounce as default
10
+ hasAdminRight,
11
+ hasAnyAdminRight
7
12
  };
8
13
  //# sourceMappingURL=harmony151.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony151.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"harmony151.mjs","sources":["../src/features/auth/utils/permissions.ts"],"sourcesContent":["// Helper function to check if user has a specific admin right\nexport const hasAdminRight = (adminRights: string[], right: string): boolean => {\n\tif (!Array.isArray(adminRights)) return false\n\treturn adminRights.includes(right)\n}\n\n// Helper function to check if user has any of the specified admin rights\nexport const hasAnyAdminRight = (adminRights: string[], rights: string[]): boolean => {\n\tif (!Array.isArray(adminRights)) return false\n\treturn rights.some((right) => adminRights.includes(right))\n}\n"],"names":[],"mappings":"AACa,MAAA,gBAAgB,CAAC,aAAuB,UAA2B;AAC/E,MAAI,CAAC,MAAM,QAAQ,WAAW,EAAU,QAAA;AACjC,SAAA,YAAY,SAAS,KAAK;AAClC;AAGa,MAAA,mBAAmB,CAAC,aAAuB,WAA8B;AACrF,MAAI,CAAC,MAAM,QAAQ,WAAW,EAAU,QAAA;AACxC,SAAO,OAAO,KAAK,CAAC,UAAU,YAAY,SAAS,KAAK,CAAC;AAC1D;"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const _commonjsHelpers = require("./harmony175.cjs");
4
- const throttle$1 = require("./harmony165.cjs");
5
- var throttleExports = throttle$1.__require();
6
- const throttle = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(throttleExports);
7
- exports.default = throttle;
4
+ const debounce$1 = require("./harmony162.cjs");
5
+ var debounceExports = debounce$1.__require();
6
+ const debounce = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(debounceExports);
7
+ exports.default = debounce;
8
8
  //# sourceMappingURL=harmony152.cjs.map
@@ -1,8 +1,8 @@
1
1
  import { getDefaultExportFromCjs } from "./harmony175.mjs";
2
- import { __require as requireThrottle } from "./harmony165.mjs";
3
- var throttleExports = requireThrottle();
4
- const throttle = /* @__PURE__ */ getDefaultExportFromCjs(throttleExports);
2
+ import { __require as requireDebounce } from "./harmony162.mjs";
3
+ var debounceExports = requireDebounce();
4
+ const debounce = /* @__PURE__ */ getDefaultExportFromCjs(debounceExports);
5
5
  export {
6
- throttle as default
6
+ debounce as default
7
7
  };
8
8
  //# sourceMappingURL=harmony152.mjs.map
@@ -1,12 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const mainLabel = "_mainLabel_1baso_1";
4
- const subLabel = "_subLabel_1baso_5";
5
- const styles = {
6
- mainLabel,
7
- subLabel
8
- };
9
- exports.default = styles;
10
- exports.mainLabel = mainLabel;
11
- exports.subLabel = subLabel;
3
+ const _commonjsHelpers = require("./harmony175.cjs");
4
+ const throttle$1 = require("./harmony166.cjs");
5
+ var throttleExports = throttle$1.__require();
6
+ const throttle = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(throttleExports);
7
+ exports.default = throttle;
12
8
  //# sourceMappingURL=harmony153.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony153.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
1
+ {"version":3,"file":"harmony153.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,12 +1,8 @@
1
- const mainLabel = "_mainLabel_1baso_1";
2
- const subLabel = "_subLabel_1baso_5";
3
- const styles = {
4
- mainLabel,
5
- subLabel
6
- };
1
+ import { getDefaultExportFromCjs } from "./harmony175.mjs";
2
+ import { __require as requireThrottle } from "./harmony166.mjs";
3
+ var throttleExports = requireThrottle();
4
+ const throttle = /* @__PURE__ */ getDefaultExportFromCjs(throttleExports);
7
5
  export {
8
- styles as default,
9
- mainLabel,
10
- subLabel
6
+ throttle as default
11
7
  };
12
8
  //# sourceMappingURL=harmony153.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony153.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"harmony153.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,9 +1,35 @@
1
1
  "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const switchContainer = "_switchContainer_9byp6_1";
4
- const styles = {
5
- switchContainer
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const assertIsNever = require("./harmony167.cjs");
4
+ const isCategoryProjectTypeMatch = (matcher) => "marketing" in matcher && typeof matcher.marketing === "function" && "classic" in matcher && typeof matcher.classic === "function";
5
+ const isPartialProjectTypeMatch = (matcher) => "otherwise" in matcher && typeof matcher.otherwise === "function";
6
+ const isFullProjectTypeMatch = (matcher) => !isCategoryProjectTypeMatch(matcher) && !isPartialProjectTypeMatch(matcher);
7
+ const callMatchFunction = (matcher, category, projectType) => {
8
+ if (isFullProjectTypeMatch(matcher)) {
9
+ return matcher[projectType]();
10
+ }
11
+ if (isPartialProjectTypeMatch(matcher)) {
12
+ return (matcher[projectType] || matcher.otherwise)();
13
+ }
14
+ if (isCategoryProjectTypeMatch(matcher)) {
15
+ return matcher[category]();
16
+ }
17
+ return false;
6
18
  };
7
- exports.default = styles;
8
- exports.switchContainer = switchContainer;
19
+ const canPerformActionByProjectType = (projectType, match) => {
20
+ switch (projectType) {
21
+ case void 0:
22
+ return false;
23
+ case "localization_files":
24
+ case "paged_documents":
25
+ case "content_integration":
26
+ return callMatchFunction(match, "classic", projectType);
27
+ case "marketing":
28
+ case "marketing_integrations":
29
+ return callMatchFunction(match, "marketing", projectType);
30
+ default:
31
+ return assertIsNever.assertIsNever(projectType);
32
+ }
33
+ };
34
+ exports.canPerformActionByProjectType = canPerformActionByProjectType;
9
35
  //# sourceMappingURL=harmony154.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony154.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"harmony154.cjs","sources":["../src/features/permissions/utils/canPerformActionByProjectType.ts"],"sourcesContent":["import { assertIsNever } from '@utils/types/assertIsNever'\nimport type { ProjectType } from '../types'\n\ntype FullProjectTypeMatch = { [K in ProjectType]: () => boolean }\ntype PartialProjectTypeMatch = { [K in ProjectType]?: () => boolean } & { otherwise: () => boolean }\ntype CategoryProjectTypeMatch = { classic: () => boolean; marketing: () => boolean }\n\ntype ProjectTypeMatch = FullProjectTypeMatch | PartialProjectTypeMatch | CategoryProjectTypeMatch\n\nconst isCategoryProjectTypeMatch = (\n\tmatcher: ProjectTypeMatch,\n): matcher is CategoryProjectTypeMatch =>\n\t'marketing' in matcher &&\n\ttypeof matcher.marketing === 'function' &&\n\t'classic' in matcher &&\n\ttypeof matcher.classic === 'function'\n\nconst isPartialProjectTypeMatch = (matcher: ProjectTypeMatch): matcher is PartialProjectTypeMatch =>\n\t'otherwise' in matcher && typeof matcher.otherwise === 'function'\n\nconst isFullProjectTypeMatch = (matcher: ProjectTypeMatch): matcher is FullProjectTypeMatch =>\n\t!isCategoryProjectTypeMatch(matcher) && !isPartialProjectTypeMatch(matcher)\n\nconst callMatchFunction = (\n\tmatcher: ProjectTypeMatch,\n\tcategory: 'classic' | 'marketing',\n\tprojectType: ProjectType,\n): boolean => {\n\tif (isFullProjectTypeMatch(matcher)) {\n\t\treturn matcher[projectType]()\n\t}\n\n\tif (isPartialProjectTypeMatch(matcher)) {\n\t\treturn (matcher[projectType] || matcher.otherwise)()\n\t}\n\n\tif (isCategoryProjectTypeMatch(matcher)) {\n\t\treturn matcher[category]()\n\t}\n\n\treturn false\n}\n\nexport const canPerformActionByProjectType = (\n\tprojectType: ProjectType | undefined,\n\tmatch: ProjectTypeMatch,\n) => {\n\tswitch (projectType) {\n\t\tcase undefined:\n\t\t\treturn false\n\n\t\tcase 'localization_files':\n\t\tcase 'paged_documents':\n\t\tcase 'content_integration':\n\t\t\treturn callMatchFunction(match, 'classic', projectType)\n\n\t\tcase 'marketing':\n\t\tcase 'marketing_integrations':\n\t\t\treturn callMatchFunction(match, 'marketing', projectType)\n\n\t\tdefault:\n\t\t\treturn assertIsNever(projectType)\n\t}\n}\n"],"names":["assertIsNever"],"mappings":";;;AASA,MAAM,6BAA6B,CAClC,YAEA,eAAe,WACf,OAAO,QAAQ,cAAc,cAC7B,aAAa,WACb,OAAO,QAAQ,YAAY;AAE5B,MAAM,4BAA4B,CAAC,YAClC,eAAe,WAAW,OAAO,QAAQ,cAAc;AAExD,MAAM,yBAAyB,CAAC,YAC/B,CAAC,2BAA2B,OAAO,KAAK,CAAC,0BAA0B,OAAO;AAE3E,MAAM,oBAAoB,CACzB,SACA,UACA,gBACa;AACT,MAAA,uBAAuB,OAAO,GAAG;AAC7B,WAAA,QAAQ,WAAW,EAAE;AAAA,EAAA;AAGzB,MAAA,0BAA0B,OAAO,GAAG;AACvC,YAAQ,QAAQ,WAAW,KAAK,QAAQ,WAAW;AAAA,EAAA;AAGhD,MAAA,2BAA2B,OAAO,GAAG;AACjC,WAAA,QAAQ,QAAQ,EAAE;AAAA,EAAA;AAGnB,SAAA;AACR;AAEa,MAAA,gCAAgC,CAC5C,aACA,UACI;AACJ,UAAQ,aAAa;AAAA,IACpB,KAAK;AACG,aAAA;AAAA,IAER,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACG,aAAA,kBAAkB,OAAO,WAAW,WAAW;AAAA,IAEvD,KAAK;AAAA,IACL,KAAK;AACG,aAAA,kBAAkB,OAAO,aAAa,WAAW;AAAA,IAEzD;AACC,aAAOA,cAAAA,cAAc,WAAW;AAAA,EAAA;AAEnC;;"}
@@ -1,9 +1,35 @@
1
- const switchContainer = "_switchContainer_9byp6_1";
2
- const styles = {
3
- switchContainer
1
+ import { assertIsNever } from "./harmony167.mjs";
2
+ const isCategoryProjectTypeMatch = (matcher) => "marketing" in matcher && typeof matcher.marketing === "function" && "classic" in matcher && typeof matcher.classic === "function";
3
+ const isPartialProjectTypeMatch = (matcher) => "otherwise" in matcher && typeof matcher.otherwise === "function";
4
+ const isFullProjectTypeMatch = (matcher) => !isCategoryProjectTypeMatch(matcher) && !isPartialProjectTypeMatch(matcher);
5
+ const callMatchFunction = (matcher, category, projectType) => {
6
+ if (isFullProjectTypeMatch(matcher)) {
7
+ return matcher[projectType]();
8
+ }
9
+ if (isPartialProjectTypeMatch(matcher)) {
10
+ return (matcher[projectType] || matcher.otherwise)();
11
+ }
12
+ if (isCategoryProjectTypeMatch(matcher)) {
13
+ return matcher[category]();
14
+ }
15
+ return false;
16
+ };
17
+ const canPerformActionByProjectType = (projectType, match) => {
18
+ switch (projectType) {
19
+ case void 0:
20
+ return false;
21
+ case "localization_files":
22
+ case "paged_documents":
23
+ case "content_integration":
24
+ return callMatchFunction(match, "classic", projectType);
25
+ case "marketing":
26
+ case "marketing_integrations":
27
+ return callMatchFunction(match, "marketing", projectType);
28
+ default:
29
+ return assertIsNever(projectType);
30
+ }
4
31
  };
5
32
  export {
6
- styles as default,
7
- switchContainer
33
+ canPerformActionByProjectType
8
34
  };
9
35
  //# sourceMappingURL=harmony154.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony154.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"harmony154.mjs","sources":["../src/features/permissions/utils/canPerformActionByProjectType.ts"],"sourcesContent":["import { assertIsNever } from '@utils/types/assertIsNever'\nimport type { ProjectType } from '../types'\n\ntype FullProjectTypeMatch = { [K in ProjectType]: () => boolean }\ntype PartialProjectTypeMatch = { [K in ProjectType]?: () => boolean } & { otherwise: () => boolean }\ntype CategoryProjectTypeMatch = { classic: () => boolean; marketing: () => boolean }\n\ntype ProjectTypeMatch = FullProjectTypeMatch | PartialProjectTypeMatch | CategoryProjectTypeMatch\n\nconst isCategoryProjectTypeMatch = (\n\tmatcher: ProjectTypeMatch,\n): matcher is CategoryProjectTypeMatch =>\n\t'marketing' in matcher &&\n\ttypeof matcher.marketing === 'function' &&\n\t'classic' in matcher &&\n\ttypeof matcher.classic === 'function'\n\nconst isPartialProjectTypeMatch = (matcher: ProjectTypeMatch): matcher is PartialProjectTypeMatch =>\n\t'otherwise' in matcher && typeof matcher.otherwise === 'function'\n\nconst isFullProjectTypeMatch = (matcher: ProjectTypeMatch): matcher is FullProjectTypeMatch =>\n\t!isCategoryProjectTypeMatch(matcher) && !isPartialProjectTypeMatch(matcher)\n\nconst callMatchFunction = (\n\tmatcher: ProjectTypeMatch,\n\tcategory: 'classic' | 'marketing',\n\tprojectType: ProjectType,\n): boolean => {\n\tif (isFullProjectTypeMatch(matcher)) {\n\t\treturn matcher[projectType]()\n\t}\n\n\tif (isPartialProjectTypeMatch(matcher)) {\n\t\treturn (matcher[projectType] || matcher.otherwise)()\n\t}\n\n\tif (isCategoryProjectTypeMatch(matcher)) {\n\t\treturn matcher[category]()\n\t}\n\n\treturn false\n}\n\nexport const canPerformActionByProjectType = (\n\tprojectType: ProjectType | undefined,\n\tmatch: ProjectTypeMatch,\n) => {\n\tswitch (projectType) {\n\t\tcase undefined:\n\t\t\treturn false\n\n\t\tcase 'localization_files':\n\t\tcase 'paged_documents':\n\t\tcase 'content_integration':\n\t\t\treturn callMatchFunction(match, 'classic', projectType)\n\n\t\tcase 'marketing':\n\t\tcase 'marketing_integrations':\n\t\t\treturn callMatchFunction(match, 'marketing', projectType)\n\n\t\tdefault:\n\t\t\treturn assertIsNever(projectType)\n\t}\n}\n"],"names":[],"mappings":";AASA,MAAM,6BAA6B,CAClC,YAEA,eAAe,WACf,OAAO,QAAQ,cAAc,cAC7B,aAAa,WACb,OAAO,QAAQ,YAAY;AAE5B,MAAM,4BAA4B,CAAC,YAClC,eAAe,WAAW,OAAO,QAAQ,cAAc;AAExD,MAAM,yBAAyB,CAAC,YAC/B,CAAC,2BAA2B,OAAO,KAAK,CAAC,0BAA0B,OAAO;AAE3E,MAAM,oBAAoB,CACzB,SACA,UACA,gBACa;AACT,MAAA,uBAAuB,OAAO,GAAG;AAC7B,WAAA,QAAQ,WAAW,EAAE;AAAA,EAAA;AAGzB,MAAA,0BAA0B,OAAO,GAAG;AACvC,YAAQ,QAAQ,WAAW,KAAK,QAAQ,WAAW;AAAA,EAAA;AAGhD,MAAA,2BAA2B,OAAO,GAAG;AACjC,WAAA,QAAQ,QAAQ,EAAE;AAAA,EAAA;AAGnB,SAAA;AACR;AAEa,MAAA,gCAAgC,CAC5C,aACA,UACI;AACJ,UAAQ,aAAa;AAAA,IACpB,KAAK;AACG,aAAA;AAAA,IAER,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACG,aAAA,kBAAkB,OAAO,WAAW,WAAW;AAAA,IAEvD,KAAK;AAAA,IACL,KAAK;AACG,aAAA,kBAAkB,OAAO,aAAa,WAAW;AAAA,IAEzD;AACC,aAAO,cAAc,WAAW;AAAA,EAAA;AAEnC;"}
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const container = "_container_q5pot_1";
4
- const profileEmail = "_profileEmail_q5pot_5";
3
+ const mainLabel = "_mainLabel_1baso_1";
4
+ const subLabel = "_subLabel_1baso_5";
5
5
  const styles = {
6
- container,
7
- profileEmail
6
+ mainLabel,
7
+ subLabel
8
8
  };
9
- exports.container = container;
10
9
  exports.default = styles;
11
- exports.profileEmail = profileEmail;
10
+ exports.mainLabel = mainLabel;
11
+ exports.subLabel = subLabel;
12
12
  //# sourceMappingURL=harmony155.cjs.map
@@ -1,12 +1,12 @@
1
- const container = "_container_q5pot_1";
2
- const profileEmail = "_profileEmail_q5pot_5";
1
+ const mainLabel = "_mainLabel_1baso_1";
2
+ const subLabel = "_subLabel_1baso_5";
3
3
  const styles = {
4
- container,
5
- profileEmail
4
+ mainLabel,
5
+ subLabel
6
6
  };
7
7
  export {
8
- container,
9
8
  styles as default,
10
- profileEmail
9
+ mainLabel,
10
+ subLabel
11
11
  };
12
12
  //# sourceMappingURL=harmony155.mjs.map
@@ -1,27 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const wrapper = "_wrapper_1in7x_5";
4
- const profileImage = "_profileImage_1in7x_11";
5
- const teamDetails = "_teamDetails_1in7x_19";
6
- const planWrapper = "_planWrapper_1in7x_28";
7
- const teamName = "_teamName_1in7x_36";
8
- const membership = "_membership_1in7x_53";
9
- const defaultProfileImage = "_defaultProfileImage_1in7x_59";
3
+ const switchContainer = "_switchContainer_9byp6_1";
10
4
  const styles = {
11
- wrapper,
12
- profileImage,
13
- teamDetails,
14
- planWrapper,
15
- teamName,
16
- membership,
17
- defaultProfileImage
5
+ switchContainer
18
6
  };
19
7
  exports.default = styles;
20
- exports.defaultProfileImage = defaultProfileImage;
21
- exports.membership = membership;
22
- exports.planWrapper = planWrapper;
23
- exports.profileImage = profileImage;
24
- exports.teamDetails = teamDetails;
25
- exports.teamName = teamName;
26
- exports.wrapper = wrapper;
8
+ exports.switchContainer = switchContainer;
27
9
  //# sourceMappingURL=harmony156.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony156.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"harmony156.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,27 +1,9 @@
1
- const wrapper = "_wrapper_1in7x_5";
2
- const profileImage = "_profileImage_1in7x_11";
3
- const teamDetails = "_teamDetails_1in7x_19";
4
- const planWrapper = "_planWrapper_1in7x_28";
5
- const teamName = "_teamName_1in7x_36";
6
- const membership = "_membership_1in7x_53";
7
- const defaultProfileImage = "_defaultProfileImage_1in7x_59";
1
+ const switchContainer = "_switchContainer_9byp6_1";
8
2
  const styles = {
9
- wrapper,
10
- profileImage,
11
- teamDetails,
12
- planWrapper,
13
- teamName,
14
- membership,
15
- defaultProfileImage
3
+ switchContainer
16
4
  };
17
5
  export {
18
6
  styles as default,
19
- defaultProfileImage,
20
- membership,
21
- planWrapper,
22
- profileImage,
23
- teamDetails,
24
- teamName,
25
- wrapper
7
+ switchContainer
26
8
  };
27
9
  //# sourceMappingURL=harmony156.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony156.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"harmony156.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const teamsContainer = "_teamsContainer_1ncrr_5";
3
+ const container = "_container_q5pot_1";
4
+ const profileEmail = "_profileEmail_q5pot_5";
4
5
  const styles = {
5
- teamsContainer
6
+ container,
7
+ profileEmail
6
8
  };
9
+ exports.container = container;
7
10
  exports.default = styles;
8
- exports.teamsContainer = teamsContainer;
11
+ exports.profileEmail = profileEmail;
9
12
  //# sourceMappingURL=harmony157.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony157.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"harmony157.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1,9 +1,12 @@
1
- const teamsContainer = "_teamsContainer_1ncrr_5";
1
+ const container = "_container_q5pot_1";
2
+ const profileEmail = "_profileEmail_q5pot_5";
2
3
  const styles = {
3
- teamsContainer
4
+ container,
5
+ profileEmail
4
6
  };
5
7
  export {
8
+ container,
6
9
  styles as default,
7
- teamsContainer
10
+ profileEmail
8
11
  };
9
12
  //# sourceMappingURL=harmony157.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony157.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"harmony157.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,15 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const container = "_container_1u995_1";
4
- const planCta = "_planCta_1u995_15";
5
- const upgradeIconWrapper = "_upgradeIconWrapper_1u995_19";
3
+ const wrapper = "_wrapper_1in7x_5";
4
+ const profileImage = "_profileImage_1in7x_11";
5
+ const teamDetails = "_teamDetails_1in7x_19";
6
+ const planWrapper = "_planWrapper_1in7x_28";
7
+ const teamName = "_teamName_1in7x_36";
8
+ const membership = "_membership_1in7x_53";
9
+ const defaultProfileImage = "_defaultProfileImage_1in7x_59";
6
10
  const styles = {
7
- container,
8
- planCta,
9
- upgradeIconWrapper
11
+ wrapper,
12
+ profileImage,
13
+ teamDetails,
14
+ planWrapper,
15
+ teamName,
16
+ membership,
17
+ defaultProfileImage
10
18
  };
11
- exports.container = container;
12
19
  exports.default = styles;
13
- exports.planCta = planCta;
14
- exports.upgradeIconWrapper = upgradeIconWrapper;
20
+ exports.defaultProfileImage = defaultProfileImage;
21
+ exports.membership = membership;
22
+ exports.planWrapper = planWrapper;
23
+ exports.profileImage = profileImage;
24
+ exports.teamDetails = teamDetails;
25
+ exports.teamName = teamName;
26
+ exports.wrapper = wrapper;
15
27
  //# sourceMappingURL=harmony158.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony158.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"harmony158.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,15 +1,27 @@
1
- const container = "_container_1u995_1";
2
- const planCta = "_planCta_1u995_15";
3
- const upgradeIconWrapper = "_upgradeIconWrapper_1u995_19";
1
+ const wrapper = "_wrapper_1in7x_5";
2
+ const profileImage = "_profileImage_1in7x_11";
3
+ const teamDetails = "_teamDetails_1in7x_19";
4
+ const planWrapper = "_planWrapper_1in7x_28";
5
+ const teamName = "_teamName_1in7x_36";
6
+ const membership = "_membership_1in7x_53";
7
+ const defaultProfileImage = "_defaultProfileImage_1in7x_59";
4
8
  const styles = {
5
- container,
6
- planCta,
7
- upgradeIconWrapper
9
+ wrapper,
10
+ profileImage,
11
+ teamDetails,
12
+ planWrapper,
13
+ teamName,
14
+ membership,
15
+ defaultProfileImage
8
16
  };
9
17
  export {
10
- container,
11
18
  styles as default,
12
- planCta,
13
- upgradeIconWrapper
19
+ defaultProfileImage,
20
+ membership,
21
+ planWrapper,
22
+ profileImage,
23
+ teamDetails,
24
+ teamName,
25
+ wrapper
14
26
  };
15
27
  //# sourceMappingURL=harmony158.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony158.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"harmony158.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const iconContainer = "_iconContainer_nz34m_1";
3
+ const teamsContainer = "_teamsContainer_1ncrr_5";
4
4
  const styles = {
5
- iconContainer
5
+ teamsContainer
6
6
  };
7
7
  exports.default = styles;
8
- exports.iconContainer = iconContainer;
8
+ exports.teamsContainer = teamsContainer;
9
9
  //# sourceMappingURL=harmony159.cjs.map