<html><head><base href="file:///">
<meta charset="utf-8">
<title>WaffleAuth Documentation</title>
<style>
    body {
        font-family: 'Segoe UI', Arial, sans-serif;
        line-height: 1.6;
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px;
        background: #f0f2f5;
        color: #333;
    }
    .container {
        background: white;
        padding: 30px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    #nav-menu {
        position: fixed;
        top: 20px;
        left: 20px;
        width: 250px;
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    #nav-menu ul {
        list-style: none;
        padding: 0;
    }
    #nav-menu li {
        margin: 8px 0;
    }
    #nav-menu a {
        color: #2c3e50;
        text-decoration: none;
        padding: 8px 12px;
        display: block;
        border-radius: 4px;
        transition: all 0.3s ease;
    }
    #nav-menu a:hover {
        background: #3498db;
        color: white;
    }
    .main-content {
        margin-left: 290px;
    }
    h1 {
        color: #2c3e50;
        border-bottom: 3px solid #3498db;
        padding-bottom: 10px;
        margin-bottom: 30px;
    }
    h2 {
        color: #2980b9;
        margin-top: 40px;
        padding-top: 20px;
        border-top: 1px solid #eee;
    }
    .function {
        background: #f8f9fa;
        padding: 25px;
        border-left: 4px solid #3498db;
        margin: 25px 0;
        border-radius: 0 8px 8px 0;
        transition: transform 0.2s ease;
    }
    .function:hover {
        transform: translateX(5px);
    }
    code {
        background: #edf2f7;
        padding: 2px 6px;
        border-radius: 4px;
        font-family: 'Consolas', monospace;
        color: #e74c3c;
    }
    pre {
        background: #f8f9fa;
        color: #2c3e50;
        padding: 20px;
        border-radius: 8px;
        overflow-x: auto;
        border: 1px solid #e1e4e8;
    }
    .note {
        background: #fff3cd;
        border-left: 4px solid #ffc107;
        padding: 20px;
        margin: 20px 0;
        border-radius: 0 8px 8px 0;
    }
    .setup {
        background: #d4edda;
        border-left: 4px solid #28a745;
        padding: 20px;
        margin: 20px 0;
        border-radius: 0 8px 8px 0;
    }
    .section {
        display: none;
        scroll-margin-top: 20px;
    }
    .section.active {
        display: block;
    }
    .feature-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        margin: 30px 0;
    }
    .feature-card {
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        border: 1px solid #e1e4e8;
    }
    pre code.hljs {
      padding: 0;
      background: transparent;
    }

    .hljs {
      background: #f8f9fa !important;
      color: #2c3e50 !important;
    }
    .hljs-keyword {
        color: #0000ff !important; /* Bright blue for keywords */
    }

    .hljs-string {
        color: #a31515 !important; /* Dark red for strings */
    }

    .hljs-comment {
        color: #008000 !important; /* Green for comments */
    }

    .hljs-title {
        color: #795E26 !important; /* Brown for class/method names */
    }

    .hljs-type {
        color: #267f99 !important; /* Blue-green for types */
    } 

    .hljs-literal {
        color: #0000ff !important; /* Blue for true/false/null */
    }

    .hljs-built_in {
        color: #267f99 !important; /* Blue-green for built-in types */
    }

    pre code.hljs {
        color: #000000 !important; /* Black for normal code text */
        font-weight: 400;
    }
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/vs.min.css">
</head>
<body>
<nav id="nav-menu">
    <h3>Quick Navigation</h3>
    <ul>
        <li><a href="#getting-started">Getting Started</a></li>
        <li><a href="#requirements">Requirements</a></li>
        <li><a href="#configuration">Configuration</a></li>
        <li><a href="#key-management">Key Management</a></li>
        <li><a href="#implementation">Implementation</a></li>
        <li><a href="#troubleshooting">Troubleshooting</a></li>
    </ul>
</nav>

<div class="main-content">
    <div class="container">
        <h1>WaffleAuth Documentation</h1>
        
        <section id="getting-started" class="section active">
            <div class="setup">
                <h2>Getting Started</h2>
                <p>WaffleAuth is a powerful license key system for C# applications, specifically designed for XAML and WinForms projects. It provides robust license management with HWID binding and Discord Rich Presence integration.</p>
                <h3>Installation Steps:</h3>
                <ol>
                    <li>Add WaffleAuth.dll as a reference in your project</li>
                    <li>Add the following using statement:</li>
                    <pre><code class="language-csharp">using WaffleAuth;</code></pre>
                    <li>Configure your Firebase/Firestore database</li>
                    <li>Set up your API endpoints</li>
                </ol>
            </div>
        </section>

        <section id="requirements" class="section">
            <h2>Requirements</h2>
            <div class="setup">
                <h3>Required NuGet Packages</h3>
                <p>WaffleAuth requires the following NuGet packages to be installed in your project:</p>
                <ul>
                    <li>Discord Rich Presence</li>
                    <li>Newtonsoft.Json</li>
                </ul>

                <h3>Installing NuGet Packages</h3>
                <p>You can install these packages using either:</p>
                
                <h4>Visual Studio NuGet Package Manager:</h4>
                <ol>
                    <li>Right-click your project in Solution Explorer</li>
                    <li>Select &quot;Manage NuGet Packages...&quot;</li>
                    <li>Search for each required package</li>
                    <li>Click &quot;Install&quot; for each package</li>
                </ol>

                <h4>Package Manager Console:</h4>
                <pre><code class="language-csharp">Install-Package DiscordRichPresence
Install-Package Newtonsoft.Json</code></pre>
                
                <div class="note">
                    <p><strong>Note:</strong> Make sure to install these packages before trying to use WaffleAuth functionality.</p>
                </div>
            </div>
        </section>

        <section id="configuration" class="section">
            <h2>Configuration Functions</h2>
            
            <div class="function">
                <h3>Initial Configuration</h3>
                <p>Configure WaffleAuth at the start of your application:</p>
                <pre><code class="language-csharp">// Required configuration
WaffleAuthFuncs.SetInitials(&quot;APP&quot;);
WaffleAuthFuncs.SetURL(&quot;your-firestore-url&quot;);
WaffleAuthFuncs.SetEndPoint(&quot;your-endpoint&quot;);
WaffleAuthFuncs.SetAPIKey(&quot;your-api-key&quot;);
WaffleAuthFuncs.MsgBoxes(true);

// Check for existing license
bool hasLicense = await WaffleAuthFuncs.Initialize();</code></pre>
            </div>

            <div class="function">
                <h3>SetInitials(string userInitials)</h3>
                <p>Sets the prefix for generated license keys. This will appear before the hyphen in all generated keys.</p>
                <pre><code class="language-csharp">WaffleAuthFuncs.SetInitials(&quot;APP&quot;);</code></pre>
                <p>Result format: APP-XXXXXXXXXXXXX</p>
            </div>

            <div class="function">
                <h3>SetURL(string userURL)</h3>
                <p>Sets the Firestore database URL where license information will be stored.</p>
                <pre><code class="language-csharp">WaffleAuthFuncs.SetURL(&quot;your-firestore-url&quot;);</code></pre>
            </div>

            <div class="function">
                <h3>SetEndPoint(string endpointuser)</h3>
                <p>Sets the API endpoint used for license validation and queries.</p>
                <pre><code class="language-csharp">WaffleAuthFuncs.SetEndPoint(&quot;your-endpoint-url&quot;);</code></pre>
            </div>

            <div class="function">
                <h3>SetAPIKey(string userapikey)</h3>
                <p>Sets the Firebase API key for authentication and database access.</p>
                <pre><code class="language-csharp">WaffleAuthFuncs.SetAPIKey(&quot;your-api-key&quot;);</code></pre>
            </div>

            <div class="function">
                <h3>MsgBoxes(bool showMsgBoxes)</h3>
                <p>Controls whether the system shows message box notifications for various events.</p>
                <pre><code class="language-csharp">WaffleAuthFuncs.MsgBoxes(true);  // Enable notifications
WaffleAuthFuncs.MsgBoxes(false); // Disable notifications</code></pre>
            </div>
        </section>

        <section id="key-management" class="section">
            <h2>Key Management Functions</h2>

            <div class="function">
                <h3>GenerateEarningKeyAsync(string websiteUrl, int timeInSeconds, int customDurationInHours)</h3>
                <p>Generates a license key after the user visits a specified website for a set duration.</p>
                <pre><code class="language-csharp">string key = await WaffleAuthFuncs.GenerateEarningKeyAsync(
    &quot;https://example.com&quot;,  // Website to visit
    30,                     // Wait time in seconds
    24                      // License duration in hours
);</code></pre>
            </div>

            <div class="function">
                <h3>CheckKey(string licenseKey)</h3>
                <p>Validates a license key independently. Use this for manual key validation.</p>
                <pre><code class="language-csharp">bool isValid = await WaffleAuthFuncs.CheckKey(&quot;APP-XXXXXXXXXXXXX&quot;);</code></pre>
            </div>

            <div class="function">
                <h3>Initialize()</h3>
                <p>Checks for any existing valid licenses on the current machine. Useful for automatic login.</p>
                <pre><code class="language-csharp">bool hasExistingLicense = await WaffleAuthFuncs.Initialize();</code></pre>
            </div>
        </section>

        <section id="implementation" class="section">
            <h2>Implementation Example</h2>
            <div class="function">
                <h3>Basic Form Implementation</h3>
                <p>Here&apos;s a complete example of implementing WaffleAuth in a Windows Forms application:</p>
                <pre><code class="language-csharp">
using WaffleAuth;

namespace License_Tester
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            // Initial configuration
            WaffleAuthFuncs.SetURL(&quot;https://firestore.googleapis.com/v1/projects/waffleauth/databases/(default)/documents/licenses&quot;);
            WaffleAuthFuncs.SetAPIKey(&quot;YOUR-API-KEY&quot;);
            WaffleAuthFuncs.SetEndPoint(&quot;https://firestore.googleapis.com/v1/projects/waffleauth/databases/(default)/documents:runQuery?key=&quot;);
            WaffleAuthFuncs.SetInitials(&quot;LA&quot;);
            WaffleAuthFuncs.MsgBoxes(true);
            InitializeComponent();
        }

        // Generate new key button click handler
        private async void button1_Click(object sender, EventArgs e)
        {
            string generatedKey = await WaffleAuthFuncs.GenerateEarningKeyAsync(
                &quot;https://youtube.com&quot;,  // Website to visit
                2,                      // Wait time in seconds
                24                      // License duration in hours
            );

            label1.Text = generatedKey;
        }

        // Validate key button click handler
        private async void button2_Click(object sender, EventArgs e)
        {
            bool isKeyValid = await WaffleAuthFuncs.CheckKey(textBox1.Text);

            if (!isKeyValid)
            {
                Application.Exit();
            }
        }
    }
}</code></pre>
            </div>

            <div class="note">
                <h3>Important Implementation Notes</h3>
                <ul>
                    <li>Always configure WaffleAuth in your form&apos;s constructor before InitializeComponent()</li>
                    <li>Handle key validation failures appropriately for your application</li>
                    <li>Store sensitive information like API keys securely</li>
                    <li>Consider implementing a loading indicator during async operations</li>
                </ul>
            </div>
        </section>

        <section id="troubleshooting" class="section">
            <h2>Troubleshooting</h2>
            <div class="note">
                <h3>Common Issues</h3>
                <ul>
                    <li><strong>Invalid API Key:</strong> Ensure your Firebase API key is correctly set and has necessary permissions</li>
                    <li><strong>Database Connection:</strong> Verify your Firestore URL and endpoint configurations</li>
                    <li><strong>HWID Mismatch:</strong> Keys are bound to specific machines and cannot be transferred</li>
                    <li><strong>Expired Keys:</strong> Check the duration set during key generation</li>
                </ul>
            </div>
        </section>
    </div>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/csharp.min.js"></script>
<script>document.querySelectorAll('#nav-menu a').forEach(anchor => {
  anchor.addEventListener('click', function (e) {
    e.preventDefault();
    document.querySelectorAll('.section').forEach(section => {
      section.classList.remove('active');
    });
    const targetId = this.getAttribute('href').substring(1);
    const targetElement = document.getElementById(targetId);
    targetElement.classList.add('active');
    targetElement.scrollIntoView({
      behavior: 'smooth'
    });
  });
});
document.addEventListener('DOMContentLoaded', () => {
  document.querySelectorAll('.section').forEach(section => {
    section.classList.remove('active');
  });
  document.getElementById('getting-started').classList.add('active');
  hljs.highlightAll();
});</script>

</body></html>