udp-react-enterprise-component-library 25.18.1-beta.64 → 25.18.1-beta.65

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 (53) hide show
  1. package/dist/AgTable-B2xTzAm2.js.map +1 -1
  2. package/dist/AmChart-CTixft8X.js.map +1 -1
  3. package/dist/AuthProvider-J79EBNDc.js.map +1 -1
  4. package/dist/DashboardWidget-CsOrr74H.js.map +1 -1
  5. package/dist/Field-Cda5rJe2.js.map +1 -1
  6. package/dist/Form-DbOA5j38.js.map +1 -1
  7. package/dist/FormButtons-BTCO-pzW.js.map +1 -1
  8. package/dist/LayoutUnit-D4jJvonh.js.map +1 -1
  9. package/dist/MenuProvider-BqEZve2y.js.map +1 -1
  10. package/dist/NumberOperator-p4HsHHx3.js.map +1 -1
  11. package/dist/PAHAdditionalRightComponent-DMOU9Mho.js.map +1 -1
  12. package/dist/PDFViewer-B4nJKbIy.js.map +1 -1
  13. package/dist/PageContext-BpOBJHpb.js.map +1 -1
  14. package/dist/PaymentForm-DFJrSIy8.js.map +1 -1
  15. package/dist/PrimaryActionHeader-DBJpROPu.js.map +1 -1
  16. package/dist/SearchOperator-D9838PIe.js.map +1 -1
  17. package/dist/SearchUtilities-DUW0kaw_.js.map +1 -1
  18. package/dist/TenantProvider-BeFMHYP8.js.map +1 -1
  19. package/dist/UdpAppProvider-DXgzyeHZ.js.map +1 -1
  20. package/dist/UdpBarChart-D2bfgm7n.js.map +1 -1
  21. package/dist/UdpMapToolbar-B410Zi_h.js.map +1 -1
  22. package/dist/{UdpTransactionsPage-CDyNjmyo.js → UdpTransactionsPage-B1Ia9x62.js} +12 -10
  23. package/dist/UdpTransactionsPage-B1Ia9x62.js.map +1 -0
  24. package/dist/UnityIconLibrary-CjIwzfjv.js.map +1 -1
  25. package/dist/actionSummary-D0CwyTXJ.js.map +1 -1
  26. package/dist/advancedSearchBuilder-7ixhIwLW.js.map +1 -1
  27. package/dist/aggridHelpers-BvrSzjdD.js.map +1 -1
  28. package/dist/apiHelpers-WIR8pqy0.js.map +1 -1
  29. package/dist/auth-BWJ4-JF-.js.map +1 -1
  30. package/dist/catalogStore-DP2GxpTJ.js.map +1 -1
  31. package/dist/charts-pX01x8rO.js.map +1 -1
  32. package/dist/form-Dj1zVw6K.js.map +1 -1
  33. package/dist/hooks-BNndjGer.js.map +1 -1
  34. package/dist/index.js +1 -1
  35. package/dist/lookupsStore-DPI8oD9R.js.map +1 -1
  36. package/dist/maps-BgmvNpkU.js.map +1 -1
  37. package/dist/newGrid-zmtQXU5G.js.map +1 -1
  38. package/dist/profile-7BieC5qc.js.map +1 -1
  39. package/dist/shellStore-C8zfPsZ-.js.map +1 -1
  40. package/dist/stepper-BaIo_Rol.js.map +1 -1
  41. package/dist/teleporterStore-CjUFtATo.js.map +1 -1
  42. package/dist/tenantStore-CFYu7ndZ.js.map +1 -1
  43. package/dist/types/src/udp/pages/UdpTransactionsPage/sidesheets/AttachmentTransaction.d.ts.map +1 -1
  44. package/dist/types/tsconfig.tsbuildinfo +1 -1
  45. package/dist/udp/pages/UdpPages/index.js +1 -1
  46. package/dist/udp/pages/UdpTransactionsPage/index.js +1 -1
  47. package/dist/useAuthedUser-Bhr7Yhlg.js.map +1 -1
  48. package/dist/useQueryExecutors-DuuHrj2M.js.map +1 -1
  49. package/dist/useUser-wpHGo6jU.js.map +1 -1
  50. package/dist/workflowStore-CCoN5uHd.js.map +1 -1
  51. package/export-map.json +1 -1
  52. package/package.json +1 -1
  53. package/dist/UdpTransactionsPage-CDyNjmyo.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"apiHelpers-WIR8pqy0.js","names":["useLoginAction: LoginFunction","loginRedirect: () => void"],"sources":["../src/utilities/auth/signInAuthProvider.js","../src/utilities/auth/whitelistedPaths.js","../src/utilities/auth/authActions.ts","../src/utilities/apiHelpers.jsx"],"sourcesContent":["import { PublicClientApplication, EventType } from '@azure/msal-browser';\nimport { ConfigService } from '../../configService';\n\nlet signInAuthProviderInstance = null;\nlet loginRequestInstance = null;\nlet tokenRequestInstance = null;\nlet apiAccessScopeValue = null;\n\nexport async function initSignInAuthProvider() {\n if (signInAuthProviderInstance) {\n return; // Already initialized\n }\n\n const PUBLIC_URL = new URL(\n import.meta.env.BASE_URL || '/',\n window.location.origin\n ).href.replace(/\\/$/, '');\n\n const REDIRECT_URL_BASE = ConfigService.config.USE_AAD_REDIRECT\n ? ConfigService.config.UNITY_URL\n : PUBLIC_URL;\n\n if (!ConfigService.config.MSAL_TENANT)\n throw new Error('MSAL_TENANT not configured');\n if (!ConfigService.config.MSAL_CLIENT_ID)\n throw new Error('MSAL_CLIENT_ID not configured');\n\n const tenant = ConfigService.config.MSAL_TENANT;\n\n // Determine idp_target and id_token_hint for Unified Policy\n const currentPath = window.location.pathname;\n const searchParams = new URLSearchParams(window.location.search);\n\n let domainHint = searchParams.get('domain_hint');\n\n if (currentPath === '/sso/entra') {\n domainHint = 'entra';\n }\n\n if (currentPath === '/sso/entra') {\n domainHint = 'entra';\n window.history.replaceState(null, '', '/');\n }\n\n const idTokenHint = searchParams.get('id_token_hint');\n\n const signInPolicy = ConfigService.config.SIGN_IN_POLICY;\n\n const applicationID = ConfigService.config.MSAL_CLIENT_ID;\n const reactRedirectUri = `${REDIRECT_URL_BASE}/${ConfigService.config.USE_AAD_REDIRECT ? 'aad_redirect' : 'aad_callback'\n }`;\n const tenantSubdomain = tenant.split('.')[0];\n const instance = `https://${tenantSubdomain}.b2clogin.com/`;\n const signInAuthority = `${instance}${tenant}/${signInPolicy}`;\n apiAccessScopeValue = `https://${tenant}/${ConfigService.config.MSAL_API_ACCESS_SCOPE}`;\n\n const ua = window.navigator.userAgent;\n const msie = ua.indexOf('MSIE ');\n const msie11 = ua.indexOf('Trident/');\n const msedge = ua.indexOf('Edge/');\n const firefox = ua.indexOf('Firefox');\n const isIE = msie > 0 || msie11 > 0;\n const isEdge = msedge > 0;\n const isFirefox = firefox > 0; // Only needed if you need to support the redirect flow in Firefox incognito\n\n // Msal Configurations\n const signInConfig = {\n auth: {\n authority: signInAuthority,\n knownAuthorities: [`${tenantSubdomain}.b2clogin.com`],\n clientId: applicationID,\n redirectUri: reactRedirectUri,\n postLogoutRedirectUri: PUBLIC_URL + '/',\n navigateToLoginRequestUrl: false,\n },\n cache: {\n cacheLocation: 'sessionStorage',\n storeAuthStateInCookie: isIE || isEdge || isFirefox,\n },\n system: {\n allowRedirectInIframe: true,\n },\n };\n\n signInAuthProviderInstance = new PublicClientApplication(signInConfig);\n\n await signInAuthProviderInstance.initialize();\n\n if (\n !signInAuthProviderInstance.getActiveAccount() &&\n signInAuthProviderInstance.getAllAccounts().length > 0\n ) {\n signInAuthProviderInstance.setActiveAccount(\n signInAuthProviderInstance.getAllAccounts()[0]\n );\n }\n\n // Check if the active account is an Entra account to set the hint\n const activeAccount = signInAuthProviderInstance.getActiveAccount();\n if (activeAccount && !domainHint) {\n const idp = activeAccount.idTokenClaims?.idp;\n if (idp && idp.includes('login.microsoftonline.com')) {\n domainHint = 'entra';\n }\n }\n\n signInAuthProviderInstance.addEventCallback((event) => {\n if (event.eventType === EventType.LOGIN_SUCCESS && event.payload.account) {\n const account = event.payload.account;\n signInAuthProviderInstance.setActiveAccount(account);\n }\n });\n\n tokenRequestInstance = { scopes: [apiAccessScopeValue] };\n\n loginRequestInstance = {\n scopes: [apiAccessScopeValue, 'openid', 'offline_access'],\n state: `${PUBLIC_URL}/aad_callback`,\n extraQueryParameters: {\n ...(idTokenHint && { id_token_hint: idTokenHint, flow: 'redeem' }),\n ...(domainHint && !idTokenHint && { domain_hint: 'entra' }),\n },\n };\n}\n\nexport const getSignInAuthProvider = () => {\n if (!signInAuthProviderInstance) {\n throw new Error(\n 'signInAuthProvider is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return signInAuthProviderInstance;\n};\n\nexport const getLoginRequest = () => {\n if (!loginRequestInstance) {\n throw new Error(\n 'loginRequest is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return loginRequestInstance;\n};\n\nexport const getTokenRequest = () => {\n if (!tokenRequestInstance) {\n throw new Error(\n 'tokenRequest is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return tokenRequestInstance;\n};\n\nexport const getApiAccessScope = () => {\n if (!apiAccessScopeValue) {\n throw new Error(\n 'apiAccessScope is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return apiAccessScopeValue;\n};\n","import { UdpPageEnums } from \"../../enums/pageEnums\";\n\nexport const whitelistedPaths = [\n '/verify', \n `/page/${UdpPageEnums.Udp_Public_Forms_Page}`, // Public forms page\n '/aad_redirect',\n '/passwordresetsuccess'\n];\n","import {\n getSignInAuthProvider,\n getTokenRequest,\n getLoginRequest,\n} from './signInAuthProvider';\nimport { BrowserUtils } from '@azure/msal-browser';\nimport { storeCurrentPath } from '../redirect/LocalRedirectUrlStorage';\nimport { whitelistedPaths } from './whitelistedPaths';\nexport type LoginFunction = () => void;\nexport type LogoutFunction = () => void;\n/**\n * Hook providing auth \"actions\" such as login/logout\n */\n\nexport const useLoginAction: LoginFunction = () => loginRedirect;\nexport const loginRedirect: () => void = () => {\n const signInAuthProvider = getSignInAuthProvider();\n signInAuthProvider.loginRedirect(getLoginRequest());\n};\n\nexport function useLogoutAction(): LogoutFunction {\n return async () => {\n const signInAuthProvider = getSignInAuthProvider();\n await signInAuthProvider.logoutRedirect({\n account: signInAuthProvider.getActiveAccount(),\n });\n };\n}\n\nexport async function acquireAccessToken(): Promise<string | void> {\n const signInAuthProvider = getSignInAuthProvider();\n const account = signInAuthProvider.getActiveAccount() ?? undefined;\n\n if (account) {\n return signInAuthProvider\n .acquireTokenSilent({ ...getTokenRequest(), account })\n .then((response) => {\n return response.accessToken;\n })\n .catch(async (error) => {\n const currentPathIsWhitelisted = whitelistedPaths.includes(\n window.location.pathname\n );\n if (!currentPathIsWhitelisted) {\n signInAuthProvider.loginRedirect(getLoginRequest());\n }\n });\n }\n}\n","import React from \"react\";\nimport { acquireAccessToken } from './auth/authActions';\nimport { InteractionRequiredAuthError } from '@azure/msal-browser';\nimport { getStoredTenant } from './storage/UnitySessionStorage';\nimport { useSnackbar } from 'notistack';\nimport { Button } from '@material-ui/core';\nimport { useCallback } from 'react';\nimport { useHistory } from 'react-router-dom';\n\nexport const getMergedConfig = (accessToken, config) => {\n const headers = config?.headers ?? {};\n\n headers.currentTenantId ||= getStoredTenant();\n if (accessToken) headers.Authorization ||= `Bearer ${accessToken}`;\n\n config.headers = headers;\n return config;\n};\n\nexport const handleResponseErrors = async (error) => {\n if (error?.response?.status === 401) {\n await acquireAccessToken();\n }\n};\n\nexport const getAccessToken = async () => {\n return await acquireAccessToken();\n};\n\n/**\n * Checks to make sure the error isn't cancelled, if so just return w/o doing anything\n *Otherwise call a pre-method, create a snackbar, then call a post-method\n *preCallBack returns a bool, true = show snackbar\n */\nexport const useHandleAxiosSnackbar = () => {\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n const history = useHistory();\n\n const dismissSnackbar = useCallback(\n (key, callback) => {\n closeSnackbar(key);\n callback?.();\n },\n [closeSnackbar]\n );\n\n const handleErrorSnackbar = useCallback(\n (error, customMessage, preCallBack, callback) => {\n const fallbackErrorMessage = 'Error executing request';\n if (\n error?.toString()?.toLowerCase() === 'cancel' ||\n error?.code === 'ERR_CANCELED'\n )\n return;\n\n // Don't call the preCallback unless we actually failed.\n const showSnackBar = preCallBack?.();\n if (preCallBack && !showSnackBar) return;\n\n let errorMessage =\n customMessage ??\n (error?.response?.data || error?.message || fallbackErrorMessage);\n if (\n typeof errorMessage !== 'string' ||\n !errorMessage ||\n errorMessage.length === 0\n ) {\n errorMessage = fallbackErrorMessage;\n }\n\n enqueueSnackbar(errorMessage, {\n variant: 'error',\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'center'\n },\n action: (key) => (\n <Button\n color='secondary'\n size='small'\n onClick={() => {\n dismissSnackbar(key);\n }}\n >\n Ok\n </Button>\n )\n });\n\n callback?.();\n },\n [dismissSnackbar, enqueueSnackbar]\n );\n\n const handleSuccessSnackbar = useCallback(\n (message, preCallBack, callback, navigationPath, buttonText) => {\n const fallbackSuccessMessage = 'Executed request successfully';\n const showMessage = preCallBack?.();\n if (preCallBack && !showMessage) return;\n\n let successMessage = message ?? fallbackSuccessMessage;\n if (\n typeof successMessage !== 'string' ||\n !successMessage ||\n successMessage.length === 0\n ) {\n successMessage = fallbackSuccessMessage;\n }\n\n const options = {\n variant: 'default',\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'center'\n },\n action: (key) => (\n <>\n {navigationPath && (\n <Button\n color='secondary'\n size='small'\n onClick={() => {\n history.push(navigationPath);\n dismissSnackbar(key);\n }}\n >\n {buttonText? buttonText : 'Go to page'}\n </Button>\n )}\n <Button\n color='secondary'\n size='small'\n onClick={() => {\n dismissSnackbar(key);\n }}\n >\n Ok\n </Button>\n </>\n )\n };\n\n enqueueSnackbar(successMessage, options);\n },\n [dismissSnackbar, enqueueSnackbar]\n );\n\n return { handleErrorSnackbar, handleSuccessSnackbar };\n};\n"],"mappings":";;;;;;;;;;AAGA,IAAI,6BAA6B;AACjC,IAAI,uBAAuB;AAC3B,IAAI,uBAAuB;AAC3B,IAAI,sBAAsB;AAE1B,eAAsB,yBAAyB;AAC7C,KAAI,2BACF;CAGF,MAAM,aAAa,IAAI,IACrB,OAAO,KAAK,IAAI,YAAY,KAC5B,OAAO,SAAS,OACjB,CAAC,KAAK,QAAQ,OAAO,GAAG;CAEzB,MAAM,oBAAoB,cAAc,OAAO,mBAC3C,cAAc,OAAO,YACrB;AAEJ,KAAI,CAAC,cAAc,OAAO,YACxB,OAAM,IAAI,MAAM,6BAA6B;AAC/C,KAAI,CAAC,cAAc,OAAO,eACxB,OAAM,IAAI,MAAM,gCAAgC;CAElD,MAAM,SAAS,cAAc,OAAO;CAGpC,MAAM,cAAc,OAAO,SAAS;CACpC,MAAM,eAAe,IAAI,gBAAgB,OAAO,SAAS,OAAO;CAEhE,IAAI,aAAa,aAAa,IAAI,cAAc;AAEhD,KAAI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AC3B,SAAS,aAAa,UAAU,gBAAgB,eAAe;GAC9D,MAAM,yBAAyB;GAC/B,MAAM,cAAc,eAAe;AACnC,OAAI,eAAe,CAAC,YAAa;GAEjC,IAAI,iBAAiB,WAAW;AAChC,OACE,OAAO,mBAAmB,YAC1B,CAAC,kBACD,eAAe,WAAW,EAE1B,kBAAiB;AAoCnB,mBAAgB,gBAjCA;IACd,SAAS;IACT,cAAc;KACZ,UAAU;KACV,YAAY;KACb;IACD,SAAS,QACP,0DACG,kBACC,oCAAC;KACC,OAAM;KACN,MAAK;KACL,eAAe;AACb,cAAQ,KAAK,eAAe;AAC5B,sBAAgB,IAAI;;OAGrB,aAAY,aAAa,aACnB,EAEX,oCAAC;KACC,OAAM;KACN,MAAK;KACL,eAAe;AACb,sBAAgB,IAAI;;OAEvB,KAEQ,CACR;IAEN,CAEuC;KAE1C,CAAC,iBAAiB,gBAAgB,CACnC;EAEoD"}
1
+ {"version":3,"file":"apiHelpers-WIR8pqy0.js","names":[],"sources":["../src/utilities/auth/signInAuthProvider.js","../src/utilities/auth/whitelistedPaths.js","../src/utilities/auth/authActions.ts","../src/utilities/apiHelpers.jsx"],"sourcesContent":["import { PublicClientApplication, EventType } from '@azure/msal-browser';\nimport { ConfigService } from '../../configService';\n\nlet signInAuthProviderInstance = null;\nlet loginRequestInstance = null;\nlet tokenRequestInstance = null;\nlet apiAccessScopeValue = null;\n\nexport async function initSignInAuthProvider() {\n if (signInAuthProviderInstance) {\n return; // Already initialized\n }\n\n const PUBLIC_URL = new URL(\n import.meta.env.BASE_URL || '/',\n window.location.origin\n ).href.replace(/\\/$/, '');\n\n const REDIRECT_URL_BASE = ConfigService.config.USE_AAD_REDIRECT\n ? ConfigService.config.UNITY_URL\n : PUBLIC_URL;\n\n if (!ConfigService.config.MSAL_TENANT)\n throw new Error('MSAL_TENANT not configured');\n if (!ConfigService.config.MSAL_CLIENT_ID)\n throw new Error('MSAL_CLIENT_ID not configured');\n\n const tenant = ConfigService.config.MSAL_TENANT;\n\n // Determine idp_target and id_token_hint for Unified Policy\n const currentPath = window.location.pathname;\n const searchParams = new URLSearchParams(window.location.search);\n\n let domainHint = searchParams.get('domain_hint');\n\n if (currentPath === '/sso/entra') {\n domainHint = 'entra';\n }\n\n if (currentPath === '/sso/entra') {\n domainHint = 'entra';\n window.history.replaceState(null, '', '/');\n }\n\n const idTokenHint = searchParams.get('id_token_hint');\n\n const signInPolicy = ConfigService.config.SIGN_IN_POLICY;\n\n const applicationID = ConfigService.config.MSAL_CLIENT_ID;\n const reactRedirectUri = `${REDIRECT_URL_BASE}/${ConfigService.config.USE_AAD_REDIRECT ? 'aad_redirect' : 'aad_callback'\n }`;\n const tenantSubdomain = tenant.split('.')[0];\n const instance = `https://${tenantSubdomain}.b2clogin.com/`;\n const signInAuthority = `${instance}${tenant}/${signInPolicy}`;\n apiAccessScopeValue = `https://${tenant}/${ConfigService.config.MSAL_API_ACCESS_SCOPE}`;\n\n const ua = window.navigator.userAgent;\n const msie = ua.indexOf('MSIE ');\n const msie11 = ua.indexOf('Trident/');\n const msedge = ua.indexOf('Edge/');\n const firefox = ua.indexOf('Firefox');\n const isIE = msie > 0 || msie11 > 0;\n const isEdge = msedge > 0;\n const isFirefox = firefox > 0; // Only needed if you need to support the redirect flow in Firefox incognito\n\n // Msal Configurations\n const signInConfig = {\n auth: {\n authority: signInAuthority,\n knownAuthorities: [`${tenantSubdomain}.b2clogin.com`],\n clientId: applicationID,\n redirectUri: reactRedirectUri,\n postLogoutRedirectUri: PUBLIC_URL + '/',\n navigateToLoginRequestUrl: false,\n },\n cache: {\n cacheLocation: 'sessionStorage',\n storeAuthStateInCookie: isIE || isEdge || isFirefox,\n },\n system: {\n allowRedirectInIframe: true,\n },\n };\n\n signInAuthProviderInstance = new PublicClientApplication(signInConfig);\n\n await signInAuthProviderInstance.initialize();\n\n if (\n !signInAuthProviderInstance.getActiveAccount() &&\n signInAuthProviderInstance.getAllAccounts().length > 0\n ) {\n signInAuthProviderInstance.setActiveAccount(\n signInAuthProviderInstance.getAllAccounts()[0]\n );\n }\n\n // Check if the active account is an Entra account to set the hint\n const activeAccount = signInAuthProviderInstance.getActiveAccount();\n if (activeAccount && !domainHint) {\n const idp = activeAccount.idTokenClaims?.idp;\n if (idp && idp.includes('login.microsoftonline.com')) {\n domainHint = 'entra';\n }\n }\n\n signInAuthProviderInstance.addEventCallback((event) => {\n if (event.eventType === EventType.LOGIN_SUCCESS && event.payload.account) {\n const account = event.payload.account;\n signInAuthProviderInstance.setActiveAccount(account);\n }\n });\n\n tokenRequestInstance = { scopes: [apiAccessScopeValue] };\n\n loginRequestInstance = {\n scopes: [apiAccessScopeValue, 'openid', 'offline_access'],\n state: `${PUBLIC_URL}/aad_callback`,\n extraQueryParameters: {\n ...(idTokenHint && { id_token_hint: idTokenHint, flow: 'redeem' }),\n ...(domainHint && !idTokenHint && { domain_hint: 'entra' }),\n },\n };\n}\n\nexport const getSignInAuthProvider = () => {\n if (!signInAuthProviderInstance) {\n throw new Error(\n 'signInAuthProvider is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return signInAuthProviderInstance;\n};\n\nexport const getLoginRequest = () => {\n if (!loginRequestInstance) {\n throw new Error(\n 'loginRequest is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return loginRequestInstance;\n};\n\nexport const getTokenRequest = () => {\n if (!tokenRequestInstance) {\n throw new Error(\n 'tokenRequest is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return tokenRequestInstance;\n};\n\nexport const getApiAccessScope = () => {\n if (!apiAccessScopeValue) {\n throw new Error(\n 'apiAccessScope is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return apiAccessScopeValue;\n};\n","import { UdpPageEnums } from \"../../enums/pageEnums\";\n\nexport const whitelistedPaths = [\n '/verify', \n `/page/${UdpPageEnums.Udp_Public_Forms_Page}`, // Public forms page\n '/aad_redirect',\n '/passwordresetsuccess'\n];\n","import {\n getSignInAuthProvider,\n getTokenRequest,\n getLoginRequest,\n} from './signInAuthProvider';\nimport { BrowserUtils } from '@azure/msal-browser';\nimport { storeCurrentPath } from '../redirect/LocalRedirectUrlStorage';\nimport { whitelistedPaths } from './whitelistedPaths';\nexport type LoginFunction = () => void;\nexport type LogoutFunction = () => void;\n/**\n * Hook providing auth \"actions\" such as login/logout\n */\n\nexport const useLoginAction: LoginFunction = () => loginRedirect;\nexport const loginRedirect: () => void = () => {\n const signInAuthProvider = getSignInAuthProvider();\n signInAuthProvider.loginRedirect(getLoginRequest());\n};\n\nexport function useLogoutAction(): LogoutFunction {\n return async () => {\n const signInAuthProvider = getSignInAuthProvider();\n await signInAuthProvider.logoutRedirect({\n account: signInAuthProvider.getActiveAccount(),\n });\n };\n}\n\nexport async function acquireAccessToken(): Promise<string | void> {\n const signInAuthProvider = getSignInAuthProvider();\n const account = signInAuthProvider.getActiveAccount() ?? undefined;\n\n if (account) {\n return signInAuthProvider\n .acquireTokenSilent({ ...getTokenRequest(), account })\n .then((response) => {\n return response.accessToken;\n })\n .catch(async (error) => {\n const currentPathIsWhitelisted = whitelistedPaths.includes(\n window.location.pathname\n );\n if (!currentPathIsWhitelisted) {\n signInAuthProvider.loginRedirect(getLoginRequest());\n }\n });\n }\n}\n","import React from \"react\";\nimport { acquireAccessToken } from './auth/authActions';\nimport { InteractionRequiredAuthError } from '@azure/msal-browser';\nimport { getStoredTenant } from './storage/UnitySessionStorage';\nimport { useSnackbar } from 'notistack';\nimport { Button } from '@material-ui/core';\nimport { useCallback } from 'react';\nimport { useHistory } from 'react-router-dom';\n\nexport const getMergedConfig = (accessToken, config) => {\n const headers = config?.headers ?? {};\n\n headers.currentTenantId ||= getStoredTenant();\n if (accessToken) headers.Authorization ||= `Bearer ${accessToken}`;\n\n config.headers = headers;\n return config;\n};\n\nexport const handleResponseErrors = async (error) => {\n if (error?.response?.status === 401) {\n await acquireAccessToken();\n }\n};\n\nexport const getAccessToken = async () => {\n return await acquireAccessToken();\n};\n\n/**\n * Checks to make sure the error isn't cancelled, if so just return w/o doing anything\n *Otherwise call a pre-method, create a snackbar, then call a post-method\n *preCallBack returns a bool, true = show snackbar\n */\nexport const useHandleAxiosSnackbar = () => {\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n const history = useHistory();\n\n const dismissSnackbar = useCallback(\n (key, callback) => {\n closeSnackbar(key);\n callback?.();\n },\n [closeSnackbar]\n );\n\n const handleErrorSnackbar = useCallback(\n (error, customMessage, preCallBack, callback) => {\n const fallbackErrorMessage = 'Error executing request';\n if (\n error?.toString()?.toLowerCase() === 'cancel' ||\n error?.code === 'ERR_CANCELED'\n )\n return;\n\n // Don't call the preCallback unless we actually failed.\n const showSnackBar = preCallBack?.();\n if (preCallBack && !showSnackBar) return;\n\n let errorMessage =\n customMessage ??\n (error?.response?.data || error?.message || fallbackErrorMessage);\n if (\n typeof errorMessage !== 'string' ||\n !errorMessage ||\n errorMessage.length === 0\n ) {\n errorMessage = fallbackErrorMessage;\n }\n\n enqueueSnackbar(errorMessage, {\n variant: 'error',\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'center'\n },\n action: (key) => (\n <Button\n color='secondary'\n size='small'\n onClick={() => {\n dismissSnackbar(key);\n }}\n >\n Ok\n </Button>\n )\n });\n\n callback?.();\n },\n [dismissSnackbar, enqueueSnackbar]\n );\n\n const handleSuccessSnackbar = useCallback(\n (message, preCallBack, callback, navigationPath, buttonText) => {\n const fallbackSuccessMessage = 'Executed request successfully';\n const showMessage = preCallBack?.();\n if (preCallBack && !showMessage) return;\n\n let successMessage = message ?? fallbackSuccessMessage;\n if (\n typeof successMessage !== 'string' ||\n !successMessage ||\n successMessage.length === 0\n ) {\n successMessage = fallbackSuccessMessage;\n }\n\n const options = {\n variant: 'default',\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'center'\n },\n action: (key) => (\n <>\n {navigationPath && (\n <Button\n color='secondary'\n size='small'\n onClick={() => {\n history.push(navigationPath);\n dismissSnackbar(key);\n }}\n >\n {buttonText? buttonText : 'Go to page'}\n </Button>\n )}\n <Button\n color='secondary'\n size='small'\n onClick={() => {\n dismissSnackbar(key);\n }}\n >\n Ok\n </Button>\n </>\n )\n };\n\n enqueueSnackbar(successMessage, options);\n },\n [dismissSnackbar, enqueueSnackbar]\n );\n\n return { handleErrorSnackbar, handleSuccessSnackbar };\n};\n"],"mappings":";;;;;;;;;;AAGA,IAAI,6BAA6B;AACjC,IAAI,uBAAuB;AAC3B,IAAI,uBAAuB;AAC3B,IAAI,sBAAsB;AAE1B,eAAsB,yBAAyB;AAC7C,KAAI,2BACF;CAGF,MAAM,aAAa,IAAI,IACrB,OAAO,KAAK,IAAI,YAAY,KAC5B,OAAO,SAAS,OACjB,CAAC,KAAK,QAAQ,OAAO,GAAG;CAEzB,MAAM,oBAAoB,cAAc,OAAO,mBAC3C,cAAc,OAAO,YACrB;AAEJ,KAAI,CAAC,cAAc,OAAO,YACxB,OAAM,IAAI,MAAM,6BAA6B;AAC/C,KAAI,CAAC,cAAc,OAAO,eACxB,OAAM,IAAI,MAAM,gCAAgC;CAElD,MAAM,SAAS,cAAc,OAAO;CAGpC,MAAM,cAAc,OAAO,SAAS;CACpC,MAAM,eAAe,IAAI,gBAAgB,OAAO,SAAS,OAAO;CAEhE,IAAI,aAAa,aAAa,IAAI,cAAc;AAEhD,KAAI,gBAAgB,aAClB,cAAa;AAGf,KAAI,gBAAgB,cAAc;AAChC,eAAa;AACb,SAAO,QAAQ,aAAa,MAAM,IAAI,IAAI;;CAG5C,MAAM,cAAc,aAAa,IAAI,gBAAgB;CAErD,MAAM,eAAe,cAAc,OAAO;CAE1C,MAAM,gBAAgB,cAAc,OAAO;CAC3C,MAAM,mBAAmB,GAAG,kBAAkB,GAAG,cAAc,OAAO,mBAAmB,iBAAiB;CAE1G,MAAM,kBAAkB,OAAO,MAAM,IAAI,CAAC;CAE1C,MAAM,kBAAkB,GADP,WAAW,gBAAgB,kBACN,OAAO,GAAG;AAChD,uBAAsB,WAAW,OAAO,GAAG,cAAc,OAAO;CAEhE,MAAM,KAAK,OA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M;KACN,MAAK;KACL,eAAe;AACb,sBAAgB,IAAI;;OAEvB,KAEQ,CACR;IAEN,CAEuC;KAE1C,CAAC,iBAAiB,gBAAgB,CACnC;EAEoD"}
@@ -1 +1 @@
1
- {"version":3,"file":"auth-BWJ4-JF-.js","names":["useSingleLogout: () => () => void"],"sources":["../src/utilities/auth/AuthProviderWrapper.jsx","../src/utilities/auth/useSingleLogout.ts","../src/utilities/auth/useAccessToken.js"],"sourcesContent":["import React from 'react';\n// import { LocalAuthProvider } from './LocalAuthProvider';\nimport { AuthProvider } from './AuthProvider';\n\nexport const AuthProviderWrapper = props => {\n const { children } = props;\n\n return <AuthProvider {...props}> {children}</AuthProvider>\n\n};\n","import 'react';\nimport { clearStoredPath } from '../redirect/LocalRedirectUrlStorage';\nimport { clearStoredExternalPath } from '../redirect/ExternalRedirectUrlStorage';\nimport {clearStoredTenant} from '../storage/UnitySessionStorage'\nimport {useLogoutAction} from './authActions';\n\nexport const useSingleLogout: () => () => void = () => {\n const logout = useLogoutAction();\n return () => {\n clearStoredPath();\n clearStoredExternalPath();\n clearStoredTenant();\n logout()\n }\n\n};\n","import { useState } from 'react';\nimport { acquireAccessToken } from './authActions';\n\nexport const useAccessToken = () => {\n const [accessToken, setAccessToken] = useState(null);\n\n acquireAccessToken().then((token) => {\n if (accessToken !== token) {\n setAccessToken(token);\n }\n });\n\n return accessToken;\n};\n"],"mappings":";;;;;;;;AAIA,MAAa,uBAAsB,UAAS;CAC1C,MAAM,EAAE,aAAa;AAErB,QAAO,oCAAC,cAAiB,OAAO,KAAE,SAAwB;;;;;ACD5D,MAAaA,wBAA0C;CACrD,MAAM,SAAS,iBAAiB;AAChC,cAAa;AACX,mBAAiB;AACjB,2BAAyB;AACzB,qBAAmB;AACnB,UAAQ;;;;;;ACTZ,MAAa,uBAAuB;CAClC,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;AAEpD,qBAAoB,CAAC,MAAM,UAAU;AACnC,MAAI,gBAAgB,MAClB,gBAAe,MAAM;GAEvB;AAEF,QAAO"}
1
+ {"version":3,"file":"auth-BWJ4-JF-.js","names":[],"sources":["../src/utilities/auth/AuthProviderWrapper.jsx","../src/utilities/auth/useSingleLogout.ts","../src/utilities/auth/useAccessToken.js"],"sourcesContent":["import React from 'react';\n// import { LocalAuthProvider } from './LocalAuthProvider';\nimport { AuthProvider } from './AuthProvider';\n\nexport const AuthProviderWrapper = props => {\n const { children } = props;\n\n return <AuthProvider {...props}> {children}</AuthProvider>\n\n};\n","import 'react';\nimport { clearStoredPath } from '../redirect/LocalRedirectUrlStorage';\nimport { clearStoredExternalPath } from '../redirect/ExternalRedirectUrlStorage';\nimport {clearStoredTenant} from '../storage/UnitySessionStorage'\nimport {useLogoutAction} from './authActions';\n\nexport const useSingleLogout: () => () => void = () => {\n const logout = useLogoutAction();\n return () => {\n clearStoredPath();\n clearStoredExternalPath();\n clearStoredTenant();\n logout()\n }\n\n};\n","import { useState } from 'react';\nimport { acquireAccessToken } from './authActions';\n\nexport const useAccessToken = () => {\n const [accessToken, setAccessToken] = useState(null);\n\n acquireAccessToken().then((token) => {\n if (accessToken !== token) {\n setAccessToken(token);\n }\n });\n\n return accessToken;\n};\n"],"mappings":";;;;;;;;AAIA,MAAa,uBAAsB,UAAS;CAC1C,MAAM,EAAE,aAAa;AAErB,QAAO,oCAAC,cAAiB,OAAO,KAAE,SAAwB;;;;;ACD5D,MAAa,wBAA0C;CACrD,MAAM,SAAS,iBAAiB;AAChC,cAAa;AACX,mBAAiB;AACjB,2BAAyB;AACzB,qBAAmB;AACnB,UAAQ;;;;;;ACTZ,MAAa,uBAAuB;CAClC,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;AAEpD,qBAAoB,CAAC,MAAM,UAAU;AACnC,MAAI,gBAAgB,MAClB,gBAAe,MAAM;GAEvB;AAEF,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"catalogStore-DP2GxpTJ.js","names":["useCatalogStore: () => CatalogState"],"sources":["../src/stores/catalogStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\n\ninterface CatalogState {\n currentApiCatalogId: string | null | undefined;\n setCurrentApiCatalogId: (apiCatalogId: string) => void;\n catalogsMap: Object | null | undefined;\n setCatalogsMap: (catalog: Object) => void;\n promotedEntityMap: Object | null | undefined;\n setPromotedEntityMap: (catalog: Object) => void;\n promotedMethodEntitiesMap: Object | null | undefined;\n setPromotedMethodEntitiesMap: (catalog: Object) => void;\n}\n\nexport const useCatalogStore: () => CatalogState = create<CatalogState>()(\n devtools((set) => ({\n currentApiCatalogId: '',\n setCurrentApiCatalogId: (apiCatalogId) => {\n sessionStorage.setItem('current-api-catalog-id', apiCatalogId);\n set((state) => ({ currentApiCatalogId: apiCatalogId }));\n },\n catalogsMap: {},\n setCatalogsMap: (catalogsMap) =>\n set((state) => ({\n catalogsMap: { ...state.catalogsMap, ...catalogsMap }\n })),\n promotedEntityMap: {},\n setPromotedEntityMap: (promotedEntityMap) =>\n set((state) => ({\n promotedEntityMap: { ...state.promotedEntityMap, ...promotedEntityMap }\n })),\n promotedMethodEntitiesMap: {},\n setPromotedMethodEntitiesMap: (promotedMethodEntitiesMap) =>\n set((state) => ({\n promotedMethodEntitiesMap: {\n ...state.promotedMethodEntitiesMap,\n ...promotedMethodEntitiesMap\n }\n }))\n }))\n);\n"],"mappings":";;;;AAcA,MAAaA,kBAAsC,QAAsB,CACvE,UAAU,SAAS;CACjB,qBAAqB;CACrB,yBAAyB,iBAAiB;AACxC,iBAAe,QAAQ,0BAA0B,aAAa;AAC9D,OAAK,WAAW,EAAE,qBAAqB,cAAc,EAAE;;CAEzD,aAAa,EAAE;CACf,iBAAiB,gBACf,KAAK,WAAW,EACd,aAAa;EAAE,GAAG,MAAM;EAAa,GAAG;EAAa,EACtD,EAAE;CACL,mBAAmB,EAAE;CACrB,uBAAuB,sBACrB,KAAK,WAAW,EACd,mBAAmB;EAAE,GAAG,MAAM;EAAmB,GAAG;EAAmB,EACxE,EAAE;CACL,2BAA2B,EAAE;CAC7B,+BAA+B,8BAC7B,KAAK,WAAW,EACd,2BAA2B;EACzB,GAAG,MAAM;EACT,GAAG;EACJ,EACF,EAAE;CACN,EAAE,CACJ"}
1
+ {"version":3,"file":"catalogStore-DP2GxpTJ.js","names":[],"sources":["../src/stores/catalogStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\n\ninterface CatalogState {\n currentApiCatalogId: string | null | undefined;\n setCurrentApiCatalogId: (apiCatalogId: string) => void;\n catalogsMap: Object | null | undefined;\n setCatalogsMap: (catalog: Object) => void;\n promotedEntityMap: Object | null | undefined;\n setPromotedEntityMap: (catalog: Object) => void;\n promotedMethodEntitiesMap: Object | null | undefined;\n setPromotedMethodEntitiesMap: (catalog: Object) => void;\n}\n\nexport const useCatalogStore: () => CatalogState = create<CatalogState>()(\n devtools((set) => ({\n currentApiCatalogId: '',\n setCurrentApiCatalogId: (apiCatalogId) => {\n sessionStorage.setItem('current-api-catalog-id', apiCatalogId);\n set((state) => ({ currentApiCatalogId: apiCatalogId }));\n },\n catalogsMap: {},\n setCatalogsMap: (catalogsMap) =>\n set((state) => ({\n catalogsMap: { ...state.catalogsMap, ...catalogsMap }\n })),\n promotedEntityMap: {},\n setPromotedEntityMap: (promotedEntityMap) =>\n set((state) => ({\n promotedEntityMap: { ...state.promotedEntityMap, ...promotedEntityMap }\n })),\n promotedMethodEntitiesMap: {},\n setPromotedMethodEntitiesMap: (promotedMethodEntitiesMap) =>\n set((state) => ({\n promotedMethodEntitiesMap: {\n ...state.promotedMethodEntitiesMap,\n ...promotedMethodEntitiesMap\n }\n }))\n }))\n);\n"],"mappings":";;;;AAcA,MAAa,kBAAsC,QAAsB,CACvE,UAAU,SAAS;CACjB,qBAAqB;CACrB,yBAAyB,iBAAiB;AACxC,iBAAe,QAAQ,0BAA0B,aAAa;AAC9D,OAAK,WAAW,EAAE,qBAAqB,cAAc,EAAE;;CAEzD,aAAa,EAAE;CACf,iBAAiB,gBACf,KAAK,WAAW,EACd,aAAa;EAAE,GAAG,MAAM;EAAa,GAAG;EAAa,EACtD,EAAE;CACL,mBAAmB,EAAE;CACrB,uBAAuB,sBACrB,KAAK,WAAW,EACd,mBAAmB;EAAE,GAAG,MAAM;EAAmB,GAAG;EAAmB,EACxE,EAAE;CACL,2BAA2B,EAAE;CAC7B,+BAA+B,8BAC7B,KAAK,WAAW,EACd,2BAA2B;EACzB,GAAG,MAAM;EACT,GAAG;EACJ,EACF,EAAE;CACN,EAAE,CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"charts-pX01x8rO.js","names":["InsightRenderer: React.FC<InsightRendererProps>","properties: InsightTypeProperties","UdpCharts","kpis:\n | { value?: string; label?: string; active?: boolean }[]\n | undefined","kpiField: { operation?: string; property?: string }","dataConfig: { [key: string]: any } | null","dataMapping: {\n name: string;\n value: { name: string; operation: string | undefined };\n alias?: string;\n }[]"],"sources":["../src/UI/charts/InsightRenderer.tsx"],"sourcesContent":["import React, { useMemo, useState, useEffect } from 'react';\nimport * as UdpCharts from './amcharts';\nimport { Insight, InsightTypeField, InsightTypeProperties } from './types';\nimport { useUser } from '../../utilities/auth/useUser';\nimport { useAxiosGet } from '../../utilities/useAxiosGet';\nimport QueryResult from '../../models/QueryResult';\nimport { ConfigService } from '../../configService';\nexport type UdpChart =\n | 'UdpBarChart'\n | 'UdpDonutChart'\n | 'UdpLineChart'\n | 'UdpDistributionChart';\nexport interface InsightRendererProps {\n insight: Insight | undefined;\n data: QueryResult | undefined;\n insightId: string | undefined;\n}\n\nconst capitilizeFirstLetter = (s: string): string =>\n s?.charAt?.(0)?.toUpperCase?.() + s?.slice?.(1);\nconst decapitilizeFirstLetter = (s: string): string =>\n s?.charAt?.(0)?.toLowerCase?.() + s?.slice?.(1);\n\nfunction getAggregateValue<T>(data: QueryResult | undefined, key: string): T {\n return data?.aggregateResults?.[0]?.[key] as T;\n}\n/**\n * InsightRenderer component\n *\n * This component is responsible for rendering insights based on the provided props.\n *\n * @prop {Insight} `insight` - The insight metadata\n * @prop {any} `data` - Search results associated with the insight\n * @prop {string} `insightId` - InsightId, if included the component will get the data from server\n * @returns {JSX.Element} - The rendered insight component.\n */\nexport const InsightRenderer: React.FC<InsightRendererProps> = (props: InsightRendererProps) => {\n const { insight: insightProp, data, insightId } = props;\n const user = useUser();\n const [{ data: loadedInsight }] = useAxiosGet(\n ConfigService.integrationV2ApiUrl,\n `Insight/${insightId}/Full`,\n {},\n !insightId || !user\n ) as unknown as [{ data: Insight }];\n\n // Use the insight passed in or the insightId\n const insight = useMemo(() => {\n if (!!insightId) return loadedInsight;\n else return insightProp;\n }, [loadedInsight, insightId, insightProp]);\n\n // determine chart component\n const Chart = useMemo(() => {\n if (!insight?.insightInsightType?.properties) return null;\n let properties: InsightTypeProperties;\n if (typeof insight?.insightInsightType?.properties === 'string') {\n properties = JSON.parse(\n insight?.insightInsightType?.properties as unknown as string\n ) as InsightTypeProperties;\n } else {\n properties = insight?.insightInsightType?.properties;\n }\n // @ts-ignore\n return UdpCharts?.[properties?.component];\n }, [insight?.insightInsightType]);\n\n const kpis:\n | { value?: string; label?: string; active?: boolean }[]\n | undefined = useMemo(() => {\n if (insight == null) return undefined;\n return insight?.insightInsightKpi?.map?.((kpi) => {\n const kpiField: { operation?: string; property?: string } =\n typeof kpi.field === 'object' ? kpi.field : JSON.parse(kpi.field);\n console.log(kpiField);\n return {\n label: kpi.label,\n active: kpi.active,\n value: getAggregateValue<string>(\n data,\n `${\n decapitilizeFirstLetter(kpiField.property ?? '') ?? ''\n }${capitilizeFirstLetter(kpiField.operation?.toLowerCase() ?? '')}`\n )\n };\n });\n }, [data, insight?.insightInsightKpi]);\n\n const dataConfig: { [key: string]: any } | null = useMemo(() => {\n if (insight == null) return null;\n const dataMapping: {\n name: string;\n value: { name: string; operation: string | undefined };\n alias?: string;\n }[] =\n typeof insight.dataMapping === 'object'\n ? insight.dataMapping\n : JSON.parse(insight.dataMapping ?? '{}');\n const dataFields: InsightTypeField[] =\n typeof insight.insightInsightType?.dataFields === 'object'\n ? insight.insightInsightType?.dataFields\n : JSON.parse(insight.insightInsightType?.dataFields ?? '{}');\n\n return dataFields?.reduce?.((value: { [key: string]: any }, field) => {\n const fieldValue = dataMapping?.find?.(\n (dm) => dm.name === field.name\n )?.value;\n if (fieldValue?.operation != undefined) {\n value[field.name] =\n decapitilizeFirstLetter(fieldValue?.name) + fieldValue.operation;\n } else {\n // @ts-ignore\n value[field.name] = fieldValue?.alias ?? fieldValue?.name ?? fieldValue;\n }\n\n return value;\n }, {});\n }, [insight?.dataMapping, insight?.insightInsightType]);\n const combinedData = useMemo(() => {\n if (data?.aggregateResults == null || data?.aggregateResults?.length === 0)\n return data?.pageList;\n return data?.pageList.map((page, i) => ({\n ...page,\n ...data?.aggregateResults?.[i]\n }));\n }, [data]);\n if (Chart == null) return null;\n return (\n <Chart\n data={combinedData}\n title={insight?.title}\n subheader={insight?.subheader}\n {...dataConfig}\n kpis={kpis?.filter((kpi) => kpi.active)}\n />\n );\n};\n"],"mappings":";;;;;;;AAkBA,MAAM,yBAAyB,MAC7B,GAAG,SAAS,EAAE,EAAE,eAAe,GAAG,GAAG,QAAQ,EAAE;AACjD,MAAM,2BAA2B,MAC/B,GAAG,SAAS,EAAE,EAAE,eAAe,GAAG,GAAG,QAAQ,EAAE;AAEjD,SAAS,kBAAqB,MAA+B,KAAgB;AAC3E,QAAO,MAAM,mBAAmB,KAAK;;;;;;;;;;;;AAYvC,MAAaA,mBAAmD,UAAgC;CAC9F,MAAM,EAAE,SAAS,aAAa,MAAM,cAAc;CAClD,MAAM,OAAO,SAAS;CACtB,MAAM,CAAC,EAAE,MAAM,mBAAmB,YAChC,cAAc,qBACd,WAAW,UAAU,QACrB,EAAE,EACF,CAAC,aAAa,CAAC,KAChB;CAGD,MAAM,UAAU,cAAc;AAC5B,MAAI,CAAC,CAAC,UAAW,QAAO;MACnB,QAAO;IACX;EAAC;EAAe;EAAW;EAAY,CAAC;CAG3C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M,eAAe,cAAc;AACjC,MAAI,MAAM,oBAAoB,QAAQ,MAAM,kBAAkB,WAAW,EACvE,QAAO,MAAM;AACf,SAAO,MAAM,SAAS,KAAK,MAAM,OAAO;GACtC,GAAG;GACH,GAAG,MAAM,mBAAmB;GAC7B,EAAE;IACF,CAAC,KAAK,CAAC;AACV,KAAI,SAAS,KAAM,QAAO;AAC1B,QACE,oCAAC;EACC,MAAM;EACN,OAAO,SAAS;EAChB,WAAW,SAAS;EACpB,GAAI;EACJ,MAAM,MAAM,QAAQ,QAAQ,IAAI,OAAO;GACvC"}
1
+ {"version":3,"file":"charts-pX01x8rO.js","names":["UdpCharts"],"sources":["../src/UI/charts/InsightRenderer.tsx"],"sourcesContent":["import React, { useMemo, useState, useEffect } from 'react';\nimport * as UdpCharts from './amcharts';\nimport { Insight, InsightTypeField, InsightTypeProperties } from './types';\nimport { useUser } from '../../utilities/auth/useUser';\nimport { useAxiosGet } from '../../utilities/useAxiosGet';\nimport QueryResult from '../../models/QueryResult';\nimport { ConfigService } from '../../configService';\nexport type UdpChart =\n | 'UdpBarChart'\n | 'UdpDonutChart'\n | 'UdpLineChart'\n | 'UdpDistributionChart';\nexport interface InsightRendererProps {\n insight: Insight | undefined;\n data: QueryResult | undefined;\n insightId: string | undefined;\n}\n\nconst capitilizeFirstLetter = (s: string): string =>\n s?.charAt?.(0)?.toUpperCase?.() + s?.slice?.(1);\nconst decapitilizeFirstLetter = (s: string): string =>\n s?.charAt?.(0)?.toLowerCase?.() + s?.slice?.(1);\n\nfunction getAggregateValue<T>(data: QueryResult | undefined, key: string): T {\n return data?.aggregateResults?.[0]?.[key] as T;\n}\n/**\n * InsightRenderer component\n *\n * This component is responsible for rendering insights based on the provided props.\n *\n * @prop {Insight} `insight` - The insight metadata\n * @prop {any} `data` - Search results associated with the insight\n * @prop {string} `insightId` - InsightId, if included the component will get the data from server\n * @returns {JSX.Element} - The rendered insight component.\n */\nexport const InsightRenderer: React.FC<InsightRendererProps> = (props: InsightRendererProps) => {\n const { insight: insightProp, data, insightId } = props;\n const user = useUser();\n const [{ data: loadedInsight }] = useAxiosGet(\n ConfigService.integrationV2ApiUrl,\n `Insight/${insightId}/Full`,\n {},\n !insightId || !user\n ) as unknown as [{ data: Insight }];\n\n // Use the insight passed in or the insightId\n const insight = useMemo(() => {\n if (!!insightId) return loadedInsight;\n else return insightProp;\n }, [loadedInsight, insightId, insightProp]);\n\n // determine chart component\n const Chart = useMemo(() => {\n if (!insight?.insightInsightType?.properties) return null;\n let properties: InsightTypeProperties;\n if (typeof insight?.insightInsightType?.properties === 'string') {\n properties = JSON.parse(\n insight?.insightInsightType?.properties as unknown as string\n ) as InsightTypeProperties;\n } else {\n properties = insight?.insightInsightType?.properties;\n }\n // @ts-ignore\n return UdpCharts?.[properties?.component];\n }, [insight?.insightInsightType]);\n\n const kpis:\n | { value?: string; label?: string; active?: boolean }[]\n | undefined = useMemo(() => {\n if (insight == null) return undefined;\n return insight?.insightInsightKpi?.map?.((kpi) => {\n const kpiField: { operation?: string; property?: string } =\n typeof kpi.field === 'object' ? kpi.field : JSON.parse(kpi.field);\n console.log(kpiField);\n return {\n label: kpi.label,\n active: kpi.active,\n value: getAggregateValue<string>(\n data,\n `${\n decapitilizeFirstLetter(kpiField.property ?? '') ?? ''\n }${capitilizeFirstLetter(kpiField.operation?.toLowerCase() ?? '')}`\n )\n };\n });\n }, [data, insight?.insightInsightKpi]);\n\n const dataConfig: { [key: string]: any } | null = useMemo(() => {\n if (insight == null) return null;\n const dataMapping: {\n name: string;\n value: { name: string; operation: string | undefined };\n alias?: string;\n }[] =\n typeof insight.dataMapping === 'object'\n ? insight.dataMapping\n : JSON.parse(insight.dataMapping ?? '{}');\n const dataFields: InsightTypeField[] =\n typeof insight.insightInsightType?.dataFields === 'object'\n ? insight.insightInsightType?.dataFields\n : JSON.parse(insight.insightInsightType?.dataFields ?? '{}');\n\n return dataFields?.reduce?.((value: { [key: string]: any }, field) => {\n const fieldValue = dataMapping?.find?.(\n (dm) => dm.name === field.name\n )?.value;\n if (fieldValue?.operation != undefined) {\n value[field.name] =\n decapitilizeFirstLetter(fieldValue?.name) + fieldValue.operation;\n } else {\n // @ts-ignore\n value[field.name] = fieldValue?.alias ?? fieldValue?.name ?? fieldValue;\n }\n\n return value;\n }, {});\n }, [insight?.dataMapping, insight?.insightInsightType]);\n const combinedData = useMemo(() => {\n if (data?.aggregateResults == null || data?.aggregateResults?.length === 0)\n return data?.pageList;\n return data?.pageList.map((page, i) => ({\n ...page,\n ...data?.aggregateResults?.[i]\n }));\n }, [data]);\n if (Chart == null) return null;\n return (\n <Chart\n data={combinedData}\n title={insight?.title}\n subheader={insight?.subheader}\n {...dataConfig}\n kpis={kpis?.filter((kpi) => kpi.active)}\n />\n );\n};\n"],"mappings":";;;;;;;AAkBA,MAAM,yBAAyB,MAC7B,GAAG,SAAS,EAAE,EAAE,eAAe,GAAG,GAAG,QAAQ,EAAE;AACjD,MAAM,2BAA2B,MAC/B,GAAG,SAAS,EAAE,EAAE,eAAe,GAAG,GAAG,QAAQ,EAAE;AAEjD,SAAS,kBAAqB,MAA+B,KAAgB;AAC3E,QAAO,MAAM,mBAAmB,KAAK;;;;;;;;;;;;AAYvC,MAAa,mBAAmD,UAAgC;CAC9F,MAAM,EAAE,SAAS,aAAa,MAAM,cAAc;CAClD,MAAM,OAAO,SAAS;CACtB,MAAM,CAAC,EAAE,MAAM,mBAAmB,YAChC,cAAc,qBACd,WAAW,UAAU,QACrB,EAAE,EACF,CAAC,aAAa,CAAC,KAChB;CAGD,MAAM,UAAU,cAAc;AAC5B,MAAI,CAAC,CAAC,UAAW,QAAO;MACnB,QAAO;IACX;EAAC;EAAe;EAAW;EAAY,CAAC;CAG3C,MAAM,QAAQ,cAAc;AAC1B,MAAI,CAAC,SAAS,oBAAoB,WAAY,QAAO;EACrD,IAAI;AACJ,MAAI,OAAO,SAAS,oBAAoB,eAAe,SACrD,cAAa,KAAK,MAChB,SAAS,oBAAoB,WAC9B;MAED,cAAa,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ACF,CAAC,KAAK,CAAC;AACV,KAAI,SAAS,KAAM,QAAO;AAC1B,QACE,oCAAC;EACC,MAAM;EACN,OAAO,SAAS;EAChB,WAAW,SAAS;EACpB,GAAI;EACJ,MAAM,MAAM,QAAQ,QAAQ,IAAI,OAAO;GACvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"form-Dj1zVw6K.js","names":["FormError: FC<FormErrorProps>","createDecorator","FormSpy: FC<FormSpyProps>","FinalFormSpy","useForm","useFinalForm","useField","useFinalField","useFormState","useFinalFormState"],"sources":["../src/utilities/form/FormError.tsx","../src/utilities/form/useFieldChangeListener.ts","../src/utilities/form/FormSpy.tsx","../src/utilities/form/formHooks.js"],"sourcesContent":["import { Typography, TypographyProps } from '@material-ui/core';\nimport React, { FC } from 'react';\nimport { FormSpy } from 'react-final-form';\n\nexport type FormErrorProps = TypographyProps<'p', {}>;\n\n/**\n * Displays form-wide validation and submit errors in a MUI Typography error element\n */\nexport const FormError: FC<FormErrorProps> = props => {\n return (\n <FormSpy subscription={{ error: true, submitError: true }}>\n {({ error, submitError }) => {\n if (error || submitError) {\n return (\n <Typography component=\"p\" paragraph {...props} color=\"error\">\n {error || submitError}\n </Typography>\n );\n }\n\n return null;\n }}\n </FormSpy>\n );\n};\n","import { useEffect } from 'react';\nimport { useForm } from 'react-final-form';\nimport { FormApi } from 'final-form';\n\nexport type FieldChangeCallback<T> = (\n form: FormApi,\n value: T,\n prevValue: T\n) => void;\n\n/**\n * Form helper hook that runs a callback when the value of a field has changed\n * Usefull for creating effects where changes to one field affect the value of another field imperatively\n */\nexport function useFieldChangeListener<T>(\n name: string,\n cb: FieldChangeCallback<T>\n) {\n const form = useForm();\n\n useEffect(() => {\n let lastValue = form.getFieldState(name)?.value;\n\n const unsubscribe = form.subscribe(\n ({ values }) => {\n const value = values[name];\n if (value !== lastValue) {\n cb(form, value, lastValue);\n }\n\n lastValue = values[name];\n },\n { values: true }\n );\n return unsubscribe;\n }, [form, name, cb]);\n}\n","import React, { FC } from 'react';\nimport {\n AnyObject,\n FormSpy as FinalFormSpy,\n FormSpyProps as FinalFormSpyProps,\n FormSpyRenderProps\n} from 'react-final-form';\nimport createDecorator from './final-form-scroll/createDecorator';\n\nexport interface FormSpyProps<FormValues = AnyObject>\n extends FinalFormSpyProps<FormValues> {\n children?: (props: FormSpyRenderProps<FormValues>) => React.ReactNode;\n id?: string;\n}\n\nconst scrollToError = createDecorator();\n\n/**\n * final-form Form Spy wrapper\n */\nexport const FormSpy: FC<FormSpyProps> = ({\n render: renderProp,\n children,\n ...props\n}) => {\n const render = renderProp || children;\n return (\n <FinalFormSpy {...props}>\n {(params) => (\n <>{typeof render === 'function' ? render(params) : render}</>\n )}\n </FinalFormSpy>\n );\n};\n","import {\n useForm as useFinalForm,\n useField as useFinalField,\n useFormState as useFinalFormState\n} from 'react-final-form';\n/**\n * @returns {any}\n */\nexport const useForm = () => useFinalForm();\n/**\n * @returns {any}\n */\nexport const useField = () => useFinalField();\n/**\n * @returns {any}\n */\nexport const useFormState = () => useFinalFormState();\n"],"mappings":";;;;;;;;;;AASA,MAAaA,aAAgC,UAAS;AACpD,QACE,oCAAC,WAAQ,cAAc;EAAE,OAAO;EAAM,aAAa;EAAM,KACrD,EAAE,OAAO,kBAAkB;AAC3B,MAAI,SAAS,YACX,QACE,oCAAC;GAAW,WAAU;GAAI;GAAU,GAAI;GAAO,OAAM;KAClD,SAAS,YACC;AAIjB,SAAO;GAED;;;;;;;;;ACTd,SAAgB,uBACd,MACA,IACA;CACA,MAAM,OAAO,SAAS;AAEtB,iBAAgB;EACd,IAAI,YAAY,KAAK,cAAc,KAAK,EAAE;AAa1C,SAXoB,KAAK,WACtB,EAAE,aAAa;GACd,MAAM,QAAQ,OAAO;AACrB,OAAI,UAAU,UACZ,IAAG,MAAM,OAAO,UAAU;AAG5B,eAAY,OAAO;KAErB,EAAE,QAAQ,MAAM,CACjB;IAEA;EAAC;EAAM;EAAM;EAAG,CAAC;;;;;ACpBAC,yBAAiB;;;;AAKvC,MAAaC,aAA6B,EACxC,QAAQ,YACR,UACA,GAAG,YACC;CACJ,MAAM,SAAS,cAAc;AAC7B,QACE,oCAACC,SAAiB,QACd,WACA,0DAAG,OAAO,WAAW,aAAa,OAAO,OAAO,GAAG,OAAU,CAElD;;;;;;;;ACvBnB,MAAaC,kBAAgBC,SAAc;;;;AAI3C,MAAaC,mBAAiBC,UAAe;;;;AAI7C,MAAaC,uBAAqBC,cAAmB"}
1
+ {"version":3,"file":"form-Dj1zVw6K.js","names":["createDecorator","FormSpy","FinalFormSpy","useForm","useFinalForm","useField","useFinalField","useFormState","useFinalFormState"],"sources":["../src/utilities/form/FormError.tsx","../src/utilities/form/useFieldChangeListener.ts","../src/utilities/form/FormSpy.tsx","../src/utilities/form/formHooks.js"],"sourcesContent":["import { Typography, TypographyProps } from '@material-ui/core';\nimport React, { FC } from 'react';\nimport { FormSpy } from 'react-final-form';\n\nexport type FormErrorProps = TypographyProps<'p', {}>;\n\n/**\n * Displays form-wide validation and submit errors in a MUI Typography error element\n */\nexport const FormError: FC<FormErrorProps> = props => {\n return (\n <FormSpy subscription={{ error: true, submitError: true }}>\n {({ error, submitError }) => {\n if (error || submitError) {\n return (\n <Typography component=\"p\" paragraph {...props} color=\"error\">\n {error || submitError}\n </Typography>\n );\n }\n\n return null;\n }}\n </FormSpy>\n );\n};\n","import { useEffect } from 'react';\nimport { useForm } from 'react-final-form';\nimport { FormApi } from 'final-form';\n\nexport type FieldChangeCallback<T> = (\n form: FormApi,\n value: T,\n prevValue: T\n) => void;\n\n/**\n * Form helper hook that runs a callback when the value of a field has changed\n * Usefull for creating effects where changes to one field affect the value of another field imperatively\n */\nexport function useFieldChangeListener<T>(\n name: string,\n cb: FieldChangeCallback<T>\n) {\n const form = useForm();\n\n useEffect(() => {\n let lastValue = form.getFieldState(name)?.value;\n\n const unsubscribe = form.subscribe(\n ({ values }) => {\n const value = values[name];\n if (value !== lastValue) {\n cb(form, value, lastValue);\n }\n\n lastValue = values[name];\n },\n { values: true }\n );\n return unsubscribe;\n }, [form, name, cb]);\n}\n","import React, { FC } from 'react';\nimport {\n AnyObject,\n FormSpy as FinalFormSpy,\n FormSpyProps as FinalFormSpyProps,\n FormSpyRenderProps\n} from 'react-final-form';\nimport createDecorator from './final-form-scroll/createDecorator';\n\nexport interface FormSpyProps<FormValues = AnyObject>\n extends FinalFormSpyProps<FormValues> {\n children?: (props: FormSpyRenderProps<FormValues>) => React.ReactNode;\n id?: string;\n}\n\nconst scrollToError = createDecorator();\n\n/**\n * final-form Form Spy wrapper\n */\nexport const FormSpy: FC<FormSpyProps> = ({\n render: renderProp,\n children,\n ...props\n}) => {\n const render = renderProp || children;\n return (\n <FinalFormSpy {...props}>\n {(params) => (\n <>{typeof render === 'function' ? render(params) : render}</>\n )}\n </FinalFormSpy>\n );\n};\n","import {\n useForm as useFinalForm,\n useField as useFinalField,\n useFormState as useFinalFormState\n} from 'react-final-form';\n/**\n * @returns {any}\n */\nexport const useForm = () => useFinalForm();\n/**\n * @returns {any}\n */\nexport const useField = () => useFinalField();\n/**\n * @returns {any}\n */\nexport const useFormState = () => useFinalFormState();\n"],"mappings":";;;;;;;;;;AASA,MAAa,aAAgC,UAAS;AACpD,QACE,oCAAC,WAAQ,cAAc;EAAE,OAAO;EAAM,aAAa;EAAM,KACrD,EAAE,OAAO,kBAAkB;AAC3B,MAAI,SAAS,YACX,QACE,oCAAC;GAAW,WAAU;GAAI;GAAU,GAAI;GAAO,OAAM;KAClD,SAAS,YACC;AAIjB,SAAO;GAED;;;;;;;;;ACTd,SAAgB,uBACd,MACA,IACA;CACA,MAAM,OAAO,SAAS;AAEtB,iBAAgB;EACd,IAAI,YAAY,KAAK,cAAc,KAAK,EAAE;AAa1C,SAXoB,KAAK,WACtB,EAAE,aAAa;GACd,MAAM,QAAQ,OAAO;AACrB,OAAI,UAAU,UACZ,IAAG,MAAM,OAAO,UAAU;AAG5B,eAAY,OAAO;KAErB,EAAE,QAAQ,MAAM,CACjB;IAEA;EAAC;EAAM;EAAM;EAAG,CAAC;;;;;ACpBAA,yBAAiB;;;;AAKvC,MAAaC,aAA6B,EACxC,QAAQ,YACR,UACA,GAAG,YACC;CACJ,MAAM,SAAS,cAAc;AAC7B,QACE,oCAACC,SAAiB,QACd,WACA,0DAAG,OAAO,WAAW,aAAa,OAAO,OAAO,GAAG,OAAU,CAElD;;;;;;;;ACvBnB,MAAaC,kBAAgBC,SAAc;;;;AAI3C,MAAaC,mBAAiBC,UAAe;;;;AAI7C,MAAaC,uBAAqBC,cAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-BNndjGer.js","names":["dateTimeOptions: Intl.DateTimeFormatOptions","localeString: string","error"],"sources":["../src/hooks/useOutlook.js","../src/hooks/useProductVersion.js","../src/hooks/useDateLocale.ts","../src/hooks/useWorkflow.js","../src/hooks/usePreloadPages.js"],"sourcesContent":["import { apiMutate } from '../utilities/useAxiosMutate';\nimport { useEffect } from 'react';\nimport { ConfigService } from '../configService';\n\nexport const useOutlook = (callbackUri, onLogin) => {\n\n const invalidateUserSession = async () => {\n try {\n // if (ConfigService.integrationV2ApiUrl === undefined) {\n // throw new Error('REACT_APP_INTEGRATION_V2_API_BASE is undefined')\n // }\n // const accessToken = localStorage.getItem('outlookAccessToken');\n // const response = await apiMutate(\n // ConfigService.integrationV2ApiUrl,\n // `OutlookIntegrationAccessToken/invalidateUserSession`,\n // {\n // method: \"post\",\n // headers : {\n // OutlookAccessToken: accessToken\n // }\n // }\n // )\n\n } catch (error) {\n console.error('Error refreshing access token:', error);\n return null;\n // }\n } finally {\n try {\n localStorage.removeItem('outlookAccessToken');\n } catch (error) {\n console.error('Error removing accessToken:', error);\n }\n\n try {\n localStorage.removeItem('outlookRefreshToken');\n } catch (error) {\n console.error('Error removing refreshToken:', error);\n }\n\n try {\n localStorage.removeItem('outlookExpiresAt');\n } catch (error) {\n console.error('Error removing expiresAt:', error);\n }\n\n }\n }\n\n const getAccessToken = async () => {\n let accessToken = localStorage.getItem('outlookAccessToken');\n\n if (!accessToken) {\n throw(new Error(\"No access token found\"));\n }\n\n const expiresAt = localStorage.getItem('outlookExpiresAt');\n if (expiresAt && !isBeforeCurrentTime(expiresAt)) {\n return accessToken;\n }\n\n const refreshToken = localStorage.getItem('outlookRefreshToken');\n if (!refreshToken) {\n throw(new Error(\"No refresh token found\"));\n }\n\n try {\n if (ConfigService.integrationV2ApiUrl === undefined) {\n throw new Error('REACT_APP_INTEGRATION_V2_API_BASE is undefined')\n }\n const response = await apiMutate(\n ConfigService.integrationV2ApiUrl,\n `OutlookIntegrationAccessToken/getAccessToken`,\n {\n method: \"post\",\n data: {\n option: \"refresh_token\",\n value: refreshToken,\n redirectUri: ConfigService.config.UNITY_URL + \"/aad_redirect\"\n }\n }\n )\n const data = response.data;\n if (data.accessToken != null && data.refreshToken != null && data.expiresIn != null) {\n localStorage.setItem('outlookAccessToken', data.accessToken);\n localStorage.setItem('outlookRefreshToken', data.refreshToken);\n localStorage.setItem('outlookExpiresAt', addSecondsToCurrentTimeUnix(data.expiresIn));\n return data.accessToken;\n } else {\n throw(new Error(\"Error: unable to get access token\"));\n }\n\n } catch (error) {\n console.error('Error refreshing access token:', error);\n return null;\n }\n };\n\n const login = () => {\n\n const baseUrl = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize';\n const clientId = process.env.REACT_APP_MSAL_API_CLIENT_ID;\n const responseType = 'code';\n const redirectUri = `${ConfigService.config.UNITY_URL}/aad_redirect`;\n const responseMode = 'query';\n const scope = [\n 'https://graph.microsoft.com/Calendars.ReadWrite',\n 'https://graph.microsoft.com/Calendars.ReadWrite.Shared',\n 'https://graph.microsoft.com/OnlineMeetingTranscript.Read.All',\n 'https://graph.microsoft.com/OnlineMeetings.Read',\n ].join('%20'); // Join scopes with URL-encoded space\n\n const authUrl = `${baseUrl}?client_id=${clientId}&response_type=${responseType}&redirect_uri=${redirectUri}&response_mode=${responseMode}&scope=${scope}&state=${callbackUri}`;\n openLoginPopup(authUrl)\n // window.location.href = authUrl;\n }\n\n\n function openLoginPopup(url) {\n var width = 600;\n var height = 600;\n var left = (screen.width - width) / 2;\n var top = (screen.height - height) / 2;\n var features = `width=${width},height=${height},top=${top},left=${left},status=no,toolbar=no,menubar=no,location=no`;\n\n var popup = window.open(url, 'LoginPopup', features);\n return popup;\n }\n function addSecondsToCurrentTimeUnix(seconds) {\n var now = new Date();\n now.setSeconds(now.getSeconds() + seconds);\n return now.getTime();\n }\n\n function isBeforeCurrentTime(unixTime) {\n var now = new Date().getTime();\n return unixTime < now;\n }\n\n const isUserSignedIn = () => {\n const accessToken = localStorage.getItem('outlookAccessToken');\n const refreshToken = localStorage.getItem('outlookRefreshToken');\n const expiresAt = localStorage.getItem('outlookExpiresAt');\n if (accessToken && refreshToken && expiresAt && !isBeforeCurrentTime(expiresAt)) {\n return true;\n } else {\n return false;\n }\n }\n\n useEffect(() => {\n const handleStorageChange = (event) => {\n if (event.key === 'outlookAccessToken') {\n onLogin();\n }\n };\n\n window.addEventListener('storage', handleStorageChange);\n\n // Clean up the event listener\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n };\n }, []);\n return {getAccessToken, invalidateUserSession, login, isUserSignedIn};\n}\n","import { useUser } from '../utilities/auth/useUser';\n\nexport const useProductVersion = (productId) => {\n const user = useUser();\n\n const matchingProduct = user?.products?.find(\n (product) => product?.productId === productId\n );\n\n return matchingProduct?.currentProductVersionId || '';\n};\n","import React, { useMemo } from 'react'\nimport {DateTime} from 'luxon'\n\n// TODO: tie in datetime config at the user or tenant level\n\nexport interface UseDateLocaleReturn {\n convertISOStringToLocalDateTime: (date: string) => string | null;\n convertISOStringToLocalDate: (date: string) => string | null;\n getISODate: () => string;\n}\n\nexport const useDateLocale = (\n datetimeFormatOptions : Intl.DateTimeFormatOptions | null = null,\n locale: string | null = null\n): UseDateLocaleReturn => {\n\n const dateTimeOptions: Intl.DateTimeFormatOptions = useMemo(() => (datetimeFormatOptions ?? {\n timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n hour12: true,\n }), [datetimeFormatOptions]);\n\n const localeString: string = useMemo(() => locale ?? navigator.language,[locale]);\n\n const convertISOStringToLocalDateTime = (date: string): string | null => {\n const luxonDateTime = DateTime.fromISO(date, {zone: 'utc'});\n luxonDateTime.setZone(dateTimeOptions.timeZone);\n\n luxonDateTime.setLocale(localeString);\n\n if(!luxonDateTime.isValid)\n {\n return null;\n }\n return luxonDateTime.toLocaleString(dateTimeOptions);\n\n }\n\n const convertISOStringToLocalDate = (date: string): string | null => {\n const luxonDateTime = DateTime.fromISO(date);\n luxonDateTime.setZone(dateTimeOptions.timeZone);\n\n luxonDateTime.setLocale(localeString);\n if(!luxonDateTime.isValid)\n {\n return null;\n }\n const { hour, minute, ...dateOptions} = dateTimeOptions;\n return luxonDateTime.toLocaleString(dateOptions);\n }\n\n const getISODate = ():string => {\n return DateTime.now().toISO({includeOffset:true, suppressMilliseconds: true})\n }\n\n return {\n convertISOStringToLocalDateTime: convertISOStringToLocalDateTime,\n convertISOStringToLocalDate: convertISOStringToLocalDate,\n getISODate: getISODate\n };\n}\n","import { useCallback } from 'react';\nimport { useWorkflowStore } from '../stores/workflowStore';\n\nexport const useWorkflow = () => {\n const { updateTaskDataMap } = useWorkflowStore();\n\n const setWorkflowTaskPageData = useCallback(\n (taskId, pageId, data) => {\n updateTaskDataMap(taskId, pageId, data);\n },\n [updateTaskDataMap]\n );\n\n return {\n setWorkflowTaskPageData\n };\n};\n","import { useEffect, useState, useCallback, useRef } from 'react';\nimport { useUser } from '../utilities/auth/useUser';\nimport { ConfigService } from '../configService';\nimport { useAxiosGet } from '../utilities/useAxiosGet';\nimport {useShellStore} from '../stores/shellStore';\n\n// Global cache to store preloaded modules (persists across component re-renders)\n// This prevents re-fetching modules when navigating to pages\nconst preloadedModulesCache = new Map();\n\n/**\n * Custom hook to preload all pages for a product.\n * This eliminates sequential server calls when navigating to /page/<id>\n * by fetching all page metadata in a single API call on mount.\n * After fetching metadata, it preloads the actual widget modules in the background.\n *\n * @param {Function} getWidget - Function to load widget modules\n * @returns {Object} - { pages, loading, error, refetch, preloadingWidgets }\n */\nexport const usePreloadPages = () => {\n const user = useUser();\n const [preloadingWidgets, setPreloadingWidgets] = useState(false);\n const [preloadedWidgets, setPreloadedWidgets] = useState(new Set());\n const { getWidget } = useShellStore();\n const preloadingRef = useRef(false); // Prevent duplicate preloading\n\n\n // Build the query parameters for the pages endpoint\n const queryParams = `page/product/${ConfigService.config.UNITY_PRODUCT_ID}?includeUdpPages=true`;\n\n // Fetch pages data - manual is true if user is not available\n const [{ data: pages, loading, error }, refetch] = useAxiosGet(\n ConfigService.tenantV1ApiUrl,\n queryParams,\n {},\n !!!user?.id || !!!user?.currentTenantId, // Skip if user info not available\n false // Don't use cache for fresh data\n );\n\n // Preload widget modules in the background after pages are fetched\n useEffect(() => {\n if (!pages || pages.length === 0 || !getWidget || preloadingRef.current) {\n return;\n }\n\n // Background preloading function\n const preloadWidgets = async () => {\n preloadingRef.current = true;\n setPreloadingWidgets(true);\n\n // Collect all unique widget types from all pages\n const widgetTypes = new Set();\n\n for (const page of pages) {\n try {\n // Parse the widgets field which contains JSON string\n if (page.widgets) {\n // The widgets field is a JSON object where the key is the pageId\n // and the value is a JSON string containing an array of widgets\n const widgetsObj = JSON.parse(page.widgets);\n const widgetsJson = widgetsObj[page.pageId];\n\n if (widgetsJson) {\n const widgetsList = JSON.parse(widgetsJson);\n\n // Extract widget types from the array\n if (Array.isArray(widgetsList)) {\n widgetsList.forEach(widget => {\n if (widget.widgetType && widget.widgetType !== '0') {\n widgetTypes.add(widget.widgetType);\n }\n });\n }\n }\n }\n } catch (error) {\n console.warn(`Failed to parse widgets for page ${page.name || page.pageId}:`, error);\n }\n }\n\n // Iterate through unique widget types and preload each module\n for (const widgetType of widgetTypes) {\n // Skip if already preloaded or no valid widget type\n if (!widgetType || preloadedWidgets.has(widgetType) || preloadedModulesCache.has(widgetType)) {\n continue;\n }\n\n try {\n // Call getWidget in the background to preload the module\n const lazyComponent = await getWidget(widgetType);\n\n // If it's a React.lazy component, we need to resolve its internal promise\n // React.lazy components have a _payload that stores the loading state\n if (lazyComponent && typeof lazyComponent === 'object' && lazyComponent._payload) {\n const payload = lazyComponent._payload;\n\n // Check if the payload is still pending (status: -1 = pending, 0 = error, 1 = success)\n if (payload._status === undefined || payload._status === -1) {\n // The module hasn't been loaded yet - trigger the import\n if (typeof payload._result === 'function') {\n // _result is the import() function - call it\n try {\n const module = await payload._result();\n // Update the lazy component's internal state\n payload._status = 1; // Success\n payload._result = module;\n console.log(widgetType, module);\n preloadedModulesCache.set(widgetType, module);\n console.log(`✓ Preloaded and cached: ${widgetType}`);\n } catch (err) {\n payload._status = 0; // Error\n payload._result = err;\n throw err;\n }\n }\n } else if (payload._status === 1) {\n // Already loaded - just cache it\n preloadedModulesCache.set(widgetType, payload._result);\n console.log(`✓ Already loaded: ${widgetType}`);\n }\n }\n\n // Mark as preloaded\n setPreloadedWidgets((prev) => new Set([...prev, widgetType]));\n } catch (error) {\n // Silently fail - don't want to block or show errors for background preloading\n console.warn(`✗ Failed to preload widget: ${widgetType}`, error);\n }\n }\n\n setPreloadingWidgets(false);\n };\n\n // Run preloading in background without blocking\n preloadWidgets();\n }, [pages, getWidget, preloadedWidgets]);\n\n /**\n * Helper function to find a page by ID from the preloaded pages\n * @param {string} pageId - The page ID to search for\n * @returns {Object|undefined} - The page object if found\n */\n const getPageById = useCallback(\n (pageId) => {\n if (!pages || !Array.isArray(pages)) return undefined;\n return pages.find((page) => page.pageId === pageId || page.id === pageId);\n },\n [pages]\n );\n\n /**\n * Helper function to check if a page name is valid (exists in preloaded pages)\n * @param {string} pageName - The page name to check\n * @returns {boolean} - True if the page name exists\n */\n const isValidPageName = useCallback(\n (pageName) => {\n if (!pages || !Array.isArray(pages)) return false;\n return pages.some(\n (page) => page.name === pageName || page.componentName === pageName\n );\n },\n [pages]\n );\n\n /**\n * Check if a module has been preloaded and cached\n * @param {string} pageName - The page/widget name\n * @returns {boolean} - True if the module is cached\n */\n const isModulePreloaded = useCallback(\n (pageName) => preloadedModulesCache.has(pageName),\n []\n );\n\n /**\n * Get a preloaded module from cache (if available)\n * @param {string} pageName - The page/widget name\n * @returns {Object|undefined} - The cached module or undefined\n */\n const getPreloadedModule = useCallback(\n (pageName) => preloadedModulesCache.get(pageName),\n []\n );\n\n return {\n pages,\n loading,\n error,\n refetch,\n getPageById,\n isValidPageName,\n preloadingWidgets,\n preloadedCount: preloadedWidgets.size,\n isModulePreloaded,\n getPreloadedModule,\n // Expose the cache for debugging\n _cache: preloadedModulesCache\n };\n};\n"],"mappings":";;;;;;;;;;AAIA,MAAa,cAAc,aAAa,YAAY;CAEhD,MAAM,wBAAwB,YAAY;AAsBlC,MAAI;AACA,gBAAa,WAAW,qBAAqB;WACtC,OAAO;AACd,WAAQ,MAAM,+BAA+B,MAAM;;AAGrD,MAAI;AACF,gBAAa,WAAW,sBAAsB;WACvC,OAAO;AACd,WAAQ,MAAM,gCAAgC,MAAM;;AAGtD,MAAI;AACF,gBAAa,WAAW,mBAAmB;WACpC,OAAO;AACd,WAAQ,MAAM,6BAA6B,MAAM;;;CAM7D,MAAM,iBAAiB,YAAY;EAC/B,IAAI,cAAc,aAAa,QAAQ,qBAAqB;AAE5D,MAAI,CAAC,YACD,uBAAM,IAAI,MAAM,wBAAwB;EAG5C,MAAM,YAAY,aAAa,QAAQ,mBAAmB;AAC1D,MAAI,aAAa,CAAC,oBAAoB,UAAU,CAC5C,QAAO;EAGX,MAAM,eAAe,aAAa,QAAQ,sBAAsB;AAChE,MAAI,CAAC,aACD,uBAAM,IAAI,MAAM,yBAAyB;AAG7C,MAAI;AACA,OAAI,cAAc,wBAAwB,OACtC,OAAM,IAAI,MAAM,iDAAiD;GAcrE,MAAM,QAZW,MAAM,UACnB,cAAc,qBACd,gDACA;IACI,QAAQ;IACR,MAAM;KACF,QAAQ;KACR,OAAO;KACP,aAA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MAAM,oBAAoB,aACvB,aAAa,sBAAsB,IAAI,SAAS,EACjD,EAAE,CACH;;;;;;CAOD,MAAM,qBAAqB,aACxB,aAAa,sBAAsB,IAAI,SAAS,EACjD,EAAE,CACH;AAED,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAAgB,iBAAiB;EACjC;EACA;EAEA,QAAQ;EACT"}
1
+ {"version":3,"file":"hooks-BNndjGer.js","names":["error"],"sources":["../src/hooks/useOutlook.js","../src/hooks/useProductVersion.js","../src/hooks/useDateLocale.ts","../src/hooks/useWorkflow.js","../src/hooks/usePreloadPages.js"],"sourcesContent":["import { apiMutate } from '../utilities/useAxiosMutate';\nimport { useEffect } from 'react';\nimport { ConfigService } from '../configService';\n\nexport const useOutlook = (callbackUri, onLogin) => {\n\n const invalidateUserSession = async () => {\n try {\n // if (ConfigService.integrationV2ApiUrl === undefined) {\n // throw new Error('REACT_APP_INTEGRATION_V2_API_BASE is undefined')\n // }\n // const accessToken = localStorage.getItem('outlookAccessToken');\n // const response = await apiMutate(\n // ConfigService.integrationV2ApiUrl,\n // `OutlookIntegrationAccessToken/invalidateUserSession`,\n // {\n // method: \"post\",\n // headers : {\n // OutlookAccessToken: accessToken\n // }\n // }\n // )\n\n } catch (error) {\n console.error('Error refreshing access token:', error);\n return null;\n // }\n } finally {\n try {\n localStorage.removeItem('outlookAccessToken');\n } catch (error) {\n console.error('Error removing accessToken:', error);\n }\n\n try {\n localStorage.removeItem('outlookRefreshToken');\n } catch (error) {\n console.error('Error removing refreshToken:', error);\n }\n\n try {\n localStorage.removeItem('outlookExpiresAt');\n } catch (error) {\n console.error('Error removing expiresAt:', error);\n }\n\n }\n }\n\n const getAccessToken = async () => {\n let accessToken = localStorage.getItem('outlookAccessToken');\n\n if (!accessToken) {\n throw(new Error(\"No access token found\"));\n }\n\n const expiresAt = localStorage.getItem('outlookExpiresAt');\n if (expiresAt && !isBeforeCurrentTime(expiresAt)) {\n return accessToken;\n }\n\n const refreshToken = localStorage.getItem('outlookRefreshToken');\n if (!refreshToken) {\n throw(new Error(\"No refresh token found\"));\n }\n\n try {\n if (ConfigService.integrationV2ApiUrl === undefined) {\n throw new Error('REACT_APP_INTEGRATION_V2_API_BASE is undefined')\n }\n const response = await apiMutate(\n ConfigService.integrationV2ApiUrl,\n `OutlookIntegrationAccessToken/getAccessToken`,\n {\n method: \"post\",\n data: {\n option: \"refresh_token\",\n value: refreshToken,\n redirectUri: ConfigService.config.UNITY_URL + \"/aad_redirect\"\n }\n }\n )\n const data = response.data;\n if (data.accessToken != null && data.refreshToken != null && data.expiresIn != null) {\n localStorage.setItem('outlookAccessToken', data.accessToken);\n localStorage.setItem('outlookRefreshToken', data.refreshToken);\n localStorage.setItem('outlookExpiresAt', addSecondsToCurrentTimeUnix(data.expiresIn));\n return data.accessToken;\n } else {\n throw(new Error(\"Error: unable to get access token\"));\n }\n\n } catch (error) {\n console.error('Error refreshing access token:', error);\n return null;\n }\n };\n\n const login = () => {\n\n const baseUrl = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize';\n const clientId = process.env.REACT_APP_MSAL_API_CLIENT_ID;\n const responseType = 'code';\n const redirectUri = `${ConfigService.config.UNITY_URL}/aad_redirect`;\n const responseMode = 'query';\n const scope = [\n 'https://graph.microsoft.com/Calendars.ReadWrite',\n 'https://graph.microsoft.com/Calendars.ReadWrite.Shared',\n 'https://graph.microsoft.com/OnlineMeetingTranscript.Read.All',\n 'https://graph.microsoft.com/OnlineMeetings.Read',\n ].join('%20'); // Join scopes with URL-encoded space\n\n const authUrl = `${baseUrl}?client_id=${clientId}&response_type=${responseType}&redirect_uri=${redirectUri}&response_mode=${responseMode}&scope=${scope}&state=${callbackUri}`;\n openLoginPopup(authUrl)\n // window.location.href = authUrl;\n }\n\n\n function openLoginPopup(url) {\n var width = 600;\n var height = 600;\n var left = (screen.width - width) / 2;\n var top = (screen.height - height) / 2;\n var features = `width=${width},height=${height},top=${top},left=${left},status=no,toolbar=no,menubar=no,location=no`;\n\n var popup = window.open(url, 'LoginPopup', features);\n return popup;\n }\n function addSecondsToCurrentTimeUnix(seconds) {\n var now = new Date();\n now.setSeconds(now.getSeconds() + seconds);\n return now.getTime();\n }\n\n function isBeforeCurrentTime(unixTime) {\n var now = new Date().getTime();\n return unixTime < now;\n }\n\n const isUserSignedIn = () => {\n const accessToken = localStorage.getItem('outlookAccessToken');\n const refreshToken = localStorage.getItem('outlookRefreshToken');\n const expiresAt = localStorage.getItem('outlookExpiresAt');\n if (accessToken && refreshToken && expiresAt && !isBeforeCurrentTime(expiresAt)) {\n return true;\n } else {\n return false;\n }\n }\n\n useEffect(() => {\n const handleStorageChange = (event) => {\n if (event.key === 'outlookAccessToken') {\n onLogin();\n }\n };\n\n window.addEventListener('storage', handleStorageChange);\n\n // Clean up the event listener\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n };\n }, []);\n return {getAccessToken, invalidateUserSession, login, isUserSignedIn};\n}\n","import { useUser } from '../utilities/auth/useUser';\n\nexport const useProductVersion = (productId) => {\n const user = useUser();\n\n const matchingProduct = user?.products?.find(\n (product) => product?.productId === productId\n );\n\n return matchingProduct?.currentProductVersionId || '';\n};\n","import React, { useMemo } from 'react'\nimport {DateTime} from 'luxon'\n\n// TODO: tie in datetime config at the user or tenant level\n\nexport interface UseDateLocaleReturn {\n convertISOStringToLocalDateTime: (date: string) => string | null;\n convertISOStringToLocalDate: (date: string) => string | null;\n getISODate: () => string;\n}\n\nexport const useDateLocale = (\n datetimeFormatOptions : Intl.DateTimeFormatOptions | null = null,\n locale: string | null = null\n): UseDateLocaleReturn => {\n\n const dateTimeOptions: Intl.DateTimeFormatOptions = useMemo(() => (datetimeFormatOptions ?? {\n timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n hour12: true,\n }), [datetimeFormatOptions]);\n\n const localeString: string = useMemo(() => locale ?? navigator.language,[locale]);\n\n const convertISOStringToLocalDateTime = (date: string): string | null => {\n const luxonDateTime = DateTime.fromISO(date, {zone: 'utc'});\n luxonDateTime.setZone(dateTimeOptions.timeZone);\n\n luxonDateTime.setLocale(localeString);\n\n if(!luxonDateTime.isValid)\n {\n return null;\n }\n return luxonDateTime.toLocaleString(dateTimeOptions);\n\n }\n\n const convertISOStringToLocalDate = (date: string): string | null => {\n const luxonDateTime = DateTime.fromISO(date);\n luxonDateTime.setZone(dateTimeOptions.timeZone);\n\n luxonDateTime.setLocale(localeString);\n if(!luxonDateTime.isValid)\n {\n return null;\n }\n const { hour, minute, ...dateOptions} = dateTimeOptions;\n return luxonDateTime.toLocaleString(dateOptions);\n }\n\n const getISODate = ():string => {\n return DateTime.now().toISO({includeOffset:true, suppressMilliseconds: true})\n }\n\n return {\n convertISOStringToLocalDateTime: convertISOStringToLocalDateTime,\n convertISOStringToLocalDate: convertISOStringToLocalDate,\n getISODate: getISODate\n };\n}\n","import { useCallback } from 'react';\nimport { useWorkflowStore } from '../stores/workflowStore';\n\nexport const useWorkflow = () => {\n const { updateTaskDataMap } = useWorkflowStore();\n\n const setWorkflowTaskPageData = useCallback(\n (taskId, pageId, data) => {\n updateTaskDataMap(taskId, pageId, data);\n },\n [updateTaskDataMap]\n );\n\n return {\n setWorkflowTaskPageData\n };\n};\n","import { useEffect, useState, useCallback, useRef } from 'react';\nimport { useUser } from '../utilities/auth/useUser';\nimport { ConfigService } from '../configService';\nimport { useAxiosGet } from '../utilities/useAxiosGet';\nimport {useShellStore} from '../stores/shellStore';\n\n// Global cache to store preloaded modules (persists across component re-renders)\n// This prevents re-fetching modules when navigating to pages\nconst preloadedModulesCache = new Map();\n\n/**\n * Custom hook to preload all pages for a product.\n * This eliminates sequential server calls when navigating to /page/<id>\n * by fetching all page metadata in a single API call on mount.\n * After fetching metadata, it preloads the actual widget modules in the background.\n *\n * @param {Function} getWidget - Function to load widget modules\n * @returns {Object} - { pages, loading, error, refetch, preloadingWidgets }\n */\nexport const usePreloadPages = () => {\n const user = useUser();\n const [preloadingWidgets, setPreloadingWidgets] = useState(false);\n const [preloadedWidgets, setPreloadedWidgets] = useState(new Set());\n const { getWidget } = useShellStore();\n const preloadingRef = useRef(false); // Prevent duplicate preloading\n\n\n // Build the query parameters for the pages endpoint\n const queryParams = `page/product/${ConfigService.config.UNITY_PRODUCT_ID}?includeUdpPages=true`;\n\n // Fetch pages data - manual is true if user is not available\n const [{ data: pages, loading, error }, refetch] = useAxiosGet(\n ConfigService.tenantV1ApiUrl,\n queryParams,\n {},\n !!!user?.id || !!!user?.currentTenantId, // Skip if user info not available\n false // Don't use cache for fresh data\n );\n\n // Preload widget modules in the background after pages are fetched\n useEffect(() => {\n if (!pages || pages.length === 0 || !getWidget || preloadingRef.current) {\n return;\n }\n\n // Background preloading function\n const preloadWidgets = async () => {\n preloadingRef.current = true;\n setPreloadingWidgets(true);\n\n // Collect all unique widget types from all pages\n const widgetTypes = new Set();\n\n for (const page of pages) {\n try {\n // Parse the widgets field which contains JSON string\n if (page.widgets) {\n // The widgets field is a JSON object where the key is the pageId\n // and the value is a JSON string containing an array of widgets\n const widgetsObj = JSON.parse(page.widgets);\n const widgetsJson = widgetsObj[page.pageId];\n\n if (widgetsJson) {\n const widgetsList = JSON.parse(widgetsJson);\n\n // Extract widget types from the array\n if (Array.isArray(widgetsList)) {\n widgetsList.forEach(widget => {\n if (widget.widgetType && widget.widgetType !== '0') {\n widgetTypes.add(widget.widgetType);\n }\n });\n }\n }\n }\n } catch (error) {\n console.warn(`Failed to parse widgets for page ${page.name || page.pageId}:`, error);\n }\n }\n\n // Iterate through unique widget types and preload each module\n for (const widgetType of widgetTypes) {\n // Skip if already preloaded or no valid widget type\n if (!widgetType || preloadedWidgets.has(widgetType) || preloadedModulesCache.has(widgetType)) {\n continue;\n }\n\n try {\n // Call getWidget in the background to preload the module\n const lazyComponent = await getWidget(widgetType);\n\n // If it's a React.lazy component, we need to resolve its internal promise\n // React.lazy components have a _payload that stores the loading state\n if (lazyComponent && typeof lazyComponent === 'object' && lazyComponent._payload) {\n const payload = lazyComponent._payload;\n\n // Check if the payload is still pending (status: -1 = pending, 0 = error, 1 = success)\n if (payload._status === undefined || payload._status === -1) {\n // The module hasn't been loaded yet - trigger the import\n if (typeof payload._result === 'function') {\n // _result is the import() function - call it\n try {\n const module = await payload._result();\n // Update the lazy component's internal state\n payload._status = 1; // Success\n payload._result = module;\n console.log(widgetType, module);\n preloadedModulesCache.set(widgetType, module);\n console.log(`✓ Preloaded and cached: ${widgetType}`);\n } catch (err) {\n payload._status = 0; // Error\n payload._result = err;\n throw err;\n }\n }\n } else if (payload._status === 1) {\n // Already loaded - just cache it\n preloadedModulesCache.set(widgetType, payload._result);\n console.log(`✓ Already loaded: ${widgetType}`);\n }\n }\n\n // Mark as preloaded\n setPreloadedWidgets((prev) => new Set([...prev, widgetType]));\n } catch (error) {\n // Silently fail - don't want to block or show errors for background preloading\n console.warn(`✗ Failed to preload widget: ${widgetType}`, error);\n }\n }\n\n setPreloadingWidgets(false);\n };\n\n // Run preloading in background without blocking\n preloadWidgets();\n }, [pages, getWidget, preloadedWidgets]);\n\n /**\n * Helper function to find a page by ID from the preloaded pages\n * @param {string} pageId - The page ID to search for\n * @returns {Object|undefined} - The page object if found\n */\n const getPageById = useCallback(\n (pageId) => {\n if (!pages || !Array.isArray(pages)) return undefined;\n return pages.find((page) => page.pageId === pageId || page.id === pageId);\n },\n [pages]\n );\n\n /**\n * Helper function to check if a page name is valid (exists in preloaded pages)\n * @param {string} pageName - The page name to check\n * @returns {boolean} - True if the page name exists\n */\n const isValidPageName = useCallback(\n (pageName) => {\n if (!pages || !Array.isArray(pages)) return false;\n return pages.some(\n (page) => page.name === pageName || page.componentName === pageName\n );\n },\n [pages]\n );\n\n /**\n * Check if a module has been preloaded and cached\n * @param {string} pageName - The page/widget name\n * @returns {boolean} - True if the module is cached\n */\n const isModulePreloaded = useCallback(\n (pageName) => preloadedModulesCache.has(pageName),\n []\n );\n\n /**\n * Get a preloaded module from cache (if available)\n * @param {string} pageName - The page/widget name\n * @returns {Object|undefined} - The cached module or undefined\n */\n const getPreloadedModule = useCallback(\n (pageName) => preloadedModulesCache.get(pageName),\n []\n );\n\n return {\n pages,\n loading,\n error,\n refetch,\n getPageById,\n isValidPageName,\n preloadingWidgets,\n preloadedCount: preloadedWidgets.size,\n isModulePreloaded,\n getPreloadedModule,\n // Expose the cache for debugging\n _cache: preloadedModulesCache\n };\n};\n"],"mappings":";;;;;;;;;;AAIA,MAAa,cAAc,aAAa,YAAY;CAEhD,MAAM,wBAAwB,YAAY;AAsBlC,MAAI;AACA,gBAAa,WAAW,qBAAqB;WACtC,OAAO;AACd,WAAQ,MAAM,+BAA+B,MAAM;;AAGrD,MAAI;AACF,gBAAa,WAAW,sBAAsB;WACvC,OAAO;AACd,WAAQ,MAAM,gCAAgC,MAAM;;AAGtD,MAAI;AACF,gBAAa,WAAW,mBAAmB;WACpC,OAAO;AACd,WAAQ,MAAM,6BAA6B,MAAM;;;CAM7D,MAAM,iBAAiB,YAAY;EAC/B,IAAI,cAAc,aAAa,QAAQ,qBAAqB;AAE5D,MAAI,CAAC,YACD,uBAAM,IAAI,MAAM,wBAAwB;EAG5C,MAAM,YAAY,aAAa,QAAQ,mBAAmB;AAC1D,MAAI,aAAa,CAAC,oBAAoB,UAAU,CAC5C,QAAO;EAGX,MAAM,eAAe,aAAa,QAAQ,sBAAsB;AAChE,MAAI,CAAC,aACD,uBAAM,IAAI,MAAM,yBAAyB;AAG7C,MAAI;AACA,OAAI,cAAc,wBAAwB,OACtC,OAAM,IAAI,MAAM,iDAAiD;GAcrE,MAAM,QAZW,MAAM,UACnB,cAAc,qBACd,gDACA;IACI,QAAQ;IACR,MAAM;KACF,QAAQ;KACR,OAAO;KACP,aAAa,cAAc,OAAO,YAAY;KACjD;IACJ,CACJ,EACqB;AACtB,OAAI,KAAK,eAAe,QAAQ,KAAK,gBAAgB,QAAQ,KAAK,aAAa,MAAM;AACnF,iBAAa,QAAQ,sBAAsB,KAA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EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAAgB,iBAAiB;EACjC;EACA;EAEA,QAAQ;EACT"}
package/dist/index.js CHANGED
@@ -246,7 +246,7 @@ import { t as ClientSideUdpGrid } from "./ClientSideUdpGrid-D5fGumO-.js";
246
246
  import { t as TrimForAvatar } from "./TrimForAvatar-BmM2bU6E.js";
247
247
  import { i as FluentMenuListButton, n as FluentCompoundButton, r as FluentUploadButton, t as FluentUploadIconButton } from "./buttons-CuLiERQe.js";
248
248
  import { t as AmbientToggleButtonGroup } from "./AmbientToggleButtonGroup-Bi9yW5gC.js";
249
- import { n as UdpTransactionsPage_default } from "./UdpTransactionsPage-CDyNjmyo.js";
249
+ import { n as UdpTransactionsPage_default } from "./UdpTransactionsPage-B1Ia9x62.js";
250
250
  import { t as AccountFlags } from "./status-moefSFBs.js";
251
251
  import { n as FormHeader, r as FormSubHeader, t as StylizedTitle } from "./typography-CvW7cAl8.js";
252
252
  import { t as Attachments } from "./uploader-YWjDebFN.js";
@@ -1 +1 @@
1
- {"version":3,"file":"lookupsStore-DPI8oD9R.js","names":["useLookupsStore: () => LookupsState"],"sources":["../src/stores/lookupsStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\n\ninterface LookupsState {\n lookupApiMethodId: string | null | undefined;\n setLookupApiMethodId: (apiMethodId: string) => void;\n lookupsDataMap: Object | null | undefined;\n setLookupsDataMap: (\n lookupsDataMap: Object,\n replace: boolean | null | undefined\n ) => void;\n}\n\nexport const useLookupsStore: () => LookupsState = create<LookupsState>()(\n devtools((set) => ({\n lookupApiMethodId: '',\n setLookupApiMethodId: (apiMethodId) =>\n set((state) => ({ lookupApiMethodId: apiMethodId })),\n lookupsDataMap: null,\n setLookupsDataMap: (lookupsDataMap, replace = false) => {\n if (replace) {\n set((state) => ({\n lookupsDataMap: lookupsDataMap\n }));\n } else {\n set((state) => ({\n lookupsDataMap: { ...state.lookupsDataMap, ...lookupsDataMap }\n }));\n }\n }\n }))\n);\n"],"mappings":";;;;AAaA,MAAaA,kBAAsC,QAAsB,CACvE,UAAU,SAAS;CACjB,mBAAmB;CACnB,uBAAuB,gBACrB,KAAK,WAAW,EAAE,mBAAmB,aAAa,EAAE;CACtD,gBAAgB;CAChB,oBAAoB,gBAAgB,UAAU,UAAU;AACtD,MAAI,QACF,MAAK,WAAW,EACE,gBACjB,EAAE;MAEH,MAAK,WAAW,EACd,gBAAgB;GAAE,GAAG,MAAM;GAAgB,GAAG;GAAgB,EAC/D,EAAE;;CAGR,EAAE,CACJ"}
1
+ {"version":3,"file":"lookupsStore-DPI8oD9R.js","names":[],"sources":["../src/stores/lookupsStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\n\ninterface LookupsState {\n lookupApiMethodId: string | null | undefined;\n setLookupApiMethodId: (apiMethodId: string) => void;\n lookupsDataMap: Object | null | undefined;\n setLookupsDataMap: (\n lookupsDataMap: Object,\n replace: boolean | null | undefined\n ) => void;\n}\n\nexport const useLookupsStore: () => LookupsState = create<LookupsState>()(\n devtools((set) => ({\n lookupApiMethodId: '',\n setLookupApiMethodId: (apiMethodId) =>\n set((state) => ({ lookupApiMethodId: apiMethodId })),\n lookupsDataMap: null,\n setLookupsDataMap: (lookupsDataMap, replace = false) => {\n if (replace) {\n set((state) => ({\n lookupsDataMap: lookupsDataMap\n }));\n } else {\n set((state) => ({\n lookupsDataMap: { ...state.lookupsDataMap, ...lookupsDataMap }\n }));\n }\n }\n }))\n);\n"],"mappings":";;;;AAaA,MAAa,kBAAsC,QAAsB,CACvE,UAAU,SAAS;CACjB,mBAAmB;CACnB,uBAAuB,gBACrB,KAAK,WAAW,EAAE,mBAAmB,aAAa,EAAE;CACtD,gBAAgB;CAChB,oBAAoB,gBAAgB,UAAU,UAAU;AACtD,MAAI,QACF,MAAK,WAAW,EACE,gBACjB,EAAE;MAEH,MAAK,WAAW,EACd,gBAAgB;GAAE,GAAG,MAAM;GAAgB,GAAG;GAAgB,EAC/D,EAAE;;CAGR,EAAE,CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"maps-BgmvNpkU.js","names":["UdpMap: React.FC<UdpMapProps>","Map"],"sources":["../src/UI/maps/UdpMap.tsx"],"sourcesContent":["import React from 'react';\nimport { UdpMap as Map } from 'udp-react-stencil-component-library';\n\nexport interface UdpMapProps {\n /* Enables the toolbar */\n enableToolbar?: boolean;\n\n /* Title appearing on map */\n mapTitle?: string;\n\n /* Feature data (in either Geo-JSON format or not). Geo-JSON format: [{ type: string, id: string, geometry: { type: 'Point' | 'LineString' | 'Polygon', coordinates: Coordinate }, properties: any }] */\n data?: any[];\n\n /* Boolean stating if the data is in Geo-JSON format */\n isGeoJsonFormat?: boolean;\n\n /* Method - If data is not in Geo-JSON format, returns data in Geo-JSON format */\n geoJsonMappingConfig?: any;\n\n /* Allows zoom */\n enableZoom?: boolean;\n\n /* Default map zoom */\n mapZoom?: number;\n\n /* Default map center */\n mapCenter?: any;\n\n /* Map height */\n mapHeight?: string;\n\n /* Coordinate reference system used */\n crs?: any;\n\n /* Map feature projection used */\n mapProjection?: string;\n\n /* Map data projection used */\n mapDataProjection?: string;\n\n /* Method - Custom filter for map features */\n getFilteredMapData?: any;\n\n /* Method - Returns custom styles for features */\n getFeatureStyles?: any;\n\n /* Method - Returns custom styles for selected features */\n getSelectedFeatureStyles?: any;\n\n /* Custom filter panel */\n filterPanel?: string;\n\n /* Method - Callback to filter features from custom filter panel */\n filterPanelCallback?: any;\n\n /* Allows selecting tile layer */\n enableTileSelection?: boolean;\n\n /* List of tile layers visible on the map */\n tileLayersOptions?: any[];\n\n /* Default tile layer name */\n defaultTileOptionName?: string;\n\n /* List of options for vector layers */\n layerOptions?: any[];\n\n /* Vector layers selected in the layer filter on initial map load */\n initialSelectedLayers?: any[];\n\n /* Callback to return layers that are selected */\n handleSelectLayersCallback: any;\n\n /* Custom action panel for selected features */\n bulkSelectedFeaturesActionPanel?: string;\n\n /* Method - Retrieves selected features when bulk selected */\n handleSetSelectedFeaturesOnBulkSelect: any;\n\n /* Method - Retrieves selected feature when individually selected */\n handleSetSelectedFeatureOnSelect: any;\n\n /* Enables filtering layers by role */\n filterLayersByRole: boolean;\n\n /* Layer keys to get the current feature layer when adding layers with features to the map */\n layerKeys?: string[];\n\n /* Layer key separator to get the current feature layer when adding layers with features to the map */\n layerKeySeparator?: string;\n\n /* Authenticated user from Unity - used to filter layers by role */\n user?: any;\n\n /* Layers assigned to roles */\n layerRoles?: any;\n\n /* Callback method to refresh map */\n handleRefresh?: any;\n\n /* Custom tooltip message on refresh button */\n refreshButtonTooltip?: string;\n\n /* Map is read-only (setting true removes the add, edit, delete functionality) */\n readOnlyMap: boolean;\n\n /* Enables adding a new feature by drawing on the map */\n enableAdd: boolean;\n\n /* When adding features on the map by drawing, this callback method returns the newly added features */\n handleAddNewFeatures: any;\n\n /* When adding features by drawing, add multiple features */\n addMultipleFeatures: boolean;\n\n /* Enables splitting line strings on the map */\n enableSplitFeature: boolean;\n\n /* Callback function to return split feature */\n handleSplitFeature: any;\n\n /* Enables viewing a selected feature */\n enableViewFeature: boolean;\n\n /* Method to enable viewing a selected feature */\n handleViewFeature: any;\n\n /* Enables deleting a selected feature */\n enableDeleteFeature: boolean;\n\n /* Callback method to handle deleting a selected feature */\n handleDeleteFeature?: any;\n\n /* Enables editing a selected feature */\n enableEditFeature: boolean;\n\n /* Callback method to handle editing a selected feature */\n handleEditFeature?: any;\n\n /* Callback method to return map zoom and extent when the resolution changes */\n handleGetZoomExtent?: any;\n\n /* Configuration object for customizing the popover card's appearance or behavior */\n cardConfig?: any;\n\n /* Array of primary action configurations for the popover (e.g., buttons) */\n popoverPrimaryActions?: { id?: string; name: string; iconName: string; onClick: (data: any) => void }[];\n\n /* Array of additional actions for the popover's \"more\" icon button (e.g., menu items) */\n popoverMoreIconButtonActions?: { id?: string; name: string; iconName: string; onClick: (data: any) => void }[];\n\n /* Function to get the message text to display in the popover, based on feature data */\n getMessagePopover?: (data: any) => string;\n\n /* Function to get the icon to display in the popover, based on feature data */\n getMessageIconPopover?: (data: any) => any;\n\n /* Boolean to control whether the message icon in the popover should be hidden */\n hideMessageIconPopover?: boolean;\n\n /* List of layers that are read only */\n readOnlyLayers?: string[];\n\n minZoom?: number;\n maxZoom?: number\n}\n\nexport const UdpMap: React.FC<UdpMapProps> = (props: UdpMapProps) => {\n return <Map {...props} />;\n};\n"],"mappings":";;;;AAuKA,MAAaA,YAAiC,UAAuB;AACnE,QAAO,oCAACC,QAAQ,MAAS"}
1
+ {"version":3,"file":"maps-BgmvNpkU.js","names":["UdpMap","Map"],"sources":["../src/UI/maps/UdpMap.tsx"],"sourcesContent":["import React from 'react';\nimport { UdpMap as Map } from 'udp-react-stencil-component-library';\n\nexport interface UdpMapProps {\n /* Enables the toolbar */\n enableToolbar?: boolean;\n\n /* Title appearing on map */\n mapTitle?: string;\n\n /* Feature data (in either Geo-JSON format or not). Geo-JSON format: [{ type: string, id: string, geometry: { type: 'Point' | 'LineString' | 'Polygon', coordinates: Coordinate }, properties: any }] */\n data?: any[];\n\n /* Boolean stating if the data is in Geo-JSON format */\n isGeoJsonFormat?: boolean;\n\n /* Method - If data is not in Geo-JSON format, returns data in Geo-JSON format */\n geoJsonMappingConfig?: any;\n\n /* Allows zoom */\n enableZoom?: boolean;\n\n /* Default map zoom */\n mapZoom?: number;\n\n /* Default map center */\n mapCenter?: any;\n\n /* Map height */\n mapHeight?: string;\n\n /* Coordinate reference system used */\n crs?: any;\n\n /* Map feature projection used */\n mapProjection?: string;\n\n /* Map data projection used */\n mapDataProjection?: string;\n\n /* Method - Custom filter for map features */\n getFilteredMapData?: any;\n\n /* Method - Returns custom styles for features */\n getFeatureStyles?: any;\n\n /* Method - Returns custom styles for selected features */\n getSelectedFeatureStyles?: any;\n\n /* Custom filter panel */\n filterPanel?: string;\n\n /* Method - Callback to filter features from custom filter panel */\n filterPanelCallback?: any;\n\n /* Allows selecting tile layer */\n enableTileSelection?: boolean;\n\n /* List of tile layers visible on the map */\n tileLayersOptions?: any[];\n\n /* Default tile layer name */\n defaultTileOptionName?: string;\n\n /* List of options for vector layers */\n layerOptions?: any[];\n\n /* Vector layers selected in the layer filter on initial map load */\n initialSelectedLayers?: any[];\n\n /* Callback to return layers that are selected */\n handleSelectLayersCallback: any;\n\n /* Custom action panel for selected features */\n bulkSelectedFeaturesActionPanel?: string;\n\n /* Method - Retrieves selected features when bulk selected */\n handleSetSelectedFeaturesOnBulkSelect: any;\n\n /* Method - Retrieves selected feature when individually selected */\n handleSetSelectedFeatureOnSelect: any;\n\n /* Enables filtering layers by role */\n filterLayersByRole: boolean;\n\n /* Layer keys to get the current feature layer when adding layers with features to the map */\n layerKeys?: string[];\n\n /* Layer key separator to get the current feature layer when adding layers with features to the map */\n layerKeySeparator?: string;\n\n /* Authenticated user from Unity - used to filter layers by role */\n user?: any;\n\n /* Layers assigned to roles */\n layerRoles?: any;\n\n /* Callback method to refresh map */\n handleRefresh?: any;\n\n /* Custom tooltip message on refresh button */\n refreshButtonTooltip?: string;\n\n /* Map is read-only (setting true removes the add, edit, delete functionality) */\n readOnlyMap: boolean;\n\n /* Enables adding a new feature by drawing on the map */\n enableAdd: boolean;\n\n /* When adding features on the map by drawing, this callback method returns the newly added features */\n handleAddNewFeatures: any;\n\n /* When adding features by drawing, add multiple features */\n addMultipleFeatures: boolean;\n\n /* Enables splitting line strings on the map */\n enableSplitFeature: boolean;\n\n /* Callback function to return split feature */\n handleSplitFeature: any;\n\n /* Enables viewing a selected feature */\n enableViewFeature: boolean;\n\n /* Method to enable viewing a selected feature */\n handleViewFeature: any;\n\n /* Enables deleting a selected feature */\n enableDeleteFeature: boolean;\n\n /* Callback method to handle deleting a selected feature */\n handleDeleteFeature?: any;\n\n /* Enables editing a selected feature */\n enableEditFeature: boolean;\n\n /* Callback method to handle editing a selected feature */\n handleEditFeature?: any;\n\n /* Callback method to return map zoom and extent when the resolution changes */\n handleGetZoomExtent?: any;\n\n /* Configuration object for customizing the popover card's appearance or behavior */\n cardConfig?: any;\n\n /* Array of primary action configurations for the popover (e.g., buttons) */\n popoverPrimaryActions?: { id?: string; name: string; iconName: string; onClick: (data: any) => void }[];\n\n /* Array of additional actions for the popover's \"more\" icon button (e.g., menu items) */\n popoverMoreIconButtonActions?: { id?: string; name: string; iconName: string; onClick: (data: any) => void }[];\n\n /* Function to get the message text to display in the popover, based on feature data */\n getMessagePopover?: (data: any) => string;\n\n /* Function to get the icon to display in the popover, based on feature data */\n getMessageIconPopover?: (data: any) => any;\n\n /* Boolean to control whether the message icon in the popover should be hidden */\n hideMessageIconPopover?: boolean;\n\n /* List of layers that are read only */\n readOnlyLayers?: string[];\n\n minZoom?: number;\n maxZoom?: number\n}\n\nexport const UdpMap: React.FC<UdpMapProps> = (props: UdpMapProps) => {\n return <Map {...props} />;\n};\n"],"mappings":";;;;AAuKA,MAAaA,YAAiC,UAAuB;AACnE,QAAO,oCAACC,QAAQ,MAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"newGrid-zmtQXU5G.js","names":["EntityMaintenanceUdpGrid: React.FC<any>","searchObject"],"sources":["../src/UI/templates/newGrid/EntityMaintenanceUdpGrid.tsx","../src/UI/templates/newGrid/BackwardsCompatibleGrid.jsx","../src/UI/templates/newGrid/ApiMethodInstanceUdpGrid.jsx","../src/UI/templates/newGrid/ServerSideUdpGrid.jsx"],"sourcesContent":["import React from 'react'\nimport { EntityMaintenanceGrid } from 'udp-react-stencil-component-library'\n\nexport const EntityMaintenanceUdpGrid: React.FC<any> = (props) => {\n\n return (\n <div >\n <EntityMaintenanceGrid {...props}/>\n </div>\n )\n}\n","import React, {\n useMemo,\n useState,\n useRef,\n forwardRef,\n useImperativeHandle\n} from 'react';\nimport { ApiMethodInstanceGrid } from 'udp-react-stencil-component-library';\nimport { useUdpExport } from '../../../udp/export/useUdpExport';\nimport { ExportSidesheet } from '../../../udp/export/ExportSidesheet';\n\n/*\n * This grid is intended to be a temporary drop in replacement for ambient-template-grid.\n * Do not use it unless you were using the old grid, this will not be further supported and is worse on performance than the other new grids.\n */\n\nexport const BackwardsCompatibleGrid = forwardRef((props, ref) => {\n const {\n gridBarTitle,\n queryId,\n gridId,\n primaryActionOnClick,\n primaryActionLabel,\n primaryActionIcon,\n defaultSearchObject,\n renderConfigs,\n disableGridPersistance,\n enableCheckboxOnColumns,\n gridHeight\n } = props;\n\n const [exportSidesheetOpen, setExportSidesheetOpen] = useState(false);\n const gridApiRef = useRef(null);\n\n //Convert the filter Elements passed in to a search object\n const fullDefaultSearchObject = useMemo(() => {\n return {\n filterElements: defaultSearchObject,\n logicalSearchOperator: 1\n };\n }, [defaultSearchObject]);\n\n //Convert renderConfigs to columnOverrides\n const columnOverrides = useMemo(() => {\n const initialColumns = renderConfigs;\n\n return initialColumns.map((col) => {\n // Use destructuring to separate 'rendererName' from the rest of the properties.\n const { rendererName, ...rest } = col;\n\n // Start building the new object, renaming rendererName if it exists.\n const newCol = {\n ...rest,\n ...(rendererName && { cellRenderer: rendererName })\n };\n\n return newCol;\n });\n }, [renderConfigs]);\n\n const sizedIcon = useMemo(() => {\n if (primaryActionIcon === 'add32') {\n return 'add';\n }\n }, [primaryActionIcon]);\n\n //export functions\n\n const {\n updateExportParameters,\n createExport,\n entity,\n searchObject,\n fileFormat,\n numRowsToExport,\n validSearch,\n errorList,\n activeExportJob,\n exportLoading,\n handleFileDownload,\n clearParameters\n } = useUdpExport();\n\n const exportFromGrid = (searchObject, entityName) => {\n if (searchObject && entityName) {\n updateExportParameters(entityName, searchObject);\n setExportSidesheetOpen(true);\n } else {\n console.error('Failed to retrieve searchObject or entityName from grid');\n }\n };\n\n const handleCloseExportSidesheet = () => {\n setExportSidesheetOpen(false);\n clearParameters();\n };\n\n useImperativeHandle(ref, () => ({\n //hooks for the parent to call these functions\n refreshOnNoResults: () => gridApiRef.current?.refreshServerSide(),\n getSelectedRows: () => gridApiRef.current?.getSelectedRows()\n }));\n\n const handleGridApiCallback = (api) => {\n gridApiRef.current = api;\n };\n\n return (\n <div>\n <ExportSidesheet\n entity={entity}\n searchObject={searchObject}\n fileFormat={fileFormat}\n numRowsToExport={numRowsToExport}\n errorList={errorList}\n activeExportJob={activeExportJob}\n handleFileDownload={handleFileDownload}\n exportSidesheetOpen={exportSidesheetOpen}\n handleCloseExportSidesheet={handleCloseExportSidesheet}\n createExport={createExport}\n exportLoading={exportLoading}\n validSearch={validSearch}\n />\n <ApiMethodInstanceGrid\n apiMethodInstanceId={queryId}\n gridId={gridId}\n defaultSearchObject={fullDefaultSearchObject}\n columnDefOverrides={columnOverrides}\n gridHeight={gridHeight}\n gridOptions={{\n pagination: true,\n rowSelection: enableCheckboxOnColumns && {\n mode: 'multiRow',\n enableClickSelection: true,\n headerCheckbox: false\n }\n }}\n gridHeaderConfig={{\n title: gridBarTitle,\n primaryActionButton: {\n label: primaryActionLabel,\n iconName: sizedIcon,\n onClick: primaryActionOnClick\n }\n }}\n gridFunctions={[\n { name: 'agGridExport' },\n { name: 'openSavedViews' },\n { name: 'agGridSizeColumnsToFit' },\n { name: 'agGridAutoSizeColumns' },\n !disableGridPersistance && { name: 'restoreGridState' },\n { name: 'agGridHideShowColumns' },\n { name: 'agGridResetColumns' },\n {\n name: 'udpExport',\n params: {\n callback: (searchObject, entityName) =>\n exportFromGrid(searchObject, entityName)\n }\n }\n ]}\n gridApiCallback={handleGridApiCallback}\n />\n </div>\n );\n});\n\nBackwardsCompatibleGrid.displayName = 'BackwardsCompatibleGrid';\n","import React from 'react'\nimport { ApiMethodInstanceGrid } from 'udp-react-stencil-component-library'\n\nexport const ApiMethodInstanceUdpGrid = (props) => {\n\n return (\n <div >\n <ApiMethodInstanceGrid {...props}/>\n </div>\n )\n}\n","import React from 'react'\nimport { ServerSideGrid } from 'udp-react-stencil-component-library'\n\nexport const ServerSideUdpGrid = (props) => {\n\n return (\n <div >\n <ServerSideGrid {...props}/>\n </div>\n )\n}\n"],"mappings":";;;;;AAGA,MAAaA,4BAA2C,UAAU;AAEhE,QACC,oCAAC,aACE,oC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AAc,2BAA2B;IACvC,MAAM;IACN,sBAAsB;IACtB,gBAAgB;IACjB;GACF;EACD,kBAAkB;GAChB,OAAO;GACP,qBAAqB;IACnB,OAAO;IACP,UAAU;IACV,SAAS;IACV;GACF;EACD,eAAe;GACb,EAAE,MAAM,gBAAgB;GACxB,EAAE,MAAM,kBAAkB;GAC1B,EAAE,MAAM,0BAA0B;GAClC,EAAE,MAAM,yBAAyB;GACjC,CAAC,0BAA0B,EAAE,MAAM,oBAAoB;GACvD,EAAE,MAAM,yBAAyB;GACjC,EAAE,MAAM,sBAAsB;GAC9B;IACE,MAAM;IACN,QAAQ,EACN,WAAW,gBAAc,eACvB,eAAeA,gBAAc,WAAW,EAC3C;IACF;GACF;EACD,iBAAiB;GACjB,CACE;EAER;AAEF,wBAAwB,cAAc;;;;ACpKtC,MAAa,4BAA4B,UAAU;AAEjD,QACC,oCAAC,aACE,oCAAC,uBAA0B,MAAQ,CAChC;;;;;ACLT,MAAa,qBAAqB,UAAU;AAE1C,QACC,oCAAC,aACE,oCAAC,gBAAmB,MAAQ,CACzB"}
1
+ {"version":3,"file":"newGrid-zmtQXU5G.js","names":["searchObject"],"sources":["../src/UI/templates/newGrid/EntityMaintenanceUdpGrid.tsx","../src/UI/templates/newGrid/BackwardsCompatibleGrid.jsx","../src/UI/templates/newGrid/ApiMethodInstanceUdpGrid.jsx","../src/UI/templates/newGrid/ServerSideUdpGrid.jsx"],"sourcesContent":["import React from 'react'\nimport { EntityMaintenanceGrid } from 'udp-react-stencil-component-library'\n\nexport const EntityMaintenanceUdpGrid: React.FC<any> = (props) => {\n\n return (\n <div >\n <EntityMaintenanceGrid {...props}/>\n </div>\n )\n}\n","import React, {\n useMemo,\n useState,\n useRef,\n forwardRef,\n useImperativeHandle\n} from 'react';\nimport { ApiMethodInstanceGrid } from 'udp-react-stencil-component-library';\nimport { useUdpExport } from '../../../udp/export/useUdpExport';\nimport { ExportSidesheet } from '../../../udp/export/ExportSidesheet';\n\n/*\n * This grid is intended to be a temporary drop in replacement for ambient-template-grid.\n * Do not use it unless you were using the old grid, this will not be further supported and is worse on performance than the other new grids.\n */\n\nexport const BackwardsCompatibleGrid = forwardRef((props, ref) => {\n const {\n gridBarTitle,\n queryId,\n gridId,\n primaryActionOnClick,\n primaryActionLabel,\n primaryActionIcon,\n defaultSearchObject,\n renderConfigs,\n disableGridPersistance,\n enableCheckboxOnColumns,\n gridHeight\n } = props;\n\n const [exportSidesheetOpen, setExportSidesheetOpen] = useState(false);\n const gridApiRef = useRef(null);\n\n //Convert the filter Elements passed in to a search object\n const fullDefaultSearchObject = useMemo(() => {\n return {\n filterElements: defaultSearchObject,\n logicalSearchOperator: 1\n };\n }, [defaultSearchObject]);\n\n //Convert renderConfigs to columnOverrides\n const columnOverrides = useMemo(() => {\n const initialColumns = renderConfigs;\n\n return initialColumns.map((col) => {\n // Use destructuring to separate 'rendererName' from the rest of the properties.\n const { rendererName, ...rest } = col;\n\n // Start building the new object, renaming rendererName if it exists.\n const newCol = {\n ...rest,\n ...(rendererName && { cellRenderer: rendererName })\n };\n\n return newCol;\n });\n }, [renderConfigs]);\n\n const sizedIcon = useMemo(() => {\n if (primaryActionIcon === 'add32') {\n return 'add';\n }\n }, [primaryActionIcon]);\n\n //export functions\n\n const {\n updateExportParameters,\n createExport,\n entity,\n searchObject,\n fileFormat,\n numRowsToExport,\n validSearch,\n errorList,\n activeExportJob,\n exportLoading,\n handleFileDownload,\n clearParameters\n } = useUdpExport();\n\n const exportFromGrid = (searchObject, entityName) => {\n if (searchObject && entityName) {\n updateExportParameters(entityName, searchObject);\n setExportSidesheetOpen(true);\n } else {\n console.error('Failed to retrieve searchObject or entityName from grid');\n }\n };\n\n const handleCloseExportSidesheet = () => {\n setExportSidesheetOpen(false);\n clearParameters();\n };\n\n useImperativeHandle(ref, () => ({\n //hooks for the parent to call these functions\n refreshOnNoResults: () => gridApiRef.current?.refreshServerSide(),\n getSelectedRows: () => gridApiRef.current?.getSelectedRows()\n }));\n\n const handleGridApiCallback = (api) => {\n gridApiRef.current = api;\n };\n\n return (\n <div>\n <ExportSidesheet\n entity={entity}\n searchObject={searchObject}\n fileFormat={fileFormat}\n numRowsToExport={numRowsToExport}\n errorList={errorList}\n activeExportJob={activeExportJob}\n handleFileDownload={handleFileDownload}\n exportSidesheetOpen={exportSidesheetOpen}\n handleCloseExportSidesheet={handleCloseExportSidesheet}\n createExport={createExport}\n exportLoading={exportLoading}\n validSearch={validSearch}\n />\n <ApiMethodInstanceGrid\n apiMethodInstanceId={queryId}\n gridId={gridId}\n defaultSearchObject={fullDefaultSearchObject}\n columnDefOverrides={columnOverrides}\n gridHeight={gridHeight}\n gridOptions={{\n pagination: true,\n rowSelection: enableCheckboxOnColumns && {\n mode: 'multiRow',\n enableClickSelection: true,\n headerCheckbox: false\n }\n }}\n gridHeaderConfig={{\n title: gridBarTitle,\n primaryActionButton: {\n label: primaryActionLabel,\n iconName: sizedIcon,\n onClick: primaryActionOnClick\n }\n }}\n gridFunctions={[\n { name: 'agGridExport' },\n { name: 'openSavedViews' },\n { name: 'agGridSizeColumnsToFit' },\n { name: 'agGridAutoSizeColumns' },\n !disableGridPersistance && { name: 'restoreGridState' },\n { name: 'agGridHideShowColumns' },\n { name: 'agGridResetColumns' },\n {\n name: 'udpExport',\n params: {\n callback: (searchObject, entityName) =>\n exportFromGrid(searchObject, entityName)\n }\n }\n ]}\n gridApiCallback={handleGridApiCallback}\n />\n </div>\n );\n});\n\nBackwardsCompatibleGrid.displayName = 'BackwardsCompatibleGrid';\n","import React from 'react'\nimport { ApiMethodInstanceGrid } from 'udp-react-stencil-component-library'\n\nexport const ApiMethodInstanceUdpGrid = (props) => {\n\n return (\n <div >\n <ApiMethodInstanceGrid {...props}/>\n </div>\n )\n}\n","import React from 'react'\nimport { ServerSideGrid } from 'udp-react-stencil-component-library'\n\nexport const ServerSideUdpGrid = (props) => {\n\n return (\n <div >\n <ServerSideGrid {...props}/>\n </div>\n )\n}\n"],"mappings":";;;;;AAGA,MAAa,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AAoB;EACR;EACZ,aAAa;GACX,YAAY;GACZ,cAAc,2BAA2B;IACvC,MAAM;IACN,sBAAsB;IACtB,gBAAgB;IACjB;GACF;EACD,kBAAkB;GAChB,OAAO;GACP,qBAAqB;IACnB,OAAO;IACP,UAAU;IACV,SAAS;IACV;GACF;EACD,eAAe;GACb,EAAE,MAAM,gBAAgB;GACxB,EAAE,MAAM,kBAAkB;GAC1B,EAAE,MAAM,0BAA0B;GAClC,EAAE,MAAM,yBAAyB;GACjC,CAAC,0BAA0B,EAAE,MAAM,oBAAoB;GACvD,EAAE,MAAM,yBAAyB;GACjC,EAAE,MAAM,sBAAsB;GAC9B;IACE,MAAM;IACN,QAAQ,EACN,WAAW,gBAAc,eACvB,eAAeA,gBAAc,WAAW,EAC3C;IACF;GACF;EACD,iBAAiB;GACjB,CACE;EAER;AAEF,wBAAwB,cAAc;;;;ACpKtC,MAAa,4BAA4B,UAAU;AAEjD,QACC,oCAAC,aACE,oCAAC,uBAA0B,MAAQ,CAChC;;;;;ACLT,MAAa,qBAAqB,UAAU;AAE1C,QACC,oCAAC,aACE,oCAAC,gBAAmB,MAAQ,CACzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"profile-7BieC5qc.js","names":["useStyles","useHistory","useHistoryNoType","useStyles","UserAvatar","UserProfileMenuWrapper: FC<UserProfileMenuWrapperProps>","Link","MenuOpener","UserAvatar"],"sources":["../src/shell/ui/profile/MenuOpener.jsx","../src/shell/ui/profile/UserAvatar.jsx","../src/shell/ui/profile/FluentProfileMenuCard.tsx","../src/shell/ui/profile/UserProfileMenuWrapper.tsx"],"sourcesContent":["import { Menu } from '@material-ui/core';\nimport {\n bindMenu,\n bindTrigger,\n usePopupState,\n} from 'material-ui-popup-state/hooks';\nimport React, {\n cloneElement,\n ElementType,\n FC,\n ReactElement,\n ReactNode,\n useCallback,\n} from 'react';\n\n/**\n * Helper to handle open a menu when a button is clicked\n */\nexport const MenuOpener = ({\n MenuComponent = Menu,\n name,\n button,\n menuProps,\n children,\n}) => {\n /* @fixme useId as string to bypass error */\n const popupId = 'useId(name)';\n const popupState = usePopupState({ variant: 'popover', popupId });\n const { close } = popupState;\n\n const click = useCallback(\n e => {\n const isButton = e.target.matches(\n 'a, button, input[type=\"button\"], input[type=\"image\"], [role=\"button\"], [role=\"link\"], a *, button *, [role=\"button\"] *, [role=\"link\"] *'\n );\n const isDropdownButton = e.target.matches(\n '.MuiAutocomplete-endAdornment *'\n );\n\n const closePopup = isButton && !isDropdownButton;\n\n if (closePopup) {\n close();\n }\n },\n [close]\n );\n\n return (\n <>\n {cloneElement(button, bindTrigger(popupState))}\n <MenuComponent {...menuProps} {...bindMenu(popupState)} onClick={click}>\n {children}\n </MenuComponent>\n </>\n );\n};\n\nexport default MenuOpener;\n","import { Avatar, makeStyles } from '@material-ui/core'\nimport clsx from 'clsx'\nimport React from 'react'\nimport useDevicePixelRatio from '../../../utilities/useDevicePixelRatio.ts'\nimport useGravatar from '../../../utilities/useGravatar.ts'\n\nconst useStyles = makeStyles(\n (theme) => ({\n root: {},\n default: {},\n toolbar: {\n width: 32,\n height: 32\n },\n large: {\n width: 80,\n height: 80\n }\n }),\n { name: 'UserAvatar' }\n)\n\n/**\n * Inteligent user Avatar element\n *\n * - Loads a Gravatar based on the email if one exists\n * - Falls back to a text avatar while loading and when a Gravatar does not exist\n * - Automatically chooses image size based on size prop and device pixel density (and updates if device pixel density changes)\n */\nconst UserAvatar = (props) => {\n const classes = useStyles(props)\n const { name, email, size = 'default', className, ...other } = props\n const dppx = useDevicePixelRatio()\n const dimension = { toolbar: 32, large: 80 }[size] || 40\n const avatar = useGravatar(email, { size: dimension * dppx })\n\n return (\n <Avatar\n alt={name}\n aria-label={`${name}'s avatar`}\n {...other}\n className={clsx(className, classes[size])}\n src={avatar}\n >\n {name?.trim()?.charAt(0) || '?'}\n </Avatar>\n )\n}\n\nexport default UserAvatar\n","import React, { forwardRef, useCallback } from 'react';\nimport { Button, CardContent, makeStyles, Typography } from '@material-ui/core';\nimport UserAvatar from './UserAvatar';\nimport { clearStoredPath } from '../../../utilities/redirect/LocalRedirectUrlStorage';\nimport { clearStoredExternalPath } from '../../../utilities/redirect/ExternalRedirectUrlStorage';\nimport {\n clearStoredTenant,\n storeTenant\n} from '../../../utilities/storage/UnitySessionStorage';\nimport { useTranslation } from 'react-i18next';\nimport { useUserActions } from '../../../utilities/auth/users';\nimport { User } from '../../../utilities/auth';\n// @ts-expect-error RRDv5 types are incompatible with react 18\nimport { useHistory as useHistoryNoType} from 'react-router-dom';\nimport { Tenant } from '../../../utilities';\nimport {History} from 'history';\nimport { TenantSelect } from '../../../utilities/tenant';\n\nconst useHistory = useHistoryNoType as () => History;\nconst useStyles = makeStyles((theme) => ({\n root: {\n '& > *': {\n margin: theme.spacing(1)\n },\n '&:last-child': {\n paddingBottom: theme.spacing(2)\n }\n },\n cardHeader: {\n display: 'flex',\n marginBottom: theme.spacing(3)\n },\n currentTenant: {\n margin: 'auto',\n width: '85%',\n marginBottom: theme.spacing(4)\n },\n buttonGroup: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center'\n },\n basicInfoContainer: {\n marginLeft: theme.spacing(1)\n },\n basicInfo: {\n paddingLeft: theme.spacing(1)\n },\n divider: {\n height: theme.spacing(3)\n },\n avatar: {\n fontSize: 40\n }\n}));\n\ninterface FluentProfileMenuCardProps {\n userTenants: Tenant[];\n currentTenant: Tenant | null;\n user: User | null;\n setUser: (user: User | null) => void;\n logout: () => void;\n unityUrl?: string;\n displayProfileButton?: boolean;\n}\n\nexport const FluentProfileMenuCard = forwardRef<HTMLDivElement, FluentProfileMenuCardProps>((props, ref) => {\n const classes = useStyles();\n const devUnityUrl = 'https://unity-dev.univerus.com/';\n const {\n userTenants,\n currentTenant,\n user,\n logout,\n unityUrl = devUnityUrl,\n } = props;\n const history = useHistory();\n const redirectToHome = useCallback(() => history.push('/'), [history]);\n // eslint-disable-next-line\n const { t } = useTranslation() as {t: (key: string) => string};\n const { changeTenant } = useUserActions();\n\n const handleTenantChange = useCallback(\n (tenant: Tenant) => {\n storeTenant(tenant.tenantId);\n changeTenant(tenant.tenantId);\n redirectToHome();\n },\n [changeTenant, redirectToHome]\n );\n\n\n\n // const handleProfileClick = () => {\n // // if this is unity (productid is 1), go to the profile slug, otherwise open the profile page in a new tab\n // if(ConfigService.config.UNITY_PRODUCT_ID === '1') history.push('/profile')\n // else window.open(unityUrl + '/profile');\n\n // }\n\n if (!user) return null;\n\n return (\n <CardContent ref={ref} className={classes.root}>\n <div className={classes.cardHeader}>\n <UserAvatar\n name={user?.name}\n email={user?.email}\n size='large'\n className={classes.avatar}\n />\n <div className={classes.basicInfoContainer}>\n <Typography className={classes.basicInfo} variant='subtitle2'>\n {user?.name}\n </Typography>\n <Typography className={classes.basicInfo} variant='body2'>\n {user?.email}\n </Typography>\n {/* {displayProfileButton && (\n <div className={classes.buttonGroup}>\n <Button\n id='udpRecord-FluentProfileMenuCard-MyProfile'\n udprecordid='udpRecord-FluentProfileMenuCard-MyProfile'\n onClick={handleProfileClick}\n target='_blank'\n color='secondary'\n >\n {t('My Profile')}\n </Button>\n </div>\n )} */}\n </div>\n </div>\n {userTenants && user && changeTenant && (\n <TenantSelect\n className={classes.currentTenant}\n id='current-tenant'\n tenants={userTenants}\n value={currentTenant}\n onTenantChange={handleTenantChange}\n label={t('Current Tenant')}\n recordIdPrefix='udpRecord-FluentProfileMenuCard'\n />\n )}\n <Button\n id='udpRecord-FluentProfileMenuCard-SignOut'\n // @ts-expect-error Custom automation attribute not typed by MUI\n udprecordid='udpRecord-FluentProfileMenuCard-SignOut'\n onClick={() => {\n clearStoredPath();\n clearStoredExternalPath();\n clearStoredTenant();\n logout();\n }}\n variant='outlined'\n color='secondary'\n >\n {t('Sign out')}\n </Button>\n </CardContent>\n );\n});\n\nFluentProfileMenuCard.displayName = 'FluentProfileMenuCard';\n","import React, { FC } from 'react';\nimport { Button, makeStyles, IconButton } from '@material-ui/core';\nimport { Link } from 'react-router-dom';\nimport MenuOpener from './MenuOpener';\nimport UserAvatar from './UserAvatar';\nimport { FluentProfileMenuCard } from './FluentProfileMenuCard';\nimport { ConfigService } from '../../../configService';\nimport { useSingleLogout, useUserActions } from '../../../utilities/auth';\nimport { useUser } from '../../../utilities/auth/useUser';\nimport { useTenant } from '../../../utilities/tenant/useTenant';\n\nconst useStyles = makeStyles((theme) => ({\n root: {},\n avatar: {\n background: theme.palette.secondary.main\n }\n}));\n\n\n\nexport interface UserProfileMenuWrapperProps {\n returnTo?: string;\n}\n\nexport const UserProfileMenuWrapper: FC<UserProfileMenuWrapperProps> = ({\n returnTo\n}) => {\n const classes = useStyles();\n const user = useUser();\n const singleLogout = useSingleLogout();\n const { setUser } = useUserActions();\n const tenantContext = useTenant();\n\n const currentTenant = tenantContext?.activeTenant ?? null;\n const availableTenants =\n tenantContext?.filteredTenantsList ??\n tenantContext?.tenantsList ??\n [];\n\n const enforcedTenantId = ConfigService.config.UNITY_TENANT_ID;\n\n const profileMenuTenants =\n !enforcedTenantId || enforcedTenantId === ''\n ? availableTenants\n : availableTenants.filter(\n (option) => option.tenantId === enforcedTenantId\n );\n\n if (!user) {\n const fallbackPath =\n returnTo ??\n (typeof window !== 'undefined' ? window.location.pathname : '/');\n\n return (\n <div className={classes.root}>\n <Button\n component={Link as React.ElementType} // react-router-dom@5 is incompatible with @types/react@18 so we have to assert the type manually\n to={{\n pathname: '/login',\n state: { returnTo: fallbackPath ?? '/' }\n }}\n color='inherit'\n >\n Sign in\n </Button>\n </div>\n );\n }\n\n return (\n <div className={classes.root}>\n <MenuOpener\n name = \"udp-user-profile-popover\"\n button={\n <IconButton>\n <UserAvatar\n name={user?.name}\n email={user?.email}\n size='toolbar'\n className={classes.avatar}\n />\n </IconButton>\n }\n menuProps={{\n keepMounted: true,\n getContentAnchorEl: null,\n variant: 'menu',\n anchorOrigin: { vertical: 'bottom', horizontal: 'right' },\n transformOrigin: { vertical: 'top', horizontal: 'right' }\n }}\n >\n <FluentProfileMenuCard\n userTenants={profileMenuTenants}\n currentTenant={currentTenant}\n user={user}\n setUser={setUser}\n logout={singleLogout}\n unityUrl={ConfigService.config.UNITY_URL}\n />\n </MenuOpener>\n </div>\n );\n};\n\nexport default UserProfileMenuWrapper;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,MAAa,cAAc,EACzB,gBAAgB,MAChB,MACA,QACA,WACA,eACI;CAGJ,MAAM,aAAa,cAAc;EAAE,SAAS;EAAW,SADvC;EACgD,CAAC;CACjE,MAAM,EAAE,UAAU;CAElB,MAAM,QAAQ,aACZ,MAAK;EACH,MAAM,WAAW,EAAE,OAAO,QACxB,sJACD;EACD,MAAM,mBAAmB,EAAE,OAAO,QAChC,kCACD;AAID,MAFmB,YAAY,CAAC,iBAG9B,QAAO;IAGX,CAAC,MAAM,CACR;AAED,QACE,0DACG,aAAa,QAAQ,YAAY,WAAW,CAAC,EAC9C,oCAAC;EAAc,GAAI;EAAW,GAAI,SAAS,WAAW;EAAE,SAAS;IAC9D,SACa,CACf;;AAIP,yBAAe;;;;ACpDf,MAAMA,cAAY,YACf,WAAW;CACV,MAAM,EAAE;CACR,SAAS,EAAE;CACX,SAAS;EACP,OAAO;EACP,QAAQ;EACT;CACD,OAAO;EACL,OAAO;EACP,QAAQ;EACT;CACF,GACD,EAAE,MAAM,cAAc,CACvB;;;;;;;;AASD,MAAM,cAAc,UAAU;CAC5B,MAAM,UAAUA,YAAU,MAAM;CAChC,MAAM,EAAE,MAAM,OAAO,OAAO,WAAW,WAAW,GAAG,UAAU;CAC/D,MAAM,OAAO,qBAAqB;CAElC,MAAM,SAAS,YAAY,OAAO,EAAE,OADlB;EAAE,SAAS;EAAI,OAAO;EAAI,CAAC,SAAS,MACA,MAAM,CAAC;AAE7D,QACE,oCAAC;EACC,KAAK;EACL,cAAY,GAAG,KAAK;EACpB,GAAI;EACJ,WAAW,KAAK,WAAW,QAAQ,MAAM;EACzC,KAAK;IAEJ,MAAM,MAAM,EAAE,OAAO,EAAE,IAAI,IACrB;;AA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O;EACN,QACE,oCAAC,kBACC,oCAACC;GACC,MAAM,MAAM;GACZ,OAAO,MAAM;GACb,MAAK;GACL,WAAW,QAAQ;IACnB,CACS;EAEf,WAAW;GACT,aAAa;GACb,oBAAoB;GACpB,SAAS;GACT,cAAc;IAAE,UAAU;IAAU,YAAY;IAAS;GACzD,iBAAiB;IAAE,UAAU;IAAO,YAAY;IAAS;GAC1D;IAED,oCAAC;EACC,aAAa;EACE;EACT;EACG;EACT,QAAQ;EACR,UAAU,cAAc,OAAO;GAC/B,CACS,CACT"}
1
+ {"version":3,"file":"profile-7BieC5qc.js","names":["useStyles","useHistory","useHistoryNoType","useStyles","UserAvatar","Link","MenuOpener","UserAvatar"],"sources":["../src/shell/ui/profile/MenuOpener.jsx","../src/shell/ui/profile/UserAvatar.jsx","../src/shell/ui/profile/FluentProfileMenuCard.tsx","../src/shell/ui/profile/UserProfileMenuWrapper.tsx"],"sourcesContent":["import { Menu } from '@material-ui/core';\nimport {\n bindMenu,\n bindTrigger,\n usePopupState,\n} from 'material-ui-popup-state/hooks';\nimport React, {\n cloneElement,\n ElementType,\n FC,\n ReactElement,\n ReactNode,\n useCallback,\n} from 'react';\n\n/**\n * Helper to handle open a menu when a button is clicked\n */\nexport const MenuOpener = ({\n MenuComponent = Menu,\n name,\n button,\n menuProps,\n children,\n}) => {\n /* @fixme useId as string to bypass error */\n const popupId = 'useId(name)';\n const popupState = usePopupState({ variant: 'popover', popupId });\n const { close } = popupState;\n\n const click = useCallback(\n e => {\n const isButton = e.target.matches(\n 'a, button, input[type=\"button\"], input[type=\"image\"], [role=\"button\"], [role=\"link\"], a *, button *, [role=\"button\"] *, [role=\"link\"] *'\n );\n const isDropdownButton = e.target.matches(\n '.MuiAutocomplete-endAdornment *'\n );\n\n const closePopup = isButton && !isDropdownButton;\n\n if (closePopup) {\n close();\n }\n },\n [close]\n );\n\n return (\n <>\n {cloneElement(button, bindTrigger(popupState))}\n <MenuComponent {...menuProps} {...bindMenu(popupState)} onClick={click}>\n {children}\n </MenuComponent>\n </>\n );\n};\n\nexport default MenuOpener;\n","import { Avatar, makeStyles } from '@material-ui/core'\nimport clsx from 'clsx'\nimport React from 'react'\nimport useDevicePixelRatio from '../../../utilities/useDevicePixelRatio.ts'\nimport useGravatar from '../../../utilities/useGravatar.ts'\n\nconst useStyles = makeStyles(\n (theme) => ({\n root: {},\n default: {},\n toolbar: {\n width: 32,\n height: 32\n },\n large: {\n width: 80,\n height: 80\n }\n }),\n { name: 'UserAvatar' }\n)\n\n/**\n * Inteligent user Avatar element\n *\n * - Loads a Gravatar based on the email if one exists\n * - Falls back to a text avatar while loading and when a Gravatar does not exist\n * - Automatically chooses image size based on size prop and device pixel density (and updates if device pixel density changes)\n */\nconst UserAvatar = (props) => {\n const classes = useStyles(props)\n const { name, email, size = 'default', className, ...other } = props\n const dppx = useDevicePixelRatio()\n const dimension = { toolbar: 32, large: 80 }[size] || 40\n const avatar = useGravatar(email, { size: dimension * dppx })\n\n return (\n <Avatar\n alt={name}\n aria-label={`${name}'s avatar`}\n {...other}\n className={clsx(className, classes[size])}\n src={avatar}\n >\n {name?.trim()?.charAt(0) || '?'}\n </Avatar>\n )\n}\n\nexport default UserAvatar\n","import React, { forwardRef, useCallback } from 'react';\nimport { Button, CardContent, makeStyles, Typography } from '@material-ui/core';\nimport UserAvatar from './UserAvatar';\nimport { clearStoredPath } from '../../../utilities/redirect/LocalRedirectUrlStorage';\nimport { clearStoredExternalPath } from '../../../utilities/redirect/ExternalRedirectUrlStorage';\nimport {\n clearStoredTenant,\n storeTenant\n} from '../../../utilities/storage/UnitySessionStorage';\nimport { useTranslation } from 'react-i18next';\nimport { useUserActions } from '../../../utilities/auth/users';\nimport { User } from '../../../utilities/auth';\n// @ts-expect-error RRDv5 types are incompatible with react 18\nimport { useHistory as useHistoryNoType} from 'react-router-dom';\nimport { Tenant } from '../../../utilities';\nimport {History} from 'history';\nimport { TenantSelect } from '../../../utilities/tenant';\n\nconst useHistory = useHistoryNoType as () => History;\nconst useStyles = makeStyles((theme) => ({\n root: {\n '& > *': {\n margin: theme.spacing(1)\n },\n '&:last-child': {\n paddingBottom: theme.spacing(2)\n }\n },\n cardHeader: {\n display: 'flex',\n marginBottom: theme.spacing(3)\n },\n currentTenant: {\n margin: 'auto',\n width: '85%',\n marginBottom: theme.spacing(4)\n },\n buttonGroup: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center'\n },\n basicInfoContainer: {\n marginLeft: theme.spacing(1)\n },\n basicInfo: {\n paddingLeft: theme.spacing(1)\n },\n divider: {\n height: theme.spacing(3)\n },\n avatar: {\n fontSize: 40\n }\n}));\n\ninterface FluentProfileMenuCardProps {\n userTenants: Tenant[];\n currentTenant: Tenant | null;\n user: User | null;\n setUser: (user: User | null) => void;\n logout: () => void;\n unityUrl?: string;\n displayProfileButton?: boolean;\n}\n\nexport const FluentProfileMenuCard = forwardRef<HTMLDivElement, FluentProfileMenuCardProps>((props, ref) => {\n const classes = useStyles();\n const devUnityUrl = 'https://unity-dev.univerus.com/';\n const {\n userTenants,\n currentTenant,\n user,\n logout,\n unityUrl = devUnityUrl,\n } = props;\n const history = useHistory();\n const redirectToHome = useCallback(() => history.push('/'), [history]);\n // eslint-disable-next-line\n const { t } = useTranslation() as {t: (key: string) => string};\n const { changeTenant } = useUserActions();\n\n const handleTenantChange = useCallback(\n (tenant: Tenant) => {\n storeTenant(tenant.tenantId);\n changeTenant(tenant.tenantId);\n redirectToHome();\n },\n [changeTenant, redirectToHome]\n );\n\n\n\n // const handleProfileClick = () => {\n // // if this is unity (productid is 1), go to the profile slug, otherwise open the profile page in a new tab\n // if(ConfigService.config.UNITY_PRODUCT_ID === '1') history.push('/profile')\n // else window.open(unityUrl + '/profile');\n\n // }\n\n if (!user) return null;\n\n return (\n <CardContent ref={ref} className={classes.root}>\n <div className={classes.cardHeader}>\n <UserAvatar\n name={user?.name}\n email={user?.email}\n size='large'\n className={classes.avatar}\n />\n <div className={classes.basicInfoContainer}>\n <Typography className={classes.basicInfo} variant='subtitle2'>\n {user?.name}\n </Typography>\n <Typography className={classes.basicInfo} variant='body2'>\n {user?.email}\n </Typography>\n {/* {displayProfileButton && (\n <div className={classes.buttonGroup}>\n <Button\n id='udpRecord-FluentProfileMenuCard-MyProfile'\n udprecordid='udpRecord-FluentProfileMenuCard-MyProfile'\n onClick={handleProfileClick}\n target='_blank'\n color='secondary'\n >\n {t('My Profile')}\n </Button>\n </div>\n )} */}\n </div>\n </div>\n {userTenants && user && changeTenant && (\n <TenantSelect\n className={classes.currentTenant}\n id='current-tenant'\n tenants={userTenants}\n value={currentTenant}\n onTenantChange={handleTenantChange}\n label={t('Current Tenant')}\n recordIdPrefix='udpRecord-FluentProfileMenuCard'\n />\n )}\n <Button\n id='udpRecord-FluentProfileMenuCard-SignOut'\n // @ts-expect-error Custom automation attribute not typed by MUI\n udprecordid='udpRecord-FluentProfileMenuCard-SignOut'\n onClick={() => {\n clearStoredPath();\n clearStoredExternalPath();\n clearStoredTenant();\n logout();\n }}\n variant='outlined'\n color='secondary'\n >\n {t('Sign out')}\n </Button>\n </CardContent>\n );\n});\n\nFluentProfileMenuCard.displayName = 'FluentProfileMenuCard';\n","import React, { FC } from 'react';\nimport { Button, makeStyles, IconButton } from '@material-ui/core';\nimport { Link } from 'react-router-dom';\nimport MenuOpener from './MenuOpener';\nimport UserAvatar from './UserAvatar';\nimport { FluentProfileMenuCard } from './FluentProfileMenuCard';\nimport { ConfigService } from '../../../configService';\nimport { useSingleLogout, useUserActions } from '../../../utilities/auth';\nimport { useUser } from '../../../utilities/auth/useUser';\nimport { useTenant } from '../../../utilities/tenant/useTenant';\n\nconst useStyles = makeStyles((theme) => ({\n root: {},\n avatar: {\n background: theme.palette.secondary.main\n }\n}));\n\n\n\nexport interface UserProfileMenuWrapperProps {\n returnTo?: string;\n}\n\nexport const UserProfileMenuWrapper: FC<UserProfileMenuWrapperProps> = ({\n returnTo\n}) => {\n const classes = useStyles();\n const user = useUser();\n const singleLogout = useSingleLogout();\n const { setUser } = useUserActions();\n const tenantContext = useTenant();\n\n const currentTenant = tenantContext?.activeTenant ?? null;\n const availableTenants =\n tenantContext?.filteredTenantsList ??\n tenantContext?.tenantsList ??\n [];\n\n const enforcedTenantId = ConfigService.config.UNITY_TENANT_ID;\n\n const profileMenuTenants =\n !enforcedTenantId || enforcedTenantId === ''\n ? availableTenants\n : availableTenants.filter(\n (option) => option.tenantId === enforcedTenantId\n );\n\n if (!user) {\n const fallbackPath =\n returnTo ??\n (typeof window !== 'undefined' ? window.location.pathname : '/');\n\n return (\n <div className={classes.root}>\n <Button\n component={Link as React.ElementType} // react-router-dom@5 is incompatible with @types/react@18 so we have to assert the type manually\n to={{\n pathname: '/login',\n state: { returnTo: fallbackPath ?? '/' }\n }}\n color='inherit'\n >\n Sign in\n </Button>\n </div>\n );\n }\n\n return (\n <div className={classes.root}>\n <MenuOpener\n name = \"udp-user-profile-popover\"\n button={\n <IconButton>\n <UserAvatar\n name={user?.name}\n email={user?.email}\n size='toolbar'\n className={classes.avatar}\n />\n </IconButton>\n }\n menuProps={{\n keepMounted: true,\n getContentAnchorEl: null,\n variant: 'menu',\n anchorOrigin: { vertical: 'bottom', horizontal: 'right' },\n transformOrigin: { vertical: 'top', horizontal: 'right' }\n }}\n >\n <FluentProfileMenuCard\n userTenants={profileMenuTenants}\n currentTenant={currentTenant}\n user={user}\n setUser={setUser}\n logout={singleLogout}\n unityUrl={ConfigService.config.UNITY_URL}\n />\n </MenuOpener>\n </div>\n );\n};\n\nexport default UserProfileMenuWrapper;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,MAAa,cAAc,EACzB,gBAAgB,MAChB,MACA,QACA,WACA,eACI;CAGJ,MAAM,aAAa,cAAc;EAAE,SAAS;EAAW,SADvC;EACgD,CAAC;CACjE,MAAM,EAAE,UAAU;CAElB,MAAM,QAAQ,aACZ,MAAK;EACH,MAAM,WAAW,EAAE,OAAO,QACxB,sJACD;EACD,MAAM,mBAAmB,EAAE,OAAO,QACh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AEF,sBAAsB,cAAc;;;;ACxJpC,MAAM,YAAY,YAAY,WAAW;CACvC,MAAM,EAAE;CACR,QAAQ,EACN,YAAY,MAAM,QAAQ,UAAU,MACrC;CACF,EAAE;AAQH,MAAa,0BAA2D,EACtE,eACI;CACJ,MAAM,UAAU,WAAW;CAC3B,MAAM,OAAO,SAAS;CACtB,MAAM,eAAe,iBAAiB;CACtC,MAAM,EAAE,YAAY,gBAAgB;CACpC,MAAM,gBAAgB,WAAW;CAEjC,MAAM,gBAAgB,eAAe,gBAAgB;CACrD,MAAM,mBACJ,eAAe,uBACf,eAAe,eACf,EAAE;CAEJ,MAAM,mBAAmB,cAAc,OAAO;CAE9C,MAAM,qBACJ,CAAC,oBAAoB,qBAAqB,KACtC,mBACA,iBAAiB,QACd,WAAW,OAAO,aAAa,iBACjC;AAEP,KAAI,CAAC,MAAM;EACT,MAAM,eACJ,aACC,OAAO,WAAW,cAAc,OAAO,SAAS,WAAW;AAE9D,SACE,oCAAC,SAAI,WAAW,QAAQ,QACtB,oCAAC;GACC,WAAWC;GACX,IAAI;IACF,UAAU;IACV,OAAO,EAAE,UAAU,gBAAgB,KAAK;IACzC;GACD,OAAM;KACP,UAEQ,CACL;;AAIV,QACE,oCAAC,SAAI,WAAW,QAAQ,QACtB,oCAACC;EACA,MAAO;EACN,QACE,oCAAC,kBACC,oCAACC;GACC,MAAM,MAAM;GACZ,OAAO,MAAM;GACb,MAAK;GACL,WAAW,QAAQ;IACnB,CACS;EAEf,WAAW;GACT,aAAa;GACb,oBAAoB;GACpB,SAAS;GACT,cAAc;IAAE,UAAU;IAAU,YAAY;IAAS;GACzD,iBAAiB;IAAE,UAAU;IAAO,YAAY;IAAS;GAC1D;IAED,oCAAC;EACC,aAAa;EACE;EACT;EACG;EACT,QAAQ;EACR,UAAU,cAAc,OAAO;GAC/B,CACS,CACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"shellStore-C8zfPsZ-.js","names":["useSetInitialShellVisibility: () => void"],"sources":["../src/stores/shellStore.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\nimport { ContainerTypeEnums } from '../enums/unitySystemEnums';\n\ninterface ShellState {\n subHeaderActionHasChildren: boolean | null | undefined;\n setSubHeaderActionHasChildren: (subHeaderActionHasChildren: boolean) => void;\n navigationExpanded: boolean | null | undefined;\n setNavigationExpanded: (navigationExpanded: boolean) => void;\n setIsValidWidget: (isValidWidget: (a: string) => boolean) => void;\n isValidWidget: (a: string) => boolean;\n setGetWidget: (getWidget: (a: string) => any) => void;\n getWidget: (a: string) => any;\n shellHidden: boolean | null | undefined;\n setShellHidden: (shellHidden: boolean) => void;\n currentContainerId: string | null | undefined;\n setCurrentContainerId: (containerId: string) => void;\n}\n\nexport const useShellStore = create<ShellState>()(\n devtools((set) => ({\n subHeaderActionHasChildren: false,\n setSubHeaderActionHasChildren: (subHeaderActionHasChildren) =>\n set((state) => ({\n subHeaderActionHasChildren: subHeaderActionHasChildren\n })),\n navigationExpanded: true,\n setNavigationExpanded: (navigationExpanded) =>\n set((state) => ({\n navigationExpanded: navigationExpanded\n })),\n isValidWidget: (a) => false,\n setIsValidWidget: (isValidWidget) =>\n set((state) => ({\n isValidWidget: isValidWidget\n })),\n getWidget: (a) => null,\n setGetWidget: (getWidget) =>\n set((state) => ({\n getWidget: getWidget\n })),\n shellHidden: false,\n setShellHidden: (shellHidden) =>\n set((state) => ({\n shellHidden: shellHidden\n })),\n currentContainerId: null,\n setCurrentContainerId: (currentContainerId) =>\n set((state) => ({ currentContainerId: currentContainerId }))\n }))\n);\n\nexport const useSetInitialShellVisibility: () => void = () => {\n const searchParams = new URLSearchParams(window.location.search);\n const withoutShell =\n searchParams.has('withoutShell') === true\n ? searchParams.get('withoutShell') === 'true'\n ? true\n : false\n : false;\n\n const setShellHidden = useShellStore((state) => state.setShellHidden);\n\n useEffect(() => {\n if (withoutShell) {\n setShellHidden(true);\n }\n }, [setShellHidden, withoutShell]);\n};\n"],"mappings":";;;;;AAoBA,MAAa,gBAAgB,QAAoB,CAC/C,UAAU,SAAS;CACjB,4BAA4B;CAC5B,gCAAgC,+BAC9B,KAAK,WAAW,EACc,4BAC7B,EAAE;CACL,oBAAoB;CACpB,wBAAwB,uBACtB,KAAK,WAAW,EACM,oBACrB,EAAE;CACL,gBAAgB,MAAM;CACtB,mBAAmB,kBACjB,KAAK,WAAW,EACC,eAChB,EAAE;CACL,YAAY,MAAM;CAClB,eAAe,cACb,KAAK,WAAW,EACH,WACZ,EAAE;CACL,aAAa;CACb,iBAAiB,gBACf,KAAK,WAAW,EACD,aACd,EAAE;CACL,oBAAoB;CACpB,wBAAwB,uBACtB,KAAK,WAAW,EAAsB,oBAAoB,EAAE;CAC/D,EAAE,CACJ;AAED,MAAaA,qCAAiD;CAC5D,MAAM,eAAe,IAAI,gBAAgB,OAAO,SAAS,OAAO;CAChE,MAAM,eACJ,aAAa,IAAI,eAAe,KAAK,OACjC,aAAa,IAAI,eAAe,KAAK,SACnC,OACA,QACF;CAEN,MAAM,iBAAiB,eAAe,UAAU,MAAM,eAAe;AAErE,iBAAgB;AACd,MAAI,aACF,gBAAe,KAAK;IAErB,CAAC,gBAAgB,aAAa,CAAC"}
1
+ {"version":3,"file":"shellStore-C8zfPsZ-.js","names":[],"sources":["../src/stores/shellStore.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\nimport { ContainerTypeEnums } from '../enums/unitySystemEnums';\n\ninterface ShellState {\n subHeaderActionHasChildren: boolean | null | undefined;\n setSubHeaderActionHasChildren: (subHeaderActionHasChildren: boolean) => void;\n navigationExpanded: boolean | null | undefined;\n setNavigationExpanded: (navigationExpanded: boolean) => void;\n setIsValidWidget: (isValidWidget: (a: string) => boolean) => void;\n isValidWidget: (a: string) => boolean;\n setGetWidget: (getWidget: (a: string) => any) => void;\n getWidget: (a: string) => any;\n shellHidden: boolean | null | undefined;\n setShellHidden: (shellHidden: boolean) => void;\n currentContainerId: string | null | undefined;\n setCurrentContainerId: (containerId: string) => void;\n}\n\nexport const useShellStore = create<ShellState>()(\n devtools((set) => ({\n subHeaderActionHasChildren: false,\n setSubHeaderActionHasChildren: (subHeaderActionHasChildren) =>\n set((state) => ({\n subHeaderActionHasChildren: subHeaderActionHasChildren\n })),\n navigationExpanded: true,\n setNavigationExpanded: (navigationExpanded) =>\n set((state) => ({\n navigationExpanded: navigationExpanded\n })),\n isValidWidget: (a) => false,\n setIsValidWidget: (isValidWidget) =>\n set((state) => ({\n isValidWidget: isValidWidget\n })),\n getWidget: (a) => null,\n setGetWidget: (getWidget) =>\n set((state) => ({\n getWidget: getWidget\n })),\n shellHidden: false,\n setShellHidden: (shellHidden) =>\n set((state) => ({\n shellHidden: shellHidden\n })),\n currentContainerId: null,\n setCurrentContainerId: (currentContainerId) =>\n set((state) => ({ currentContainerId: currentContainerId }))\n }))\n);\n\nexport const useSetInitialShellVisibility: () => void = () => {\n const searchParams = new URLSearchParams(window.location.search);\n const withoutShell =\n searchParams.has('withoutShell') === true\n ? searchParams.get('withoutShell') === 'true'\n ? true\n : false\n : false;\n\n const setShellHidden = useShellStore((state) => state.setShellHidden);\n\n useEffect(() => {\n if (withoutShell) {\n setShellHidden(true);\n }\n }, [setShellHidden, withoutShell]);\n};\n"],"mappings":";;;;;AAoBA,MAAa,gBAAgB,QAAoB,CAC/C,UAAU,SAAS;CACjB,4BAA4B;CAC5B,gCAAgC,+BAC9B,KAAK,WAAW,EACc,4BAC7B,EAAE;CACL,oBAAoB;CACpB,wBAAwB,uBACtB,KAAK,WAAW,EACM,oBACrB,EAAE;CACL,gBAAgB,MAAM;CACtB,mBAAmB,kBACjB,KAAK,WAAW,EACC,eAChB,EAAE;CACL,YAAY,MAAM;CAClB,eAAe,cACb,KAAK,WAAW,EACH,WACZ,EAAE;CACL,aAAa;CACb,iBAAiB,gBACf,KAAK,WAAW,EACD,aACd,EAAE;CACL,oBAAoB;CACpB,wBAAwB,uBACtB,KAAK,WAAW,EAAsB,oBAAoB,EAAE;CAC/D,EAAE,CACJ;AAED,MAAa,qCAAiD;CAC5D,MAAM,eAAe,IAAI,gBAAgB,OAAO,SAAS,OAAO;CAChE,MAAM,eACJ,aAAa,IAAI,eAAe,KAAK,OACjC,aAAa,IAAI,eAAe,KAAK,SACnC,OACA,QACF;CAEN,MAAM,iBAAiB,eAAe,UAAU,MAAM,eAAe;AAErE,iBAAgB;AACd,MAAI,aACF,gBAAe,KAAK;IAErB,CAAC,gBAAgB,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"stepper-BaIo_Rol.js","names":["UdpStepper: React.FC<UdpStepperProps>","Stepper"],"sources":["../src/UI/stepper/udp-stepper.tsx"],"sourcesContent":["import React from 'react';\nimport { UdpStepper as Stepper } from 'udp-react-stencil-component-library';\nimport { UdpStepperProps } from './types';\n\nexport const UdpStepper: React.FC<UdpStepperProps> = (props: UdpStepperProps) => {\n // @ts-ignore\n return <Stepper {...props} >{props?.children}</Stepper>;\n};\n"],"mappings":";;;;AAIA,MAAaA,gBAAyC,UAA2B;AAE/E,QAAO,oCAACC,YAAY,OAAS,OAAO,SAAmB"}
1
+ {"version":3,"file":"stepper-BaIo_Rol.js","names":["UdpStepper","Stepper"],"sources":["../src/UI/stepper/udp-stepper.tsx"],"sourcesContent":["import React from 'react';\nimport { UdpStepper as Stepper } from 'udp-react-stencil-component-library';\nimport { UdpStepperProps } from './types';\n\nexport const UdpStepper: React.FC<UdpStepperProps> = (props: UdpStepperProps) => {\n // @ts-ignore\n return <Stepper {...props} >{props?.children}</Stepper>;\n};\n"],"mappings":";;;;AAIA,MAAaA,gBAAyC,UAA2B;AAE/E,QAAO,oCAACC,YAAY,OAAS,OAAO,SAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"teleporterStore-CjUFtATo.js","names":["result: [string, string, TeleporterInstance][]"],"sources":["../src/stores/teleporterStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { createTeleporter } from 'react-teleporter';\n\ntype TeleporterInstance = ReturnType<typeof createTeleporter>;\n\ntype LocationEntry = {\n teleporter: TeleporterInstance;\n};\n\ntype TeleporterMap = Map<string, Map<string, LocationEntry>>;\n\ninterface TeleporterStore {\n teleporterMap: TeleporterMap;\n getTeleporter: (targetId: string, location: string) => TeleporterInstance;\n getAllTeleporters: () => [string, string, TeleporterInstance][];\n}\n\nexport const useTeleporterStore = create<TeleporterStore>((set, get) => ({\n teleporterMap: new Map(),\n\n getTeleporter: (targetId = '', location) => {\n const mapCopy = new Map(get().teleporterMap); // clone to maintain reactivity\n let locationMap = mapCopy.get(targetId);\n\n if (!locationMap) {\n locationMap = new Map();\n mapCopy.set(targetId, locationMap);\n }\n\n if (!locationMap.has(location)) {\n locationMap.set(location, {\n teleporter: createTeleporter()\n });\n }\n\n const teleporter = locationMap.get(location)!.teleporter;\n\n // Update store\n set({ teleporterMap: mapCopy });\n\n return teleporter;\n },\n\n getAllTeleporters: () => {\n const result: [string, string, TeleporterInstance][] = [];\n const map = get().teleporterMap;\n\n for (const [targetId, locationMap] of map.entries()) {\n for (const [location, entry] of locationMap.entries()) {\n result.push([targetId, location, entry.teleporter]);\n }\n }\n\n return result;\n }\n}));\n"],"mappings":";;;;AAiBA,MAAa,qBAAqB,QAAyB,KAAK,SAAS;CACvE,+BAAe,IAAI,KAAK;CAExB,gBAAgB,WAAW,IAAI,aAAa;EAC1C,MAAM,UAAU,IAAI,IAAI,KAAK,CAAC,cAAc;EAC5C,IAAI,cAAc,QAAQ,IAAI,SAAS;AAEvC,MAAI,CAAC,aAAa;AAChB,iCAAc,IAAI,KAAK;AACvB,WAAQ,IAAI,UAAU,YAAY;;AAGpC,MAAI,CAAC,YAAY,IAAI,SAAS,CAC5B,aAAY,IAAI,UAAU,EACxB,YAAY,kBAAkB,EAC/B,CAAC;EAGJ,MAAM,aAAa,YAAY,IAAI,SAAS,CAAE;AAG9C,MAAI,EAAE,eAAe,SAAS,CAAC;AAE/B,SAAO;;CAGT,yBAAyB;EACvB,MAAMA,SAAiD,EAAE;EACzD,MAAM,MAAM,KAAK,CAAC;AAElB,OAAK,MAAM,CAAC,UAAU,gBAAgB,IAAI,SAAS,CACjD,MAAK,MAAM,CAAC,UAAU,UAAU,YAAY,SAAS,CACnD,QAAO,KAAK;GAAC;GAAU;GAAU,MAAM;GAAW,CAAC;AAIvD,SAAO;;CAEV,EAAE"}
1
+ {"version":3,"file":"teleporterStore-CjUFtATo.js","names":[],"sources":["../src/stores/teleporterStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { createTeleporter } from 'react-teleporter';\n\ntype TeleporterInstance = ReturnType<typeof createTeleporter>;\n\ntype LocationEntry = {\n teleporter: TeleporterInstance;\n};\n\ntype TeleporterMap = Map<string, Map<string, LocationEntry>>;\n\ninterface TeleporterStore {\n teleporterMap: TeleporterMap;\n getTeleporter: (targetId: string, location: string) => TeleporterInstance;\n getAllTeleporters: () => [string, string, TeleporterInstance][];\n}\n\nexport const useTeleporterStore = create<TeleporterStore>((set, get) => ({\n teleporterMap: new Map(),\n\n getTeleporter: (targetId = '', location) => {\n const mapCopy = new Map(get().teleporterMap); // clone to maintain reactivity\n let locationMap = mapCopy.get(targetId);\n\n if (!locationMap) {\n locationMap = new Map();\n mapCopy.set(targetId, locationMap);\n }\n\n if (!locationMap.has(location)) {\n locationMap.set(location, {\n teleporter: createTeleporter()\n });\n }\n\n const teleporter = locationMap.get(location)!.teleporter;\n\n // Update store\n set({ teleporterMap: mapCopy });\n\n return teleporter;\n },\n\n getAllTeleporters: () => {\n const result: [string, string, TeleporterInstance][] = [];\n const map = get().teleporterMap;\n\n for (const [targetId, locationMap] of map.entries()) {\n for (const [location, entry] of locationMap.entries()) {\n result.push([targetId, location, entry.teleporter]);\n }\n }\n\n return result;\n }\n}));\n"],"mappings":";;;;AAiBA,MAAa,qBAAqB,QAAyB,KAAK,SAAS;CACvE,+BAAe,IAAI,KAAK;CAExB,gBAAgB,WAAW,IAAI,aAAa;EAC1C,MAAM,UAAU,IAAI,IAAI,KAAK,CAAC,cAAc;EAC5C,IAAI,cAAc,QAAQ,IAAI,SAAS;AAEvC,MAAI,CAAC,aAAa;AAChB,iCAAc,IAAI,KAAK;AACvB,WAAQ,IAAI,UAAU,YAAY;;AAGpC,MAAI,CAAC,YAAY,IAAI,SAAS,CAC5B,aAAY,IAAI,UAAU,EACxB,YAAY,kBAAkB,EAC/B,CAAC;EAGJ,MAAM,aAAa,YAAY,IAAI,SAAS,CAAE;AAG9C,MAAI,EAAE,eAAe,SAAS,CAAC;AAE/B,SAAO;;CAGT,yBAAyB;EACvB,MAAM,SAAiD,EAAE;EACzD,MAAM,MAAM,KAAK,CAAC;AAElB,OAAK,MAAM,CAAC,UAAU,gBAAgB,IAAI,SAAS,CACjD,MAAK,MAAM,CAAC,UAAU,UAAU,YAAY,SAAS,CACnD,QAAO,KAAK;GAAC;GAAU;GAAU,MAAM;GAAW,CAAC;AAIvD,SAAO;;CAEV,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"tenantStore-CFYu7ndZ.js","names":["useTenantStore: () => TenantState"],"sources":["../src/stores/tenantStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\nimport { TenantTypeEnums } from '../enums/unitySystemEnums';\n\ninterface TenantView {\n tenantId: string;\n name: string | null | undefined;\n tenantType: TenantTypeEnums;\n theme?: string | null;\n}\n\ninterface TenantState {\n currentTenant: TenantView | null | undefined;\n setCurrentTenant: (currentTenant: TenantView) => void;\n isProductTenant: boolean;\n}\n\nexport const useTenantStore: () => TenantState = create<TenantState>()(\n devtools((set) => ({\n currentTenant: null,\n setCurrentTenant: (currentTenant: TenantView) =>\n set((state) => {\n const isProductTenant =\n currentTenant?.tenantType === TenantTypeEnums.Product;\n return { currentTenant, isProductTenant };\n }),\n isProductTenant: false\n }))\n);\n"],"mappings":";;;;;AAiBA,MAAaA,iBAAoC,QAAqB,CACpE,UAAU,SAAS;CACjB,eAAe;CACf,mBAAmB,kBACjB,KAAK,UAAU;AAGb,SAAO;GAAE;GAAe,iBADtB,eAAe,eAAe,gBAAgB;GACP;GACzC;CACJ,iBAAiB;CAClB,EAAE,CACJ"}
1
+ {"version":3,"file":"tenantStore-CFYu7ndZ.js","names":[],"sources":["../src/stores/tenantStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\nimport { TenantTypeEnums } from '../enums/unitySystemEnums';\n\ninterface TenantView {\n tenantId: string;\n name: string | null | undefined;\n tenantType: TenantTypeEnums;\n theme?: string | null;\n}\n\ninterface TenantState {\n currentTenant: TenantView | null | undefined;\n setCurrentTenant: (currentTenant: TenantView) => void;\n isProductTenant: boolean;\n}\n\nexport const useTenantStore: () => TenantState = create<TenantState>()(\n devtools((set) => ({\n currentTenant: null,\n setCurrentTenant: (currentTenant: TenantView) =>\n set((state) => {\n const isProductTenant =\n currentTenant?.tenantType === TenantTypeEnums.Product;\n return { currentTenant, isProductTenant };\n }),\n isProductTenant: false\n }))\n);\n"],"mappings":";;;;;AAiBA,MAAa,iBAAoC,QAAqB,CACpE,UAAU,SAAS;CACjB,eAAe;CACf,mBAAmB,kBACjB,KAAK,UAAU;AAGb,SAAO;GAAE;GAAe,iBADtB,eAAe,eAAe,gBAAgB;GACP;GACzC;CACJ,iBAAiB;CAClB,EAAE,CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentTransaction.d.ts","sourceRoot":"","sources":["../../../../../../../src/udp/pages/UdpTransactionsPage/sidesheets/AttachmentTransaction.jsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAgBf,QAAA,MAAM,qBAAqB,mCAyN1B,CAAC;AACF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"AttachmentTransaction.d.ts","sourceRoot":"","sources":["../../../../../../../src/udp/pages/UdpTransactionsPage/sidesheets/AttachmentTransaction.jsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAgBf,QAAA,MAAM,qBAAqB,mCA+N1B,CAAC;AACF,eAAe,qBAAqB,CAAC"}