import{jsxs as t,jsx as e}from"react/jsx-runtime";import{u as b,d as c,e as m,S as g,f as S,g as _,h as y,i as v,A as x,j as N,N as w,k as A,l as k,m as T,n as C,o as H}from"./app-sidebar-header-BX2s-HO_.js";import{g as L}from"./main-CWwoxgdq.js";import{usePage as u,Link as p}from"@inertiajs/react";import{useEffect as h}from"react";import{T as M}from"./toaster-DuLpwsc2.js";import{toast as n}from"sonner";import{B as P}from"./button-BvFBRYHq.js";import{S as j}from"./separator-BDLxzoJ8.js";import{c as B}from"./utils-CMbmcP35.js";function V({title:r,description:a}){return t("header",{children:[e("h3",{className:"mb-0.5 text-base font-medium",children:r}),a&&e("p",{className:"text-muted-foreground text-sm",children:a})]})}function I(){const{services:r}=u().props,{theme:a}=b(),s={dashboard:r?.menu_dashboard_enabled??!0,online:r?.menu_online_enabled??!0,voucher:r?.menu_voucher_enabled??!0,shop:r?.menu_shop_enabled??!0,topspender:r?.menu_topspender_enabled??!0,ingame:r?.menu_ingame_enabled??!0,historylog:r?.menu_historylog_enabled??!0,streamer:r?.menu_streamer_enabled??!0,event:r?.menu_event_enabled??!0,topup:r?.menu_topup_enabled??!0,rankingPvp:r?.menu_ranking_pvp_enabled??!0},o=L(r?.ipaymu_active??!1,r?.duitku_active??!1,r?.tripay_active??!1,r?.pakasir_active??!1,s);h(()=>{a?.colors?c(a.colors,a.respectsSystemTheme):c(m,!0)},[a]);const i=a?.colors??m,l=a?.respectsSystemTheme??!0,f=l?{}:{backgroundColor:i.background,color:i.foreground},d=l?{}:{borderColor:i.border};return t(g,{collapsible:"icon",variant:"sidebar",style:f,children:[e(S,{style:d,children:e(_,{children:e(y,{children:e(v,{size:"lg",asChild:!0,children:e(p,{href:"/dashboard",prefetch:!0,children:e(x,{})})})})})}),e(N,{children:e(w,{items:o})}),e(A,{style:d,children:e(k,{})})]})}function F({children:r,breadcrumbs:a=[]}){const{flash:s}=u().props;return h(()=>{s?.success&&n.success(s.success),s?.error&&n.error(s.error),s?.info&&n.info(s.info),s?.warning&&n.warning(s.warning)},[s]),t(T,{variant:"sidebar",children:[e(I,{}),t(C,{variant:"sidebar",children:[e(M,{}),e(H,{breadcrumbs:a}),r]})]})}const W=({children:r,breadcrumbs:a,...s})=>e(F,{breadcrumbs:a,...s,children:r});function z({title:r,description:a}){return t("div",{className:"mb-8 space-y-0.5",children:[e("h2",{className:"text-xl font-semibold tracking-tight",children:r}),a&&e("p",{className:"text-muted-foreground text-sm",children:a})]})}const $=[{title:"Profile",href:"/dashboard/settings/profile",icon:null},{title:"Password",href:"/dashboard/settings/password",icon:null},{title:"Appearance",href:"/dashboard/settings/appearance",icon:null}];function X({children:r}){if(typeof window>"u")return null;const a=window.location.pathname;return t("div",{className:"px-4 py-6",children:[e(z,{title:"Settings",description:"Manage your profile and account settings"}),t("div",{className:"flex flex-col space-y-8 lg:flex-row lg:space-y-0 lg:space-x-12",children:[e("aside",{className:"w-full max-w-xl lg:w-48",children:e("nav",{className:"flex flex-col space-y-1 space-x-0",children:$.map((s,o)=>e(P,{size:"sm",variant:"ghost",asChild:!0,className:B("w-full justify-start",{"bg-muted":a===s.href}),children:e(p,{href:s.href,prefetch:!0,children:s.title})},`${s.href}-${o}`))})}),e(j,{className:"my-6 md:hidden"}),e("div",{className:"flex-1 md:max-w-2xl",children:e("section",{className:"max-w-xl space-y-12",children:r})})]})]})}export{W as A,V as H,X as S};
