<!-- SPDX-FileCopyrightText: 2023 Sayantan Santra <sayantan.santra689@gmail.com> -->
<!-- SPDX-License-Identifier: MIT -->

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <title>Chhoto URL</title>
    <meta name="description" content="A simple selfhosted URL shortener with no unnecessary features.">
    <meta name="keywords" content="url shortener, link shortener, self hosted, open source">
    <link rel="icon" type="image/x-icon" href="assets/favicon.ico" sizes="any">
    <link rel="icon" type="image/svg+xml" href="assets/favicon.svg">
    <link rel="icon" type="image/png" href="assets/favicon-32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="assets/favicon-196.png" sizes="196x196">

    <script src="static/script.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/purecss@1.0.1/build/pure-min.css"
        integrity="sha384-oAOxQR6DkCoMliIh8yFnu25d7Eq/PHS21PClpwjOTeU2jRSq11vu66rf90/cZr47" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css" target="_blank" href="static/styles.css">
</head>

<body>

    <div class="container" id="container">
        <form class="pure-form pure-form-aligned" name="new-url-form">
            <fieldset>
                <legend id="logo"><img src="assets/favicon-32.png" width="26px" alt="logo"> Chhoto URL</legend>
                <div class="pure-control-group">
                    <label for="longUrl">Long URL</label>
                    <input type="url" name="longUrl" id="longUrl" placeholder="Please enter a valid URL"
                        onblur="addProtocol(this)" required />
                </div>
                <div class=" pure-control-group">
                    <label for="shortUrl">Short URL (optional)</label>
                    <input type="text" name="shortUrl" id="shortUrl" placeholder="Only a-z, 0-9, - and _ are allowed"
                        pattern="[a-z0-9\-_]+" title="Only a-z, 0-9, - and _ are allowed"/>
                </div>
                <div class="pure-controls">
                    <button class="pure-button pure-button-primary">Shorten!</button>
                    <p id="alert-box">&nbsp;</p>
                </div>
            </fieldset>
        </form>

        <p name="loading-text">Loading links table...</p>
        <table class="pure-table">
            <caption>Active links</caption>
            <br />
            <thead>
                <tr>
                    <td id="short-url-header">Short URL (click to copy)</td>
                    <td>Long URL</td>
                    <td name="hitsColumn">Hits</td>
                    <td name="deleteBtn">&times;</td>
                </tr>
            </thead>
            <tbody id="url-table">
                <!-- The links would be inserted here -->
            </tbody>
        </table>
    </div>

    <div name="github-link">
        <a id="version-number" href="https://github.com/SinTan1729/chhoto-url" target="_blank" rel="noopener noreferrer"
            hidden>Source Code</a>
        <!-- The version number would be inserted here -->
    </div>

    <dialog id="login-dialog">
        <form class="pure-form" name="login-form">
            <p>Please enter password to access this website</p>
            <input type="password" id="password" />
            <button class="pure-button pure-button-primary" value="default">Log in</button>
            <p id="wrong-pass">&nbsp;</p>
        </form>
    </dialog>

</body>

</html>