<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" encoding="utf-8" indent="yes"/>

    <!-- Parameters -->

    <xsl:param name="VERSION">1.0</xsl:param>
    <xsl:param name="APPLICATION_NAME"></xsl:param>
    <xsl:param name="NAVIGATION_AREA_WIDTH">xxl</xsl:param>
    <xsl:param name="CONTENT_AREA_WIDTH">xxl</xsl:param>

    <!-- Main Template -->

    <xsl:template match="/">

        <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html></xsl:text>
    
        <html lang="en" data-bs-theme="{$THEME}">
      
            <head>
        
                <meta charset="utf-8"/>
                <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
                <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

                <title>
                    <xsl:value-of select="$APPLICATION_NAME"/>
                </title>
                
                <link rel="icon" type="image/x-icon" href="images/dec-international-logo.png"/>
        
                <link href="css/themes/Spacelab/bootstrap.min.css?version={$VERSION}"   rel="stylesheet" media="screen"/>
                <link href="css/bootstrap-icons.min.css?version={$VERSION}"             rel="stylesheet" media="screen"/>
                <link href="css/base.css?version={$VERSION}"                            rel="stylesheet" media="screen" />
                <link href="css/bootstrap-datepicker.min.css?version={$VERSION}"        rel="stylesheet" media="screen" />
                <link href="css/bootstrap-select.min.css?version={$VERSION}"            rel="stylesheet" media="screen" />

                <script src="js/jquery-3.2.0.min.js?version={$VERSION}"/>        
                <script src="js/bootstrap.bundle.min.js?version={$VERSION}"/>   
                <script src="js/base.js?version={$VERSION}"/>   
                <script src="js/content.js?version={$VERSION}"/>   
                <script src="js/bootstrap-datepicker.min.js?version={$VERSION}"/>   
                <script src="js/jquery.inputmask.min.js?version={$VERSION}"/>   
                <script src="js/bootstrap-select.min.js?version={$VERSION}"/>   
                <script src="js/dinero.min.js?version={$VERSION}"/>
                <script src="js/autologout.js?version={$VERSION}"/>

            </head>

            <body>
        
                <xsl:if test="$THEME = 'Spacelab'">
                    <xsl:attribute name="class">bg-light bg-opacity-50</xsl:attribute>
                </xsl:if>
    
                <script type="text/javascript">
                    var msie = /msie\s|trident/i.test(window.navigator.userAgent);
                    if (msie) {
                    window.location.href = "html/unsupported.html";
                    }
                </script>

                <input type="hidden" id="APPLICATION_MNEMONIC" value="{$APPLICATION_MNEMONIC}"/>

                <nav class="navbar navbar-expand-lg fixed-top bg-primary navbar-dark">

                    <div class="container-xxl">
          
                        <a class="navbar-brand ms-1 me-0" href="./" aria-label="Home" data-bs-toggle="tooltip" data-bs-title="Home" data-bs-custom-class="custom-tooltip" data-bs-placement="right" data-bs-offset="0,5">
                            <i class="bi bi-house me-2"></i>
                            <xsl:value-of select="$APPLICATION_NAME"/>
                        </a>

                        <button type="button" class="navbar-toggler p-0" data-bs-toggle="collapse" data-bs-target="#navbar-main" aria-controls="navbar-main" aria-expanded="false" aria-label="Toggle Navigation">
                            <span class="navbar-toggler-icon"></span>
                        </button>

                        <div class="navbar-collapse collapse" id="navbar-main">

                            <ul class="navbar-nav mx-auto">

                                <li class="nav-item">
                                    <a class="nav-link user-subscriptions" href="javascript:void(0);">
                                        <i class="bi bi-list-check me-1" aria-hidden="true"/>
                                        SUBSCRIPTIONS
                                    </a>
                                </li>
                                
                                <!-- MANAGE/REPORTS/SETUP is only available to Administrators -->
                                
                                <xsl:if test="$USER_ROLE = 'Administrator' or $USER_ROLE = 'System Administrator'">
                                    
                                    <li class="nav-link disabled">
                                        <xsl:text>  |  </xsl:text>
                                    </li>
                                
                                    <li class="nav-item dropdown">

                                        <a href="javascript:void(0);" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                                            <i class="bi bi-kanban me-1" aria-hidden="true"/>
                                            MANAGE
                                        </a>

                                        <div class="dropdown-menu mt-2 pt-0 pb-0">
                                            
                                            <a class="dropdown-item ps-2 manage-permits" href="javascript:void(0);">
                                                <i class="bi bi-buildings me-2"/>Permits</a>
                                        
                                            <a class="dropdown-item ps-2 rdi-consolidation" href="javascript:void(0);">
                                                <i class="bi bi-hammer me-2"/>RDI Consolidation</a>
                                                
                                            <a class="dropdown-item ps-2 import-permit-csv" href="javascript:void(0);">
                                                <i class="bi bi-upload me-2"/>Import CSV</a>
                                            
                                        </div>
                                    
                                    </li>

                                    <li class="nav-link disabled">
                                        <xsl:text>  |  </xsl:text>
                                    </li>

                                    <li class="nav-item">
                                        <a class="nav-link select-report" href="javascript:void(0);">
                                            <i class="bi bi-printer me-1" aria-hidden="true"/>
                                            REPORTS
                                        </a>
                                    </li> 
                  
<!--                                    <li class="nav-link disabled">
                                        <xsl:text>  |  </xsl:text>
                                    </li>

                                    <li class="nav-item">
                                        <a class="nav-link run-developer-stub" href="javascript:void(0);">
                                            <i class="bi bi-code me-1" aria-hidden="true"/>
                                            DEV STUB
                                        </a>
                                    </li>-->
                
                                </xsl:if>
                                
                                <li class="nav-link disabled">
                                    <xsl:text>  |  </xsl:text>
                                </li>

                                <li class="nav-item">
                                    <a class="nav-link start-support-ticket" href="javascript:void(0);">
                                        <i class="bi bi-question-circle me-1" aria-hidden="true"/>
                                        SUPPORT
                                    </a>
                                </li>
                                
                            </ul>

                            <ul class="navbar-nav user-dropdown ms-0">

                                <li class="nav-item dropdown">

                                    <a href="javascript:void(0);" class="nav-link ps-2 dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false">
                                        <span class="username me-1">
                                            <span>
                                                <i class="bi bi-person-circle me-2" aria-hidden="true"></i>
                                            </span> 
                                            <xsl:value-of select="$USER_CLIENT_NAME"/>
                                        </span> 
                                    </a>

                                    <div class="dropdown-menu dropdown-menu-right mt-2 pt-0 pb-0"> 
                                        
                                        <!--                                        <a class="dropdown-item ps-2 my-account" href="javascript:void(0);">
                                        <i class="bi bi-person me-2"/>My Account</a>-->
                                            
                                        <a class="dropdown-item ps-2 toggle-theme" href="javascript:void(0);">
                                            <i class="bi bi-moon me-2"/>Toggle Dark/Light</a>
                                            
                                        <xsl:if test="$USER_ROLE = 'Administrator' or $USER_ROLE = 'System Administrator'">
                                            
                                            <div class="dropdown-divider mt-1 mb-1"/>
                                            
                                            <a class="dropdown-item ps-2 setup-alerts" href="javascript:void(0);">
                                                <i class="bi bi-info-circle me-2"/>Alerts</a>
                      
                                            <a class="dropdown-item ps-2 setup-counties" href="javascript:void(0);">
                                                <i class="bi bi-building me-2"/>Counties
                                            </a>

                                            <a class="dropdown-item ps-2 setup-dropdowntypes" href="javascript:void(0);">
                                                <i class="bi bi-caret-down-square me-2"/>Dropdown Types
                                            </a>

                                            <a class="dropdown-item ps-2 setup-dropdowns" href="javascript:void(0);">
                                                <i class="bi bi-caret-down me-2"/>Dropdowns
                                            </a>

                                            <a class="dropdown-item ps-2 setup-popovers" href="javascript:void(0);">
                                                <i class="bi bi-chat-left-dots me-2"/>Popovers
                                            </a>

                                            <a class="dropdown-item ps-2 setup-reports" href="javascript:void(0);">
                                                <i class="bi bi-printer me-2"/>Reports
                                            </a>

                                            <a class="dropdown-item ps-2 setup-statuses" href="javascript:void(0);">
                                                <i class="bi bi-card-checklist me-2"/>Statuses
                                            </a>

                                            <a class="dropdown-item ps-2 setup-subscriptions" href="javascript:void(0);">
                                                <i class="bi bi-list-check me-2"/>Subscriptions
                                            </a>
                                          

                                            <div class="dropdown-divider mt-1 mb-1"></div>
                                            
                                            <a class="dropdown-item ps-2 setup-users" href="javascript:void(0);">
                                                <i class="bi bi-person-circle me-2"/>Users
                                            </a>
                                            
                                            <a class="dropdown-item ps-2 view-journal" href="javascript:void(0);">
                                                <i class="bi bi-journal me-2"/>Journal
                                            </a>
                                            
                                            <!--                                            <a class="dropdown-item ps-2 view-support-tickets" href="javascript:void(0);">
                                                <i class="bi bi-question-circle me-2"/>Support Tickets
                                            </a>-->
                                            
                                            <div class="dropdown-divider mt-1 mb-1"/>
                                            
                                        </xsl:if>
                                        
                                        <a class="dropdown-item ps-2 sign-out" href="javascript:void(0);">
                                            <i class="bi bi-box-arrow-left me-2"/>Sign Out</a>
                    
                                    </div>

                                </li>

                            </ul>

                        </div>

                    </div>

                </nav>

                <!-- Content Area -->

                <div class="container-xxl content">
          
                    $$$-CONTENT-$$$
          
                </div>

                <!-- Footer --> 

                <footer id="footer"> 

                    <div class="col text-center mt-3 lh-1">
                        <div class="m-0 p-0"> 
                            <small class="text-muted pb-4">Copyright ©2026 DEC International, LLC | All Rights Reserved</small>
                        </div>
                    </div>
          
                </footer>

                <!-- Spinner Modal Dialog -->

                <div class="modal" id="spinner-dialog" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1">
                    <div class="modal-dialog modal-sm modal-dialog-centered">
                        <div class="modal-content bg-transparent border-0">
                            <div class="modal-body text-center">
                                <div class="spinner-border text-white" style="width:5rem;height:5rem;" role="status">
                                    <span class="visually-hidden">Loading...</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Confirm Modal Dialog -->

                <div class="modal" id="confirm-dialog" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1">
                    <div class="modal-dialog modal-dialog-centered">
                        <div class="modal-content">
                            <div class="modal-header bg-primary p-1 ps-3">
                                <h6 class="modal-title text-white"/> 
                            </div>
                            <div class="modal-body mt-2"/>
                            <div class="buttons m-3 mt-2">
                                <button type="button" class="btn btn-sm btn-primary me-2 btnConfirmDialogCancel" data-bs-dismiss="modal">
                                    <i class="bi bi-box-arrow-left me-2"/>Cancel</button>
                                <button type="button" class="btn btn-sm btn-primary me-2 btnConfirmDialogConfirm">
                                    <i class="bi-check-lg me-2"/>Confirm</button>
                            </div>
                        </div>    
                    </div>
                </div>

                <!-- Continue Modal Dialog -->

                <div class="modal" id="continue-dialog" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1">
                    <div class="modal-dialog modal-dialog-centered">
                        <div class="modal-content">
                            <div class="modal-header bg-primary p-1 ps-3">
                                <h6 class="modal-title text-white"/>
                            </div>
                            <div class="modal-body mt-2"/>
                            <div class="buttons m-3 mt-2">
                                <button type="button" class="btn btn-sm btn-primary me-1 btnClose" data-bs-dismiss="modal">
                                    <i class="bi bi-box-arrow-left me-2"/>Close</button>
                            </div>
                        </div>    
                    </div>
                </div>

                <!-- Toast -->

                <div class="toast-container position-fixed bottom-0 start-50 translate-middle-x p-2">
                    <div id="toast-message" class="toast bg-primary text-center" role="alert" aria-live="assertive" aria-atomic="true" data-bs-delay="3000">
                        <div class="toast-body fs-100 text-white"/>
                    </div>
                </div>
      
                <!-- Print Dialog -->

                <div class="modal fade" id="print-dialog" tabindex="-1" role="dialog" data-bs-backdrop="static" data-bs-keyboard="false">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header bg-primary p-2 pl-2">
                                <h6 class="modal-title text-white">
                                    View / Print
                                </h6>
                            </div>
                            <div class="modal-body">
                                <div id="print-report-container"/>
                            </div> 
                            <div class="modal-footer">
                                <button type="button" class="btn page-link btn-sm mr-auto" data-dismiss="modal" data-toggle="tooltip" title="Close" data-placement="top">Close</button>
                            </div>
                        </div>    
                    </div>
                </div>
                
                <!-- Common Submit Form -->
        
                <form action="./" method="post" id="formSubmit"/>

            </body>
      
        </html>
    
    </xsl:template>

</xsl:stylesheet>
