<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <title>QuinceChat: Contact @sitemap.xml</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <meta name="apple-itunes-app" content="app-id=6475718544, app-argument: qs://resolve?domain=sitemap.xml">

    <!--    TODO: есть ли смысл приводить в порядок внешний вид при шаринге в др сетях-->
    <!--    TODO: change icons-->
    <link rel="apple-touch-icon" sizes="180x180" href="/files/apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="/files/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/files/favicon-16x16.png">
<!--    <link rel="alternate icon" href="https://telegram.org/img/favicon.ico" type="image/x-icon">-->

    <link href="/files/font-roboto.css" rel="stylesheet" type="text/css">
    <link href="/files/bootstrap.min.css" rel="stylesheet">
    <link href="/files/telegram.css" rel="stylesheet" media="screen">

    <!--    <meta http-equiv="refresh" th:content="'1;url=' + ${redirectUrl}" />-->
</head>
<body class="">
    <div class="tgme_background_wrap">
        <canvas id="tgme_background" class="tgme_background default"
                width="50" height="50"
                data-colors="5b28b4,190f2c,742ac3,4722a6">
        </canvas>
        <div class="tgme_background_pattern default"></div>
    </div>

    <div class="tgme_page_wrap">
        <div class="tgme_head_wrap">
            <div class="tgme_head">
                <img src="/files/logo.png">
                <a class="tgme_head_right_btn" href="https://itunes.apple.com/app/id6475718544">Download</a>
            </div>
        </div>
        <div class="tgme_body_wrap">
            <div class="tgme_page">
                <div id="ios_platform_content">
                    <div class="tgme_page_title"><span dir="auto"></span></div>
                    <div class="tgme_page_extra"></div>

                    <div class="tgme_page_action">
                        <a class="tgme_action_button_new shine"
                           href="qs://resolve?domain=sitemap.xml"
                        >Send Message</a>
                    </div>
                    <!-- WEBOGRAM_BTN -->
                    <!-- PRIVACY_BTN -->

                </div>

                <div class="tgme_page_description"
                     id="additional_msg_on_ios"
                    style="display:none;"
                >If you have <strong>Quince Chat</strong>, you can contact<br> <a class=tgme_username_link href=qs://resolve?domain=sitemap.xml>sitemap.xml</a> right away.</div>

                <div class="tgme_page_description" id="not_ios_platform_msg">
                    <div style="padding-bottom: 18px;"><strong>Quince Chat</strong> is a communication application, currently exclusively available on the iOS platform</div>
                    <a class="dwnld_btn_in_desc shine" href="https://itunes.apple.com/app/id6475718544">Download</a>
                </div>
            </div>

        </div>
    </div>

    <script src="/files/tgwallpaper.min.js"></script>

    <script>
        var protoUrl = "qs:\/\/resolve?domain=sitemap.xml";
        var userNameFromDB = "";
        var appStoreUrl = "https:\/\/itunes.apple.com\/app\/id6475718544";

        // var linker = new DeepLinker({
        //     onIgnored: function() {
        //         console.log('browser failed to respond to the deep link');
        //     },
        //     onFallback: function() {
        //         window.location.replace(appStoreUrl);
        //         console.log('dialog hidden or user returned to tab');
        //     },
        //     onReturn: function() {
        //         console.log('user returned to the page from the native app');
        //     },
        // });

        // linker.openURL(protoUrl);

        if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
            setTimeout(function () {
                window.location = protoUrl;
            }, 100);
            if (userNameFromDB == "") {
                document.getElementById('additional_msg_on_ios').style.display = 'block'
            }
            document.getElementById('ios_platform_content').style.display = 'block'
            document.getElementById('not_ios_platform_msg').style.display = 'none'
        }
        else {
            // TODO: uncomment
            document.getElementById('ios_platform_content').style.display = 'none'
            document.getElementById('not_ios_platform_msg').style.display = 'block'
        }

        var tme_bg = document.getElementById('tgme_background');
        if (tme_bg) {
            TWallpaper.init(tme_bg);
            TWallpaper.animate(true);
            window.onfocus = function () {
                TWallpaper.update();
            };
        }
        document.body.classList.remove('no_transition');

    </script>

</body>
</html>
