// Code generated by templ - DO NOT EDIT.

// templ: version: v0.2.663
package dev_employeeanalytic

//lint:file-ignore SA4006 This context is only used if a nested component is present.

import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"

import "cpone/layout"
import "cpone/component/customtextfield"
import "cpone/models"

func EmployeeAnalyticScreen(
	listID string,
	paginationID string,
	breadcrumb templ.Component,
	filtercomponent templ.Component,
	listingcomponent templ.Component,
	paginationcomponent templ.Component,
) templ.Component {
	return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
		if !templ_7745c5c3_IsBuffer {
			templ_7745c5c3_Buffer = templ.GetBuffer()
			defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
		}
		ctx = templ.InitializeContext(ctx)
		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
		if templ_7745c5c3_Var1 == nil {
			templ_7745c5c3_Var1 = templ.NopComponent
		}
		ctx = templ.ClearChildren(ctx)
		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"dashboardpicid\" class=\"container-fluid\">")
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "listID",
			Name:  "listID",
			Type:  "hidden",
			Value: listID}).Render(ctx, templ_7745c5c3_Buffer)
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
			Name:  "paginationID",
			Type:  "hidden",
			Value: paginationID}).Render(ctx, templ_7745c5c3_Buffer)
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row align-item-center mb-10\"><div class=\"col-md-10 col-sm-12 p-0\">")
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		templ_7745c5c3_Err = breadcrumb.Render(ctx, templ_7745c5c3_Buffer)
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		templ_7745c5c3_Err = filtercomponent.Render(ctx, templ_7745c5c3_Buffer)
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-parent\" class=\"rounded\">")
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		templ_7745c5c3_Err = listingcomponent.Render(ctx, templ_7745c5c3_Buffer)
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		templ_7745c5c3_Err = paginationcomponent.Render(ctx, templ_7745c5c3_Buffer)
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-child\" class=\"rounded bg-transparent\"><div id=\"loading-spinner\" class=\"spinner-border text-primary d-none\" style=\"width: 3rem; height: 3rem;\" role=\"status\"><span class=\"sr-only\">Loading...</span></div></div></div><div id=\"loadingcontent\"></div></div>")
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		if !templ_7745c5c3_IsBuffer {
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
		}
		return templ_7745c5c3_Err
	})
}

func CSSEmployeeAnalytic() templ.Component {
	return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
		if !templ_7745c5c3_IsBuffer {
			templ_7745c5c3_Buffer = templ.GetBuffer()
			defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
		}
		ctx = templ.InitializeContext(ctx)
		templ_7745c5c3_Var2 := templ.GetChildren(ctx)
		if templ_7745c5c3_Var2 == nil {
			templ_7745c5c3_Var2 = templ.NopComponent
		}
		ctx = templ.ClearChildren(ctx)
		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"stylesheet\" href=\"assets/css/googlefont/poppins.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><style>\r\n        body {\r\n            background-color: white;\r\n        }\r\n        #div-chart {\r\n            margin: 40px 10vw 40px 10vw;\r\n        }\r\n        .title {\r\n            font-size: 20px;\r\n            font-weight: bold;\r\n        }\r\n        #title {\r\n            font-weight: 600;\r\n        }\r\n    </style>")
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		if !templ_7745c5c3_IsBuffer {
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
		}
		return templ_7745c5c3_Err
	})
}

func JSEmployeeAnalytic() templ.Component {
	return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
		if !templ_7745c5c3_IsBuffer {
			templ_7745c5c3_Buffer = templ.GetBuffer()
			defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
		}
		ctx = templ.InitializeContext(ctx)
		templ_7745c5c3_Var3 := templ.GetChildren(ctx)
		if templ_7745c5c3_Var3 == nil {
			templ_7745c5c3_Var3 = templ.NopComponent
		}
		ctx = templ.ClearChildren(ctx)
		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script>\r\n\t\tdocument.addEventListener('htmx:afterSwap', function(event) {\r\n\t\t\t// Reinitialize selectpicker after HTMX content swap\r\n\t\t\t$('.selectpicker').selectpicker('refresh');\r\n\t\t});\r\n    \r\n        document.addEventListener('htmx:beforeRequest', function(event) {\r\n            console.log(\"Before Request\")\r\n\t\t\tconsole.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.target)\r\n            \r\n        });\r\n\r\n        document.addEventListener('htmx:afterRequest', function(event) {\r\n            console.log(\"After Request\")\r\n            console.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.target)\r\n        });\r\n        document.addEventListener('htmx:historyCacheError', function(event) {\r\n            console.log(\"Error History Cache Error\")\r\n            console.log(event.detail.cause)\r\n\t\t\t\r\n        });\r\n        document.addEventListener('htmx:historyCacheMissError', function(event) {\r\n            console.log(\"Error History Cache Miss Error\")\r\n            console.log(event.detail.xhr)\r\n            console.log(event.detail.path)\r\n\t\t\t\r\n        });\r\n        document.addEventListener('htmx:oobErrorNoTarget', function(event) {\r\n            console.log(\"Error OOB No Target\")\r\n            console.log(event.detail.content)\r\n        });\r\n        document.addEventListener('htmx:onLoadError', function(event) {\r\n            console.log(\"Error On Load\")\r\n            console.log(event.detail.xhr)\r\n            console.log(event.detail.elt)\r\n            console.log(event.detail.target)\r\n            console.log(event.detail.exception)\r\n            console.log(event.detail.requestConfig)\r\n        });\r\n        document.addEventListener('htmx:responseError', function(event) {\r\n            console.log(\"Error Response\")\r\n            console.log(event.detail.xhr)\r\n            console.log(event.detail.elt)\r\n            console.log(event.detail.requestConfig)\r\n        });\r\n        document.addEventListener('htmx:sendError', function(event) {\r\n            console.log(\"Error Send Error\")\r\n            console.log(event.detail.xhr)\r\n            console.log(event.detail.elt)\r\n            console.log(event.detail.requestConfig)\r\n        });\r\n        document.addEventListener('htmx:sseError', function(event) {\r\n            console.log(\"Error Sse \")\r\n            console.log(event.detail.xhr)\r\n            console.log(event.detail.error)\r\n            console.log(event.detail.source)\r\n        });\r\n\t\tdocument.addEventListener('htmx:swapError', function(event) {\r\n            console.log(\"Error Swap Error\")\r\n            console.log(event.detail.xhr)\r\n            console.log(event.detail.elt)\r\n            console.log(\"Target Swap: \"+event.detail.target)\r\n            console.log(event.detail.requestConfig)\r\n        });\r\n\t\tdocument.addEventListener('htmx:targetError', function(event) {\r\n            console.log(\"Error target\")\r\n            console.log(event.detail.elt)\r\n            console.log(\"Target ID: \"+event.detail.target)\r\n        });\r\n    </script>")
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		if !templ_7745c5c3_IsBuffer {
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
		}
		return templ_7745c5c3_Err
	})
}

func BeforeRequestContent() templ.ComponentScript {
	return templ.ComponentScript{
		Name: `__templ_BeforeRequestContent_5717`,
		Function: `function __templ_BeforeRequestContent_5717(){const loadingParent = document.getElementById("loading-parent");
    const loadingChild = document.getElementById("loading-child");
    const loadingSpinner = document.getElementById("loading-spinner");

    loadingParent.classList.add("overlay");
    loadingParent.classList.add("overlay-block");
    loadingChild.classList.add("overlay-layer");
    loadingSpinner.classList.remove("d-none");
}`,
		Call:       templ.SafeScript(`__templ_BeforeRequestContent_5717`),
		CallInline: templ.SafeScriptInline(`__templ_BeforeRequestContent_5717`),
	}
}

func AfterRequestContent() templ.ComponentScript {
	return templ.ComponentScript{
		Name: `__templ_AfterRequestContent_848c`,
		Function: `function __templ_AfterRequestContent_848c(){const loadingParent = document.getElementById("loading-parent");
    const loadingChild = document.getElementById("loading-child");
    const loadingSpinner = document.getElementById("loading-spinner");

    loadingParent.classList.remove("overlay");
    loadingParent.classList.remove("overlay-block");
    loadingChild.classList.remove("overlay-layer");
    loadingSpinner.classList.add("d-none");    
}`,
		Call:       templ.SafeScript(`__templ_AfterRequestContent_848c`),
		CallInline: templ.SafeScriptInline(`__templ_AfterRequestContent_848c`),
	}
}

func ShowEmployeeAnalytic(
	title string,
	cmp templ.Component,
	css templ.Component,
	js templ.Component,
	navbaruser templ.Component,
	userprofile templ.Component,
) templ.Component {
	return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
		if !templ_7745c5c3_IsBuffer {
			templ_7745c5c3_Buffer = templ.GetBuffer()
			defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
		}
		ctx = templ.InitializeContext(ctx)
		templ_7745c5c3_Var4 := templ.GetChildren(ctx)
		if templ_7745c5c3_Var4 == nil {
			templ_7745c5c3_Var4 = templ.NopComponent
		}
		ctx = templ.ClearChildren(ctx)
		templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
			if !templ_7745c5c3_IsBuffer {
				templ_7745c5c3_Buffer = templ.GetBuffer()
				defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
			}
			templ_7745c5c3_Err = cmp.Render(ctx, templ_7745c5c3_Buffer)
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			if !templ_7745c5c3_IsBuffer {
				_, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer)
			}
			return templ_7745c5c3_Err
		})
		templ_7745c5c3_Err = layout.DashboardLayout(title, css, js, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer)
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		if !templ_7745c5c3_IsBuffer {
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
		}
		return templ_7745c5c3_Err
	})
}
