You are a software architect tasked with creating a detailed mermaid diagram showing the functional flow of a software function. The diagram should show: 1. The main function flow 2. All features and their interactions 3. Decision points and conditions 4. Data flow between components 5. Error handling paths Function Details: Module Name: {module_name} Module Description: {module_description} Function Name: {function_name} Function Description: {function_description} Features: {features} User Stories: {user_stories} {custom_instructions} Please create a detailed mermaid flowchart diagram that visualizes this function's flow. Use proper mermaid syntax and include comprehensive comments explaining each part of the flow. The diagram should be technically accurate and follow software engineering best practices. Requirements: - Use mermaid flowchart syntax - Include clear start and end points - Show all major decision points - Indicate error handling paths - Use appropriate shapes for different types of operations - Add descriptive comments for complex flows - Keep the diagram readable and well-organized - Add %% title: and %% description: comments at the top of the diagram Return ONLY the mermaid diagram code, nothing else. Start with ```mermaid and end with ```. Do not include any other text or explanations. The diagram must start with title and description comments.