ethyca-fides 2.58.2b3__py2.py3-none-any.whl → 2.58.2rc0__py2.py3-none-any.whl

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 (198) hide show
  1. {ethyca_fides-2.58.2b3.dist-info → ethyca_fides-2.58.2rc0.dist-info}/METADATA +1 -1
  2. {ethyca_fides-2.58.2b3.dist-info → ethyca_fides-2.58.2rc0.dist-info}/RECORD +172 -181
  3. fides/_version.py +3 -3
  4. fides/api/api/deps.py +2 -8
  5. fides/api/api/v1/endpoints/user_endpoints.py +12 -8
  6. fides/api/cryptography/identity_salt.py +13 -12
  7. fides/api/custom_types.py +1 -6
  8. fides/api/db/base.py +0 -5
  9. fides/api/db/system.py +3 -1
  10. fides/api/migrations/hash_migration_job.py +2 -2
  11. fides/api/models/attachment.py +11 -80
  12. fides/api/models/comment.py +15 -45
  13. fides/api/models/detection_discovery.py +0 -31
  14. fides/api/models/fides_user.py +9 -26
  15. fides/api/models/fides_user_invite.py +0 -2
  16. fides/api/models/privacy_experience.py +0 -42
  17. fides/api/models/privacy_request/privacy_request.py +6 -23
  18. fides/api/schemas/connection_configuration/connection_config.py +16 -30
  19. fides/api/schemas/user.py +1 -5
  20. fides/api/service/deps.py +0 -9
  21. fides/api/service/storage/s3.py +1 -14
  22. fides/api/service/user/fides_user_service.py +128 -0
  23. fides/api/task/graph_task.py +1 -1
  24. fides/ui-build/static/admin/404.html +1 -1
  25. fides/ui-build/static/admin/_next/static/chunks/{1150-2642cd9cdc8a52f6.js → 1150-035a721a04f4451e.js} +1 -1
  26. fides/ui-build/static/admin/_next/static/chunks/1376-5cea5ef9362215e8.js +1 -0
  27. fides/ui-build/static/admin/_next/static/chunks/{2397-0d1c289b788fcc11.js → 2397-ee53235fb21b5e97.js} +1 -1
  28. fides/ui-build/static/admin/_next/static/chunks/3412-7ec8751b8182e1bf.js +1 -0
  29. fides/ui-build/static/admin/_next/static/chunks/{3855-63495367531cb776.js → 3855-b6b7865dedd7bc2a.js} +1 -1
  30. fides/ui-build/static/admin/_next/static/chunks/{3872-472bb47eb34d8fdb.js → 3872-4e053c20d546f027.js} +1 -1
  31. fides/ui-build/static/admin/_next/static/chunks/{4060-53a5c6347690a8fa.js → 4060-8d165e1236ea521a.js} +1 -1
  32. fides/ui-build/static/admin/_next/static/chunks/4450-36234280bee624ff.js +1 -0
  33. fides/ui-build/static/admin/_next/static/chunks/4481-aab99ff80f707473.js +1 -0
  34. fides/ui-build/static/admin/_next/static/chunks/{5258-cf7b27ef51f38392.js → 5258-0658dc2274df6832.js} +1 -1
  35. fides/ui-build/static/admin/_next/static/chunks/{5480-52dc446be40725f5.js → 5480-f49696df5e8ae500.js} +1 -1
  36. fides/ui-build/static/admin/_next/static/chunks/{5487-8678d75ee1d1ef09.js → 5487-3ad50d21cdbc9209.js} +1 -1
  37. fides/ui-build/static/admin/_next/static/chunks/5973-52aee296edc44f7e.js +1 -0
  38. fides/ui-build/static/admin/_next/static/chunks/{6315-1adb10a8b98b4a13.js → 6315-fa1519cdf080f42d.js} +1 -1
  39. fides/ui-build/static/admin/_next/static/chunks/{6372-e0bb9f8d07cc3b04.js → 6372-ca9c12ac8902365b.js} +1 -1
  40. fides/ui-build/static/admin/_next/static/chunks/{6853-09e831e9dff7fd3b.js → 6853-8941824350c3c1a8.js} +1 -1
  41. fides/ui-build/static/admin/_next/static/chunks/{6954-baa1d873abfe8b77.js → 6954-3b887fb444f9228c.js} +1 -1
  42. fides/ui-build/static/admin/_next/static/chunks/7453-39761c38da31257e.js +1 -0
  43. fides/ui-build/static/admin/_next/static/chunks/{7751-a70fe0e5f67f5538.js → 7751-a8f31c062d4cb09d.js} +1 -1
  44. fides/ui-build/static/admin/_next/static/chunks/{79-8e060d36d36c752c.js → 79-f9b948ebb186900f.js} +1 -1
  45. fides/ui-build/static/admin/_next/static/chunks/{7980-72f745bff9fabcc9.js → 7980-4bd08957448dea32.js} +1 -1
  46. fides/ui-build/static/admin/_next/static/chunks/{9046-8a5fdd335a76d224.js → 9046-04bd7becea207cb1.js} +1 -1
  47. fides/ui-build/static/admin/_next/static/chunks/9767-1a23925d2cb27b51.js +1 -0
  48. fides/ui-build/static/admin/_next/static/chunks/{main-090643377c8254e6.js → main-24f422f93845a596.js} +1 -1
  49. fides/ui-build/static/admin/_next/static/chunks/{main-app-59156a9331ac7bce.js → main-app-94a0711202e08b15.js} +1 -1
  50. fides/ui-build/static/admin/_next/static/chunks/pages/{_app-fbe3db87623c87a0.js → _app-fc89ce7bed454c84.js} +1 -1
  51. fides/ui-build/static/admin/_next/static/chunks/pages/add-systems/{manual-9f9500c639362aa6.js → manual-9acaab973dfe86e2.js} +1 -1
  52. fides/ui-build/static/admin/_next/static/chunks/pages/{add-systems-fac606150b65d494.js → add-systems-d258f0c25fa020bf.js} +1 -1
  53. fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-experience/[id]-fb75fa0aea77678d.js +1 -0
  54. fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-experience/{new-c02b14c50b19bd91.js → new-a9d9402c219d13e5.js} +1 -1
  55. fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-experience-c946b33b0322b8ad.js +1 -0
  56. fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices-ea57f9d6ad17e957.js +1 -0
  57. fides/ui-build/static/admin/_next/static/chunks/pages/consent/{reporting-100234c23a85d235.js → reporting-788cf0e34829af46.js} +1 -1
  58. fides/ui-build/static/admin/_next/static/chunks/pages/{data-catalog-49bffaf07973fead.js → data-catalog-900004e402c31797.js} +1 -1
  59. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]/{[systemId]-727f1f5d06be674b.js → [systemId]-b66831fdafcdf67c.js} +1 -1
  60. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]-5f9ef1f99818117c.js +1 -0
  61. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{action-center-719949074f10bd6e.js → action-center-d001337d1bb73bd1.js} +1 -1
  62. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/activity-11b3ce9f61d9bfe9.js +1 -0
  63. fides/ui-build/static/admin/_next/static/chunks/pages/dataset/{new-4d4a31d0186a4a5b.js → new-803c1b577ab17ae3.js} +1 -1
  64. fides/ui-build/static/admin/_next/static/chunks/pages/{dataset-29317d18ce34adfe.js → dataset-fa743ddc7f89d76b.js} +1 -1
  65. fides/ui-build/static/admin/_next/static/chunks/pages/datastore-connection/{[id]-14c57e5069e9cccd.js → [id]-bbe1ca2793798e6b.js} +1 -1
  66. fides/ui-build/static/admin/_next/static/chunks/pages/datastore-connection/{new-f0a4e385c1ad8fee.js → new-abc17fef69cd951b.js} +1 -1
  67. fides/ui-build/static/admin/_next/static/chunks/pages/datastore-connection-a78a73b65929853a.js +1 -0
  68. fides/ui-build/static/admin/_next/static/chunks/pages/{index-b70def65e264270e.js → index-bfaacdb55a5a6c9f.js} +1 -1
  69. fides/ui-build/static/admin/_next/static/chunks/pages/integrations/[id]-d4329043219fed9b.js +1 -0
  70. fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/{[id]-72d64a02b7ef175e.js → [id]-fe765154315782cf.js} +1 -1
  71. fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/configure/{messaging-5e2687ab5ab10275.js → messaging-f5f7a8069909ef24.js} +1 -1
  72. fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/configure/{storage-2914aade73dcaecc.js → storage-9f7eaad05e5b9292.js} +1 -1
  73. fides/ui-build/static/admin/_next/static/chunks/pages/{privacy-requests-b0f801d66e79a31a.js → privacy-requests-d85c0d16ba09ba35.js} +1 -1
  74. fides/ui-build/static/admin/_next/static/chunks/pages/reporting/{datamap-f035cddf17f4d898.js → datamap-afedc48ef4e7f858.js} +1 -1
  75. fides/ui-build/static/admin/_next/static/chunks/pages/settings/consent-89524101b7279f6e.js +1 -0
  76. fides/ui-build/static/admin/_next/static/chunks/pages/settings/{custom-fields-dfcd7a4b6aa773bd.js → custom-fields-52d030b1db2ca1b9.js} +1 -1
  77. fides/ui-build/static/admin/_next/static/chunks/pages/settings/{organization-0e0aa552f520f913.js → organization-a08693d0d1e10bc8.js} +1 -1
  78. fides/ui-build/static/admin/_next/static/chunks/pages/systems/configure/[id]/{test-datasets-1d83d5178b3eb216.js → test-datasets-151571cff4e85894.js} +1 -1
  79. fides/ui-build/static/admin/_next/static/chunks/pages/systems/configure/{[id]-a158fa77df288523.js → [id]-4f5a28226575c976.js} +1 -1
  80. fides/ui-build/static/admin/_next/static/chunks/pages/{systems-8490aaaee9d76a4a.js → systems-abd68fc5ddde5482.js} +1 -1
  81. fides/ui-build/static/admin/_next/static/chunks/pages/{taxonomy-be1ffe267b1602e1.js → taxonomy-16b4d75c49276add.js} +1 -1
  82. fides/ui-build/static/admin/_next/static/chunks/pages/user-management/profile/{[id]-c0378fd1a26a71da.js → [id]-78eaf933f755bfe8.js} +1 -1
  83. fides/ui-build/static/admin/_next/static/chunks/pages/{user-management-3ca3c687e72d1364.js → user-management-6c9ad62479a7d03e.js} +1 -1
  84. fides/ui-build/static/admin/_next/static/css/{cf2744a40308fc4a.css → 113d823fe71f6af0.css} +1 -1
  85. fides/ui-build/static/admin/_next/static/o0mKeH0cB6eAYV6qOlVD0/_buildManifest.js +1 -0
  86. fides/ui-build/static/admin/add-systems/manual.html +1 -1
  87. fides/ui-build/static/admin/add-systems/multiple.html +1 -1
  88. fides/ui-build/static/admin/add-systems.html +1 -1
  89. fides/ui-build/static/admin/ant-poc.html +1 -1
  90. fides/ui-build/static/admin/consent/configure/add-vendors.html +1 -1
  91. fides/ui-build/static/admin/consent/configure.html +1 -1
  92. fides/ui-build/static/admin/consent/privacy-experience/[id].html +1 -1
  93. fides/ui-build/static/admin/consent/privacy-experience/new.html +1 -1
  94. fides/ui-build/static/admin/consent/privacy-experience.html +1 -1
  95. fides/ui-build/static/admin/consent/privacy-notices/[id].html +1 -1
  96. fides/ui-build/static/admin/consent/privacy-notices/new.html +1 -1
  97. fides/ui-build/static/admin/consent/privacy-notices.html +1 -1
  98. fides/ui-build/static/admin/consent/properties.html +1 -1
  99. fides/ui-build/static/admin/consent/reporting.html +1 -1
  100. fides/ui-build/static/admin/consent.html +1 -1
  101. fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn]/[resourceUrn].html +1 -1
  102. fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn].html +1 -1
  103. fides/ui-build/static/admin/data-catalog/[systemId]/projects.html +1 -1
  104. fides/ui-build/static/admin/data-catalog/[systemId]/resources/[resourceUrn].html +1 -1
  105. fides/ui-build/static/admin/data-catalog/[systemId]/resources.html +1 -1
  106. fides/ui-build/static/admin/data-catalog.html +1 -1
  107. fides/ui-build/static/admin/data-discovery/action-center/[monitorId]/[systemId].html +1 -1
  108. fides/ui-build/static/admin/data-discovery/action-center/[monitorId].html +1 -1
  109. fides/ui-build/static/admin/data-discovery/action-center.html +1 -1
  110. fides/ui-build/static/admin/data-discovery/activity.html +1 -1
  111. fides/ui-build/static/admin/data-discovery/detection/[resourceUrn].html +1 -1
  112. fides/ui-build/static/admin/data-discovery/detection.html +1 -1
  113. fides/ui-build/static/admin/data-discovery/discovery/[resourceUrn].html +1 -1
  114. fides/ui-build/static/admin/data-discovery/discovery.html +1 -1
  115. fides/ui-build/static/admin/datamap.html +1 -1
  116. fides/ui-build/static/admin/dataset/[datasetId]/[collectionName]/[...subfieldNames].html +1 -1
  117. fides/ui-build/static/admin/dataset/[datasetId]/[collectionName].html +1 -1
  118. fides/ui-build/static/admin/dataset/[datasetId].html +1 -1
  119. fides/ui-build/static/admin/dataset/new.html +1 -1
  120. fides/ui-build/static/admin/dataset.html +1 -1
  121. fides/ui-build/static/admin/datastore-connection/[id].html +1 -1
  122. fides/ui-build/static/admin/datastore-connection/new.html +1 -1
  123. fides/ui-build/static/admin/datastore-connection.html +1 -1
  124. fides/ui-build/static/admin/index.html +1 -1
  125. fides/ui-build/static/admin/integrations/[id].html +1 -1
  126. fides/ui-build/static/admin/integrations.html +1 -1
  127. fides/ui-build/static/admin/lib/fides-ext-gpp.js +1 -1
  128. fides/ui-build/static/admin/lib/fides-headless.js +1 -1
  129. fides/ui-build/static/admin/lib/fides-tcf.js +4 -4
  130. fides/ui-build/static/admin/lib/fides.js +3 -3
  131. fides/ui-build/static/admin/login/[provider].html +1 -1
  132. fides/ui-build/static/admin/login.html +1 -1
  133. fides/ui-build/static/admin/messaging/[id].html +1 -1
  134. fides/ui-build/static/admin/messaging/add-template.html +1 -1
  135. fides/ui-build/static/admin/messaging.html +1 -1
  136. fides/ui-build/static/admin/privacy-requests/[id].html +1 -1
  137. fides/ui-build/static/admin/privacy-requests/configure/messaging.html +1 -1
  138. fides/ui-build/static/admin/privacy-requests/configure/storage.html +1 -1
  139. fides/ui-build/static/admin/privacy-requests/configure.html +1 -1
  140. fides/ui-build/static/admin/privacy-requests.html +1 -1
  141. fides/ui-build/static/admin/properties/[id].html +1 -1
  142. fides/ui-build/static/admin/properties/add-property.html +1 -1
  143. fides/ui-build/static/admin/properties.html +1 -1
  144. fides/ui-build/static/admin/reporting/datamap.html +1 -1
  145. fides/ui-build/static/admin/settings/about.html +1 -1
  146. fides/ui-build/static/admin/settings/consent.html +1 -1
  147. fides/ui-build/static/admin/settings/custom-fields.html +1 -1
  148. fides/ui-build/static/admin/settings/domain-records.html +1 -1
  149. fides/ui-build/static/admin/settings/domains.html +1 -1
  150. fides/ui-build/static/admin/settings/email-templates.html +1 -1
  151. fides/ui-build/static/admin/settings/locations.html +1 -1
  152. fides/ui-build/static/admin/settings/organization.html +1 -1
  153. fides/ui-build/static/admin/settings/regulations.html +1 -1
  154. fides/ui-build/static/admin/systems/configure/[id]/test-datasets.html +1 -1
  155. fides/ui-build/static/admin/systems/configure/[id].html +1 -1
  156. fides/ui-build/static/admin/systems.html +1 -1
  157. fides/ui-build/static/admin/taxonomy.html +1 -1
  158. fides/ui-build/static/admin/user-management/new.html +1 -1
  159. fides/ui-build/static/admin/user-management/profile/[id].html +1 -1
  160. fides/ui-build/static/admin/user-management.html +1 -1
  161. fides/api/alembic/migrations/versions/67d01c4e124e_add_reject_all_mechanism_to_privacy_.py +0 -56
  162. fides/api/alembic/migrations/versions/6e565c16dae1_add_tcf_publisher_restrictions.py +0 -107
  163. fides/api/alembic/migrations/versions/99c603c1b8f9_add_password_login_enabled_and_totp_secret_to_fidesuser.py +0 -45
  164. fides/api/models/tcf_publisher_restrictions.py +0 -304
  165. fides/service/error_handling/__init__.py +0 -0
  166. fides/service/error_handling/error_handler.py +0 -202
  167. fides/service/user/__init__.py +0 -0
  168. fides/service/user/user_service.py +0 -140
  169. fides/ui-build/static/admin/_next/static/S7gURhIaHGAv7MFBTEOOS/_buildManifest.js +0 -1
  170. fides/ui-build/static/admin/_next/static/chunks/1376-03e7f50e708b7589.js +0 -1
  171. fides/ui-build/static/admin/_next/static/chunks/146-0ae2d30ec71fce09.js +0 -1
  172. fides/ui-build/static/admin/_next/static/chunks/1817-f82105a9608bba1a.js +0 -1
  173. fides/ui-build/static/admin/_next/static/chunks/3938-6a1c07d06a80cf4c.js +0 -1
  174. fides/ui-build/static/admin/_next/static/chunks/4450-6a8aa0d7358ac26f.js +0 -1
  175. fides/ui-build/static/admin/_next/static/chunks/4481-275aa9f4c10bce53.js +0 -1
  176. fides/ui-build/static/admin/_next/static/chunks/5973-d3d3872692c1d0fa.js +0 -1
  177. fides/ui-build/static/admin/_next/static/chunks/9767-8179ce7336727141.js +0 -1
  178. fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-experience/[id]-ab3ef485f6101697.js +0 -1
  179. fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-experience-ba5325035c71a97e.js +0 -1
  180. fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices-ef31c181cac86c64.js +0 -1
  181. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]-53efbed54d230f07.js +0 -1
  182. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/activity-4892603e743cd6ab.js +0 -1
  183. fides/ui-build/static/admin/_next/static/chunks/pages/datastore-connection-d2f88a8fc68944db.js +0 -1
  184. fides/ui-build/static/admin/_next/static/chunks/pages/integrations/[id]-b75ab4ee677f118d.js +0 -1
  185. fides/ui-build/static/admin/_next/static/chunks/pages/settings/consent-3ac1e5d3de5dd4a7.js +0 -1
  186. fides/ui-build/static/admin/images/connector-logos/website.svg +0 -10
  187. {ethyca_fides-2.58.2b3.dist-info → ethyca_fides-2.58.2rc0.dist-info}/LICENSE +0 -0
  188. {ethyca_fides-2.58.2b3.dist-info → ethyca_fides-2.58.2rc0.dist-info}/WHEEL +0 -0
  189. {ethyca_fides-2.58.2b3.dist-info → ethyca_fides-2.58.2rc0.dist-info}/entry_points.txt +0 -0
  190. {ethyca_fides-2.58.2b3.dist-info → ethyca_fides-2.58.2rc0.dist-info}/top_level.txt +0 -0
  191. /fides/ui-build/static/admin/_next/static/chunks/{4723-1dd1d16f404d56a2.js → 4723-0a3c5e2ce143a7d0.js} +0 -0
  192. /fides/ui-build/static/admin/_next/static/chunks/{5826-ef0aa43ffad83acc.js → 5826-e5dcb4e68cfe6289.js} +0 -0
  193. /fides/ui-build/static/admin/_next/static/chunks/pages/consent/{configure-a4e636eecaba5324.js → configure-723cc3d4f5740ea6.js} +0 -0
  194. /fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices/{[id]-606457ef5bd1eb04.js → [id]-72251b48e2e03a1e.js} +0 -0
  195. /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{about-2ae030f3a28f057a.js → about-a49d0f84cf0cf05e.js} +0 -0
  196. /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{domain-records-72ec54ee8755a503.js → domain-records-fa42d8f18df44927.js} +0 -0
  197. /fides/ui-build/static/admin/_next/static/chunks/pages/user-management/{new-f8bca2e322ddf252.js → new-be690621a944bfe2.js} +0 -0
  198. /fides/ui-build/static/admin/_next/static/{S7gURhIaHGAv7MFBTEOOS → o0mKeH0cB6eAYV6qOlVD0}/_ssgManifest.js +0 -0
@@ -46,21 +46,6 @@ class Layer1ButtonOption(Enum):
46
46
 
47
47
  ACKNOWLEDGE = "acknowledge"
48
48
  OPT_IN_OPT_OUT = "opt_in_opt_out"
49
- OPT_IN_ONLY = "opt_in_only"
50
-
51
-
52
- class RejectAllMechanism(Enum):
53
- """
54
- Reject all mechanism options - not formalized in the db.
55
- Used to configure the behavior of the reject all button in TCF experiences
56
- """
57
-
58
- # Reject both consent and legitimate interest preferences (all purposes, special features, vendors)
59
- # This is the default behavior
60
- REJECT_ALL = "reject_all"
61
- # Reject only consent preferences (all purposes, special features, vendors).
62
- # Do not reject any legitimate interest preferences.
63
- REJECT_CONSENT_ONLY = "reject_consent_only"
64
49
 
65
50
 
66
51
  # Fides JS UX Types - there should only be one of these defined per region
@@ -194,10 +179,6 @@ class PrivacyExperienceConfig(PrivacyExperienceConfigBase, Base):
194
179
  The Privacy Experience Configuration model that stores shared configuration for Privacy Experiences.
195
180
 
196
181
  - Translations, Notices, and Regions (via Privacy Experiences) are linked to this resource.
197
-
198
- If you're adding a new PrivacyExperienceConfig, make sure to use the `create` method since it has
199
- custom logic that ensures other resources are created/updated as needed, as well as setting the
200
- expected values for some fields in the experience config itself.
201
182
  """
202
183
 
203
184
  allow_language_selection = Column(
@@ -222,13 +203,6 @@ class PrivacyExperienceConfig(PrivacyExperienceConfigBase, Base):
222
203
  String, ForeignKey(ExperienceConfigTemplate.id_field_path)
223
204
  ) # The template from which this config was created if applicable
224
205
 
225
- # Mechanism to use when the reject all button is clicked in a TCF experience
226
- # Nullable because this is not applicable for other experience types
227
- reject_all_mechanism = Column(
228
- EnumColumn(RejectAllMechanism),
229
- nullable=True,
230
- )
231
-
232
206
  # Relationships
233
207
  experiences = relationship(
234
208
  "PrivacyExperience",
@@ -330,15 +304,6 @@ class PrivacyExperienceConfig(PrivacyExperienceConfigBase, Base):
330
304
  # Link Properties to this Privacy Experience config via the PrivacyExperienceConfigProperty table
331
305
  link_properties_to_experience_config(db, properties, experience_config)
332
306
 
333
- # If the reject all mechanism is not set and the experience config is a TCF experience,
334
- # set the reject all mechanism to REJECT_ALL
335
- if (
336
- experience_config.component == ComponentType.tcf_overlay
337
- and experience_config.reject_all_mechanism is None
338
- ):
339
- experience_config.reject_all_mechanism = RejectAllMechanism.REJECT_ALL # type: ignore
340
- experience_config.save(db)
341
-
342
307
  return experience_config
343
308
 
344
309
  def update(self, db: Session, *, data: dict[str, Any]) -> PrivacyExperienceConfig:
@@ -542,13 +507,6 @@ class PrivacyExperienceConfigHistory(
542
507
  index=True,
543
508
  ) # If a translation is deleted, this is set to null, but the overall record remains in the database for reporting purposes
544
509
 
545
- # Mechanism to use when the reject all button is clicked in a TCF experience
546
- # Nullable because this is not applicable for other experience types
547
- reject_all_mechanism = Column(
548
- EnumColumn(RejectAllMechanism),
549
- nullable=True,
550
- )
551
-
552
510
  version = Column(Float, nullable=False, default=1.0)
553
511
 
554
512
 
@@ -39,14 +39,10 @@ from fides.api.graph.config import (
39
39
  CollectionAddress,
40
40
  )
41
41
  from fides.api.migrations.hash_migration_mixin import HashMigrationMixin
42
- from fides.api.models.attachment import (
43
- Attachment,
44
- AttachmentReference,
45
- AttachmentReferenceType,
46
- )
42
+ from fides.api.models.attachment import Attachment, AttachmentReference
47
43
  from fides.api.models.audit_log import AuditLog
48
44
  from fides.api.models.client import ClientDetail
49
- from fides.api.models.comment import Comment, CommentReference, CommentReferenceType
45
+ from fides.api.models.comment import Comment, CommentReference
50
46
  from fides.api.models.fides_user import FidesUser
51
47
  from fides.api.models.manual_webhook import AccessManualWebhook
52
48
  from fides.api.models.policy import (
@@ -173,25 +169,18 @@ class PrivacyRequest(
173
169
  backref="privacy_requests",
174
170
  )
175
171
  attachments = relationship(
176
- "Attachment",
172
+ Attachment,
177
173
  secondary="attachment_reference",
178
- primaryjoin="and_(PrivacyRequest.id == AttachmentReference.reference_id, "
179
- "AttachmentReference.reference_type == 'privacy_request')",
174
+ primaryjoin="PrivacyRequest.id == AttachmentReference.reference_id",
180
175
  secondaryjoin="Attachment.id == AttachmentReference.attachment_id",
181
176
  order_by="Attachment.created_at",
182
- viewonly=True,
183
- uselist=True,
184
177
  )
185
-
186
178
  comments = relationship(
187
- "Comment",
179
+ Comment,
188
180
  secondary="comment_reference",
189
- primaryjoin="and_(PrivacyRequest.id == CommentReference.reference_id, "
190
- "CommentReference.reference_type == 'privacy_request')",
181
+ primaryjoin="PrivacyRequest.id == CommentReference.reference_id",
191
182
  secondaryjoin="Comment.id == CommentReference.comment_id",
192
183
  order_by="Comment.created_at",
193
- viewonly=True,
194
- uselist=True,
195
184
  )
196
185
  property_id = Column(String, nullable=True)
197
186
 
@@ -334,12 +323,6 @@ class PrivacyRequest(
334
323
  deleting this object from the database
335
324
  """
336
325
  self.clear_cached_values()
337
- Attachment.delete_attachments_for_reference_and_type(
338
- db, self.id, AttachmentReferenceType.privacy_request
339
- )
340
- Comment.delete_comments_for_reference_and_type(
341
- db, self.id, CommentReferenceType.privacy_request
342
- )
343
326
 
344
327
  for provided_identity in self.provided_identities: # type: ignore[attr-defined]
345
328
  provided_identity.delete(db=db)
@@ -71,23 +71,29 @@ def mask_sensitive_fields(
71
71
  return new_connection_secrets
72
72
 
73
73
 
74
- class ConnectionConfigSecretsMixin(BaseModel):
74
+ class ConnectionConfigurationResponse(BaseModel):
75
75
  """
76
- A schema mixin to declare a connection config `secrets` attribute
77
- and handle masking of sensitive values based on `connection_type`
78
- and (optionally) a `saas_config`.
76
+ Describes the returned schema for a ConnectionConfiguration.
79
77
  """
80
78
 
79
+ name: Optional[str] = None
80
+ key: FidesKey
81
+ description: Optional[str] = None
81
82
  connection_type: ConnectionType
82
- secrets: Optional[Dict[str, Any]] = None
83
+ access: AccessLevel
84
+ created_at: datetime
85
+ updated_at: Optional[datetime] = None
86
+ disabled: Optional[bool] = False
87
+ last_test_timestamp: Optional[datetime] = None
88
+ last_test_succeeded: Optional[bool] = None
83
89
  saas_config: Optional[SaaSConfigBase] = None
90
+ secrets: Optional[Dict[str, Any]] = None
91
+ authorized: Optional[bool] = False
92
+ enabled_actions: Optional[List[ActionType]] = None
84
93
 
85
94
  @model_validator(mode="after")
86
- def mask_sensitive_values(self) -> "ConnectionConfigSecretsMixin":
87
- """
88
- Mask sensitive values in the `secrets` attribute based on `connection_type`
89
- and (optionally) a `saas_config`.
90
- """
95
+ def mask_sensitive_values(self) -> "ConnectionConfigurationResponse":
96
+ """Mask sensitive values in the response."""
91
97
  if self.secrets is None:
92
98
  return self
93
99
 
@@ -110,26 +116,6 @@ class ConnectionConfigSecretsMixin(BaseModel):
110
116
  self.secrets = mask_sensitive_fields(cast(dict, self.secrets), secret_schema)
111
117
  return self
112
118
 
113
-
114
- class ConnectionConfigurationResponse(ConnectionConfigSecretsMixin):
115
- """
116
- Describes the returned schema for a ConnectionConfiguration.
117
-
118
- The mixin base class ensures that `secrets` sensitive values are masked.
119
- """
120
-
121
- name: Optional[str] = None
122
- key: FidesKey
123
- description: Optional[str] = None
124
- access: AccessLevel
125
- created_at: datetime
126
- updated_at: Optional[datetime] = None
127
- disabled: Optional[bool] = False
128
- last_test_timestamp: Optional[datetime] = None
129
- last_test_succeeded: Optional[bool] = None
130
- authorized: Optional[bool] = False
131
- enabled_actions: Optional[List[ActionType]] = None
132
-
133
119
  model_config = ConfigDict(from_attributes=True)
134
120
 
135
121
 
fides/api/schemas/user.py CHANGED
@@ -3,7 +3,7 @@ from datetime import datetime
3
3
  from enum import Enum
4
4
  from typing import Optional
5
5
 
6
- from pydantic import ConfigDict, EmailStr, field_validator
6
+ from pydantic import EmailStr, field_validator
7
7
 
8
8
  from fides.api.cryptography.cryptographic_util import decode_password
9
9
  from fides.api.schemas.base_class import FidesSchema
@@ -27,8 +27,6 @@ class UserCreate(FidesSchema):
27
27
  last_name: Optional[str] = None
28
28
  disabled: bool = False
29
29
 
30
- model_config = ConfigDict(extra="ignore")
31
-
32
30
  @field_validator("username")
33
31
  @classmethod
34
32
  def validate_username(cls, username: str) -> str:
@@ -142,8 +140,6 @@ class UserUpdate(FidesSchema):
142
140
  first_name: Optional[str] = None
143
141
  last_name: Optional[str] = None
144
142
 
145
- model_config = ConfigDict(extra="ignore")
146
-
147
143
 
148
144
  class DisabledReason(Enum):
149
145
  """Reasons for why a user is disabled"""
fides/api/service/deps.py CHANGED
@@ -8,7 +8,6 @@ from fides.service.dataset.dataset_config_service import DatasetConfigService
8
8
  from fides.service.dataset.dataset_service import DatasetService
9
9
  from fides.service.messaging.messaging_service import MessagingService
10
10
  from fides.service.privacy_request.privacy_request_service import PrivacyRequestService
11
- from fides.service.user.user_service import UserService
12
11
 
13
12
 
14
13
  def get_messaging_service(
@@ -33,11 +32,3 @@ def get_dataset_service(db: Session = Depends(get_db)) -> DatasetService:
33
32
 
34
33
  def get_dataset_config_service(db: Session = Depends(get_db)) -> DatasetConfigService:
35
34
  return DatasetConfigService(db)
36
-
37
-
38
- def get_user_service(
39
- db: Session = Depends(get_db),
40
- config: FidesConfig = Depends(get_config),
41
- config_proxy: ConfigProxy = Depends(get_config_proxy),
42
- ) -> UserService:
43
- return UserService(db, config, config_proxy)
@@ -64,7 +64,7 @@ def generic_upload_to_s3( # pylint: disable=R0913
64
64
  size_threshold: int = LARGE_FILE_THRESHOLD, # 5 MB threshold
65
65
  ) -> Optional[AnyHttpUrlString]:
66
66
  """
67
- Uploads file like objects to S3.
67
+ Uploads arbitrary data to S3 returned from an access request.
68
68
  Handles both small and large uploads.
69
69
 
70
70
  :param storage_secrets: S3 storage secrets
@@ -75,19 +75,6 @@ def generic_upload_to_s3( # pylint: disable=R0913
75
75
  """
76
76
  logger.info("Starting S3 Upload of {}", file_key)
77
77
 
78
- # Validate that the document is a file-like object
79
- if not hasattr(document, "read") or not hasattr(document, "seek"):
80
- raise TypeError(
81
- f"The 'document' parameter must be a file-like object supporting 'read' and 'seek'. "
82
- f"Received: {type(document)}"
83
- )
84
-
85
- # Ensure the file pointer is at the beginning
86
- try:
87
- document.seek(0)
88
- except Exception as e:
89
- raise ValueError(f"Failed to reset file pointer for document: {e}")
90
-
91
78
  s3_client = maybe_get_s3_client(auth_method, storage_secrets)
92
79
 
93
80
  # Define a transfer configuration for multipart uploads
@@ -0,0 +1,128 @@
1
+ import uuid
2
+ from datetime import datetime
3
+ from typing import Optional, Tuple
4
+
5
+ from loguru import logger
6
+ from sqlalchemy.orm import Session
7
+
8
+ from fides.api.api.v1.endpoints.messaging_endpoints import user_email_invite_status
9
+ from fides.api.common_exceptions import AuthorizationError
10
+ from fides.api.models.client import ClientDetail
11
+ from fides.api.models.fides_user import FidesUser
12
+ from fides.api.models.fides_user_invite import FidesUserInvite
13
+ from fides.api.schemas.messaging.messaging import (
14
+ MessagingActionType,
15
+ UserInviteBodyParams,
16
+ )
17
+ from fides.api.schemas.redis_cache import Identity
18
+ from fides.api.service.messaging.message_dispatch_service import dispatch_message
19
+ from fides.config import FidesConfig
20
+ from fides.config.config_proxy import ConfigProxy
21
+
22
+
23
+ def invite_user(db: Session, config_proxy: ConfigProxy, user: FidesUser) -> None:
24
+ """
25
+ Generates a user invite and sends the invite code to the user via email.
26
+
27
+ This is a no-op if email messaging isn't configured.
28
+ """
29
+
30
+ # invite user via email if email messaging is enabled and the Admin UI URL is defined
31
+ if user_email_invite_status(db=db, config_proxy=config_proxy).enabled:
32
+ invite_code = str(uuid.uuid4())
33
+ FidesUserInvite.create(
34
+ db=db, data={"username": user.username, "invite_code": invite_code}
35
+ )
36
+ user.update(db, data={"disabled": True})
37
+ dispatch_message(
38
+ db,
39
+ action_type=MessagingActionType.USER_INVITE,
40
+ to_identity=Identity(email=user.email_address),
41
+ service_type=config_proxy.notifications.notification_service_type,
42
+ message_body_params=UserInviteBodyParams(
43
+ username=user.username, invite_code=invite_code
44
+ ),
45
+ )
46
+
47
+
48
+ def accept_invite(
49
+ db: Session, config: FidesConfig, user: FidesUser, new_password: str
50
+ ) -> Tuple[FidesUser, str]:
51
+ """
52
+ Updates the user password and enables the user. Also removes the user invite from the database.
53
+ Returns a tuple of the updated user and their access code.
54
+ """
55
+
56
+ # update password and enable
57
+ user.update_password(db=db, new_password=new_password)
58
+ user.update(
59
+ db,
60
+ data={"disabled": False, "disabled_reason": None},
61
+ )
62
+ db.refresh(user)
63
+
64
+ # delete invite
65
+ if user.username:
66
+ invite = FidesUserInvite.get_by(db=db, field="username", value=user.username)
67
+ if invite:
68
+ invite.delete(db)
69
+ else:
70
+ logger.warning("Username is missing, skipping invite deletion.")
71
+
72
+ client = perform_login(
73
+ db,
74
+ config.security.oauth_client_id_length_bytes,
75
+ config.security.oauth_client_secret_length_bytes,
76
+ user,
77
+ )
78
+
79
+ logger.info("Creating login access token")
80
+ access_code = client.create_access_code_jwe(config.security.app_encryption_key)
81
+
82
+ return user, access_code
83
+
84
+
85
+ def perform_login(
86
+ db: Session,
87
+ client_id_byte_length: int,
88
+ client_secret_byte_length: int,
89
+ user: FidesUser,
90
+ skip_save: Optional[bool] = False,
91
+ ) -> ClientDetail:
92
+ """Performs a login by updating the FidesUser instance and creating and returning
93
+ an associated ClientDetail.
94
+
95
+ If the username or password was bad, skip_save should be True. We still run through
96
+ parallel operations to keep the timing of operations similar, but should skip
97
+ saving to the database.
98
+ """
99
+
100
+ client = user.client
101
+ if not client:
102
+ logger.info("Creating client for login")
103
+ client, _ = ClientDetail.create_client_and_secret(
104
+ db,
105
+ client_id_byte_length,
106
+ client_secret_byte_length,
107
+ scopes=[], # type: ignore
108
+ roles=user.permissions.roles, # type: ignore
109
+ systems=user.system_ids, # type: ignore
110
+ user_id=user.id,
111
+ in_memory=skip_save, # If login flow has already errored, don't persist this to the database
112
+ )
113
+ else:
114
+ # Refresh the client just in case - for example, scopes and roles were added via the db directly.
115
+ client.roles = user.permissions.roles # type: ignore
116
+ client.systems = user.system_ids # type: ignore
117
+ if not skip_save:
118
+ client.save(db)
119
+
120
+ if user.permissions and (not user.permissions.roles and not user.systems): # type: ignore
121
+ logger.warning("User {} needs roles or systems to login.", user.id)
122
+ raise AuthorizationError(detail="Not Authorized for this action")
123
+
124
+ if not skip_save:
125
+ user.last_login_at = datetime.utcnow()
126
+ user.save(db)
127
+
128
+ return client
@@ -10,7 +10,7 @@ from loguru import logger
10
10
  from ordered_set import OrderedSet
11
11
  from sqlalchemy.orm import Session
12
12
 
13
- from fides.api.api.deps import get_autoclose_db_session as get_db
13
+ from fides.api.api.deps import get_db_contextmanager as get_db
14
14
  from fides.api.common_exceptions import (
15
15
  ActionDisabled,
16
16
  AwaitingAsyncTaskCallback,
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link data-next-font="" rel="preconnect" href="/" crossorigin="anonymous"/><link rel="preload" href="/_next/static/css/cf2744a40308fc4a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cf2744a40308fc4a.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-2c7ccac5843c4d8e.js" defer=""></script><script src="/_next/static/chunks/framework-c92fc3344e6fd165.js" defer=""></script><script src="/_next/static/chunks/main-090643377c8254e6.js" defer=""></script><script src="/_next/static/chunks/pages/_app-fbe3db87623c87a0.js" defer=""></script><script src="/_next/static/chunks/pages/404-b202c0d8f6fc75c3.js" defer=""></script><script src="/_next/static/S7gURhIaHGAv7MFBTEOOS/_buildManifest.js" defer=""></script><script src="/_next/static/S7gURhIaHGAv7MFBTEOOS/_ssgManifest.js" defer=""></script><style>.data-ant-cssinjs-cache-path{content:"";}</style></head><body><div id="__next"><div style="height:100%;display:flex"></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/404","query":{},"buildId":"S7gURhIaHGAv7MFBTEOOS","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link data-next-font="" rel="preconnect" href="/" crossorigin="anonymous"/><link rel="preload" href="/_next/static/css/113d823fe71f6af0.css" as="style"/><link rel="stylesheet" href="/_next/static/css/113d823fe71f6af0.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-2c7ccac5843c4d8e.js" defer=""></script><script src="/_next/static/chunks/framework-c92fc3344e6fd165.js" defer=""></script><script src="/_next/static/chunks/main-24f422f93845a596.js" defer=""></script><script src="/_next/static/chunks/pages/_app-fc89ce7bed454c84.js" defer=""></script><script src="/_next/static/chunks/pages/404-b202c0d8f6fc75c3.js" defer=""></script><script src="/_next/static/o0mKeH0cB6eAYV6qOlVD0/_buildManifest.js" defer=""></script><script src="/_next/static/o0mKeH0cB6eAYV6qOlVD0/_ssgManifest.js" defer=""></script><style>.data-ant-cssinjs-cache-path{content:"";}</style></head><body><div id="__next"><div style="height:100%;display:flex"></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/404","query":{},"buildId":"o0mKeH0cB6eAYV6qOlVD0","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1150],{7617:function(e,s,t){t.d(s,{q:function(){return a}});var i=t(24246),n=t(77181);let a=e=>{let{label:s,isDisabled:t,...a}=e;return(0,i.jsx)(n.OK9,{"data-testid":"tab-".concat(s),_selected:{fontWeight:"600",color:"complimentary.500",borderColor:"complimentary.500"},fontSize:a.fontSize,fontWeight:"500",color:"gray.500",isDisabled:t||!1,children:s})};s.Z=e=>{let{data:s,border:t="partial",...l}=e;return(0,i.jsxs)(n.mQc,{colorScheme:"complimentary",...l,children:[(0,i.jsx)(n.tdY,{width:"partial"===t?"max-content":void 0,children:s.map(e=>(0,i.jsx)(a,{label:e.label,isDisabled:e.isDisabled,fontSize:l.fontSize},e.label))}),(0,i.jsx)(n.nPR,{children:s.map(e=>(0,i.jsx)(n.x45,{px:0,"data-testid":"tab-panel-".concat(e.label),children:e.content},e.label))})]})}},58452:function(e,s,t){var i=t(24246),n=t(77181);s.Z=e=>{let{isOpen:s,onClose:t,onConfirm:a,onCancel:l,title:r,message:d,cancelButtonText:o,continueButtonText:c,isLoading:h,returnFocusOnClose:x,isCentered:m,testId:u="confirmation-modal",icon:p}=e;return(0,i.jsxs)(n.u_l,{isOpen:s,onClose:t,size:"lg",returnFocusOnClose:null==x||x,isCentered:m,children:[(0,i.jsx)(n.ZAr,{}),(0,i.jsxs)(n.hzk,{textAlign:"center",p:6,"data-testid":u,children:[p?(0,i.jsx)(n.M5Y,{mb:2,children:p}):null,r?(0,i.jsx)(n.xBx,{fontWeight:"medium",pb:0,children:r}):null,d?(0,i.jsx)(n.fef,{children:d}):null,(0,i.jsx)(n.mzw,{children:(0,i.jsxs)(n.MIq,{columns:2,width:"100%",children:[(0,i.jsx)(n.wpx,{onClick:()=>{l&&l(),t()},size:"large",className:"mr-3","data-testid":"cancel-btn",disabled:h,children:o||"Cancel"}),(0,i.jsx)(n.wpx,{type:"primary",size:"large",onClick:a,"data-testid":"continue-btn",loading:h,children:c||"Continue"})]})})]})]})}},41150:function(e,s,t){t.d(s,{Z:function(){return H}});var i=t(24246),n=t(77181),a=t(91437),l=()=>(0,i.jsxs)(n.xuv,{children:[(0,i.jsx)(n.xuv,{pb:4,fontSize:"18px",fontWeight:"semibold",children:"Role Description"}),(0,i.jsx)(n.gCW,{spacing:4,children:a.K.map(e=>(0,i.jsxs)(n.xuv,{width:"100%",padding:4,borderRadius:"md",backgroundColor:"gray.75",fontSize:"14px",children:[(0,i.jsx)(n.xuv,{fontWeight:"semibold",children:e.label}),(0,i.jsx)(n.xuv,{color:"gray.700",children:e.description})]},e.roleKey))})]}),r=t(16134),d=t(7617),o=t(28120),c=t(19904),h=t(34090),x=t(86677),m=t(27378),u=t(812),p=t(58452),j=t(77830),w=t(91613),g=t(46628),f=t(86780),b=t(1315),y=t(95492),v=t(65497);let C=e=>{let{assignedSystems:s,onAssignedSystemChange:t}=e,a=(0,r.C)(v.Ux);if((0,v.d6)(a,{skip:!a}),0===s.length)return null;let l=e=>{t(s.filter(s=>s.fides_key!==e.fides_key))};return(0,i.jsxs)(n.iA_,{size:"sm","data-testid":"assign-systems-delete-table",children:[(0,i.jsx)(n.hrZ,{children:(0,i.jsxs)(n.Tr,{children:[(0,i.jsx)(n.Th,{children:"System"}),(0,i.jsx)(n.Th,{})]})}),(0,i.jsx)(n.p3B,{children:s.map(e=>(0,i.jsxs)(n.Tr,{_hover:{bg:"gray.50"},"data-testid":"row-".concat(e.fides_key),children:[(0,i.jsx)(n.Td,{children:e.name}),(0,i.jsx)(n.Td,{textAlign:"end",children:(0,i.jsx)(n.wpx,{"aria-label":"Unassign system from user",icon:(0,i.jsx)(y.l,{}),onClick:()=>l(e),"data-testid":"unassign-btn"})})]},e.fides_key))})]})};var S=e=>{let{allSystems:s,assignedSystems:t,onChange:a}=e,l=e=>{t.find(s=>s.fides_key===e.fides_key)?a(t.filter(s=>s.fides_key!==e.fides_key)):a([...t,e])};return(0,i.jsx)(n.xuv,{overflowY:"auto",maxHeight:"300px",children:(0,i.jsxs)(n.iA_,{size:"sm","data-testid":"assign-systems-table",maxHeight:"50vh",overflowY:"scroll",children:[(0,i.jsx)(n.hrZ,{position:"sticky",top:0,background:"white",zIndex:1,children:(0,i.jsxs)(n.Tr,{children:[(0,i.jsx)(n.Th,{children:"System"}),(0,i.jsx)(n.Th,{children:"Assign"})]})}),(0,i.jsx)(n.p3B,{children:s.map(e=>{let s=!!t.find(s=>s.fides_key===e.fides_key);return(0,i.jsxs)(n.Tr,{_hover:{bg:"gray.50"},"data-testid":"row-".concat(e.fides_key),children:[(0,i.jsx)(n.Td,{children:e.name}),(0,i.jsx)(n.Td,{children:(0,i.jsx)(n.rAg,{checked:s,onChange:()=>l(e),"data-testid":"assign-switch"})})]},e.fides_key)})})]})})};let k=(e,s)=>{var t,i;return(null===(t=e.name)||void 0===t?void 0:t.toLocaleLowerCase().includes(s.toLocaleLowerCase()))||(null===(i=e.description)||void 0===i?void 0:i.toLocaleLowerCase().includes(s.toLocaleLowerCase()))};var _=e=>{let{isOpen:s,onClose:t,assignedSystems:a,onAssignedSystemChange:l}=e,{data:r}=(0,b.K3)(),[d,o]=(0,m.useState)(""),[c,h]=(0,m.useState)(a),x=async()=>{l(c),t()},u=!r||0===r.length,p=(0,m.useMemo)(()=>r?r.filter(e=>k(e,d)):[],[r,d]),j=(0,m.useMemo)(()=>{let e=new Set(c.map(e=>e.fides_key));return p.every(s=>e.has(s.fides_key))},[p,c]);return(0,i.jsxs)(n.u_l,{isOpen:s,onClose:t,size:"2xl",children:[(0,i.jsx)(n.ZAr,{}),(0,i.jsxs)(n.hzk,{p:8,"data-testid":"confirmation-modal",children:[(0,i.jsxs)(n.xBx,{fontWeight:"medium",display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(n.xvT,{children:"Assign systems"}),(0,i.jsxs)(n.j8w,{color:"success",children:["Assigned to ",a.length," systems"]})]}),(0,i.jsx)(n.fef,{"data-testid":"assign-systems-modal-body",children:u?(0,i.jsx)(n.xvT,{children:"No systems found"}):(0,i.jsxs)(n.Kqy,{spacing:4,children:[(0,i.jsxs)(n.kCb,{justifyContent:"space-between",children:[(0,i.jsx)(n.xvT,{fontSize:"sm",flexGrow:1,fontWeight:"medium",children:"Assign systems in your organization to this user"}),(0,i.jsx)(n.xuv,{children:(0,i.jsxs)(n.NIc,{display:"flex",alignItems:"center",children:[(0,i.jsx)(n.lXp,{fontSize:"sm",htmlFor:"assign-all-systems",mb:"0",children:"Assign all systems"}),(0,i.jsx)(n.rAg,{size:"small",id:"assign-all-systems",checked:j,onChange:e=>{e&&r?h(p):h(r?r.filter(e=>!p.includes(e)):[])},"data-testid":"assign-all-systems-toggle"})]})})]}),(0,i.jsx)(f.Z,{search:d,onChange:o,placeholder:"Search for systems","data-testid":"system-search",withIcon:!0}),(0,i.jsx)(S,{allSystems:p,assignedSystems:c,onChange:h})]})}),(0,i.jsx)(n.mzw,{justifyContent:"flex-start",children:(0,i.jsxs)("div",{children:[(0,i.jsx)(n.wpx,{onClick:t,className:"mr-2","data-testid":"cancel-btn",children:"Cancel"}),u?null:(0,i.jsx)(n.wpx,{type:"primary",onClick:x,"data-testid":"confirm-btn",children:"Confirm"})]})})]})]})},P=e=>{let{label:s,roleKey:t,isSelected:a,isDisabled:l,assignedSystems:r,onAssignedSystemChange:d}=e,{setFieldValue:c}=(0,h.u6)(),x=(0,n.qY0)(),m=l?"You do not have sufficient permissions to assign this role.":void 0;return a?(0,i.jsxs)(n.Kqy,{borderRadius:"md",border:"1px solid",borderColor:"gray.200",p:4,backgroundColor:"gray.50","aria-selected":"true",spacing:4,"data-testid":"selected",children:[(0,i.jsxs)(n.kCb,{alignItems:"center",justifyContent:"space-between",children:[(0,i.jsx)(n.xvT,{fontSize:"md",fontWeight:"semibold",children:s}),(0,i.jsx)(n.StI,{})]}),t!==o.A7.APPROVER?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.kCb,{alignItems:"center",children:[(0,i.jsx)(n.xvT,{fontSize:"sm",fontWeight:"semibold",mr:1,children:"Assigned systems"}),(0,i.jsx)(w.Z,{label:"Assigned systems refer to those systems that have been specifically allocated to a user for management purposes. Users assigned to a system possess full edit permissions and are listed as the Data Steward for the respective system."})]}),(0,i.jsx)(n.wpx,{disabled:l,title:m,type:"primary",size:"small",onClick:x.onOpen,"data-testid":"assign-systems-btn",children:"Assign systems +"}),(0,i.jsx)(C,{assignedSystems:r,onAssignedSystemChange:d}),x.isOpen?(0,i.jsx)(_,{isOpen:x.isOpen,onClose:x.onClose,assignedSystems:r,onAssignedSystemChange:d}):null]}):null]}):(0,i.jsx)(n.wpx,{onClick:()=>{c("roles",[t])},"data-testid":"role-option-".concat(s),title:m,disabled:l,children:s})};let A={roles:[]};var T=()=>{var e;let s=(0,n.pmc)(),t=(0,x.useRouter)(),l=(0,r.C)(v.Ux);(0,v.d6)(l,{skip:!l});let{isOpen:d,onOpen:f,onClose:b}=(0,n.qY0)(),y=(0,r.C)(v.R$),[C,S]=(0,m.useState)(y),[k]=(0,v.G$)();(0,m.useEffect)(()=>{S(y)},[y]);let{data:_,isLoading:T}=(0,v.gU)(null!=l?l:"",{skip:!l}),[R]=(0,v.lD)(),z=async e=>{if(d&&b(),!l)return;let t=e.roles.includes(o.A7.APPROVER),i=await R({user_id:l,payload:{roles:e.roles}});if((0,u.D4)(i)){s((0,g.Vo)((0,u.e$)(i.error)));return}if(!t){let e=C.map(e=>e.fides_key),t=await k({userId:l,fidesKeys:e});if((0,u.D4)(t)){s((0,g.Vo)((0,u.e$)(t.error)));return}}s((0,g.t5)("Permissions updated"))},I=async e=>{l&&(C.length>0&&e.roles.includes(o.A7.APPROVER)?f():await z(e))},q=(0,c.Tg)([o.Sh.USER_PERMISSION_ASSIGN_OWNERS]);if(!l)return null;if(T)return(0,i.jsx)(n.$jN,{});if(!q&&(null==_?void 0:null===(e=_.roles)||void 0===e?void 0:e.includes(o.A7.OWNER)))return(0,i.jsx)(n.xvT,{"data-testid":"insufficient-access",children:"You do not have sufficient access to change this user's permissions."});let E=(null==_?void 0:_.roles)?{roles:_.roles}:A;return(0,i.jsx)(h.J9,{onSubmit:I,initialValues:E,enableReinitialize:!0,children:e=>{let{values:s,isSubmitting:l,dirty:r}=e;return(0,i.jsxs)(h.l0,{children:[(0,i.jsxs)(n.Kqy,{spacing:7,children:[(0,i.jsxs)(n.Kqy,{spacing:3,"data-testid":"role-options",children:[(0,i.jsxs)(n.kCb,{alignItems:"center",children:[(0,i.jsx)(n.xvT,{fontSize:"sm",fontWeight:"semibold",mr:1,children:"User role"}),(0,i.jsx)(w.Z,{label:"A user's role in the organization determines what parts of the UI they can access and which functions are available to them."})]}),a.K.map(e=>{let t=s.roles.indexOf(e.roleKey)>=0;return(0,i.jsx)(P,{isSelected:t,isDisabled:e.roleKey===o.A7.OWNER&&!q,assignedSystems:C,onAssignedSystemChange:S,...e},e.roleKey)})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(n.wpx,{onClick:()=>t.push(j.e3),children:"Cancel"}),(0,i.jsx)(n.wpx,{type:"primary",htmlType:"submit",loading:l,disabled:!r&&C===y,"data-testid":"save-btn",children:"Save"})]})]}),(0,i.jsx)(p.Z,{isOpen:d,onClose:b,onConfirm:()=>z(s),title:"Change role to Approver",testId:"downgrade-to-approver-confirmation-modal",continueButtonText:"Yes",message:(0,i.jsx)(n.xvT,{children:"Switching to an approver role will remove all assigned systems. Do you wish to proceed?"})})]})}})},R=t(61038),z=t(55484),I=t(25980),q=t(40324),E=t(96006);let{useGetEmailInviteStatusQuery:O}=t(78780).u.injectEndpoints({endpoints:e=>({getEmailInviteStatus:e.query({query:()=>({url:"/messaging/email-invite/status"}),providesTags:()=>["Email Invite Status"]})})});var N=t(76174),Z=t(91317),U=t(31883);let W=z.Ry().shape({password:E.a.label("Password"),passwordConfirmation:z.Z_().required().oneOf([z.iH("password")],"Passwords must match").label("Password confirmation")}),D={password:"",passwordConfirmation:""},K=e=>{let s=(0,n.qY0)(),t=(0,n.pmc)(),[i]=(0,v.ls)(),a=async n=>{let a=await i({id:e,new_password:n.password});(0,U.D4)(a)?t((0,g.Vo)((0,u.e$)(a.error))):(t((0,g.t5)("Successfully reset user's password. Please inform the user of their new password.")),s.onClose())};return{...s,handleResetPassword:a}};var V=e=>{let{id:s}=e,{handleResetPassword:t,isOpen:a,onClose:l,onOpen:r}=K(s);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.wpx,{onClick:r,"data-testid":"reset-password-btn",children:"Reset password"}),(0,i.jsxs)(n.u_l,{isCentered:!0,isOpen:a,onClose:l,children:[(0,i.jsx)(n.ZAr,{}),(0,i.jsx)(n.hzk,{children:(0,i.jsx)(h.J9,{initialValues:D,validationSchema:W,onSubmit:t,children:e=>{let{isSubmitting:s,dirty:t,isValid:a}=e;return(0,i.jsxs)(h.l0,{children:[(0,i.jsx)(n.xBx,{children:"Reset Password"}),(0,i.jsx)(n.olH,{}),(0,i.jsx)(n.fef,{children:(0,i.jsxs)(n.Kqy,{direction:"column",spacing:4,children:[(0,i.jsx)(n.xvT,{mb:2,children:"Choose a new password for this user."}),(0,i.jsx)(q.j0,{name:"password",label:"Password",placeholder:"********",type:"password",tooltip:"Password must contain at least 8 characters, 1 number, 1 capital letter, 1 lowercase letter, and at least 1 symbol.",autoComplete:"new-password"}),(0,i.jsx)(q.j0,{name:"passwordConfirmation",label:"Confirm Password",placeholder:"********",type:"password",tooltip:"Must match above password.",autoComplete:"confirm-password"})]})}),(0,i.jsx)(n.mzw,{children:(0,i.jsxs)("div",{className:"w-full gap-2",children:[(0,i.jsx)(n.wpx,{onClick:l,className:"w-1/2",children:"Cancel"}),(0,i.jsx)(n.wpx,{type:"primary",disabled:!t||!a,loading:s,htmlType:"submit",className:"w-1/2","data-testid":"submit-btn",children:"Change Password"})]})})]})}})})]})]})};let Y=e=>{let s=(0,n.qY0)(),t=(0,n.pmc)(),[i,a]=(0,m.useState)(""),[l,r]=(0,m.useState)(""),[d,{isLoading:o}]=(0,v.ev)(),c=!!(e&&l&&i),h=async()=>{c&&d({id:e,old_password:i,new_password:l}).unwrap().then(()=>{t((0,g.t5)("Password updated")),s.onClose()})};return{...s,changePasswordValidation:c,handleChange:e=>{"oldPassword"===e.target.name?a(e.target.value):r(e.target.value)},handleChangePassword:h,isLoading:o,newPasswordValue:l,oldPasswordValue:i}};var B=e=>{let{id:s}=e,{changePasswordValidation:t,handleChange:a,handleChangePassword:l,isLoading:r,isOpen:d,newPasswordValue:o,oldPasswordValue:c,onClose:h,onOpen:x}=Y(s);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.wpx,{onClick:x,"data-testid":"update-password-btn",children:"Update password"}),(0,i.jsxs)(n.u_l,{isCentered:!0,isOpen:d,onClose:h,children:[(0,i.jsx)(n.ZAr,{}),(0,i.jsxs)(n.hzk,{children:[(0,i.jsx)(n.xBx,{children:"Update Password"}),(0,i.jsx)(n.olH,{}),(0,i.jsx)(n.fef,{pb:6,children:(0,i.jsxs)(n.Kqy,{direction:"column",spacing:"15px",children:[(0,i.jsx)(n.NIc,{children:(0,i.jsx)(n.IIB,{isRequired:!0,name:"oldPassword",onChange:a,placeholder:"Old Password",type:"password",value:c,"data-testid":"input-oldPassword"})}),(0,i.jsx)(n.NIc,{children:(0,i.jsx)(n.IIB,{isRequired:!0,name:"newPassword",onChange:a,placeholder:"New Password",type:"password",value:o,"data-testid":"input-newPassword"})})]})}),(0,i.jsxs)(n.mzw,{children:[(0,i.jsx)(n.wpx,{onClick:h,className:"mr-2 w-1/2",children:"Cancel"}),(0,i.jsx)(n.wpx,{type:"primary",disabled:!t,loading:r,onClick:l,htmlType:"submit",className:"mr-3 w-1/2","data-testid":"submit-btn",children:"Change Password"})]})]})]})]})},L=()=>{let e=(0,r.C)(v.Ux),s=(0,r.C)(Z.dy),t=!!s&&s.id===e;return(0,i.jsx)(n.xuv,{children:e?(0,i.jsxs)(n.Ugi,{children:[t?(0,i.jsx)(B,{id:e}):null,(0,i.jsx)(c.ZP,{scopes:[o.Sh.USER_PASSWORD_RESET],children:(0,i.jsx)(V,{id:e})})]}):null})};let F={username:"",first_name:"",email_address:"",last_name:"",password:""},M=z.Ry().shape({username:z.Z_().required().label("Username"),email_address:z.Z_().email().required().label("Email address"),first_name:z.Z_().label("First name"),last_name:z.Z_().label("Last name"),password:E.a.label("Password")});var $=e=>{let{onSubmit:s,initialValues:t,canEditNames:a}=e,l=(0,x.useRouter)(),d=(0,n.pmc)(),o=(0,r.T)(),c=(0,n.qY0)(),m=(0,r.C)(v.ZC),{data:p}=O(),w=null==p?void 0:p.enabled,{flags:f}=(0,I.Vb)(),b=!m,C=!b&&!a,S=b&&!w,k=async e=>{let{password:t,...i}=e,n=await s(S?e:i);if((0,u.D4)(n)){d((0,g.Vo)((0,u.e$)(n.error)));return}d((0,g.t5)("".concat(b?"User created. By default, new users are set to the Viewer role. To change the role, please go to the Permissions tab.":"User updated."))),(null==n?void 0:n.data)&&o((0,v.Vv)(n.data.id))},_=M,{data:P}=(0,N.qv)(),A=!f.ssoAuthentication||!(null==P?void 0:P.length);return A||(_=M.shape({password:E.a.optional().label("Password")})),_=S?_:_.omit(["password"]),(0,i.jsx)(h.J9,{onSubmit:k,initialValues:null!=t?t:F,validationSchema:_,children:e=>{let{dirty:s,isSubmitting:t,isValid:a}=e;return(0,i.jsx)(h.l0,{children:(0,i.jsxs)(n.Kqy,{maxW:["xs","xs","100%"],width:"100%",spacing:7,children:[(0,i.jsxs)(n.Kqy,{spacing:6,maxWidth:"55%",children:[(0,i.jsxs)(n.kCb,{children:[(0,i.jsxs)(n.xvT,{display:"flex",alignItems:"center",fontSize:"sm",fontWeight:"semibold",children:["Profile"," ",(null==m?void 0:m.disabled)&&(0,i.jsx)(n.j8w,{color:"success",className:"ml-2","data-testid":"invite-sent-badge",children:"Invite sent"})]}),(0,i.jsx)(n.xuv,{marginLeft:"auto",children:(0,i.jsxs)(n.Ugi,{children:[(0,i.jsx)(L,{}),b?null:(0,i.jsxs)(n.xuv,{children:[(0,i.jsx)(n.wpx,{"aria-label":"delete",icon:(0,i.jsx)(y.l,{}),onClick:c.onOpen,"data-testid":"delete-user-btn"}),(0,i.jsx)(R.Z,{user:m,...c})]})]})})]}),(0,i.jsx)(q.j0,{name:"username",label:"Username",variant:"block",placeholder:"Enter new username",disabled:!b,isRequired:!0}),(0,i.jsx)(q.j0,{name:"email_address",label:"Email address",variant:"block",placeholder:"Enter email of user",isRequired:!0}),(0,i.jsx)(q.j0,{name:"first_name",label:"First Name",variant:"block",placeholder:"Enter first name of user",disabled:C}),(0,i.jsx)(q.j0,{name:"last_name",label:"Last Name",variant:"block",placeholder:"Enter last name of user",disabled:C}),S?(0,i.jsx)(q.j0,{name:"password",label:"Password",variant:"block",placeholder:"********",type:"password",tooltip:"Password must contain at least 8 characters, 1 number, 1 capital letter, 1 lowercase letter, and at least 1 symbol.",isRequired:A}):null]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(n.wpx,{onClick:()=>l.push(j.e3),className:"mr-3",children:"Cancel"}),(0,i.jsx)(n.wpx,{htmlType:"submit",type:"primary",disabled:!s||!a,loading:t,"data-testid":"save-user-btn",children:"Save"})]})]})})}})},H=e=>{let{onSubmit:s,initialValues:t,...a}=e,h=(0,r.C)(v.Ux);(0,v.Fk)(h,{skip:!h});let x=(0,c.Tg)([o.Sh.USER_PERMISSION_UPDATE]),m=[{label:"Profile",content:(0,i.jsx)($,{onSubmit:s,initialValues:t,...a})},{label:"Permissions",content:(0,i.jsxs)(n.kCb,{gap:"97px",children:[(0,i.jsx)(n.xuv,{w:{base:"100%",md:"50%",xl:"50%"},children:(0,i.jsx)(T,{})}),(0,i.jsx)(n.xuv,{position:"absolute",top:"96px",right:6,height:"calc(100% + 100px)",overflowY:"scroll",padding:6,w:"35%",borderLeftWidth:"1px",children:(0,i.jsx)(l,{})})]}),isDisabled:!h||!x}];return(0,i.jsx)(d.Z,{data:m})}},31883:function(e,s,t){t.d(s,{Bw:function(){return i.Bw},D4:function(){return i.D4}});var i=t(19043)}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1150],{7617:function(e,s,t){t.d(s,{q:function(){return a}});var i=t(24246),n=t(77181);let a=e=>{let{label:s,isDisabled:t,...a}=e;return(0,i.jsx)(n.OK9,{"data-testid":"tab-".concat(s),_selected:{fontWeight:"600",color:"complimentary.500",borderColor:"complimentary.500"},fontSize:a.fontSize,fontWeight:"500",color:"gray.500",isDisabled:t||!1,children:s})};s.Z=e=>{let{data:s,border:t="partial",...l}=e;return(0,i.jsxs)(n.mQc,{colorScheme:"complimentary",...l,children:[(0,i.jsx)(n.tdY,{width:"partial"===t?"max-content":void 0,children:s.map(e=>(0,i.jsx)(a,{label:e.label,isDisabled:e.isDisabled,fontSize:l.fontSize},e.label))}),(0,i.jsx)(n.nPR,{children:s.map(e=>(0,i.jsx)(n.x45,{px:0,"data-testid":"tab-panel-".concat(e.label),children:e.content},e.label))})]})}},58452:function(e,s,t){var i=t(24246),n=t(77181);s.Z=e=>{let{isOpen:s,onClose:t,onConfirm:a,onCancel:l,title:r,message:d,cancelButtonText:o,continueButtonText:c,isLoading:h,returnFocusOnClose:x,isCentered:m,testId:u="confirmation-modal",icon:p}=e;return(0,i.jsxs)(n.u_l,{isOpen:s,onClose:t,size:"lg",returnFocusOnClose:null==x||x,isCentered:m,children:[(0,i.jsx)(n.ZAr,{}),(0,i.jsxs)(n.hzk,{textAlign:"center",p:6,"data-testid":u,children:[p?(0,i.jsx)(n.M5Y,{mb:2,children:p}):null,r?(0,i.jsx)(n.xBx,{fontWeight:"medium",pb:0,children:r}):null,d?(0,i.jsx)(n.fef,{children:d}):null,(0,i.jsx)(n.mzw,{children:(0,i.jsxs)(n.MIq,{columns:2,width:"100%",children:[(0,i.jsx)(n.wpx,{onClick:()=>{l&&l(),t()},size:"large",className:"mr-3","data-testid":"cancel-btn",disabled:h,children:o||"Cancel"}),(0,i.jsx)(n.wpx,{type:"primary",size:"large",onClick:a,"data-testid":"continue-btn",loading:h,children:c||"Continue"})]})})]})]})}},41150:function(e,s,t){t.d(s,{Z:function(){return H}});var i=t(24246),n=t(77181),a=t(91437),l=()=>(0,i.jsxs)(n.xuv,{children:[(0,i.jsx)(n.xuv,{pb:4,fontSize:"18px",fontWeight:"semibold",children:"Role Description"}),(0,i.jsx)(n.gCW,{spacing:4,children:a.K.map(e=>(0,i.jsxs)(n.xuv,{width:"100%",padding:4,borderRadius:"md",backgroundColor:"gray.75",fontSize:"14px",children:[(0,i.jsx)(n.xuv,{fontWeight:"semibold",children:e.label}),(0,i.jsx)(n.xuv,{color:"gray.700",children:e.description})]},e.roleKey))})]}),r=t(16134),d=t(7617),o=t(21702),c=t(19904),h=t(34090),x=t(86677),m=t(27378),u=t(812),p=t(58452),j=t(77830),w=t(91613),g=t(46628),f=t(86780),b=t(1315),y=t(95492),v=t(65497);let C=e=>{let{assignedSystems:s,onAssignedSystemChange:t}=e,a=(0,r.C)(v.Ux);if((0,v.d6)(a,{skip:!a}),0===s.length)return null;let l=e=>{t(s.filter(s=>s.fides_key!==e.fides_key))};return(0,i.jsxs)(n.iA_,{size:"sm","data-testid":"assign-systems-delete-table",children:[(0,i.jsx)(n.hrZ,{children:(0,i.jsxs)(n.Tr,{children:[(0,i.jsx)(n.Th,{children:"System"}),(0,i.jsx)(n.Th,{})]})}),(0,i.jsx)(n.p3B,{children:s.map(e=>(0,i.jsxs)(n.Tr,{_hover:{bg:"gray.50"},"data-testid":"row-".concat(e.fides_key),children:[(0,i.jsx)(n.Td,{children:e.name}),(0,i.jsx)(n.Td,{textAlign:"end",children:(0,i.jsx)(n.wpx,{"aria-label":"Unassign system from user",icon:(0,i.jsx)(y.l,{}),onClick:()=>l(e),"data-testid":"unassign-btn"})})]},e.fides_key))})]})};var S=e=>{let{allSystems:s,assignedSystems:t,onChange:a}=e,l=e=>{t.find(s=>s.fides_key===e.fides_key)?a(t.filter(s=>s.fides_key!==e.fides_key)):a([...t,e])};return(0,i.jsx)(n.xuv,{overflowY:"auto",maxHeight:"300px",children:(0,i.jsxs)(n.iA_,{size:"sm","data-testid":"assign-systems-table",maxHeight:"50vh",overflowY:"scroll",children:[(0,i.jsx)(n.hrZ,{position:"sticky",top:0,background:"white",zIndex:1,children:(0,i.jsxs)(n.Tr,{children:[(0,i.jsx)(n.Th,{children:"System"}),(0,i.jsx)(n.Th,{children:"Assign"})]})}),(0,i.jsx)(n.p3B,{children:s.map(e=>{let s=!!t.find(s=>s.fides_key===e.fides_key);return(0,i.jsxs)(n.Tr,{_hover:{bg:"gray.50"},"data-testid":"row-".concat(e.fides_key),children:[(0,i.jsx)(n.Td,{children:e.name}),(0,i.jsx)(n.Td,{children:(0,i.jsx)(n.rAg,{checked:s,onChange:()=>l(e),"data-testid":"assign-switch"})})]},e.fides_key)})})]})})};let k=(e,s)=>{var t,i;return(null===(t=e.name)||void 0===t?void 0:t.toLocaleLowerCase().includes(s.toLocaleLowerCase()))||(null===(i=e.description)||void 0===i?void 0:i.toLocaleLowerCase().includes(s.toLocaleLowerCase()))};var _=e=>{let{isOpen:s,onClose:t,assignedSystems:a,onAssignedSystemChange:l}=e,{data:r}=(0,b.K3)(),[d,o]=(0,m.useState)(""),[c,h]=(0,m.useState)(a),x=async()=>{l(c),t()},u=!r||0===r.length,p=(0,m.useMemo)(()=>r?r.filter(e=>k(e,d)):[],[r,d]),j=(0,m.useMemo)(()=>{let e=new Set(c.map(e=>e.fides_key));return p.every(s=>e.has(s.fides_key))},[p,c]);return(0,i.jsxs)(n.u_l,{isOpen:s,onClose:t,size:"2xl",children:[(0,i.jsx)(n.ZAr,{}),(0,i.jsxs)(n.hzk,{p:8,"data-testid":"confirmation-modal",children:[(0,i.jsxs)(n.xBx,{fontWeight:"medium",display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(n.xvT,{children:"Assign systems"}),(0,i.jsxs)(n.j8w,{color:"success",children:["Assigned to ",a.length," systems"]})]}),(0,i.jsx)(n.fef,{"data-testid":"assign-systems-modal-body",children:u?(0,i.jsx)(n.xvT,{children:"No systems found"}):(0,i.jsxs)(n.Kqy,{spacing:4,children:[(0,i.jsxs)(n.kCb,{justifyContent:"space-between",children:[(0,i.jsx)(n.xvT,{fontSize:"sm",flexGrow:1,fontWeight:"medium",children:"Assign systems in your organization to this user"}),(0,i.jsx)(n.xuv,{children:(0,i.jsxs)(n.NIc,{display:"flex",alignItems:"center",children:[(0,i.jsx)(n.lXp,{fontSize:"sm",htmlFor:"assign-all-systems",mb:"0",children:"Assign all systems"}),(0,i.jsx)(n.rAg,{size:"small",id:"assign-all-systems",checked:j,onChange:e=>{e&&r?h(p):h(r?r.filter(e=>!p.includes(e)):[])},"data-testid":"assign-all-systems-toggle"})]})})]}),(0,i.jsx)(f.Z,{search:d,onChange:o,placeholder:"Search for systems","data-testid":"system-search",withIcon:!0}),(0,i.jsx)(S,{allSystems:p,assignedSystems:c,onChange:h})]})}),(0,i.jsx)(n.mzw,{justifyContent:"flex-start",children:(0,i.jsxs)("div",{children:[(0,i.jsx)(n.wpx,{onClick:t,className:"mr-2","data-testid":"cancel-btn",children:"Cancel"}),u?null:(0,i.jsx)(n.wpx,{type:"primary",onClick:x,"data-testid":"confirm-btn",children:"Confirm"})]})})]})]})},P=e=>{let{label:s,roleKey:t,isSelected:a,isDisabled:l,assignedSystems:r,onAssignedSystemChange:d}=e,{setFieldValue:c}=(0,h.u6)(),x=(0,n.qY0)(),m=l?"You do not have sufficient permissions to assign this role.":void 0;return a?(0,i.jsxs)(n.Kqy,{borderRadius:"md",border:"1px solid",borderColor:"gray.200",p:4,backgroundColor:"gray.50","aria-selected":"true",spacing:4,"data-testid":"selected",children:[(0,i.jsxs)(n.kCb,{alignItems:"center",justifyContent:"space-between",children:[(0,i.jsx)(n.xvT,{fontSize:"md",fontWeight:"semibold",children:s}),(0,i.jsx)(n.StI,{})]}),t!==o.A7.APPROVER?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.kCb,{alignItems:"center",children:[(0,i.jsx)(n.xvT,{fontSize:"sm",fontWeight:"semibold",mr:1,children:"Assigned systems"}),(0,i.jsx)(w.Z,{label:"Assigned systems refer to those systems that have been specifically allocated to a user for management purposes. Users assigned to a system possess full edit permissions and are listed as the Data Steward for the respective system."})]}),(0,i.jsx)(n.wpx,{disabled:l,title:m,type:"primary",size:"small",onClick:x.onOpen,"data-testid":"assign-systems-btn",children:"Assign systems +"}),(0,i.jsx)(C,{assignedSystems:r,onAssignedSystemChange:d}),x.isOpen?(0,i.jsx)(_,{isOpen:x.isOpen,onClose:x.onClose,assignedSystems:r,onAssignedSystemChange:d}):null]}):null]}):(0,i.jsx)(n.wpx,{onClick:()=>{c("roles",[t])},"data-testid":"role-option-".concat(s),title:m,disabled:l,children:s})};let A={roles:[]};var T=()=>{var e;let s=(0,n.pmc)(),t=(0,x.useRouter)(),l=(0,r.C)(v.Ux);(0,v.d6)(l,{skip:!l});let{isOpen:d,onOpen:f,onClose:b}=(0,n.qY0)(),y=(0,r.C)(v.R$),[C,S]=(0,m.useState)(y),[k]=(0,v.G$)();(0,m.useEffect)(()=>{S(y)},[y]);let{data:_,isLoading:T}=(0,v.gU)(null!=l?l:"",{skip:!l}),[R]=(0,v.lD)(),z=async e=>{if(d&&b(),!l)return;let t=e.roles.includes(o.A7.APPROVER),i=await R({user_id:l,payload:{roles:e.roles}});if((0,u.D4)(i)){s((0,g.Vo)((0,u.e$)(i.error)));return}if(!t){let e=C.map(e=>e.fides_key),t=await k({userId:l,fidesKeys:e});if((0,u.D4)(t)){s((0,g.Vo)((0,u.e$)(t.error)));return}}s((0,g.t5)("Permissions updated"))},I=async e=>{l&&(C.length>0&&e.roles.includes(o.A7.APPROVER)?f():await z(e))},q=(0,c.Tg)([o.Sh.USER_PERMISSION_ASSIGN_OWNERS]);if(!l)return null;if(T)return(0,i.jsx)(n.$jN,{});if(!q&&(null==_?void 0:null===(e=_.roles)||void 0===e?void 0:e.includes(o.A7.OWNER)))return(0,i.jsx)(n.xvT,{"data-testid":"insufficient-access",children:"You do not have sufficient access to change this user's permissions."});let E=(null==_?void 0:_.roles)?{roles:_.roles}:A;return(0,i.jsx)(h.J9,{onSubmit:I,initialValues:E,enableReinitialize:!0,children:e=>{let{values:s,isSubmitting:l,dirty:r}=e;return(0,i.jsxs)(h.l0,{children:[(0,i.jsxs)(n.Kqy,{spacing:7,children:[(0,i.jsxs)(n.Kqy,{spacing:3,"data-testid":"role-options",children:[(0,i.jsxs)(n.kCb,{alignItems:"center",children:[(0,i.jsx)(n.xvT,{fontSize:"sm",fontWeight:"semibold",mr:1,children:"User role"}),(0,i.jsx)(w.Z,{label:"A user's role in the organization determines what parts of the UI they can access and which functions are available to them."})]}),a.K.map(e=>{let t=s.roles.indexOf(e.roleKey)>=0;return(0,i.jsx)(P,{isSelected:t,isDisabled:e.roleKey===o.A7.OWNER&&!q,assignedSystems:C,onAssignedSystemChange:S,...e},e.roleKey)})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(n.wpx,{onClick:()=>t.push(j.e3),children:"Cancel"}),(0,i.jsx)(n.wpx,{type:"primary",htmlType:"submit",loading:l,disabled:!r&&C===y,"data-testid":"save-btn",children:"Save"})]})]}),(0,i.jsx)(p.Z,{isOpen:d,onClose:b,onConfirm:()=>z(s),title:"Change role to Approver",testId:"downgrade-to-approver-confirmation-modal",continueButtonText:"Yes",message:(0,i.jsx)(n.xvT,{children:"Switching to an approver role will remove all assigned systems. Do you wish to proceed?"})})]})}})},R=t(61038),z=t(55484),I=t(25980),q=t(40324),E=t(96006);let{useGetEmailInviteStatusQuery:O}=t(78780).u.injectEndpoints({endpoints:e=>({getEmailInviteStatus:e.query({query:()=>({url:"/messaging/email-invite/status"}),providesTags:()=>["Email Invite Status"]})})});var N=t(76174),Z=t(91317),U=t(31883);let W=z.Ry().shape({password:E.a.label("Password"),passwordConfirmation:z.Z_().required().oneOf([z.iH("password")],"Passwords must match").label("Password confirmation")}),D={password:"",passwordConfirmation:""},K=e=>{let s=(0,n.qY0)(),t=(0,n.pmc)(),[i]=(0,v.ls)(),a=async n=>{let a=await i({id:e,new_password:n.password});(0,U.D4)(a)?t((0,g.Vo)((0,u.e$)(a.error))):(t((0,g.t5)("Successfully reset user's password. Please inform the user of their new password.")),s.onClose())};return{...s,handleResetPassword:a}};var V=e=>{let{id:s}=e,{handleResetPassword:t,isOpen:a,onClose:l,onOpen:r}=K(s);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.wpx,{onClick:r,"data-testid":"reset-password-btn",children:"Reset password"}),(0,i.jsxs)(n.u_l,{isCentered:!0,isOpen:a,onClose:l,children:[(0,i.jsx)(n.ZAr,{}),(0,i.jsx)(n.hzk,{children:(0,i.jsx)(h.J9,{initialValues:D,validationSchema:W,onSubmit:t,children:e=>{let{isSubmitting:s,dirty:t,isValid:a}=e;return(0,i.jsxs)(h.l0,{children:[(0,i.jsx)(n.xBx,{children:"Reset Password"}),(0,i.jsx)(n.olH,{}),(0,i.jsx)(n.fef,{children:(0,i.jsxs)(n.Kqy,{direction:"column",spacing:4,children:[(0,i.jsx)(n.xvT,{mb:2,children:"Choose a new password for this user."}),(0,i.jsx)(q.j0,{name:"password",label:"Password",placeholder:"********",type:"password",tooltip:"Password must contain at least 8 characters, 1 number, 1 capital letter, 1 lowercase letter, and at least 1 symbol.",autoComplete:"new-password"}),(0,i.jsx)(q.j0,{name:"passwordConfirmation",label:"Confirm Password",placeholder:"********",type:"password",tooltip:"Must match above password.",autoComplete:"confirm-password"})]})}),(0,i.jsx)(n.mzw,{children:(0,i.jsxs)("div",{className:"w-full gap-2",children:[(0,i.jsx)(n.wpx,{onClick:l,className:"w-1/2",children:"Cancel"}),(0,i.jsx)(n.wpx,{type:"primary",disabled:!t||!a,loading:s,htmlType:"submit",className:"w-1/2","data-testid":"submit-btn",children:"Change Password"})]})})]})}})})]})]})};let Y=e=>{let s=(0,n.qY0)(),t=(0,n.pmc)(),[i,a]=(0,m.useState)(""),[l,r]=(0,m.useState)(""),[d,{isLoading:o}]=(0,v.ev)(),c=!!(e&&l&&i),h=async()=>{c&&d({id:e,old_password:i,new_password:l}).unwrap().then(()=>{t((0,g.t5)("Password updated")),s.onClose()})};return{...s,changePasswordValidation:c,handleChange:e=>{"oldPassword"===e.target.name?a(e.target.value):r(e.target.value)},handleChangePassword:h,isLoading:o,newPasswordValue:l,oldPasswordValue:i}};var B=e=>{let{id:s}=e,{changePasswordValidation:t,handleChange:a,handleChangePassword:l,isLoading:r,isOpen:d,newPasswordValue:o,oldPasswordValue:c,onClose:h,onOpen:x}=Y(s);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.wpx,{onClick:x,"data-testid":"update-password-btn",children:"Update password"}),(0,i.jsxs)(n.u_l,{isCentered:!0,isOpen:d,onClose:h,children:[(0,i.jsx)(n.ZAr,{}),(0,i.jsxs)(n.hzk,{children:[(0,i.jsx)(n.xBx,{children:"Update Password"}),(0,i.jsx)(n.olH,{}),(0,i.jsx)(n.fef,{pb:6,children:(0,i.jsxs)(n.Kqy,{direction:"column",spacing:"15px",children:[(0,i.jsx)(n.NIc,{children:(0,i.jsx)(n.IIB,{isRequired:!0,name:"oldPassword",onChange:a,placeholder:"Old Password",type:"password",value:c,"data-testid":"input-oldPassword"})}),(0,i.jsx)(n.NIc,{children:(0,i.jsx)(n.IIB,{isRequired:!0,name:"newPassword",onChange:a,placeholder:"New Password",type:"password",value:o,"data-testid":"input-newPassword"})})]})}),(0,i.jsxs)(n.mzw,{children:[(0,i.jsx)(n.wpx,{onClick:h,className:"mr-2 w-1/2",children:"Cancel"}),(0,i.jsx)(n.wpx,{type:"primary",disabled:!t,loading:r,onClick:l,htmlType:"submit",className:"mr-3 w-1/2","data-testid":"submit-btn",children:"Change Password"})]})]})]})]})},L=()=>{let e=(0,r.C)(v.Ux),s=(0,r.C)(Z.dy),t=!!s&&s.id===e;return(0,i.jsx)(n.xuv,{children:e?(0,i.jsxs)(n.Ugi,{children:[t?(0,i.jsx)(B,{id:e}):null,(0,i.jsx)(c.ZP,{scopes:[o.Sh.USER_PASSWORD_RESET],children:(0,i.jsx)(V,{id:e})})]}):null})};let F={username:"",first_name:"",email_address:"",last_name:"",password:""},M=z.Ry().shape({username:z.Z_().required().label("Username"),email_address:z.Z_().email().required().label("Email address"),first_name:z.Z_().label("First name"),last_name:z.Z_().label("Last name"),password:E.a.label("Password")});var $=e=>{let{onSubmit:s,initialValues:t,canEditNames:a}=e,l=(0,x.useRouter)(),d=(0,n.pmc)(),o=(0,r.T)(),c=(0,n.qY0)(),m=(0,r.C)(v.ZC),{data:p}=O(),w=null==p?void 0:p.enabled,{flags:f}=(0,I.Vb)(),b=!m,C=!b&&!a,S=b&&!w,k=async e=>{let{password:t,...i}=e,n=await s(S?e:i);if((0,u.D4)(n)){d((0,g.Vo)((0,u.e$)(n.error)));return}d((0,g.t5)("".concat(b?"User created. By default, new users are set to the Viewer role. To change the role, please go to the Permissions tab.":"User updated."))),(null==n?void 0:n.data)&&o((0,v.Vv)(n.data.id))},_=M,{data:P}=(0,N.qv)(),A=!f.ssoAuthentication||!(null==P?void 0:P.length);return A||(_=M.shape({password:E.a.optional().label("Password")})),_=S?_:_.omit(["password"]),(0,i.jsx)(h.J9,{onSubmit:k,initialValues:null!=t?t:F,validationSchema:_,children:e=>{let{dirty:s,isSubmitting:t,isValid:a}=e;return(0,i.jsx)(h.l0,{children:(0,i.jsxs)(n.Kqy,{maxW:["xs","xs","100%"],width:"100%",spacing:7,children:[(0,i.jsxs)(n.Kqy,{spacing:6,maxWidth:"55%",children:[(0,i.jsxs)(n.kCb,{children:[(0,i.jsxs)(n.xvT,{display:"flex",alignItems:"center",fontSize:"sm",fontWeight:"semibold",children:["Profile"," ",(null==m?void 0:m.disabled)&&(0,i.jsx)(n.j8w,{color:"success",className:"ml-2","data-testid":"invite-sent-badge",children:"Invite sent"})]}),(0,i.jsx)(n.xuv,{marginLeft:"auto",children:(0,i.jsxs)(n.Ugi,{children:[(0,i.jsx)(L,{}),b?null:(0,i.jsxs)(n.xuv,{children:[(0,i.jsx)(n.wpx,{"aria-label":"delete",icon:(0,i.jsx)(y.l,{}),onClick:c.onOpen,"data-testid":"delete-user-btn"}),(0,i.jsx)(R.Z,{user:m,...c})]})]})})]}),(0,i.jsx)(q.j0,{name:"username",label:"Username",variant:"block",placeholder:"Enter new username",disabled:!b,isRequired:!0}),(0,i.jsx)(q.j0,{name:"email_address",label:"Email address",variant:"block",placeholder:"Enter email of user",isRequired:!0}),(0,i.jsx)(q.j0,{name:"first_name",label:"First Name",variant:"block",placeholder:"Enter first name of user",disabled:C}),(0,i.jsx)(q.j0,{name:"last_name",label:"Last Name",variant:"block",placeholder:"Enter last name of user",disabled:C}),S?(0,i.jsx)(q.j0,{name:"password",label:"Password",variant:"block",placeholder:"********",type:"password",tooltip:"Password must contain at least 8 characters, 1 number, 1 capital letter, 1 lowercase letter, and at least 1 symbol.",isRequired:A}):null]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(n.wpx,{onClick:()=>l.push(j.e3),className:"mr-3",children:"Cancel"}),(0,i.jsx)(n.wpx,{htmlType:"submit",type:"primary",disabled:!s||!a,loading:t,"data-testid":"save-user-btn",children:"Save"})]})]})})}})},H=e=>{let{onSubmit:s,initialValues:t,...a}=e,h=(0,r.C)(v.Ux);(0,v.Fk)(h,{skip:!h});let x=(0,c.Tg)([o.Sh.USER_PERMISSION_UPDATE]),m=[{label:"Profile",content:(0,i.jsx)($,{onSubmit:s,initialValues:t,...a})},{label:"Permissions",content:(0,i.jsxs)(n.kCb,{gap:"97px",children:[(0,i.jsx)(n.xuv,{w:{base:"100%",md:"50%",xl:"50%"},children:(0,i.jsx)(T,{})}),(0,i.jsx)(n.xuv,{position:"absolute",top:"96px",right:6,height:"calc(100% + 100px)",overflowY:"scroll",padding:6,w:"35%",borderLeftWidth:"1px",children:(0,i.jsx)(l,{})})]}),isDisabled:!h||!x}];return(0,i.jsx)(d.Z,{data:m})}},31883:function(e,s,t){t.d(s,{Bw:function(){return i.Bw},D4:function(){return i.D4}});var i=t(19043)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1376],{87361:function(e,a,n){var i=n(24246),t=n(77181);a.Z=e=>{let{title:a,text:n,onClose:l}=e;return(0,i.jsxs)(t.Ugi,{backgroundColor:"gray.50",border:"1px solid",borderRadius:"md",justifyContent:"space-between",py:4,pr:6,pl:3,"data-testid":"empty-state",gap:2,position:"relative",children:[l&&(0,i.jsx)(t.Two,{boxSize:5,position:"absolute",right:3,top:3,zIndex:1,cursor:"pointer",p:1,onClick:l}),(0,i.jsx)(t.iid,{alignSelf:"start",color:"minos",mt:.5,flexGrow:0}),(0,i.jsxs)(t.kCb,{direction:"column",gap:2,flexGrow:1,children:[(0,i.jsx)(t.X6q,{fontSize:"md",children:a}),(0,i.jsx)(t.xvT,{fontSize:"sm",color:"gray.600",lineHeight:"5",children:n})]})]})}},97181:function(e,a,n){n.d(a,{d:function(){return d}});var i=n(24246),t=n(77181),l=n(34090),r=n(27378),o=n(91613),s=n(40324);let d=e=>{let{name:a,label:n,labelProps:d,tooltip:_,isRequired:c,layout:u="inline",...F}=e,[p,b,{setValue:m}]=(0,l.U$)(a),v=!!(b.touched&&b.error),[g,h]=(0,r.useState)("");p.value||"tags"!==F.mode&&"multiple"!==F.mode||(p.value=[]),"tags"===F.mode&&"string"==typeof p.value&&(p.value=[p.value]);let S="tags"===F.mode?(e,a)=>e?e.value!==g||p.value.includes(g)?F.optionRender?F.optionRender(e,a):e.label:'Create "'.concat(g,'"'):void 0:F.optionRender||void 0,C=e=>{h(e),F.onSearch&&F.onSearch(e)},f=(e,a)=>{m(e),F.onChange&&F.onChange(e,a)};return"inline"===u?(0,i.jsx)(t.NIc,{isInvalid:v,isRequired:c,children:(0,i.jsxs)(t.rjZ,{templateColumns:n?"1fr 3fr":"1fr",children:[n?(0,i.jsx)(s.__,{htmlFor:F.id||a,...d,children:n}):null,(0,i.jsxs)(t.jqI,{align:"center",children:[(0,i.jsxs)(t.jqI,{vertical:!0,flex:1,className:"mr-2",children:[(0,i.jsx)(t.WPr,{...p,id:F.id||a,"data-testid":"controlled-select-".concat(p.name),...F,optionRender:S,onSearch:"tags"===F.mode?C:void 0,onChange:f,value:p.value||void 0,status:v?"error":void 0}),(0,i.jsx)(s.Bc,{isInvalid:v,message:b.error,fieldName:p.name})]}),_?(0,i.jsx)(o.Z,{label:_}):null]})]})}):(0,i.jsx)(t.NIc,{isInvalid:v,isRequired:c,children:(0,i.jsxs)(t.gCW,{alignItems:"start",children:[(0,i.jsxs)(t.jqI,{align:"center",children:[n?(0,i.jsx)(s.__,{htmlFor:F.id||a,fontSize:"xs",my:0,mr:1,...d,children:n}):null,_?(0,i.jsx)(o.Z,{label:_}):null]}),(0,i.jsx)(t.WPr,{...p,id:F.id||a,"data-testid":"controlled-select-".concat(p.name),...F,optionRender:S,onSearch:"tags"===F.mode?C:void 0,onChange:f,value:p.value||void 0,status:v?"error":void 0}),(0,i.jsx)(s.Bc,{isInvalid:v,message:b.error,fieldName:p.name})]})})}},57899:function(e,a,n){var i=n(24246),t=n(77181),l=n(27378);a.Z=e=>{let{handleConfirm:a,isOpen:n,onClose:r,title:o,message:s,confirmButtonText:d="Continue",cancelButtonText:_="Cancel"}=e,c=(0,l.useRef)(null);return(0,i.jsx)(t.aRR,{isOpen:n,leastDestructiveRef:c,onClose:r,children:(0,i.jsx)(t.dhV,{children:(0,i.jsxs)(t._Tf,{alignItems:"center",textAlign:"center",children:[(0,i.jsx)(t.aNP,{marginTop:3}),(0,i.jsx)(t.fYl,{fontSize:"lg",fontWeight:"bold",children:o}),(0,i.jsx)(t.iPF,{pt:0,children:s}),(0,i.jsxs)(t.xoY,{children:[(0,i.jsx)(t.wpx,{ref:c,onClick:r,size:"large",children:_}),(0,i.jsx)(t.wpx,{onClick:()=>a(),type:"primary",size:"large",className:"ml-3","data-testid":"warning-modal-confirm-btn",children:d})]})]})})})}},90980:function(e,a,n){n.d(a,{R:function(){return s}});var i=n(24246),t=n(77181),l=n(79894),r=n.n(l),o=n(63662);let s=e=>{let{onClick:a,...n}=e;return(0,i.jsxs)(t.kCb,{alignItems:"center",mt:-4,mb:3,onClick:a,cursor:"pointer",...n,children:[(0,i.jsx)(t.wpx,{"aria-label":"Back",icon:(0,i.jsx)(t.Rpv,{}),className:"mr-2",size:"small"}),(0,i.jsx)(t.xvT,{as:"a",fontSize:"sm",fontWeight:"500",children:"Back"})]})};a.Z=e=>{let{backPath:a,...n}=e,l=(0,o.useRouter)();return(0,i.jsxs)(t.kCb,{alignItems:"center",mb:6,...n,children:[(0,i.jsx)(t.wpx,{onClick:()=>l.push(a),"aria-label":"Back",icon:(0,i.jsx)(t.Rpv,{}),className:"mr-2",size:"small"}),(0,i.jsx)(t.xvT,{as:r(),href:a,fontSize:"sm",fontWeight:"500",children:"Back"})]})}},8411:function(e,a,n){n.d(a,{NA:function(){return l},Z8:function(){return t}});var i=n(21702);let t={[i._F.ER]:"Eritrea",[i._F.DJ]:"Djibouti",[i._F.MR]:"Mauritania",[i._F.NA]:"Namibia",[i._F.GH]:"Ghana",[i._F.SS]:"South Sudan",[i._F.SC]:"Seychelles",[i._F.IO]:"British Indian Ocean Territory",[i._F.GQ]:"Equatorial Guinea",[i._F.AO]:"Angola",[i._F.CG]:"Republic of the Congo",[i._F.BW]:"Botswana",[i._F.BI]:"Burundi",[i._F.DZ]:"Algeria",[i._F.TD]:"Chad",[i._F.NG]:"Nigeria",[i._F.TZ]:"Tanzania",[i._F.EH]:"Western Sahara",[i._F.SN]:"Senegal",[i._F.LR]:"Liberia",[i._F.ZA]:"South Africa",[i._F.CV]:"Cape Verde",[i._F.GM]:"Gambia",[i._F.SD]:"Sudan",[i._F.KM]:"Comoros",[i._F.SZ]:"Eswatini",[i._F.UG]:"Uganda",[i._F.MG]:"Madagascar",[i._F.RW]:"Rwanda",[i._F.CD]:"DR Congo",[i._F.CM]:"Cameroon",[i._F.SH]:"Saint Helena, Ascension and Tristan da Cunha",[i._F.TG]:"Togo",[i._F.MU]:"Mauritius",[i._F.NE]:"Niger",[i._F.BJ]:"Benin",[i._F.EG]:"Egypt",[i._F.LS]:"Lesotho",[i._F.ET]:"Ethiopia",[i._F.MA]:"Morocco",[i._F.YT]:"Mayotte",[i._F.BF]:"Burkina Faso",[i._F.RE]:"R\xe9union",[i._F.ST]:"S\xe3o Tom\xe9 and Pr\xedncipe",[i._F.CF]:"Central African Republic",[i._F.MZ]:"Mozambique",[i._F.MW]:"Malawi",[i._F.ML]:"Mali",[i._F.ZM]:"Zambia",[i._F.LY]:"Libya",[i._F.GW]:"Guinea-Bissau",[i._F.SO]:"Somalia",[i._F.KE]:"Kenya",[i._F.GN]:"Guinea",[i._F.ZW]:"Zimbabwe",[i._F.TN]:"Tunisia",[i._F.SL]:"Sierra Leone",[i._F.GA]:"Gabon",[i._F.CI]:"Ivory Coast",[i._F.JO]:"Jordan",[i._F.PK]:"Pakistan",[i._F.KP]:"North Korea",[i._F.MO]:"Macau",[i._F.AM]:"Armenia",[i._F.SY]:"Syria",[i._F.TJ]:"Tajikistan",[i._F.SA]:"Saudi Arabia",[i._F.KR]:"South Korea",[i._F.NP]:"Nepal",[i._F.PH]:"Philippines",[i._F.IQ]:"Iraq",[i._F.LB]:"Lebanon",[i._F.MN]:"Mongolia",[i._F.PS]:"Palestine",[i._F.YE]:"Yemen",[i._F.JP]:"Japan",[i._F.KZ]:"Kazakhstan",[i._F.LK]:"Sri Lanka",[i._F.MM]:"Myanmar",[i._F.KG]:"Kyrgyzstan",[i._F.CN]:"China",[i._F.AF]:"Afghanistan",[i._F.OM]:"Oman",[i._F.IN]:"India",[i._F.LA]:"Laos",[i._F.UZ]:"Uzbekistan",[i._F.MV]:"Maldives",[i._F.ID]:"Indonesia",[i._F.VN]:"Vietnam",[i._F.MY]:"Malaysia",[i._F.TW]:"Taiwan",[i._F.KH]:"Cambodia",[i._F.AE]:"United Arab Emirates",[i._F.HK]:"Hong Kong",[i._F.GE]:"Georgia",[i._F.BD]:"Bangladesh",[i._F.KW]:"Kuwait",[i._F.TM]:"Turkmenistan",[i._F.QA]:"Qatar",[i._F.BH]:"Bahrain",[i._F.BN]:"Brunei",[i._F.TH]:"Thailand",[i._F.BT]:"Bhutan",[i._F.SG]:"Singapore",[i._F.IL]:"Israel",[i._F.AZ]:"Azerbaijan",[i._F.TL]:"Timor-Leste",[i._F.IR]:"Iran",[i._F.TR]:"Turkey",[i._F.MK]:"North Macedonia",[i._F.IE]:"Ireland",[i._F.DK]:"Denmark",[i._F.SK]:"Slovakia",[i._F.MD]:"Moldova",[i._F.AX]:"\xc5land Islands",[i._F.PL]:"Poland",[i._F.BA]:"Bosnia and Herzegovina",[i._F.SM]:"San Marino",[i._F.CZ]:"Czechia",[i._F.EE]:"Estonia",[i._F.XK]:"Kosovo",[i._F.FO]:"Faroe Islands",[i._F.SJ]:"Svalbard and Jan Mayen",[i._F.GG]:"Guernsey",[i._F.FR]:"France",[i._F.NL]:"Netherlands",[i._F.FI]:"Finland",[i._F.PT]:"Portugal",[i._F.DE]:"Germany",[i._F.MT]:"Malta",[i._F.JE]:"Jersey",[i._F.IS]:"Iceland",[i._F.ES]:"Spain",[i._F.GI]:"Gibraltar",[i._F.NO]:"Norway",[i._F.CY]:"Cyprus",[i._F.RS]:"Serbia",[i._F.LT]:"Lithuania",[i._F.MC]:"Monaco",[i._F.LU]:"Luxembourg",[i._F.UA]:"Ukraine",[i._F.IM]:"Isle of Man",[i._F.RO]:"Romania",[i._F.BE]:"Belgium",[i._F.SE]:"Sweden",[i._F.ME]:"Montenegro",[i._F.LV]:"Latvia",[i._F.VA]:"Vatican City",[i._F.AT]:"Austria",[i._F.AL]:"Albania",[i._F.LI]:"Liechtenstein",[i._F.GR]:"Greece",[i._F.IT]:"Italy",[i._F.AD]:"Andorra",[i._F.GB]:"United Kingdom",[i._F.RU]:"Russia",[i._F.SI]:"Slovenia",[i._F.BY]:"Belarus",[i._F.CH]:"Switzerland",[i._F.HU]:"Hungary",[i._F.BG]:"Bulgaria",[i._F.HR]:"Croatia",[i._F.TC]:"Turks and Caicos Islands",[i._F.CW]:"Cura\xe7ao",[i._F.GP]:"Guadeloupe",[i._F.UM]:"United States Minor Outlying Islands",[i._F.GT]:"Guatemala",[i._F.PM]:"Saint Pierre and Miquelon",[i._F.BQ]:"Caribbean Netherlands",[i._F.GL]:"Greenland",[i._F.SX]:"Sint Maarten",[i._F.PA]:"Panama",[i._F.AW]:"Aruba",[i._F.MQ]:"Martinique",[i._F.AG]:"Antigua and Barbuda",[i._F.BM]:"Bermuda",[i._F.CU]:"Cuba",[i._F.GD]:"Grenada",[i._F.NI]:"Nicaragua",[i._F.LC]:"Saint Lucia",[i._F.KN]:"Saint Kitts and Nevis",[i._F.DO]:"Dominican Republic",[i._F.VC]:"Saint Vincent and the Grenadines",[i._F.BZ]:"Belize",[i._F.HT]:"Haiti",[i._F.JM]:"Jamaica",[i._F.BS]:"Bahamas",[i._F.MX]:"Mexico",[i._F.MF]:"Saint Martin",[i._F.SV]:"El Salvador",[i._F.BL]:"Saint Barth\xe9lemy",[i._F.AI]:"Anguilla",[i._F.MS]:"Montserrat",[i._F.VG]:"British Virgin Islands",[i._F.BB]:"Barbados",[i._F.HN]:"Honduras",[i._F.KY]:"Cayman Islands",[i._F.DM]:"Dominica",[i._F.TT]:"Trinidad and Tobago",[i._F.CR]:"Costa Rica",[i._F.SR]:"Suriname",[i._F.CX]:"Christmas Island",[i._F.WS]:"Samoa",[i._F.PF]:"French Polynesia",[i._F.AS]:"American Samoa",[i._F.NC]:"New Caledonia",[i._F.TK]:"Tokelau",[i._F.PW]:"Palau",[i._F.KI]:"Kiribati",[i._F.VU]:"Vanuatu",[i._F.PN]:"Pitcairn Islands",[i._F.CK]:"Cook Islands",[i._F.FJ]:"Fiji",[i._F.PG]:"Papua New Guinea",[i._F.MP]:"Northern Mariana Islands",[i._F.NU]:"Niue",[i._F.TV]:"Tuvalu",[i._F.NF]:"Norfolk Island",[i._F.TO]:"Tonga",[i._F.FM]:"Micronesia",[i._F.SB]:"Solomon Islands",[i._F.NR]:"Nauru",[i._F.WF]:"Wallis and Futuna",[i._F.GU]:"Guam",[i._F.AU]:"Australia",[i._F.NZ]:"New Zealand",[i._F.MH]:"Marshall Islands",[i._F.CC]:"Cocos (Keeling) Islands",[i._F.VE]:"Venezuela",[i._F.PY]:"Paraguay",[i._F.BR]:"Brazil",[i._F.CO]:"Colombia",[i._F.PE]:"Peru",[i._F.CL]:"Chile",[i._F.UY]:"Uruguay",[i._F.AR]:"Argentina",[i._F.GY]:"Guyana",[i._F.BO]:"Bolivia",[i._F.GF]:"French Guiana",[i._F.EC]:"Ecuador",[i._F.FK]:"Falkland Islands",[i._F.US_AL]:"Alabama",[i._F.US_AK]:"Alaska",[i._F.US_AZ]:"Arizona",[i._F.US_AR]:"Arkansas",[i._F.US_CA]:"California",[i._F.US_CO]:"Colorado",[i._F.US_CT]:"Connecticut",[i._F.US_DE]:"Delaware",[i._F.US_DC]:"District of Columbia (DC)",[i._F.US_FL]:"Florida",[i._F.US_GA]:"Georgia",[i._F.US_HI]:"Hawaii",[i._F.US_ID]:"Idaho",[i._F.US_IL]:"Illinois",[i._F.US_IN]:"Indiana",[i._F.US_IA]:"Iowa",[i._F.US_KS]:"Kansas",[i._F.US_KY]:"Kentucky",[i._F.US_LA]:"Louisiana",[i._F.US_ME]:"Maine",[i._F.US_MD]:"Maryland",[i._F.US_MA]:"Massachusetts",[i._F.US_MI]:"Michigan",[i._F.US_MN]:"Minnesota",[i._F.US_MS]:"Mississippi",[i._F.US_MO]:"Missouri",[i._F.US_MT]:"Montana",[i._F.US_NE]:"Nebraska",[i._F.US_NV]:"Nevada",[i._F.US_NH]:"New Hampshire",[i._F.US_NJ]:"New Jersey",[i._F.US_NM]:"New Mexico",[i._F.US_NY]:"New York",[i._F.US_NC]:"North Carolina",[i._F.US_ND]:"North Dakota",[i._F.US_OH]:"Ohio",[i._F.US_OK]:"Oklahoma",[i._F.US_OR]:"Oregon",[i._F.US_PA]:"Pennsylvania",[i._F.US_PR]:"Puerto Rico",[i._F.US_RI]:"Rhode Island",[i._F.US_SC]:"South Carolina",[i._F.US_SD]:"San Diego",[i._F.US_TN]:"Tennessee",[i._F.US_TX]:"Texas",[i._F.US_UT]:"Utah",[i._F.US_VA]:"Virginia",[i._F.US_VI]:"United States Virgin Islands",[i._F.US_VT]:"Vermon",[i._F.US_WA]:"Washington",[i._F.US_WV]:"West Virginia",[i._F.US_WI]:"Wisconsin",[i._F.US_WY]:"Wyoming",[i._F.CA_AB]:"Alberta",[i._F.CA_BC]:"British Columbia",[i._F.CA_MB]:"Manitoba",[i._F.CA_NB]:"New Brunswick",[i._F.CA_NL]:"Newfoundland and Labrador",[i._F.CA_NS]:"Nova Scotia",[i._F.CA_ON]:"Ontario",[i._F.CA_PE]:"Prince Edward Island",[i._F.CA_QC]:"Quebec",[i._F.CA_SK]:"Saskatchewan",[i._F.CA_NT]:"Northwest Territories",[i._F.CA_NU]:"Nunavut",[i._F.CA_YT]:"Yukon",[i._F.CA]:"Canada",[i._F.US]:"United States",[i._F.MEXICO_CENTRAL_AMERICA]:"Mexico and Central America",[i._F.CARIBBEAN]:"Caribbean",[i._F.EEA]:"European Economic Area (EEA)",[i._F.NON_EEA]:"Non European Economic Area"},l=new Map(Object.entries(t));Object.entries(t).map(e=>({value:e[0],label:e[1]}))},7426:function(e,a,n){n.d(a,{D2:function(){return u},L:function(){return o},U7:function(){return d},Yh:function(){return p},ak:function(){return s},km:function(){return r},tB:function(){return l}});var i=n(3228);let t=n(78780).u.injectEndpoints({endpoints:e=>({getConfigurationSettings:e.query({query:e=>{let{api_set:a}=e;return{url:"/config",method:"GET",params:{api_set:a}}},providesTags:["Configuration Settings"]}),putConfigurationSettings:e.mutation({query:e=>({url:"/config",method:"PUT",body:e}),invalidatesTags:["Configuration Settings"]}),patchConfigurationSettings:e.mutation({query:e=>({url:"/config",method:"PATCH",body:e}),invalidatesTags:["Configuration Settings","Privacy Notices"]})})}),{useGetConfigurationSettingsQuery:l,usePutConfigurationSettingsMutation:r,usePatchConfigurationSettingsMutation:o}=t,s=(0,i.P1)([e=>e,t.endpoints.getConfigurationSettings.select({api_set:!0}),t.endpoints.getConfigurationSettings.select({api_set:!1})],(e,a,n)=>{var i,t,l;let{data:r}=a,{data:o}=n;return{configSet:{cors_origins:(null==o?void 0:null===(i=o.security)||void 0===i?void 0:i.cors_origins)||[],cors_origin_regex:null==o?void 0:null===(t=o.security)||void 0===t?void 0:t.cors_origin_regex},apiSet:{cors_origins:(null==r?void 0:null===(l=r.security)||void 0===l?void 0:l.cors_origins)||[]}}}),d=()=>(0,i.P1)([e=>e,t.endpoints.getConfigurationSettings.select({api_set:!0})],(e,a)=>{let{data:n}=a;return n}),_={enabled:!1,cmp_api_required:!1},c=(e,a,n,i)=>{let t=n&&n[e],l=i&&i[e];return t&&l?{...i[e],...n[e]}:l?i[e]:t?{...n[e]}:a},u=(0,i.P1)([e=>e,t.endpoints.getConfigurationSettings.select({api_set:!0}),t.endpoints.getConfigurationSettings.select({api_set:!1})],(e,a,n)=>{let{data:i}=a,{data:t}=n;return c("gpp",_,i,t)}),F={tcf_publisher_country_code:null},p=(0,i.P1)([e=>e,t.endpoints.getConfigurationSettings.select({api_set:!0}),t.endpoints.getConfigurationSettings.select({api_set:!1})],(e,a,n)=>{let{data:i}=a,{data:t}=n;return c("plus_consent_settings",F,i,t)})},16194:function(e,a,n){n.d(a,{RN:function(){return A},d0:function(){return j}});var i=n(24246),t=n(77181),l=n(34090),r=n(86677),o=n(27378),s=n(16134),d=n(40324),_=n(90980),c=n(77830),u=n(8411),F=n(51472),p=n(64781),b=n(48515),m=n(60325),v=n(34334),g=n(71922),h=n(98795),S=n(21702),C=n(97181);let f=[{label:"Banner and modal",value:S.re.BANNER_AND_MODAL},{label:"Modal",value:S.re.MODAL},{label:"Privacy center",value:S.re.PRIVACY_CENTER},{label:"Headless",value:S.re.HEADLESS}],y=[{label:"Opt In/Opt Out",value:b.O.OPT_IN_OPT_OUT},{label:"Acknowledge",value:b.O.ACKNOWLEDGE}],x="tcf_purposes_placeholder",A=e=>{let{buttonPanel:a,children:n}=e;return(0,i.jsxs)(t.kCb,{direction:"column",minH:"full",w:"25%",borderRight:"1px solid #DEE5EE",children:[(0,i.jsx)(t.kCb,{direction:"column",h:"full",overflowY:"auto",px:4,children:(0,i.jsx)(t.kCb,{direction:"column",gap:4,w:"full",pb:4,children:n})}),a]})},j=e=>{var a,n,b,j,k;let{allPrivacyNotices:N,translationsEnabled:T,onSelectTranslation:M,onCreateTranslation:I}=e,E=(0,r.useRouter)(),{values:U,setFieldValue:R,dirty:w,isValid:O,isSubmitting:B,initialValues:L}=(0,l.u6)(),P=(0,s.C)(g.Zp),q=(0,s.C)(g.G1);(0,g.J6)({page:P,size:q});let D=(0,o.useMemo)(()=>{let e=[...N];return e.some(e=>e.id===x)||e.push({name:"TCF Purposes",id:x,notice_key:x,data_uses:[],consent_mechanism:S.J7.NOTICE_ONLY,disabled:!1}),e},[N]),G=e=>{var a;let n=D.find(a=>a.id===e);return null!==(a=null==n?void 0:n.name)&&void 0!==a?a:e};(0,p.QM)();let K=(0,s.C)(p.P8),V=[...(0,m.TK)(K.locations),...(0,m.TK)(K.location_groups)],Z=(0,s.C)(v.fJ),Y=(0,s.C)(h.Zp),W=(0,s.C)(h.G1);(0,h.gz)({page:Y,size:W});let z=(0,s.C)(h.YO),H=(0,i.jsxs)("div",{className:"flex justify-between border-t border-[#DEE5EE] p-4",children:[(0,i.jsx)(t.wpx,{onClick:()=>E.push(c.w0),children:"Cancel"}),(0,i.jsx)(t.wpx,{htmlType:"submit",type:"primary","data-testid":"save-btn",disabled:B||!w||!O,loading:B,children:"Save"})]});return(0,i.jsxs)(A,{buttonPanel:H,children:[(0,i.jsx)(_.Z,{backPath:c.w0,mt:4}),(0,i.jsx)(t.X6q,{fontSize:"md",fontWeight:"semibold",children:"Configure experience"}),(0,i.jsx)(d.j0,{name:"name",id:"name",label:"Name (internal admin use only)",isRequired:!0,variant:"stacked"}),U.component!==S.re.TCF_OVERLAY&&(0,i.jsx)(C.d,{name:"component",id:"component",options:f,label:"Experience type",layout:"stacked",disabled:!!L.component,isRequired:!0}),(0,i.jsx)(t.UO1,{in:U.component!==S.re.PRIVACY_CENTER&&U.component!==S.re.HEADLESS,animateOpacity:!0,children:(0,i.jsx)(t.xuv,{p:"1px",children:(0,i.jsx)(d.w8,{name:"dismissable",id:"dismissable",label:"Allow user to dismiss",variant:"stacked"})})}),(0,i.jsx)(t.UO1,{in:U.component===S.re.BANNER_AND_MODAL,animateOpacity:!0,children:(0,i.jsx)(C.d,{name:"layer1_button_options",id:"layer1_button_options",options:y,label:"Banner options",layout:"stacked",disabled:U.component!==S.re.BANNER_AND_MODAL})}),(0,i.jsx)(F.Z,{label:"Associated properties",addButtonLabel:"Add property",idField:"id",nameField:"name",allItems:z.map(e=>({id:e.id,name:e.name})),values:null!==(n=U.properties)&&void 0!==n?n:[],setValues:e=>R("properties",e),draggable:!0,maxHeight:100,baseTestId:"property"}),(0,i.jsx)(t.izJ,{}),(0,i.jsx)(t.X6q,{fontSize:"md",fontWeight:"semibold",children:"Privacy notices"}),U.component===S.re.TCF_OVERLAY?(0,i.jsx)(F.Z,{addButtonLabel:"Add privacy notice",allItems:D.map(e=>e.id),values:function(e){if(!e.privacy_notice_ids)return[x];let a=e.privacy_notice_ids;return a.includes(x)||a.push(x),a}(U),setValues:e=>R("privacy_notice_ids",e),canDeleteItem:e=>e!==x,getTooltip:e=>{if(e===x)return"TCF Purposes are required by the framework and cannot be deleted."},getItemLabel:G,draggable:!0,baseTestId:"privacy-notice"}):(0,i.jsx)(F.Z,{addButtonLabel:"Add privacy notice",allItems:(e=>{var a;let n=e.map(e=>{var a;return null===(a=e.children)||void 0===a?void 0:a.map(e=>e.id)}).flat();return null!==(a=N.filter(e=>!n.includes(e.id)))&&void 0!==a?a:[]})(N).map(e=>e.id),values:null!==(b=U.privacy_notice_ids)&&void 0!==b?b:[],setValues:e=>R("privacy_notice_ids",e),getItemLabel:G,draggable:!0,baseTestId:"privacy-notice"}),U.component===S.re.BANNER_AND_MODAL?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.UO1,{in:!!(null===(a=U.privacy_notice_ids)||void 0===a?void 0:a.length),animateOpacity:!0,children:(0,i.jsx)(t.xuv,{p:"1px",children:(0,i.jsx)(d.w8,{name:"show_layer1_notices",id:"show_layer1_notices",label:"Add privacy notices to banner",variant:"stacked"})})}),(0,i.jsx)(t.izJ,{})]}):null,(0,i.jsx)(t.xvT,{as:"h2",fontWeight:"600",children:"Locations & Languages"}),(0,i.jsx)(F.Z,{label:"Locations for this experience",addButtonLabel:"Add location",allItems:V,values:null!==(j=U.regions)&&void 0!==j?j:[],setValues:e=>R("regions",e),getItemLabel:e=>u.Z8[e],draggable:!0,baseTestId:"location"}),T?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(F.Z,{label:"Languages for this experience",addButtonLabel:"Add language",values:null!==(k=U.translations)&&void 0!==k?k:[],setValues:e=>R("translations",e),idField:"language",canDeleteItem:e=>!e.is_default,allItems:Z.slice().sort((e,a)=>e.name.localeCompare(a.name)).map(e=>({language:e.id,is_default:!1})),getItemLabel:e=>{let a=Z.find(a=>a.id===e.language),n=a?a.name:e.language;return"".concat(n).concat(e.is_default?" (Default)":"")},createNewValue:e=>I(e.value),onRowClick:M,selectOnAdd:!0,draggable:!0,baseTestId:"language"}),(0,i.jsx)(d.w8,{name:"auto_detect_language",id:"auto_detect_language",label:"Auto detect language",variant:"stacked"})]}):(0,i.jsx)(t.wpx,{icon:(0,i.jsx)(t.mrv,{}),iconPosition:"end",onClick:()=>M(U.translations[0]),"data-testid":"edit-experience-btn",children:"Edit experience text"}),(0,i.jsx)(d.w8,{name:"auto_subdomain_cookie_deletion",id:"auto_subdomain_cookie_deletion",label:"Automatically delete subdomain cookies",variant:"stacked",tooltip:"If enabled, automatically deletes cookies set on subdomains in addition to main domain where appropriate. Recommended to enable for full consent compliance."})]})}},16277:function(e,a,n){n.d(a,{f:function(){return m}});var i=n(24246),t=n(77181),l=n(34090),r=n(56141),o=n.n(r),s=n(27378),d=n(40324),_=n(87361),c=n(57899),u=n(90980),F=n(60325),p=n(16194),b=n(21702);let m=e=>{let{languageName:a}=e;return(0,i.jsx)(_.Z,{text:"This is a default translation provided by Fides. If you've modified the default English language text, these translations will not match, so verify any changes with a native ".concat(a," speaker before using."),"data-testid":"oob-translation-notice"})};a.Z=e=>{var a,n,r,_,v,g,h;let S,{translation:C,translationsEnabled:f,isOOB:y,onReturnToMainForm:x}=e,{values:A,setFieldValue:j,errors:k,touched:N,setTouched:T}=(0,l.u6)(),M=(0,s.useMemo)(()=>{let{name:e,...a}=C;return a},[C]),I=!!M.title&&!y,E=(0,F.y3)(A.component),U=A.translations.findIndex(e=>e.language===C.language),R=!o()(A.translations[U],M),{onOpen:w,isOpen:O,onClose:B}=(0,t.qY0)(),{onOpen:L,isOpen:P,onClose:q}=(0,t.qY0)(),D=()=>{R||y?w():x()},G=e=>{let a=A.translations.map((a,n)=>({...a,is_default:n===e}));a.unshift(a.splice(e,1)[0]),j("translations",a),x()},K=(0,i.jsxs)("div",{className:"flex justify-between border-t border-[#DEE5EE] p-4",children:[(0,i.jsx)(t.wpx,{onClick:D,"data-testid":"cancel-btn",children:"Cancel"}),(0,i.jsx)(t.wpx,{onClick:()=>{A.translations[U].is_default&&!M.is_default?L():x()},type:"primary","data-testid":"save-btn",disabled:!R&&!y||!!k.translations,children:I?"Save":"Add translation"})]});return S=f?I?"You have unsaved changes to this translation. Discard changes?":"This translation has not been added to your experience. Discard translation?":"You have unsaved changes to this experience text. Discard changes?",(0,i.jsxs)(p.RN,{buttonPanel:K,children:[(0,i.jsx)(u.R,{onClick:D,mt:4}),(0,i.jsx)(c.Z,{isOpen:O,onClose:B,title:f?"Translation not saved":"Text not saved",message:(0,i.jsx)(t.xvT,{children:S}),confirmButtonText:"Discard",handleConfirm:()=>{let e=A.translations.slice();I?e[U]={...M,title:M.title,description:M.description}:e.splice(U,1),j("translations",e);let{translations:a,...n}=N;T({...n}),x()}}),(0,i.jsx)(t.X6q,{fontSize:"md",fontWeight:"semibold",children:f?"Edit ".concat(C.name," translation"):"Edit experience text"}),y?(0,i.jsx)(m,{languageName:C.name}):null,f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.w8,{name:"translations.".concat(U,".is_default"),id:"translations.".concat(U,".is_default"),label:"Default language",isDisabled:!!M.is_default,variant:"stacked"}),(0,i.jsx)(c.Z,{isOpen:P,onClose:q,title:"Update default language",message:(0,i.jsx)(t.xvT,{children:"Are you sure you want to update the default language of this experience?"}),handleConfirm:()=>G(U)})]}),(0,i.jsx)(d.j0,{name:"translations.".concat(U,".title"),id:"translations.".concat(U,".title"),label:"Title",isRequired:!0,variant:"stacked"}),(0,i.jsx)(d.Ks,{name:"translations.".concat(U,".description"),id:"translations.".concat(U,".description"),label:"Description",isRequired:!0,variant:"stacked"}),(A.component===b.re.BANNER_AND_MODAL||A.component===b.re.TCF_OVERLAY)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.j0,{name:"translations.".concat(U,".banner_title"),id:"translations.".concat(U,".banner_title"),label:"Banner title (optional)",tooltip:"A separate title for the banner (defaults to main title)",variant:"stacked"}),(0,i.jsx)(d.Ks,{name:"translations.".concat(U,".banner_description"),id:"translations.".concat(U,".banner_description"),label:"Banner description (optional)",tooltip:"A separate description for the banner (defaults to main description)",variant:"stacked"})]}),A.component===b.re.TCF_OVERLAY&&(0,i.jsx)(d.j0,{name:"translations.".concat(U,".purpose_header"),id:"translations.".concat(U,".purpose_header"),label:"Purpose header (optional)",tooltip:"Appears above the Purpose list section of the TCF banner",variant:"stacked"}),(0,i.jsx)(d.j0,{name:"translations.".concat(U,".accept_button_label"),id:"translations.".concat(U,".accept_button_label"),label:'"Accept" button label',isRequired:!0,variant:"stacked"}),(0,i.jsx)(d.j0,{name:"translations.".concat(U,".reject_button_label"),id:"translations.".concat(U,".reject_button_label"),label:'"Reject" button label',isRequired:!0,variant:"stacked"}),(null===(a=E.privacy_preferences_link_label)||void 0===a?void 0:a.included)&&(0,i.jsx)(d.j0,{name:"translations.".concat(U,".privacy_preferences_link_label"),id:"translations.".concat(U,".privacy_preferences_link_label"),label:'"Manage privacy preferences" button label',variant:"stacked",isRequired:null===(n=E.privacy_preferences_link_label)||void 0===n?void 0:n.required}),(null===(r=E.save_button_label)||void 0===r?void 0:r.included)&&(0,i.jsx)(d.j0,{name:"translations.".concat(U,".save_button_label"),id:"translations.".concat(U,".save_button_label"),label:'"Save" button label',variant:"stacked",isRequired:E.save_button_label.required}),(null===(_=E.acknowledge_button_label)||void 0===_?void 0:_.included)&&(0,i.jsx)(d.j0,{name:"translations.".concat(U,".acknowledge_button_label"),id:"translations.".concat(U,".acknowledge_button_label"),label:'"Acknowledge" button label',variant:"stacked",isRequired:E.acknowledge_button_label.required}),(null===(v=E.privacy_policy_link_label)||void 0===v?void 0:v.included)&&(0,i.jsx)(d.j0,{name:"translations.".concat(U,".privacy_policy_link_label"),id:"translations.".concat(U,".privacy_policy_link_label"),label:"Privacy policy link label (optional)",variant:"stacked"}),(null===(g=E.privacy_policy_url)||void 0===g?void 0:g.included)&&(0,i.jsx)(d.j0,{name:"translations.".concat(U,".privacy_policy_url"),id:"translations.".concat(U,".privacy_policy_url"),label:"Privacy policy link URL (optional)",variant:"stacked"}),(null===(h=E.modal_link_label)||void 0===h?void 0:h.included)&&(0,i.jsx)(d.j0,{name:"translations.".concat(U,".modal_link_label"),id:"translations.".concat(U,".modal_link_label"),label:"Trigger link label (optional)",tooltip:"Include text here if you would like the Fides CMP to manage the copy of the button that is included on your site to open the CMP.",variant:"stacked"})]})}},48515:function(e,a,n){var i,t;n.d(a,{O:function(){return i}}),(t=i||(i={})).ACKNOWLEDGE="acknowledge",t.OPT_IN_OPT_OUT="opt_in_opt_out"},60325:function(e,a,n){n.d(a,{DD:function(){return s},Go:function(){return d},TK:function(){return l},Uv:function(){return c},k1:function(){return r},y3:function(){return u}});var i=n(21702),t=n(48515);let l=e=>{var a;return null!==(a=null==e?void 0:e.filter(e=>e.selected).map(e=>e.id))&&void 0!==a?a:[]},r=e=>{var a;return null!==(a=null==e?void 0:e.filter(e=>e.selected))&&void 0!==a?a:[]},o=[{language:i.eU.EN,is_default:!0,title:"Title",description:"Description",accept_button_label:"Accept",reject_button_label:"Reject",save_button_label:"Save",acknowledge_button_label:"OK",privacy_preferences_link_label:"Privacy Preferences"}],s={name:"",disabled:!1,dismissable:!0,allow_language_selection:!1,show_layer1_notices:!1,layer1_button_options:t.O.OPT_IN_OPT_OUT,regions:[],translations:o,auto_detect_language:!0,auto_subdomain_cookie_deletion:!0},d=(e,a)=>{let n=a.find(a=>a.id===e.language);return n?n.name:e.language},_=e=>{var a,n,i,t,l,r,o,s,d;let{language:_,is_default:c,accept_button_label:u,reject_button_label:F}=e;return{language:_,is_default:c,accept_button_label:u,reject_button_label:F,title:e.title,description:e.description,acknowledge_button_label:null!==(a=e.acknowledge_button_label)&&void 0!==a?a:void 0,banner_title:null!==(n=e.banner_title)&&void 0!==n?n:void 0,banner_description:null!==(i=e.banner_description)&&void 0!==i?i:void 0,purpose_header:null!==(t=e.purpose_header)&&void 0!==t?t:void 0,privacy_policy_link_label:null!==(l=e.privacy_policy_link_label)&&void 0!==l?l:void 0,privacy_policy_url:null!==(r=e.privacy_policy_url)&&void 0!==r?r:void 0,privacy_preferences_link_label:null!==(o=e.privacy_preferences_link_label)&&void 0!==o?o:void 0,save_button_label:null!==(s=e.save_button_label)&&void 0!==s?s:void 0,modal_link_label:null!==(d=e.modal_link_label)&&void 0!==d?d:void 0}},c=e=>{let{created_at:a,updated_at:n,privacy_notices:i,origin:t,id:l,...r}=e;return{...r,privacy_notice_ids:i?i.map(e=>e.id):[],translations:e.translations?e.translations.map(e=>_(e)):[]}},u=e=>e===i.re.PRIVACY_CENTER?{title:{included:!0,required:!0},description:{included:!0,required:!0},save_button_label:{included:!0,required:!0},accept_button_label:{included:!0,required:!0},reject_button_label:{included:!0,required:!0},privacy_policy_link_label:{included:!0},privacy_policy_url:{included:!0},modal_link_label:{included:!0}}:e===i.re.MODAL?{title:{included:!0,required:!0},description:{included:!0,required:!0},accept_button_label:{included:!0,required:!0},reject_button_label:{included:!0,required:!0},save_button_label:{included:!0,required:!0},acknowledge_button_label:{included:!0,required:!0},privacy_policy_link_label:{included:!0},privacy_policy_url:{included:!0},privacy_preferences_link_label:{included:!0},modal_link_label:{included:!0}}:e===i.re.BANNER_AND_MODAL?{title:{included:!0,required:!0},banner_title:{included:!0},description:{included:!0,required:!0},banner_description:{included:!0},accept_button_label:{included:!0,required:!0},reject_button_label:{included:!0,required:!0},save_button_label:{included:!0,required:!0},acknowledge_button_label:{included:!0,required:!0},privacy_policy_link_label:{included:!0},privacy_policy_url:{included:!0},privacy_preferences_link_label:{included:!0,required:!0},modal_link_label:{included:!0}}:e===i.re.TCF_OVERLAY?{title:{included:!0,required:!0},banner_title:{included:!0},description:{included:!0,required:!0},banner_description:{included:!0},purpose_header:{included:!0},accept_button_label:{included:!0,required:!0},reject_button_label:{included:!0,required:!0},save_button_label:{included:!0,required:!0},acknowledge_button_label:{included:!0,required:!0},privacy_policy_link_label:{included:!0},privacy_policy_url:{included:!0},privacy_preferences_link_label:{included:!0,required:!0},modal_link_label:{included:!0}}:{title:{included:!0,required:!0},description:{included:!0,required:!0},accept_button_label:{included:!0,required:!0},reject_button_label:{included:!0,required:!0},save_button_label:{included:!0,required:!0},acknowledge_button_label:{included:!0,required:!0},privacy_policy_link_label:{included:!0},privacy_policy_url:{included:!0},privacy_preferences_link_label:{included:!0,required:!0},modal_link_label:{included:!0}}}}]);