You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: page.rs
    path of file: ./repos/nyaa/src/widget
    
    the code of the file until where you have to start completion: use std::cmp::{max, min};

use crate::app::{App, LoadType, Mode};
use crossterm::event::{Event, KeyCode, KeyEvent, KeyEventKind};
use ratatui::{
    layout::{Margin, Rect},
    widgets::{Paragraph, Widget as _},
    Frame,
};

use super::{
    border_block,
    input::{self, InputWidget},
    Widget,
};

pub struct PagePopup {
    pub input: InputWidget,
}

impl Default for PagePopup {
    fn default() -> Self {
        PagePopup {
            input: InputWidget::new(3, Some(|e| e.is_numeric())),
        }
    }
}

impl Widget for PagePopup {
    fn draw(&self, f: &mut Frame, app: &App, area: Rect) {
        let buf = f.bu
    
    fn draw(&self, f: &mut Frame, app: &App, area: Rect) {
        let buf = f.buffer_mut();
        let center = super::centered_rect(13, 3, area);
        let clear = super::centered_rect(center.width + 2, center.height, area);
        let page_p = Paragraph::new(self.input.input.clone());
        let indicator = Paragraph::new(">").block(border_block(app.theme, true).title("Goto Page"));
        super::clear(clear, buf, app.theme.bg);
        indicator.render(center, buf);

        let input_area = center.inner(&Margin {
            vertical: 1,
            horizontal: 1,
        });
        let input_area = Rect::new(
            input_area.x + 2,
            input_area.y,
            input_area.width,
            input_area.height,
        );
        page_p.render(input_area, buf);

        if app.mode == Mode::Page {
            self.input.show_cursor(f, input_area);
        }
    }