/*! @azure/msal-react v3.0.17 2025-08-05 */ 'use strict'; import React__default, { useMemo } from 'react'; import { useMsal } from '../hooks/useMsal.js'; import { useIsAuthenticated } from '../hooks/useIsAuthenticated.js'; import { getChildrenOrFunction } from '../utils/utilities.js'; import { InteractionStatus } from '@azure/msal-browser'; /* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ /** * Renders child components if user is unauthenticated * @param props */ function UnauthenticatedTemplate({ username, homeAccountId, localAccountId, children, }) { const context = useMsal(); const accountIdentifier = useMemo(() => { return { username, homeAccountId, localAccountId, }; }, [username, homeAccountId, localAccountId]); const isAuthenticated = useIsAuthenticated(accountIdentifier); if (!isAuthenticated && context.inProgress !== InteractionStatus.Startup && context.inProgress !== InteractionStatus.HandleRedirect) { return (React__default.createElement(React__default.Fragment, null, getChildrenOrFunction(children, context))); } return null; } export { UnauthenticatedTemplate }; //# sourceMappingURL=UnauthenticatedTemplate.js.map