public function calculateRowsPerPageForTextareaQuestion(array $question, int $max_rows_per_page, int $extra_rows): array 	{ 		$textual_question_data = collect(); 		$question_answers = collect(); 		$last_page_empty_rows = 0; 		$question_answer_last_index = 0;  		$question_answers->push(array_values($question['answers_rows']));  		$question_answers->flatten(1)->each(function (int $answer_rows_number, int $key) use (&$max_rows_per_page, &$extra_rows, &$question_answer_last_index, &$textual_question_data, &$question, &$last_page_empty_rows) { 			if ($extra_rows > 0) { 				$question_answers = $question['answers']->take($extra_rows);  				$textual_question_data->push($this->getExtraTextualQuestionData($question, $question_answers, $extra_rows, false));  				$answers_rows = collect(); 				$answers_rows->push(array_values($question['answers_rows'])); 				$rows_remaining = $answers_rows->flatten(1)->splice(1)->sum();  				$last_page_empty_rows = $rows_remaining > $max_rows_per_page ? 0 : $max_rows_per_page - $rows_remaining; 				$question_answer_last_index = $key + 1; 				$extra_rows = 0; 			}  			$question_answers_row_sum = collect(); 			$question_answers_row_sum = $question_answers_row_sum->push(array_values($question['answers_rows'])); 			$question_answers_row_sum = $question_answers_row_sum->flatten(1)->splice($question_answer_last_index, $key)->sum();  			if ($question_answers_row_sum > $max_rows_per_page) { 				$question_answers_rows = collect(); 				$question_answers = collect();  				$question_answers_rows->push(array_values($question['answers_rows'])); 				$question_answers_rows = $question_answers_rows->flatten(1)->splice($question_answer_last_index, $key - 1);  				$question_answers->push($question['answers']); 				$question_answers = $question_answers->flatten(1)->splice($question_answer_last_index, $key - 1);  				$extra_answers_rows = $question_answers_rows->sum();  				$textual_question_data->push($this->getExtraTextualQuestionData($question, $question_answers, $extra_answers_rows, true));  				$last_page_empty_rows = $max_rows_per_page - $question_answers->count(); 				$question_answer_last_index = $key; 			}  			if ($key == array_key_last($question['answers_rows'])) { 				$question_answers_rows = collect(); 				$question_answers = collect();  				$question_answers_rows->push(array_values($question['answers_rows'])); 				$question_answers_rows = $question_answers_rows->flatten(1)->splice($question_answer_last_index, $key);  				$question_answers->push($question['answers']); 				$question_answers = $question_answers->flatten(1)->splice($question_answer_last_index, $key);  				$extra_answers_rows = $question_answers_rows->sum();  				$textual_question_data->push($this->getExtraTextualQuestionData($question, $question_answers, $extra_answers_rows, true));  				$last_page_empty_rows = $max_rows_per_page - $question_answers_rows->sum(); 			} 		});  		return [ 			'data' => $textual_question_data->all(), 			'extra_rows' => $last_page_empty_rows, 		]; 	}