@starasia/admin 14.58.0 → 14.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(u,Br){typeof exports=="object"&&typeof module<"u"?Br(exports,require("@starasia/alert"),require("@starasia/avatar"),require("@starasia/badges"),require("@starasia/box"),require("@starasia/breadcrumb"),require("@starasia/button"),require("@starasia/card"),require("@starasia/date"),require("@starasia/dialog"),require("@starasia/drawer"),require("@starasia/dropdown"),require("@starasia/hooks"),require("@starasia/http"),require("@starasia/input"),require("@starasia/menu"),require("@starasia/pagination"),require("@starasia/storage"),require("@starasia/table"),require("@starasia/tabs"),require("@starasia/textarea"),require("@starasia/theme"),require("@starasia/toast"),require("@starasia/toggle"),require("@starasia/tooltip"),require("@starasia/checkbox"),require("@starasia/radio"),require("@starasia/text"),require("@starasia/icon"),require("@starasia/flex"),require("@starasia/grid"),require("@starasia/progress"),require("@starasia/stepper"),require("@starasia/accordion"),require("@starasia/story-record"),require("@starasia/skeleton"),require("@starasia/progress-stepper"),require("react/jsx-runtime"),require("react"),require("react-dom"),require("react-easy-crop")):typeof define=="function"&&define.amd?define(["exports","@starasia/alert","@starasia/avatar","@starasia/badges","@starasia/box","@starasia/breadcrumb","@starasia/button","@starasia/card","@starasia/date","@starasia/dialog","@starasia/drawer","@starasia/dropdown","@starasia/hooks","@starasia/http","@starasia/input","@starasia/menu","@starasia/pagination","@starasia/storage","@starasia/table","@starasia/tabs","@starasia/textarea","@starasia/theme","@starasia/toast","@starasia/toggle","@starasia/tooltip","@starasia/checkbox","@starasia/radio","@starasia/text","@starasia/icon","@starasia/flex","@starasia/grid","@starasia/progress","@starasia/stepper","@starasia/accordion","@starasia/story-record","@starasia/skeleton","@starasia/progress-stepper","react/jsx-runtime","react","react-dom","react-easy-crop"],Br):(u=typeof globalThis<"u"?globalThis:u||self,Br(u["@starasia/admin"]={},u.alert,u.avatar,u.badges,u.box,u.breadcrumb,u.button,u.card,u.date,u.dialog,u.drawer,u.dropdown,u.hooks,u.http,u.input,u.menu,u.pagination,u.storage,u.table,u.tabs,u.textarea,u.theme,u.toast,u.toggle,u.tooltip,u.checkbox,u.radio,u.text,u.icon,u.flex,u.grid,u.progress,u.stepper,u.accordion,u.storyRecord,u.skeleton,u.progressStepper,u.jsxRuntime,u.React,u.ReactDOM,u.ReactEasyCrop))})(this,function(u,Br,Jr,nr,f,mr,_,It,xr,Oe,$r,Er,ke,Fr,hr,z,Pr,_r,G,So,Lt,Ir,ko,Lr,Te,fr,Mt,k,I,de,Bo,mo,Eo,Fo,Io,rr,Lo,e,h,Kr,Dn){"use strict";const Sn={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Tt=h.createContext(Sn),At=()=>h.useContext(Tt),Mo=r=>{const[t,o]=h.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:o}},To=h.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),Ao=({children:r})=>{const[t,o]=h.useState({}),n=h.useCallback(c=>{o(a=>typeof c=="function"?c(a):c)},[]),l=h.useCallback((c,a)=>{o(d=>{const g=typeof a=="function"?a(d[c]):a;return{...d,[c]:g}})},[]),s=h.useCallback(c=>{o(a=>{if(!(c in a))return a;const d={...a};return delete d[c],d})},[]),i=h.useMemo(()=>({badges:t,setBadge:l,setBadges:n,clearBadge:s}),[t,l,n,s]);return e.jsx(To.Provider,{value:i,children:r})},Oo=()=>h.useContext(To),Rr=(r,t)=>{const o=t!==void 0?t:r;return o==null?null:typeof o=="string"||typeof o=="number"?{value:o}:o},Ot=240,Wt=200,zt=480,kn="sa-sidebar-width",Ht=(r,t,o)=>Math.min(Math.max(r,t),o),Bn=(r,t,o,n)=>{if(typeof window>"u")return t;try{const l=window.localStorage.getItem(r);if(!l)return t;const s=parseInt(l,10);return Number.isFinite(s)?Ht(s,o,n):t}catch{return t}},Wo=(r,t)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(r,String(t))}catch{}},zo=h.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},width:Ot,setWidth:()=>{},resetWidth:()=>{},minWidth:Wt,maxWidth:zt,mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),Ho=({children:r,defaultCollapsed:t=!1,defaultWidth:o=Ot,minWidth:n=Wt,maxWidth:l=zt,widthStorageKey:s=kn})=>{const[i,c]=h.useState(t),[a,d]=h.useState(!1),[g,b]=h.useState(()=>Bn(s,o,n,l)),p=h.useCallback(m=>{c(O=>typeof m=="function"?m(O):m)},[]),C=h.useCallback(()=>c(m=>!m),[]),w=h.useCallback(()=>c(!0),[]),S=h.useCallback(()=>c(!1),[]),H=h.useCallback(m=>{b(O=>{const N=typeof m=="function"?m(O):m,$=Ht(Math.round(N),n,l);return Wo(s,$),$})},[n,l,s]),T=h.useCallback(()=>{const m=Ht(o,n,l);Wo(s,m),b(m)},[o,n,l,s]),A=h.useCallback(m=>{d(O=>typeof m=="function"?m(O):m)},[]),x=h.useCallback(()=>d(!0),[]),B=h.useCallback(()=>d(!1),[]),W=h.useCallback(()=>d(m=>!m),[]),F=h.useMemo(()=>({collapsed:i,setCollapsed:p,toggle:C,collapse:w,expand:S,width:g,setWidth:H,resetWidth:T,minWidth:n,maxWidth:l,mobileOpen:a,setMobileOpen:A,openMobile:x,closeMobile:B,toggleMobile:W}),[i,p,C,w,S,g,H,T,n,l,a,A,x,B,W]);return e.jsx(zo.Provider,{value:F,children:r})},Po=()=>h.useContext(zo),_o=h.createContext(null),jo=({adapter:r,children:t})=>e.jsx(_o.Provider,{value:r,children:t}),sr=()=>{const r=h.useContext(_o);if(!r)throw new Error("[@starasia/admin] Router adapter belum dipasang. Bungkus aplikasi dengan <App routerAdapter={...} /> atau <StarasiaRouterProvider adapter={...}>. Import adapter dari '@starasia/admin/adapters/react-router' atau '@starasia/admin/adapters/tanstack'.");return r},No=({router:r,routerAdapter:t,menus:o=[],menuBottom:n,logo:l,appName:s="Workspace",initialUserData:i,theme:c})=>{const a=Mo({initialUserData:i}),{theme:d}=Ir.useTheme();return e.jsx(jo,{adapter:t,children:e.jsx(Tt.Provider,{value:{logo:l,appName:s,menus:o,userData:a.userData,setUserData:a.setUserData,menuBottom:n},children:e.jsx(Ao,{children:e.jsx(Ho,{children:c?e.jsx(Ir.ThemeProvider,{value:c,children:r}):d?e.jsx(Ir.ThemeProvider,{value:d,children:r}):r})})})})},mn=h.memo(No);function Vo({collapsed:r=!1,children:t}){if(!t)return null;const o=typeof t=="function",n=o?t({collapsed:r}):t;return n==null||n===!1?null:e.jsx("div",{style:{position:"sticky",top:"var(--app-header-height, 4rem)",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:r?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingRight:r?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:o?n:e.jsx("div",{style:{opacity:r?0:1,transition:"opacity 0.3s",visibility:r?"hidden":"visible"},children:n})})}const Pt=h.createContext(null);function qo({children:r}){const[t,o]=h.useState(null),[n,l]=h.useState(null),[s,i]=h.useState(null),[c,a]=h.useState(0),d=h.useCallback(()=>(a(g=>g+1),()=>a(g=>g-1)),[]);return e.jsx(Pt.Provider,{value:{prependNode:t,appendNode:n,replaceNode:s,setPrependNode:o,setAppendNode:l,setReplaceNode:i,replaceCount:c,registerReplace:d},children:r})}function Zo({children:r}){const t=h.useContext(Pt);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t.setPrependNode,style:{display:"contents"}}),t.replaceCount>0?e.jsx("div",{ref:t.setReplaceNode,style:{display:"contents"}}):r,e.jsx("div",{ref:t.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:r})}function En({children:r,mode:t="append"}){const o=h.useContext(Pt);if(h.useEffect(()=>{if(!(t!=="replace"||!o))return o.registerReplace()},[t,o]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const n=t==="prepend"?o.prependNode:t==="replace"?o.replaceNode:o.appendNode;return n?Kr.createPortal(r,n):null}const _t=h.createContext(null);function Go({children:r}){const[t,o]=h.useState({}),[n,l]=h.useState({}),s=h.useCallback((a,d)=>{o(g=>g[a]===d?g:{...g,[a]:d})},[]),i=h.useCallback(a=>(l(d=>({...d,[a]:(d[a]??0)+1})),()=>l(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),c=h.useMemo(()=>({outletNodes:t,setOutletNode:s,slotCounts:n,registerSlot:i}),[t,s,n,i]);return e.jsx(_t.Provider,{value:c,children:r})}function jt({slotKey:r,fallback:t}){const o=h.useContext(_t),n=o?(o.slotCounts[r]??0)>0:!1,l=h.useRef(o==null?void 0:o.setOutletNode);l.current=o==null?void 0:o.setOutletNode;const s=h.useCallback(i=>{var c;return(c=l.current)==null?void 0:c.call(l,r,i)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:s,style:{display:"contents"}}):t})}function Fn({slotKey:r,children:t}){const o=h.useContext(_t),n=h.useRef(o==null?void 0:o.registerSlot);if(n.current=o==null?void 0:o.registerSlot,h.useEffect(()=>{var s;return(s=n.current)==null?void 0:s.call(n,r)},[r]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const l=o.outletNodes[r];return l?Kr.createPortal(t,l):null}const et="moduleSwitcherGroupId",Nt="sa-module-switcher-change";function Qo(){if(typeof window>"u")return null;const r=window.localStorage.getItem(et);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function Uo(r){typeof window>"u"||(r===null?window.localStorage.removeItem(et):window.localStorage.setItem(et,String(r)),window.dispatchEvent(new CustomEvent(Nt,{detail:r})))}function In(){Uo(null)}function Vt(){const[r,t]=h.useState(()=>Qo());return h.useEffect(()=>{const n=()=>{t(Qo())},l=s=>{s.key===et&&n()};return window.addEventListener(Nt,n),window.addEventListener("storage",l),()=>{window.removeEventListener(Nt,n),window.removeEventListener("storage",l)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{Uo(n),t(n)}}}const qt="var(--sa-app-sidebar-bg, var(--sa-background-primary-inverse))",Be={row:"_row_134el_37",rowIcon:"_rowIcon_134el_62",chevron:"_chevron_134el_73",label:"_label_134el_82",popoverLabel:"_popoverLabel_134el_87",badgeDotRing:"_badgeDotRing_134el_92",indicator:"_indicator_134el_99",submenu:"_submenu_134el_125",submenuInner:"_submenuInner_134el_146",submenuLine:"_submenuLine_134el_151",childRow:"_childRow_134el_160",groupLabel:"_groupLabel_134el_180",railButton:"_railButton_134el_198",railIcon:"_railIcon_134el_208",railBadge:"_railBadge_134el_239",railLabel:"_railLabel_134el_244",railTabs:"_railTabs_134el_252",railTab:"_railTab_134el_252",railTabLabel:"_railTabLabel_134el_287"},Ln="4.5rem",Mn="var(--app-header-height, 4rem)",Yo=r=>r?Ln:Mn;function Xo({icon:r,label:t,tooltip:o=t,selected:n,location:l=!1,badge:s,showLabel:i=!0,onClick:c}){const a=n===!0;return e.jsx(Te.Tooltip,{fluid:!0,label:o,position:"right",children:e.jsxs(f.Box,{as:"button",position:"relative",onClick:c,"aria-label":o,"aria-pressed":n,className:Be.railButton,"data-active":a||void 0,"data-location":l||void 0,fullWidth:!0,direction:"column",align:"center",gap:"spacing-2",paddingBlock:"xs",children:[e.jsxs(f.Box,{position:"relative",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",borderRadius:a?"rounded-sm":"rounded-md",className:Be.railIcon,children:[e.jsx(I.Icon,{name:r,size:"sm"}),s&&!i&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",className:Be.badgeDotRing,children:e.jsx(nr.BadgeDot,{tone:"error",variant:"solid",size:"xs"})}),s&&i&&e.jsx(f.Box,{position:"absolute",display:"inline-flex",className:Be.railBadge,children:e.jsx(nr.Badge,{text:String(s.value),variant:s.variant??"info",size:"xs",border:!0})})]}),i&&e.jsx(k.Text,{as:"span",fontSize:"xs",fontWeight:a?"medium":"normal",textAlign:"center",truncate:!0,className:Be.railLabel,children:t})]})})}function Tn({items:r,bottomItems:t,activeKey:o,locationKey:n,onSelect:l,onAction:s,logo:i,panelCollapsed:c,onExpandPanel:a,showLabels:d=!0,theme:g}){const[b,p]=h.useState(!1),C=c&&b;return e.jsxs(f.Box,{as:"nav","aria-label":"Primary navigation","data-slot":"app-rail","data-theme":g,bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:"0",style:{width:Yo(d),height:"100%",backgroundColor:qt},children:[e.jsxs(f.Box,{onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),position:"relative",align:"center",justify:"center",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",flexShrink:"0",style:{height:"var(--app-header-height, 4rem)"},children:[e.jsx("img",{src:i,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",transition:"opacity 0.2s",opacity:C?0:1}}),c&&e.jsx(f.Box,{as:"button",onClick:a,"aria-label":"Expand sidebar",position:"absolute",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-sm",style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"var(--sa-text-primary, #292a2e)",opacity:C?1:0,pointerEvents:C?"auto":"none",transition:"opacity 0.2s"},children:e.jsx(I.Icon,{name:"LayoutLeft",size:"sm"})})]}),e.jsx(f.Box,{flex:"1",overflow:"overflow-y-auto",paddingBlock:"md",paddingInline:"xs",gap:"xs",children:r.map(w=>e.jsx(Xo,{icon:w.icon,label:w.label,tooltip:w.tooltip,badge:w.badge,showLabel:d,selected:w.key===o,location:w.key===n,onClick:()=>l(w.key)},w.key))}),t&&t.length>0&&e.jsx(f.Box,{borderWidth:"border-t",borderStyle:"border-solid-t",borderColor:"border-base",paddingBlock:"md",paddingInline:"xs",gap:"xs",flexShrink:"0",children:t.map(w=>e.jsx(Xo,{icon:w.icon,label:w.label,tooltip:w.tooltip,badge:w.badge,showLabel:d,onClick:()=>s(w)},w.key))})]})}function An({items:r,activeKey:t,locationKey:o,onSelect:n}){return e.jsx(f.Box,{role:"tablist","aria-label":"Primary navigation",direction:"row",gap:"xs",paddingInline:"md",paddingBlock:"sm",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",flexShrink:"0",className:Be.railTabs,children:r.map(l=>{const s=l.key===t,i=l.key===o;return e.jsxs(f.Box,{as:"button",role:"tab","aria-selected":s,className:Be.railTab,"data-active":s||void 0,"data-location":i||void 0,onClick:()=>n(l.key),position:"relative",direction:"row",align:"center",gap:"spacing-4",paddingInline:"sm",height:"height-32",flexShrink:"0",borderRadius:s?"rounded-sm":"rounded-md",hover:s?void 0:{bg:"neutral"},children:[e.jsx(I.Icon,{name:l.icon,size:"sm"}),e.jsx(k.Text,{as:"span",fontSize:"sm",fontWeight:s?"medium":"normal",className:Be.railTabLabel,children:l.label})]},l.key)})})}const Zt=(r,t)=>!r.groupIds||r.groupIds.includes(t.id)||t.parentGroupId!==void 0&&r.groupIds.includes(t.parentGroupId),Jo=(r,t)=>r.find(o=>o.groupIds&&Zt(o,t))??r.find(o=>!o.groupIds);let rt=0,Sr=!1,$o=new Set;const Ko=new Set;function On(r,t){const[o,n]=h.useState(!1),l=h.useRef(null),s=h.useRef(null);return h.useLayoutEffect(()=>{const i=l.current;if(!i)return;let c=0;const a=()=>{c=0;const g=s.current;if(!g)return;const b=g.scrollWidth>i.clientWidth;n(p=>p===b?p:b)},d=new ResizeObserver(()=>{c||(c=requestAnimationFrame(a))});return d.observe(i),a(),()=>{c&&cancelAnimationFrame(c),d.disconnect()}},[r,t]),{containerRef:l,textRef:s,truncated:o}}function Ro({text:r,emphasis:t}){const{containerRef:o,textRef:n,truncated:l}=On(r,t),s=e.jsx(k.Text,{ref:n,as:"span",fontSize:"md",fontWeight:t==="location"?"semibold":t==="trail"?"medium":"normal",truncate:!0,className:Be.label,children:r});return e.jsx(f.Box,{ref:o,display:"block",flex:"1",minWidth:"width-0",children:l?e.jsx(Te.Tooltip,{fluid:!0,label:r,position:"top",children:s}):s})}const Wn=200,Gt="var(--app-header-height, 4rem)",el="44px",Qt=`calc((${Gt} - 2rem) / 2)`,rl=16;function zn({children:r,headerLeftSlot:t,profile:o,isLoadingProfile:n,onLogout:l,isLoggingOut:s,loadingComponent:i,sidebarHeaderContent:c,headerActions:a,profileRole:d,profileMenuButtons:g,profileMenuItems:b,logoutButton:p,resizableSidebar:C=!0,rail:w,sidebarTheme:S}){var Ur,zr,kt;const{useSearchParams:H,useNavigate:T,useLocation:A,Outlet:x}=sr(),[B]=H(),W=B.get("embed")==="true",F=At(),{badges:m}=Oo(),O=T(),N=A(),M=!ke.useMediaQuery("md"),[q,J]=h.useState(!1),{collapsed:U,setCollapsed:K,width:R,setWidth:ae,resetWidth:Q,minWidth:re,maxWidth:he,mobileOpen:ve,setMobileOpen:Me}=Po(),[Ie,Ce]=h.useState(!1),[ye,Ze]=h.useState(()=>new Set($o)),[ze,Ge]=h.useState(null),{selectedGroupId:ne,setSelectedGroupId:me}=Vt(),we=!!(w&&w.items.length>0),oe=U&&!M&&!we,Fe=U&&!M&&we;h.useEffect(()=>{$o=ye},[ye]);const Ke=h.useRef(null),or=h.useRef(null),P=h.useRef(null),[Y,X]=h.useState(!1),[fe,Le]=h.useState(null),pe=C&&!M&&!U,Pe=E=>Math.min(Math.max(E,re),he),Re=fe??R,Ye=E=>{var Ve,Je,$e;if(!pe)return;E.preventDefault();const j=E.clientX,Z=((Ve=P.current)==null?void 0:Ve.getBoundingClientRect().width)??R;($e=(Je=E.currentTarget).setPointerCapture)==null||$e.call(Je,E.pointerId),X(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize";let ie=0,ge=Z;const xe=gr=>{ge=Z+(gr.clientX-j),ie||(ie=requestAnimationFrame(()=>{ie=0,Le(Pe(ge))}))},Ae=()=>{ie&&cancelAnimationFrame(ie),window.removeEventListener("pointermove",xe),window.removeEventListener("pointerup",Ae),document.body.style.userSelect="",document.body.style.cursor="",Le(null),X(!1),ge<Wn?K(!0):ae(Pe(ge))};window.addEventListener("pointermove",xe),window.addEventListener("pointerup",Ae)},_e=E=>{pe&&(E.key==="ArrowLeft"?(E.preventDefault(),ae(j=>j-rl)):E.key==="ArrowRight"?(E.preventDefault(),ae(j=>j+rl)):E.key==="Home"?(E.preventDefault(),ae(re)):E.key==="End"&&(E.preventDefault(),ae(he)))};h.useEffect(()=>{const E=Ke.current;if(!E)return;const j=()=>{Sr||(rt=E.scrollTop)};return E.addEventListener("scroll",j),()=>E.removeEventListener("scroll",j)},[]);const Xe=()=>{const E=Ke.current;E&&rt>0&&(Sr=!0,E.scrollTop=rt,requestAnimationFrame(()=>{Sr=!1}))};h.useLayoutEffect(()=>{Sr=!0,Xe();const E=setTimeout(()=>{Sr=!1},300);return()=>clearTimeout(E)},[]),h.useLayoutEffect(()=>{F.menus.length>0&&(rt>0?Xe():requestAnimationFrame(()=>{var j;const E=(j=Ke.current)==null?void 0:j.querySelector("[data-menu-active='true']");E&&E.scrollIntoView({block:"center",behavior:"instant"})}))},[F.menus]),h.useEffect(()=>{Sr=!0,Xe();const E=setTimeout(Xe,0),j=setTimeout(Xe,50),Z=setTimeout(Xe,100),ie=setTimeout(Xe,200),ge=setTimeout(()=>{Sr=!1},300),xe=setTimeout(()=>{const Ae=Ke.current,Ve=Ae==null?void 0:Ae.querySelector("[data-menu-active='true']");if(Ae&&Ve){const Je=Ae.getBoundingClientRect(),$e=Ve.getBoundingClientRect();$e.top>=Je.top&&$e.bottom<=Je.bottom||Ve.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(E),clearTimeout(j),clearTimeout(Z),clearTimeout(ie),clearTimeout(ge),clearTimeout(xe)}},[N.pathname]),h.useEffect(()=>{or.current&&(or.current.scrollTop=0)},[N.pathname]),h.useEffect(()=>{M&&Me(!1)},[N.pathname,M]),h.useEffect(()=>{M&&K(!0)},[M]),h.useEffect(()=>{const E=document.documentElement;return E.style.setProperty("--app-header-height",el),()=>{E.style.removeProperty("--app-header-height")}},[]);const vr=()=>{J(!0)},Ee=()=>{J(!1)},je=()=>{J(!1),l()},ur=E=>{const j=E.slotKey?[]:[E.to];return E.children&&j.push(...E.children.map(Z=>Z.to)),j},Ar=[...F.menus.flatMap(E=>E.items.flatMap(ur)),...((Ur=F.menuBottom)==null?void 0:Ur.flatMap(ur))??[]],lr=E=>{if(!N.pathname.startsWith(E))return!1;const j=Ar.filter(Z=>N.pathname.startsWith(Z)).sort((Z,ie)=>ie.length-Z.length)[0];return E===j},Dr=h.useRef(w);Dr.current=w;const Cr=()=>F.menus.find(E=>E.items.some(j=>ur(j).some(lr))),Ne=E=>{const j=Dr.current;if(!j||j.items.length===0)return null;const Z=j.defaultKey??j.items[0].key,ie=j.items.find(Ae=>Ae.key===E),ge=Cr();if(!ge)return ie?ie.key:Z;if(ie&&Zt(ie,ge))return ie.key;const xe=Jo(j.items,ge);return(xe==null?void 0:xe.key)??(ie==null?void 0:ie.key)??Z},[Ct,wt]=h.useState(()=>Ne(null));h.useEffect(()=>{wt(E=>Ne(E))},[N.pathname,F.menus]);const Qe=we?w.items.find(E=>E.key===Ct)??w.items[0]:void 0,xt=we?Cr():void 0,Dt=xt?(zr=Jo(w.items,xt))==null?void 0:zr.key:void 0,Or=E=>{wt(E),Fe&&K(!1)},yo=E=>{E.onClick?E.onClick():E.to&&O(E.to)};h.useEffect(()=>{var j;const E=Z=>{var ge;const ie=Z.defaultExpanded&&!Ko.has(Z.id);ie&&Ko.add(Z.id),(ie||(ge=Z.children)!=null&&ge.some(xe=>N.pathname.startsWith(xe.to)))&&Ze(xe=>{const Ae=new Set(xe);return Ae.add(Z.id),Ae})};F.menus.forEach(Z=>{Z.items.forEach(E)}),(j=F.menuBottom)==null||j.forEach(E)},[N.pathname,F.menus,F.menuBottom]);const kr=E=>{Ze(j=>{const Z=new Set(j);return Z.has(E)?Z.delete(E):Z.add(E),Z})};h.useEffect(()=>{F.menus.length!==0&&ne!==null&&!F.menus.some(E=>E.id===ne)&&me(null)},[F.menus,ne,me]);const St=h.useMemo(()=>{if(Qe!=null&&Qe.groupIds)return F.menus.filter(ge=>Zt(Qe,ge));const E=F.menus,j=we?null:ne;if(j!==null)return E.filter(ge=>ge.id===j||ge.parentGroupId===j);const Z=E.filter(ge=>ge.parentGroupId===void 0),ie=E.filter(ge=>ge.parentGroupId!==void 0).flatMap(ge=>ge.items);return ie.length===0?Z:[...Z,{id:18,name:"Pengaturan",items:ie,parentGroupId:void 0}]},[F.menus,ne,Qe,we]);if(W)return e.jsx(f.Box,{as:"main",overflow:"overflow-y-auto",bg:"surface-inverse",style:{height:"100vh"},children:r||e.jsx(x,{})});const Wr=E=>{const j=E.children&&E.children.length>0,Z=!!E.slotKey,ie=j||Z,ge=ye.has(E.id),xe=j?E.children.some(gr=>lr(gr.to)):Z?!1:lr(E.to),Ae=xe&&j&&ge&&!oe,Ve=xe&&!Ae,Je=Rr(E.badge,m[E.id]),$e=!!Je&&oe;return e.jsxs(f.Box,{display:"block","data-menu-active":xe||void 0,children:[e.jsxs(f.Box,{as:"button",position:"relative",onClick:gr=>{if(Z&&oe)O(E.to);else if(ie)if(oe){const wr=gr.currentTarget.getBoundingClientRect();Ge({item:E,top:wr.top,left:wr.right+8})}else kr(E.id);else O(E.to)},fullWidth:!0,direction:"row",align:"center",justify:oe?"center":void 0,gap:"sm",paddingInline:oe?void 0:"sm",paddingBlock:"xs",height:"height-32",borderRadius:Ve?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",hover:Ve?void 0:{bg:"neutral"},title:oe?E.title:void 0,className:`${Be.row} ${Be.indicator}`,"data-active":xe||void 0,"data-location":Ve||void 0,"data-trail":Ae||void 0,"data-compact":oe||void 0,"aria-current":Ve&&!j?"page":void 0,"aria-expanded":ie&&!oe?ge:void 0,children:[e.jsxs(f.Box,{position:"relative",display:"inline-flex",align:"center",flexShrink:"0",children:[e.jsx(I.Icon,{name:E.icon,size:"sm",className:Be.rowIcon}),$e&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",className:Be.badgeDotRing,children:e.jsx(nr.BadgeDot,{tone:"error",variant:"solid",size:"xs"})})]}),!oe&&e.jsxs(e.Fragment,{children:[e.jsx(Ro,{text:E.title,emphasis:Ve?"location":Ae?"trail":void 0}),Je&&e.jsx(nr.Badge,{text:String(Je.value),variant:Je.variant??"info",size:"xs",border:!0}),ie&&e.jsx(I.Icon,{name:"ChevronDown",size:"sm",className:Be.chevron})]})]}),ie&&!oe&&(()=>{const wr=(E.children??[]).map(yr=>{const Yr=Rr(yr.badge,m[yr.id]),pr=lr(yr.to);return e.jsxs(f.Box,{as:"button",onClick:()=>O(yr.to),position:"relative",fullWidth:!0,direction:"row",align:"center",gap:"sm",paddingLeft:"sm",paddingRight:"sm",paddingBlock:"xs",height:"height-32",borderRadius:pr?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",hover:pr?void 0:{bg:"neutral"},className:`${Be.row} ${Be.childRow}`,"data-active":pr||void 0,"data-location":pr||void 0,"aria-current":pr?"page":void 0,children:[e.jsx(I.Icon,{name:yr.icon,size:"sm",className:Be.rowIcon}),e.jsx(Ro,{text:yr.title,emphasis:pr?"location":void 0}),Yr&&e.jsx(nr.Badge,{text:String(Yr.value),variant:Yr.variant??"info",size:"xs",border:!0})]},yr.id)});return e.jsx(f.Box,{className:Be.submenu,"data-open":ge||void 0,children:e.jsxs(f.Box,{position:"relative",overflow:"overflow-hidden",className:Be.submenuInner,children:[e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",top:"top-0",fullHeight:!0,className:Be.submenuLine}),Z?e.jsx(jt,{slotKey:E.slotKey,fallback:wr}):wr]})})})()]},E.id)};return e.jsx(Go,{children:e.jsxs(qo,{children:[e.jsxs(f.Box,{direction:"row",position:"relative",style:{height:"100vh","--app-header-height":el,"--app-sidebar-width":M?"0px":we?`calc(${Yo(w.showLabels??!0)} + ${Fe?"0px":`${Re}px`})`:U?Gt:`${Re}px`,"--app-footer-zindex":M&&ve?"40":"998"},children:[M&&e.jsx(f.Box,{position:"fixed",zIndex:"40",bg:"black-alpha-a50",style:{inset:0,opacity:ve?.5:0,pointerEvents:ve?"auto":"none",transition:"opacity 0.3s"},onClick:()=>Me(!1)}),we&&!M&&e.jsx(Tn,{items:w.items,bottomItems:w.bottomItems,activeKey:Qe.key,locationKey:Dt,onSelect:Or,onAction:yo,logo:F.logo,panelCollapsed:Fe,onExpandPanel:()=>K(!1),showLabels:w.showLabels??!0,theme:S}),e.jsxs(f.Box,{as:"aside",ref:P,"aria-hidden":Fe||void 0,"data-slot":"app-sidebar","data-theme":S,bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:M?void 0:"0",style:{width:M?"16.375rem":Fe?"0px":U?Gt:`${Re}px`,...Fe&&{borderRightWidth:0,overflow:"hidden",visibility:"hidden"},position:M?"fixed":"relative",...M&&{inset:0,zIndex:50,transform:ve?"translateX(0)":"translateX(-100%)"},transition:Y?"none":"all 0.3s ease-in-out",minWidth:0,backgroundColor:qt},children:[e.jsx(f.Box,{onMouseEnter:()=>Ce(!0),onMouseLeave:()=>Ce(!1),direction:"row",align:"center",justify:"space-between",paddingInline:oe?void 0:"lg",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",position:"relative",style:{height:"var(--app-header-height, 4rem)",...oe?{paddingInline:Qt}:null},children:(()=>{const E=we&&!M,j=Qe!=null&&Qe.groupIds?Qe.tooltip??Qe.label:F.appName,Z=!M&&U&&!ve&&!we,ie=Z&&Ie;return e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flex:Z?"1":void 0,justify:Z?"center":void 0,style:{transition:"opacity 0.2s",opacity:ie?0:1,pointerEvents:ie?"none":"auto"},children:[!E&&e.jsx("img",{src:F.logo,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",flexShrink:0}}),(!U||ve)&&e.jsx(k.Text,{as:"span",fontSize:"md",fontWeight:"semibold",color:"primary",truncate:!0,style:{transition:"opacity 0.3s"},children:E?j:F.appName})]}),!M&&!U&&e.jsx(f.Box,{as:"button",onClick:()=>K(!0),"aria-label":"Collapse sidebar",display:"inline-flex",align:"center",justify:"center",flexShrink:"0",style:{color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(I.Icon,{name:"LayoutLeft",size:"sm"})}),Z&&e.jsx(f.Box,{as:"button",onClick:()=>K(!1),"aria-label":"Expand sidebar",position:"absolute",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-sm",style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"var(--sa-text-primary, #292a2e)",opacity:ie?1:0,pointerEvents:ie?"auto":"none",transition:"opacity 0.2s"},children:e.jsx(I.Icon,{name:"LayoutLeft",size:"sm"})}),M&&e.jsx(f.Box,{as:"button",onClick:()=>Me(!1),"aria-label":"Close menu",align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(I.Icon,{name:"Cross",size:"md"})})]})})()}),c&&e.jsx(Vo,{collapsed:M||we?!1:U,children:c}),we&&M&&e.jsx(An,{items:w.items,activeKey:Qe.key,locationKey:Dt,onSelect:Or}),e.jsx(f.Box,{ref:Ke,flex:"1",overflow:"overflow-y-auto",paddingBlock:"lg",children:St.map(E=>{const j=E.items.some(Z=>ur(Z).some(lr));return e.jsxs(f.Box,{marginBottom:"lg",children:[oe?E.name&&e.jsx(f.Box,{"aria-label":E.name,direction:"row",align:"center",justify:"center",paddingBlock:"md",children:e.jsx(f.Box,{width:"width-16",style:{height:"2px",borderRadius:"min(1px, var(--sa-radii-xs, 4px))",backgroundColor:E.color??"var(--sa-background-brand, #04254f)"}})}):E.name&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"semibold",color:"subtlest",textTransform:"uppercase",truncate:!0,className:Be.groupLabel,"data-active":j||void 0,children:E.name}),e.jsx(f.Box,{paddingInline:oe?void 0:"md",gap:"xs",style:oe?{paddingInline:Qt}:void 0,children:E.slotKey?e.jsx(jt,{slotKey:E.slotKey,fallback:E.items.map(Z=>Wr(Z))}):E.items.map(Z=>Wr(Z))})]},E.id)})}),F.menuBottom&&F.menuBottom.length>0&&e.jsx(f.Box,{borderWidth:"border-t",borderStyle:"border-solid-t",borderColor:"border-base",paddingBlock:"md",paddingInline:oe?void 0:"md",bg:"surface-inverse",gap:"xs",flexShrink:"0",style:{backgroundColor:qt,...oe?{paddingInline:Qt}:null},children:F.menuBottom.map(E=>Wr(E))}),pe&&e.jsx(f.Box,{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":R,"aria-valuemin":re,"aria-valuemax":he,tabIndex:0,onPointerDown:Ye,onKeyDown:_e,onDoubleClick:Q,title:"Drag to resize · double-click to reset",position:"absolute",top:"top-0",right:"right-0",fullHeight:!0,style:{width:"6px",transform:"translateX(50%)",cursor:"col-resize",zIndex:5,touchAction:"none",background:Y?"var(--sa-background-brand, #04254f)":"transparent",transition:"background 0.15s"},onMouseEnter:E=>{Y||(E.currentTarget.style.background="var(--sa-border-bold, #0b120e40)")},onMouseLeave:E=>{Y||(E.currentTarget.style.background="transparent")}})]}),e.jsxs(f.Box,{flex:"1",overflow:"overflow-hidden",children:[e.jsxs(f.Box,{as:"header",bg:"white",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",direction:"row",align:"center",justify:"space-between",paddingInline:"lg",flexShrink:"0",style:{height:"var(--app-header-height, 4rem)"},children:[e.jsxs(f.Box,{direction:"row",align:"center",gap:M?"lg":void 0,children:[M&&e.jsx(f.Box,{as:"button",onClick:()=>Me(!0),align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(I.Icon,{name:"MenuBurger",size:"lg"})}),e.jsx(Zo,{children:t})]}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"md",children:[a,e.jsxs(z.Menu,{position:"bottom-right",children:[e.jsx(z.MenuButton,{children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",cursor:"pointer",children:[!M&&e.jsxs(f.Box,{display:"block",textAlign:"right",customMaxWidth:"12.5rem",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",textAlign:"right",truncate:!0,lineHeight:"leading-none",children:n?"Loading...":(o==null?void 0:o.name)||"unknown"}),e.jsx(k.Text,{fontSize:"sm",color:"subtle",textAlign:"right",truncate:!0,children:n?"":(o==null?void 0:o.email)||"unknown"})]}),e.jsx(Jr.Avatar,{size:"sm",src:(o==null?void 0:o.avatar)||void 0,name:o==null?void 0:o.name,initials:((o==null?void 0:o.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)"}),e.jsx(I.Icon,{name:"ChevronDown",size:"xs",color:"subtle"})]})}),e.jsxs(z.MenuLists,{width:280,style:{paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(z.MenuHeading,{children:e.jsxs(f.Box,{align:"center",textAlign:"center",paddingBlock:"sm",fullWidth:!0,children:[e.jsx(Jr.Avatar,{customSize:64,src:(o==null?void 0:o.avatar)||void 0,name:o==null?void 0:o.name,initials:((o==null?void 0:o.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)",style:{fontSize:"1.25rem",marginBottom:"0.75rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)"}}),e.jsx(k.Text,{fontSize:"md",fontWeight:"semibold",color:"primary",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.name)||"unknown"}),e.jsx(k.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.email)||"unknown"}),d&&e.jsx(k.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:d})]})}),(g&&g.length>0||b)&&e.jsxs(z.MenuBody,{children:[g==null?void 0:g.map((E,j)=>e.jsx(z.MenuItem,{onClick:E.onClick,startIcon:e.jsx(I.Icon,{name:E.icon,size:"md"}),children:E.label},`${E.label}-${j}`)),b]}),p??e.jsx(z.MenuFooter,{children:e.jsx(z.MenuItem,{intent:"danger",onClick:vr,startIcon:e.jsx(I.Icon,{name:"Logout",size:"md"}),children:"Logout"})})]})]})]})]}),e.jsx(f.Box,{as:"main",ref:or,flex:"1",overflow:"overflow-y-auto",children:r||e.jsx(x,{})})]})]}),s&&i&&e.jsx(f.Box,{position:"fixed",align:"center",justify:"center",bg:"black-alpha-a70",style:{inset:0,zIndex:9999},children:i}),e.jsxs(Oe.Dialog,{isShow:q,onHide:Ee,children:[e.jsx(Oe.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Oe.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Oe.DialogFooter,{children:e.jsx(f.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(de.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(f.Box,{direction:"column",children:e.jsx(_.Button,{secondary:!0,onClick:Ee,children:"Cancel"})}),e.jsx(f.Box,{direction:"column",children:e.jsx(_.Button,{primary:!0,onClick:je,children:"Yes, Sure"})})]})})})]}),ze&&e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{onClick:()=>Ge(null),position:"fixed",style:{inset:0,zIndex:60}}),e.jsxs(f.Box,{role:"dialog","aria-label":ze.item.title,position:"fixed",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-md",shadow:"shadow-lg",padding:"sm",gap:"spacing-2",style:{top:ze.top,left:ze.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem"},children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-500",textTransform:"uppercase",style:{padding:"0.25rem 0.5rem 0.5rem",letterSpacing:"0.05em"},children:ze.item.title}),(kt=ze.item.children)==null?void 0:kt.map(E=>{const j=lr(E.to),Z=Rr(E.badge,m[E.id]);return e.jsxs(f.Box,{as:"button",onClick:()=>{O(E.to),Ge(null)},fullWidth:!0,direction:"row",align:"center",gap:"md",paddingBlock:"sm",paddingInline:"md",borderRadius:"rounded-md",borderWidth:"border",borderStyle:"border-solid",hover:j?void 0:{bg:"primary-inverse"},className:Be.row,"data-active":j||void 0,"data-location":j||void 0,"aria-current":j?"page":void 0,children:[E.icon&&e.jsx(I.Icon,{name:E.icon,size:"sm",className:Be.rowIcon}),e.jsx(k.Text,{as:"span",fontSize:"md",fontWeight:j?"semibold":"normal",whiteSpace:"nowrap",className:Be.popoverLabel,children:E.title}),Z&&e.jsx(nr.Badge,{text:String(Z.value),variant:Z.variant??"info",size:"xs",border:!0})]},E.id)})]})]})]})})}const jr=h.forwardRef(({children:r,...t},o)=>e.jsx(f.Box,{ref:o,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),tl=({title:r,iconName:t,textColor:o,iconColor:n,hoverTextColor:l,hoverIconColor:s})=>{const[i,c]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=o??"var(--sa-text-subtle, #8c8f97)",g=s??"var(--sa-text-subtle, #8c8f97)",b=l??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{cursor:"pointer"},children:[e.jsx(I.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:i?g:a,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:i?b:d,transition:"color 0.15s ease"},children:r||"Back"})]})},Hn=({items:r,separator:t="/",iconName:o,iconColor:n,hoverIconColor:l})=>{const{Link:s}=sr(),[i,c]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=l??"var(--sa-text-subtle, #8c8f97)",g=r.length>1?r[0]:void 0,b=!!(g!=null&&g.to||g!=null&&g.onClick),p=e.jsx(I.Icon,{name:o||"ChevronLeft",size:"xs",onMouseEnter:b?()=>c(!0):void 0,onMouseLeave:b?()=>c(!1):void 0,style:{color:b&&i?d:a,transition:"color 0.15s ease",cursor:b?"pointer":void 0}}),C=g!=null&&g.to?e.jsx(s,{to:g.to,replace:!0,style:{textDecoration:"none"},children:p}):g!=null&&g.onClick?e.jsx(jr,{onClick:g.onClick,children:p}):p;return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",children:[C,e.jsx(mr.Breadcrumb,{separator:t,size:"md",children:r.map((w,S)=>{const H=S===r.length-1;return w.to&&!H?e.jsx(mr.BreadcrumbItem,{children:e.jsx(s,{to:w.to,children:w.label})},S):e.jsx(mr.BreadcrumbItem,{currentPage:H,children:e.jsx(mr.BreadcrumbLink,{onClick:H?void 0:w.onClick,children:w.label})},S)})})]})},Pn=r=>{const{Link:t}=sr(),{items:o,separator:n,onClick:l,navigateTo:s,...i}=r;return o&&o.length>0?e.jsx(Hn,{items:o,separator:n,iconName:i.iconName,iconColor:i.iconColor,hoverIconColor:i.hoverIconColor}):s?e.jsx(f.Box,{direction:"row",children:e.jsx(t,{to:s,replace:!0,style:{textDecoration:"none"},children:e.jsx(tl,{...i})})}):e.jsx(f.Box,{direction:"row",children:e.jsx(jr,{onClick:l,children:e.jsx(tl,{...i})})})},Ut=[{icon:"var(--sa-color-brand-400, #3366b7)",activeBg:"var(--sa-color-brand-50, #e6edf6)",activeBorder:"var(--sa-color-brand-300, #668cc9)",activeShadow:"rgba(51, 102, 183, 0.25)"},{icon:"var(--sa-color-warning-400, #ed9f30)",activeBg:"var(--sa-color-warning-50, #fef2e6)",activeBorder:"var(--sa-color-warning-300, #f1b259)",activeShadow:"rgba(237, 159, 48, 0.25)"},{icon:"var(--sa-color-secondary-300, #5468e1)",activeBg:"var(--sa-color-secondary-50, #e6e9fb)",activeBorder:"var(--sa-color-secondary-200, #8a98ea)",activeShadow:"rgba(84, 104, 225, 0.25)"},{icon:"var(--sa-color-info-500, #00abeb)",activeBg:"var(--sa-color-info-50, #effaff)",activeBorder:"var(--sa-color-info-300, #75dbff)",activeShadow:"rgba(0, 171, 235, 0.25)"},{icon:"var(--sa-color-success-500, #30ce84)",activeBg:"var(--sa-color-success-50, #ecfff6)",activeBorder:"var(--sa-color-success-300, #75dead)",activeShadow:"rgba(48, 206, 132, 0.25)"},{icon:"var(--sa-color-error-400, #ff758f)",activeBg:"var(--sa-color-error-50, #fff0f3)",activeBorder:"var(--sa-color-error-300, #ff8fa3)",activeShadow:"rgba(255, 117, 143, 0.25)"}];function ol(r,t,o){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:r?`2px solid ${o.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:r?o.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:r?t?`0 8px 20px ${o.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${o.activeShadow}`:t?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:t?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const ll={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-text-primary, #292a2e)",lineHeight:"1.3",maxWidth:"80px"},nl={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function sl({isShow:r,onHide:t,menus:o,selectedGroupId:n,onSelect:l}){const[s,i]=h.useState(void 0),c=d=>{l(d),t()},a=Ut[0];return e.jsx(Oe.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Oe.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>c(null),onMouseEnter:()=>i("all"),onMouseLeave:()=>i(void 0),style:nl,children:[e.jsx("div",{style:ol(n===null,s==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(I.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:ll,children:"Semua"})]}),o.map((d,g)=>{var S;const b=n===d.id,p=s===d.id,C=((S=d.items[0])==null?void 0:S.icon)??"Grid",w=Ut[(g+1)%Ut.length];return e.jsxs("button",{onClick:()=>c(d.id),onMouseEnter:()=>i(d.id),onMouseLeave:()=>i(void 0),style:nl,children:[e.jsx("div",{style:ol(b,p,w),children:e.jsx("div",{style:{color:w.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(I.Icon,{name:C,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:ll,children:d.name})]},d.id)})]})})})}function _n({onSelect:r,"aria-label":t="Pilih module"}={}){const o=At(),{useNavigate:n}=sr(),l=n(),{selectedGroupId:s,setSelectedGroupId:i}=Vt(),[c,a]=h.useState(!1),d=g=>{var b;if(i(g),g!==null){const p=o.menus.find(w=>w.id===g),C=(b=p==null?void 0:p.items[0])==null?void 0:b.to;C&&l(C)}r==null||r(g)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>a(!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2.25rem",height:"2.25rem",borderRadius:"var(--sa-radii-sm, 0.25rem)",border:"1px solid var(--sa-border-subtle, #0b120e24)",color:"var(--sa-text-subtle, #8c8f97)",backgroundColor:"transparent",cursor:"pointer"},"aria-label":t,onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent"},children:e.jsx(I.Icon,{name:"GridApplication",size:"sm"})}),s!==null&&e.jsx("span",{style:{position:"absolute",top:"0.25rem",right:"0.25rem",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-brand-500, #1a4fa0)"},"aria-hidden":"true"})]}),e.jsx(sl,{isShow:c,onHide:()=>a(!1),menus:o.menus.filter(g=>g.parentGroupId===void 0),selectedGroupId:s,onSelect:d})]})}const jn=(r,t)=>{const o=[];if(t===0)return o.push(r),o;for(let n=0;n<r.length;n+=t){const l=r.slice(n,n+t);o.push(l)}return o},Nn=h.memo(({value:r,label:t,separator:o,labelWidth:n,lastIndex:l,labelAlign:s="top"})=>{const i=h.useMemo(()=>({padding:0,paddingBottom:l?0:12,verticalAlign:s}),[l,s]),c=h.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:l?0:12,verticalAlign:s}),[l,s]),a=()=>typeof t=="string"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(k.Text,{color:"primary",fontWeight:"medium",children:r}):r,g=()=>typeof o=="string"||typeof o=="number"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:o}):o;return e.jsxs(G.Tr,{children:[e.jsx(G.Td,{style:i,width:n,children:a()}),o?e.jsx(G.Td,{style:c,width:24,children:g()}):null,e.jsx(G.Td,{style:i,children:d()})]})}),Vn=h.memo(({fields:r,separator:t,labelWidth:o})=>e.jsx(G.Table,{withColumnBorder:!1,withRowBorder:!1,children:r.map((n,l)=>e.jsx(Nn,{separator:t,labelWidth:o,lastIndex:l===r.length-1,...n},`field-group-field-${l}`))})),qn=h.memo(({maxRow:r=0,maxColumn:t=2,separator:o=":",fields:n=[],labelWidth:l=150,bordered:s=!1})=>{const i=h.useMemo(()=>jn(n,r),[n,r]),c=i.length>2,a=()=>{switch(t){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(f.Box,{gap:c?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:c?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:s?"border":void 0,borderStyle:s?"border-solid":void 0,borderColor:s?"border-subtle":void 0,children:i.map((d,g)=>e.jsx(f.Box,{direction:"column",flex:c?void 0:"1",width:c?a():void 0,marginBottom:c?"lg":void 0,children:e.jsx(Vn,{labelWidth:l,fields:d,separator:o})},g))})}),Zn=({backButton:r})=>{const[t,o]=h.useState(!1),n=(r==null?void 0:r.iconColor)??"var(--sa-text-subtle, #8c8f97)",l=(r==null?void 0:r.textColor)??"var(--sa-text-subtle, #8c8f97)",s=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",i=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{cursor:"pointer"},children:[e.jsx(I.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?s:n,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:t?i:l,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},il=({backButton:r,title:t,titleIcon:o,titleTag:n,children:l,header:s=!0,headerBorder:i=!1,disableAnimation:c=!1,scrollable:a=!1,stickyHeader:d=!1,subHeaders:g,action:b,titleTagProps:p,containerProps:C,headerProps:w})=>{const S=ke.useMediaQuery("md"),{Link:H,useNavigate:T}=sr(),A=T(),x=r==null?void 0:r.show,B=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}A(-1,{replace:!0})},W=()=>{if(!b)return null;if(h.isValidElement(b))return b;const M=b.filter(q=>q&&(q.title||q.icon));return M.length===0?null:S?e.jsx(f.Box,{direction:"row",gap:"md",children:M.map(({title:q,icon:J,buttonProps:U,onClick:K},R)=>e.jsx(_.Button,{iconLeft:J?e.jsx(I.Icon,{name:J,size:"md"}):void 0,onClick:K,...U,children:q},`action-${R}`))}):e.jsxs(z.Menu,{position:"bottom-right",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(I.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{minWidth:200},children:M.map(({title:q,icon:J,buttonProps:U,onClick:K},R)=>{const ae=(U==null?void 0:U.tone)==="error"||(U==null?void 0:U.danger)===!0;return e.jsx(z.MenuItem,{intent:ae?"danger":void 0,disabled:U==null?void 0:U.disabled,startIcon:J?e.jsx(I.Icon,{name:J}):void 0,onClick:K,children:q},`action-${R}`)})})})]})},F=()=>{const M=e.jsx(Zn,{backButton:r});return r!=null&&r.navigateTo?e.jsx(f.Box,{direction:"row",children:e.jsx(H,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:M})}):e.jsx(f.Box,{direction:"row",children:e.jsx(jr,{onClick:B,children:M})})},m=()=>{const M=!!t,q=Array.isArray(b)&&b.length>0,J=h.isValidElement(b)?!0:q;if(!M&&!J&&!x)return null;const K=S||!S&&q;return e.jsxs(f.Box,{direction:"column",gap:"xs",paddingBlock:(w==null?void 0:w.paddingBlock)??"sm",paddingInline:(w==null?void 0:w.paddingInline)??"md",...w,style:{...i?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...w==null?void 0:w.style},children:[x&&F(),(M||J)&&e.jsxs(f.Box,{direction:K?"row":"column",gap:"sm",justify:"space-between",align:K?"center":"flex-start",children:[M?typeof t=="string"?e.jsxs(f.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[o&&e.jsx(I.Icon,{name:o,size:"md",color:"primary"}),e.jsx(k.Text,{variant:"h3",fontWeight:"semibold",children:t})]}),n&&e.jsx(nr.Badge,{border:!0,size:"lg",text:n,...p})]}):t:null,W()]})]})},O=()=>{if(!g||g.length===0)return null;const M=g.filter(U=>U.show!==!1);if(M.length===0)return null;let q=0,J=-1/0;return M.forEach((U,K)=>{const R=U.order??0;R>=J&&(J=R,q=K)}),M.map(({content:U,order:K,borderBottom:R=!0,keepBottomPadding:ae=!1,paddingInline:Q=!0,paddingBlock:re=!0},he)=>e.jsx(f.Box,{direction:"column",paddingTop:re?"sm":"spacing-0",paddingBottom:re&&(R||ae||he===q)?"sm":"spacing-0",paddingInline:Q?"md":"spacing-0",style:{...R?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...K!==void 0?{order:K}:{}},children:U},`sub-header-${he}`))},N=()=>{const M=s?m():null,q=O();return!M&&!q?null:e.jsxs(f.Box,{direction:"column",style:{...a?{position:"sticky",left:0,...d?{top:0}:{},zIndex:2,background:"var(--sa-background-primary, #ffffff)"}:{},marginBottom:q?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[M,q]})},$=()=>l;return e.jsxs(f.Box,{direction:"column",as:"main",...C,style:{...a?{height:"100%",minHeight:0,overflow:"auto"}:{},...(C==null?void 0:C.style)??{},...c?{}:{animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"}},children:[N(),$()]})},Gn=r=>{const{useLocation:t}=sr(),o=t();return e.jsx(il,{...r},o.pathname)},Qn=r=>r.remountOnRouteChange?e.jsx(Gn,{...r}):e.jsx(il,{...r}),Un=h.memo(Qn),Yn={icon:"Cross",title:""},Xn=320,cl=16,al=4,Jn=8,dl=h.forwardRef(({onHide:r,show:t,withBlur:o=!1,style:n,children:l,closeButton:s=Yn,paddingHorizontal:i=!0,width:c,minWidth:a,maxWidth:d,hideBackdrop:g=!1,title:b,headerAction:p,header:C=!0,widthPresets:w,resizable:S=!0,resizeMin:H=Xn,resizeMax:T,onWidthChange:A},x)=>{const W=!ke.useMediaQuery("md"),F=c??d??a??"357px",m=w??[],O=m.length>1,[N,$]=h.useState(()=>{const ne=m.indexOf(F);return ne>=0?ne:0}),[M,q]=h.useState(null),[J,U]=h.useState(!1),[K,R]=h.useState(!1),ae=h.useRef(null),Q=ne=>{ae.current=ne,typeof x=="function"?x(ne):x&&(x.current=ne)},re=O?m[N]:F,he=M!=null?`${M}px`:re,ve=S&&!W,Me=N===m.length-1,Ie=()=>{const ne=(N+1)%m.length;q(null),$(ne),A==null||A(m[ne])},Ce=h.useCallback(ne=>{const me=T??window.innerWidth;return Math.min(Math.max(ne,H),me)},[H,T]),ye=h.useRef(null),Ze=ne=>{if(!ve)return;ne.preventDefault();const me=ne.currentTarget;me.setPointerCapture(ne.pointerId),U(!0);const we=document.body.style.cursor,oe=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let Fe=null;const Ke=P=>{const Y=Ce(window.innerWidth-P.clientX);ye.current=Y,Fe==null&&(Fe=window.requestAnimationFrame(()=>{Fe=null,ye.current!=null&&q(ye.current)}))},or=P=>{Fe!=null&&window.cancelAnimationFrame(Fe),ye.current!=null&&q(ye.current),me.releasePointerCapture(P.pointerId),me.removeEventListener("pointermove",Ke),me.removeEventListener("pointerup",or),me.removeEventListener("pointercancel",or),document.body.style.cursor=we,document.body.style.userSelect=oe,U(!1),ye.current!=null&&(A==null||A(`${ye.current}px`))};me.addEventListener("pointermove",Ke),me.addEventListener("pointerup",or),me.addEventListener("pointercancel",or)},ze=ne=>{var Fe;if(!ve||ne.key!=="ArrowLeft"&&ne.key!=="ArrowRight")return;ne.preventDefault();const me=ne.key==="ArrowLeft"?cl:-cl,we=M??((Fe=ae.current)==null?void 0:Fe.offsetWidth)??H,oe=Ce(we+me);q(oe),A==null||A(`${oe}px`)},Ge=()=>{ve&&(q(null),A==null||A(re))};return e.jsx($r.Drawer,{blur:o,isShow:t,position:"right",onHide:r,ref:Q,size:he,style:n,flush:!0,radius:"none",hideBackdrop:g,children:e.jsxs(f.Box,{direction:"column",height:"height-full",children:[ve?e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Ubah lebar panel",tabIndex:0,onPointerDown:Ze,onKeyDown:ze,onDoubleClick:Ge,title:"Tarik untuk mengubah lebar — klik dua kali untuk reset",onPointerEnter:()=>R(!0),onPointerLeave:()=>R(!1),style:{position:"absolute",left:0,top:0,bottom:0,width:Jn,cursor:"col-resize",zIndex:1,background:J||K?`linear-gradient(to right, var(--sa-border-brand, var(--sa-border-subtle)) 0 ${al}px, transparent ${al}px)`:"transparent",transition:"background 0.15s",touchAction:"none"}}):null,C?e.jsxs(f.Box,{direction:"row",align:"center",justify:"space-between",gap:"sm",paddingInline:"md",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",customHeight:"var(--app-header-height, 44px)",flexShrink:"0",children:[e.jsx(f.Box,{direction:"row",align:"center",gap:"sm",overflow:"overflow-hidden",children:typeof b=="string"?e.jsx(k.Text,{fontSize:"md",fontWeight:"bold",children:b}):b}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[p,O?e.jsx(_.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:Ie,"aria-label":Me?"Kecilkan panel":"Lebarkan panel",iconRight:e.jsx(I.Icon,{name:Me?"ChevronRight":"ChevronLeft"})}):null,s?e.jsx(_.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:r,"aria-label":s.title||"Tutup",iconRight:e.jsx(I.Icon,{name:s.icon}),children:s.title||void 0}):null]})]}):null,e.jsx(f.Box,{direction:"column",paddingBlock:"md",paddingInline:i?"md":"spacing-0",overflow:"overflow-y-auto",style:{flex:1,minHeight:0},children:l})]})})}),Yt=h.memo(({children:r,borderBottom:t=!0,padding:o=!0})=>{const n=ke.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),Xt=h.memo(({children:r,borderTop:t=!0,padding:o=!0})=>{const n=ke.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),$n=h.memo(({children:r,...t})=>e.jsx(f.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),Kn=h.memo(({children:r,title:t,titleTag:o,action:n,header:l,footer:s,actionContainer:i,containerProps:c,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:g={borderTop:!0},variantTag:b="info"})=>{const p=ke.useMediaQuery("lg"),C=()=>o?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:t}),e.jsx(nr.Badges,{border:!0,text:o,variant:b})]}):e.jsx(k.Text,{fontWeight:"medium",children:t}),w=()=>l||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:t?C():null}),e.jsx(f.Box,{direction:"column",style:p?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...i,children:n??null})]}),S=!!(l||t||n);return e.jsxs(f.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...c,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(c==null?void 0:c.style)??{}},children:[l!==null&&S?e.jsx(Yt,{...d,children:w()}):null,e.jsx($n,{...a,children:r}),s?e.jsx(Xt,{...g,children:s}):null]})}),tr={H1:r=>e.jsx(k.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(k.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(k.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(k.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(k.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(k.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(k.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(k.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(k.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(k.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(k.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(k.Text,{variant:"body-3",children:r.children,...r.props})},qe=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=sr(),[n,l]=r(),s=Fr.searchParamsToObject(n.toString()),i=t(),c=o(),a=i.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,w)=>n.has(C)&&n.get(C)===w,getQueryParam:C=>n.get(C),getRouteParam:C=>i[C],params:i,location:c,id:a,hasId:!!a}},hl=r=>JSON.stringify(r),fl=r=>JSON.stringify(r),ul=r=>JSON.stringify(r),gl=r=>JSON.stringify(r),Rn=r=>r,es=r=>JSON.stringify(r),ir=r=>{if(typeof r!="string"||r==="")return{};try{const t=JSON.parse(r);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}},cr=r=>{if(!(typeof r!="string"||r===""))try{return JSON.parse(r)}catch{return}},Nr=({value:r,name:t,type:o,withSearchParam:n=!0,setSearchParams:l,searchQueries:s,dropdownSearchKey:i,filterKey:c="filter",pageKey:a="page"})=>{if(n){let d;switch(o){case"search":d=Rn(r);break;case"dropdown":case"dropdown-multiple":d=hl(r);break;case"radio":d=fl(r);break;case"date-range":d=ul(r);break;case"advanced-date-range":d=es(r);break;case"date":d=gl(r);break;default:d=r;break}if(typeof d<"u"){const g={...ir(s[c]),[t]:d},b={...s};i&&typeof i=="string"&&delete b[i],delete b[a];const p={...b,[c]:JSON.stringify(g)},C=new URLSearchParams(s).toString(),w=new URLSearchParams(p).toString();if(C===w)return;l(p)}}},tt=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{var c,a,d,g;const l=o.get(t)||void 0,s=l&&typeof l=="string"?ir(l):void 0,i=s?s[r]:void 0;return n==="label"&&i?(a=(c=cr(i))==null?void 0:c[0])==null?void 0:a.label:n==="value"&&i?(g=(d=cr(i))==null?void 0:d[0])==null?void 0:g.value:i},yl=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{var c,a;const l=o.get(t)||void 0,s=l&&typeof l=="string"?ir(l):void 0,i=s?s[r]:void 0;return n==="label"&&i?(c=cr(i))==null?void 0:c.map(d=>d.label):n==="value"&&i?(a=cr(i))==null?void 0:a.map(d=>d.value):n==="array"&&i?cr(i):i},rs=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{var c,a,d;const l=o.get(t)||void 0,s=l&&typeof l=="string"?ir(l):void 0,i=s?s[r]:void 0;return n==="id"&&i?(c=cr(i))==null?void 0:c.id:n==="label"&&i?(a=cr(i))==null?void 0:a.label:n==="value"&&i?(d=cr(i))==null?void 0:d.value:i},ot=(r,t,o)=>{const n=t.get(o||"filter")||void 0,l=n&&typeof n=="string"?ir(n):void 0;return l?l[r]:void 0},ts=({name:r,filterKey:t="filter",searchParams:o})=>{var i,c;const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?ir(n):void 0,s=l?l[r]:void 0;return{start:s?(i=cr(s))==null?void 0:i.from:void 0,end:s?(c=cr(s))==null?void 0:c.to:void 0}},pl=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?ir(n):void 0,s=l?l[r]:void 0;return s?cr(s):void 0},os=(r,{filterKey:t="filter",perPageKey:o="perPage",pageKey:n="page"})=>{const l=r.get(t)||void 0,s=r.get(o)||void 0,i=r.get(n)||void 0;return!!l||!!s||!!i},bl=({isOpen:r,onClose:t,filterKey:o,pageKey:n,filters:l})=>{const{searchParams:s,setSearchParams:i,searchQueries:c}=qe(),[a,d]=h.useState({}),g=()=>{s.delete(o||"filter"),i(s)},b=(p,C)=>{switch(p.type){case"radio":{const{show:w=!0}=p;return w&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}case"dropdown":{const{show:w=!0}=p;return w&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}case"date-range":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C);case"date":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C);case"dropdown-multiple":{const{show:w=!0}=p;return w&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}default:return null}};return e.jsx(dl,{onHide:t,show:r||!1,children:e.jsxs(f.Box,{direction:"column",gap:"md",children:[e.jsxs(de.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(f.Box,{direction:"column",children:"Filter"}),e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},onClick:g,children:"Reset"})]}),l==null?void 0:l.map((p,C)=>b(p,C))]})})},vl=({searchKey:r="q",statusKey:t="status",searchPlaceholder:o="Search",searchHighlightPlaceholder:n,extendedFilter:l,showSearchFilter:s=!0,showStatusFilter:i=!0,filterKey:c="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:g,filterConfigs:b,buttonToggleProps:p,position:C="right",titleSearchLabel:w="Work Order",withTitleLabels:S=!1})=>{const T=(p==null?void 0:p.isShowLabel)??!0,[A,x]=h.useState(!1),[B,W]=h.useState(0),F=()=>{W(Q=>Q+1)},{searchParams:m,setSearchParams:O,getQueryParam:N}=qe(),$=Fr.searchParamsToObject(m.toString()),M=ot(r,m,c)||"",[q,J]=h.useState(M),U=N(c),R=!!(U&&!(()=>{if(U)try{const Q=JSON.parse(U);return Object.keys(Q).length===1&&Q[r]===""}catch(Q){console.error("Filter parameter is not a valid JSON:",Q)}return!1})()),ae=ke.useMediaQuery("md");return h.useEffect(()=>{J(M)},[M]),h.useEffect(()=>{if(q===M)return;const Q=window.setTimeout(()=>{Nr({value:q,name:r,type:"search",searchQueries:$,setSearchParams:O,filterKey:c,pageKey:a})},350);return()=>{window.clearTimeout(Q)}},[q,M,r,$,O,c,a]),e.jsxs(de.Flex,{gap:"md",style:{flexDirection:ae&&C==="left"?"row":ae&&C==="right"?"row-reverse":"column"},align:"flex-end",children:[R&&e.jsx(f.Box,{direction:"column",justify:"flex-end",children:e.jsx(_.Button,{onClick:()=>{const Q=new URLSearchParams(m);Q.delete(c),O(Q),J(""),F(),g&&g()},variant:"outline",tone:"neutral",children:e.jsx(k.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),l==null?void 0:l.map(({minWidth:Q,content:re,title:he,onClickContainer:ve},Me)=>e.jsxs(f.Box,{direction:"column",gap:"sm",onClick:ve,style:{minWidth:Q},children:[he&&e.jsx(tr.SubH3,{children:he}),re]},`extended-filter-${Me}-${B}`)),!!(b!=null&&b.length)&&e.jsx(_.Button,{primary:R,secondary:!R,iconLeft:e.jsx(I.Icon,{size:"sm",name:(p==null?void 0:p.icon)||"FilterHorizontal",style:{color:U?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!ae,onClick:()=>x(!0),children:T?"Filter":void 0}),i&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[S&&e.jsx(tr.SubH3,{children:"Status"}),e.jsx(Er.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:tt({get:"value",name:t,searchParams:m,filterKey:c})?[{label:tt({get:"value",name:t,searchParams:m,filterKey:c})==="active"?"Active":"InActive",value:tt({get:"value",name:t,searchParams:m,filterKey:c})}]:[],onChange:Q=>Nr({value:Q,name:t,type:"dropdown",searchQueries:$,setSearchParams:O,filterKey:c}),placeholder:S?"All":"All Status"},B)]}),s&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{width:d&&ae?d:ae?"310px":""},children:[S&&e.jsxs(tr.SubH3,{children:["Search for ",w]}),e.jsx(hr.Input,{placeholder:o,leftIcon:e.jsx(I.Icon,{name:"Search",width:20,height:20}),onChange:Q=>J(Q.target.value),value:q,fullWidth:!0},B+1+c)]}),e.jsx(bl,{isOpen:A,onClose:()=>x(!1),filterKey:c,filters:b,pageKey:a})]})},ls=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r==="text"?"search":r;function Jt({configs:r,filterKey:t="filter",activeFilterKey:o="filters",pageKey:n="page",searchKey:l="q"}){const{searchParams:s,setSearchParams:i,searchQueries:c}=qe(),a=h.useMemo(()=>Object.fromEntries(r.map(B=>[B.key,B])),[r]),d=h.useMemo(()=>{const B=(s.get(o)||"").split(",").map(F=>F.trim()).filter(Boolean),W=Object.keys(ir(s.get(t))).filter(F=>F!==l);return r.map(F=>F.key).filter(F=>{const m=a[F];return(m==null?void 0:m.locked)||B.includes(F)||W.includes(F)})},[s,o,t,l,r,a]),g=h.useCallback(B=>ir(B[t]),[t]),b=h.useCallback(B=>{const W={...c};B.length?W[o]=B.join(","):delete W[o],i(W)},[c,o,i]),p=h.useCallback(B=>{d.includes(B)||b([...d,B])},[d,b]),C=h.useCallback(B=>{var O;if((O=a[B])!=null&&O.locked)return;const W={...c},F=d.filter(N=>N!==B);F.length?W[o]=F.join(","):delete W[o];const m=g(W);B in m&&(delete m[B],Object.keys(m).length?W[t]=JSON.stringify(m):delete W[t]),delete W[n],i(W)},[c,d,o,t,n,g,i,a]),w=h.useCallback(B=>d.includes(B)?C(B):p(B),[d,p,C]),S=h.useCallback(B=>{switch(B.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return yl({name:B.key,get:"array",searchParams:s,filterKey:t})||[];case"date":{const W=pl({name:B.key,searchParams:s,filterKey:t});return W?new Date(W):void 0}case"date-compact":{const F=g(Object.fromEntries(s.entries()))[B.key];return F&&typeof F=="object"?F:void 0}case"text":{const F=g(Object.fromEntries(s.entries()))[B.key];return typeof F=="string"?F:void 0}default:return}},[s,t,g]),H=h.useCallback((B,W)=>{if(B.type==="date-compact"||B.type==="text"){const F={...c},m=g(F);W==null||W===""?delete m[B.key]:m[B.key]=W,Object.keys(m).length?F[t]=JSON.stringify(m):delete F[t],delete F[n],i(F);return}Nr({value:W,name:B.key,type:ls(B.type),searchQueries:c,setSearchParams:i,filterKey:t,pageKey:n})},[c,i,t,n,g]),T=h.useCallback(B=>{const W={...c},F=g(W);B in F&&(delete F[B],Object.keys(F).length?W[t]=JSON.stringify(F):delete W[t]),delete W[n],i(W)},[c,t,n,g,i]),A=h.useCallback(()=>{const B={...c};delete B[t],delete B[o],delete B[n],i(B)},[c,t,o,n,i]),x=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:x,addFilter:p,removeFilter:C,toggleFilter:w,getValue:S,setValue:H,clearValue:T,clearAll:A}}const $t={get(r){return _r.storage.get(r)??null},set(r,t){_r.storage.save(r,t)},remove(r){_r.storage.delete(r)}},Mr={columns:r=>`filterbar:colprefs:${r}`,savedViews:r=>`filterbar:views:${r}`,lastState:r=>`filterbar:last:${r}`,perPage:r=>`filterbar:perpage:${r}`,tableSort:r=>`tablelayout:sort:${r}`},lt=(r,t)=>{const o=new Set(t.map(s=>s.key)),n=r.order.filter(s=>o.has(s));for(const s of t)n.includes(s.key)||n.push(s.key);const l=r.hidden.filter(s=>o.has(s));return{order:n,hidden:l}};function ns({columns:r,scopeId:t,storage:o,onColumnsChange:n,value:l}){const s=h.useMemo(()=>({order:r.map(m=>m.key),hidden:[]}),[r]),i=t?Mr.columns(t):void 0,c=(m,O)=>lt({order:m.order??O,hidden:m.hidden??[]},r),[a,d]=h.useState(()=>{if(l&&(l.order||l.hidden))return c(l,r.map(m=>m.key));if(i){const m=o.get(i);if(m&&Array.isArray(m.order))return lt(m,r)}return s}),g=r.map(m=>m.key).join("|");h.useEffect(()=>d(m=>lt(m,r)),[g]);const b=h.useRef(a);b.current=a;const p=l?`${(l.order??[]).join("|")}~${(l.hidden??[]).join("|")}`:null,C=h.useRef(p);h.useEffect(()=>{if(p==null||C.current===p)return;C.current=p;const m=b.current,O=c(l,m.order);O.order.join("|")===m.order.join("|")&&O.hidden.join("|")===m.hidden.join("|")||(d(O),i&&o.set(i,O))},[p,g]);const w=h.useRef(!1);h.useEffect(()=>{w.current||(w.current=!0,n==null||n(a))},[]);const S=h.useCallback(m=>{d(m),i&&o.set(i,m),n==null||n(m)},[i,o,n]),H=h.useMemo(()=>{const m=new Map(r.map(O=>[O.key,O]));return a.order.filter(O=>m.has(O)).map(O=>({...m.get(O),visible:!a.hidden.includes(O)}))},[a,r]),T=h.useCallback(m=>{const O=a.hidden.includes(m)?a.hidden.filter(N=>N!==m):[...a.hidden,m];S({...a,hidden:O})},[a,S]),A=h.useCallback((m,O)=>{if(m===O)return;const N=[...a.order],[$]=N.splice(m,1);N.splice(O,0,$),S({...a,order:N})},[a,S]),x=h.useCallback(m=>{S({...a,hidden:m?r.filter(O=>!O.locked).map(O=>O.key):[]})},[a,r,S]),B=h.useCallback(()=>S(s),[S,s]),W=h.useCallback(m=>S(lt(m,r)),[S,r]),F=a.hidden.length===0;return{state:a,orderedColumns:H,allVisible:F,toggleVisibility:T,reorder:A,setAllHidden:x,reset:B,applyState:W}}function ss({scopeId:r,storage:t,snapshotKeys:o,pageKey:n="page",getColumns:l,applyColumns:s}){const{searchParams:i,setSearchParams:c}=qe(),a=r?Mr.savedViews(r):void 0,[d,g]=h.useState(()=>a?t.get(a)||[]:[]),b=h.useCallback(S=>{g(S),a&&t.set(a,S)},[a]),p=h.useCallback(S=>{const H=S.trim();if(!H)return;const T={};o.forEach(x=>{const B=i.get(x);B!=null&&(T[x]=B)});const A={id:`${Date.now()}`,name:H,query:T,columns:l==null?void 0:l(),createdAt:Date.now()};b([...d,A])},[o,i,l,b,d]),C=h.useCallback(S=>b(d.filter(H=>H.id!==S)),[b,d]),w=h.useCallback(S=>{const H=Object.fromEntries(i.entries());o.forEach(T=>delete H[T]),Object.assign(H,S.query),delete H[n],c(H),S.columns&&(s==null||s(S.columns))},[i,o,n,c,s]);return{enabled:!!a,views:d,saveView:p,deleteView:C,applyView:w}}function is(r,t){const o=ir(r);return delete o[t],Object.keys(o).length>0?JSON.stringify(o):void 0}function Cl(r,t,o){const n=r[t];if(n==null)return;const l=is(n,o);l===void 0?delete r[t]:r[t]=l}function cs({scopeId:r,storage:t,snapshotKeys:o,enabled:n=!0,filterKey:l="filter",searchKey:s="q",persistSearch:i=!0}){const{searchParams:c}=qe(),a=r&&n?Mr.lastState(r):void 0,d=h.useRef(a),g=h.useRef(!1);h.useEffect(()=>{if(!a){d.current=a;return}if(d.current!==a){d.current=a,g.current=!1;return}const C={};if(o.forEach(w=>{const S=c.get(w);S!=null&&(C[w]=S)}),i||Cl(C,l,s),Object.keys(C).length===0){g.current&&t.remove(a);return}g.current=!0,t.set(a,C)},[c,a,o,t,i,l,s]);const b=h.useCallback(()=>{if(!a)return null;const C=t.get(a);if(!C||typeof C!="object"||Array.isArray(C)||Object.keys(C).length===0)return null;const w=C[l];return w!=null&&Object.keys(ir(w)).length===0&&delete C[l],i||Cl(C,l,s),Object.keys(C).length>0?C:null},[a,t,i,l,s]),p=h.useCallback(()=>{a&&t.remove(a)},[a,t]);return{enabled:!!a,read:b,clear:p}}function as({scopeId:r,storage:t,perPageKey:o,pageSizeOptions:n,enabled:l=!0}){const{searchParams:s}=qe(),i=r&&l?Mr.perPage(r):void 0,c=s.toString(),a=h.useRef(i);h.useEffect(()=>{if(!i){a.current=i;return}if(a.current!==i){a.current=i;return}const b=s.get(o);if(!b)return;const p=Number(b);!Number.isFinite(p)||p<=0||t.set(i,p)},[c,i,o,t]);const d=h.useCallback(()=>{if(!i)return null;const b=t.get(i);if(b==null)return null;const p=Number(b);return!Number.isFinite(p)||p<=0||n&&!n.includes(p)?null:String(p)},[i,t,n]),g=h.useCallback(()=>{i&&t.remove(i)},[i,t]);return{enabled:!!i,read:d,clear:g}}let Kt={},Rt=!1,eo=null;const ds=(r,t)=>{Object.assign(Kt,r),eo=t,!Rt&&(Rt=!0,queueMicrotask(()=>{const o=Kt,n=eo;Kt={},Rt=!1,eo=null,!(!n||Object.keys(o).length===0)&&n(l=>{const s=new URLSearchParams(l);return Object.entries(o).forEach(([i,c])=>s.set(i,c)),s},{replace:!0})}))};function hs({enabled:r,snapshotKeys:t,perPageKey:o,readSnapshot:n,readPerPage:l}){const{searchParams:s,setSearchParams:i,location:c}=qe(),a=h.useRef(null);h.useEffect(()=>{if(!r||a.current===c.pathname)return;a.current=c.pathname;const d={};if(!s.has(o)){const g=l();g&&(d[o]=g)}if(!t.some(g=>s.has(g))){const g=n();g&&Object.assign(d,g)}Object.keys(d).length!==0&&ds(d,i)},[c.pathname,r])}const fs=({configs:r,activeKeys:t,onToggle:o,hasActiveFilter:n,onReset:l})=>r.length?e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(I.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{minWidth:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&l&&e.jsx(_.Button,{variant:"link",tone:"brand",size:"xs",onClick:l,children:"Reset"})]}),children:r.map(s=>e.jsx(z.MenuItem,{selected:s.locked||t.includes(s.key),disabled:s.locked,closeOnSelect:!1,startIcon:s.icon??void 0,onClick:()=>{s.locked||o(s.key)},children:s.label},s.key))})})]}):null,Vr=({onClear:r,onRemove:t})=>e.jsxs(z.Menu,{position:"bottom-right",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(I.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(z.MenuLists,{children:e.jsxs(z.MenuBody,{style:{width:180},children:[e.jsx(z.MenuItem,{startIcon:e.jsx(I.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(z.MenuItem,{intent:"danger",startIcon:e.jsx(I.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),us=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},wl=(r,t,o)=>{const n=new Date(r);return o==="day"?n.setDate(n.getDate()+t):o==="week"?n.setDate(n.getDate()+t*7):o==="month"?n.setMonth(n.getMonth()+t):n.setFullYear(n.getFullYear()+t),n},xl=r=>{const t=us(new Date);if(r.direction==="this"){const n=new Date(t),l=new Date(t);return r.period==="week"?(n.setDate(t.getDate()-t.getDay()),l.setDate(n.getDate()+6)):r.period==="month"?(n.setDate(1),l.setMonth(l.getMonth()+1,0)):r.period==="year"&&(n.setMonth(0,1),l.setMonth(11,31)),{from:n,to:l}}const o=r.count??1;return r.direction==="past"?{from:wl(t,-o,r.period),to:t}:{from:t,to:wl(t,o,r.period)}},Dl=24,Sl=r=>r.length>Dl?`${r.slice(0,Dl)}...`:r,kl=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),ro=(r,t="days")=>t==="months"?r.toLocaleDateString(void 0,{month:"short",year:"numeric"}):t==="years"?String(r.getFullYear()):kl(r),nt={is:"Is","is-before":"Is before","is-after":"Is after","is-on-or-before":"Is on or before","is-on-or-after":"Is on or after","is-between":"Is between","is-relative-to-today":"Is relative to today","is-empty":"Is empty","is-not-empty":"Is not empty"},Bl=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],to={past:"Past",next:"Next",this:"This"},gs=["day","week","month","year"],ys=["past","next","this"],ps=r=>r.field.type==="date-compact"?e.jsx(Cs,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(bs,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),bs=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=t?kl(new Date(t)):null,i=!!s,c=i?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Sl(s)})]}):r.label;return e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i?e.jsx(I.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(I.Icon,{name:"ChevronSmallDown"}),children:c})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Vr,{onClear:n,onRemove:l})]}),children:e.jsx(xr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():o(a),withPadding:!1})})})]})},vs=(r,t="days")=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${nt[r.op]} ${ro(new Date(r.date),t)}`:null;case"is-between":return r.from&&r.to?`${ro(new Date(r.from),t)} - ${ro(new Date(r.to),t)}`:null;case"is-relative-to-today":{const o=r.relative;if(!o)return null;if(o.direction==="this")return`This ${o.period}`;const n=o.count??1,l=n===1?o.period:`${o.period}s`;return`${to[o.direction]} ${n} ${l}`}case"is-empty":case"is-not-empty":return nt[r.op];default:return null}},Cs=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.ops&&r.ops.length>0?r.ops:Bl,i=r.defaultOp&&s.includes(r.defaultOp)?r.defaultOp:s[0],c=r.mode??"days",a=(t==null?void 0:t.op)??i,d=t?vs(t,c):null,g=!!d,b=g?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Sl(d)})]}):r.label,p=C=>{if(C!==a){if(C==="is-empty"||C==="is-not-empty"){o({op:C});return}if(C==="is-relative-to-today"){o({op:C,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(C==="is-between"){o({op:C,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}o({op:C,date:t==null?void 0:t.date})}};return e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:g?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:g?e.jsx(I.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(I.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsxs(z.MenuLists,{children:[e.jsx(z.MenuBody,{style:{width:320},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(ml,{op:a,ops:s,onChange:p})]}),e.jsx(Vr,{onClear:n,onRemove:l})]}),children:e.jsx(El,{value:t,op:a,mode:c,onChange:o})}),a==="is-relative-to-today"&&e.jsx(z.MenuFooter,{children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},ml=({op:r,ops:t,onChange:o})=>e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(I.Icon,{name:"ChevronSmallDown"}),children:nt[r]})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{width:200},children:t.map(n=>e.jsx(z.MenuItem,{selected:r===n,onClick:()=>o(n),endIcon:r===n?e.jsx(I.Icon,{name:"Check"}):void 0,children:nt[n]},n))})})]}),El=({value:r,op:t,mode:o="days",onChange:n})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const l=r!=null&&r.from||r!=null&&r.to?{from:r!=null&&r.from?new Date(r.from):null,to:r!=null&&r.to?new Date(r.to):null}:void 0;return e.jsx(xr.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,filter:o,value:l,onChange:s=>{if(s==null){n({op:t});return}if(typeof s=="object"&&s!==null&&"from"in s&&"to"in s){let{from:i,to:c}=s;if(!i&&c&&(i=c,c=null),!i&&!c){n({op:t});return}n({op:t,from:i?i.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},`range-${o}`)}return t==="is-relative-to-today"?e.jsx(ws,{value:r==null?void 0:r.relative,onChange:l=>n({op:t,relative:l})}):e.jsx(xr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:o,value:r!=null&&r.date?new Date(r.date):void 0,onChange:l=>{if(l==null){n({op:t});return}l instanceof Date&&n({op:t,date:l.toISOString()})},withPadding:!1},`single-${o}`)},ws=({value:r,onChange:t})=>{const o=(r==null?void 0:r.direction)??"past",n=(r==null?void 0:r.count)??1,l=(r==null?void 0:r.period)??"week",s=o!=="this",i=xl({direction:o,count:n,period:l});return e.jsxs(f.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(I.Icon,{name:"ChevronSmallDown"}),children:to[o]})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{width:140},children:ys.map(c=>e.jsx(z.MenuItem,{selected:o===c,endIcon:o===c?e.jsx(I.Icon,{name:"Check"}):void 0,onClick:()=>t(c==="this"?{direction:c,period:l}:{direction:c,count:n,period:l}),children:to[c]},c))})})]}),s&&e.jsx(hr.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:c=>{const a=Number(c.target.value);t({direction:o,count:Number.isFinite(a)&&a>0?a:1,period:l})},style:{width:72}}),e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(I.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{width:140},children:gs.map(c=>e.jsx(z.MenuItem,{selected:l===c,endIcon:l===c?e.jsx(I.Icon,{name:"Check"}):void 0,onClick:()=>t(o==="this"?{direction:o,period:c}:{direction:o,count:n,period:c}),children:c},c))})})]})]}),e.jsx(xr.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:i,onChange:()=>{},withPadding:!1},"relative-preview")]})},Fl=18,xs=r=>r.length>Fl?`${r.slice(0,Fl)}...`:r,Ds=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.type==="dropdown-multiple",i=t.length,c=r.searchable!==!1,[a,d]=h.useState(""),g=r.options,b=typeof r.onSearch=="function",p=(()=>{if(b)return g;const T=a.trim().toLowerCase();return T?g.filter(A=>A.label.toLowerCase().includes(T)):g})(),C=T=>t.some(A=>A.value===T.value),w=T=>{if(!s){o([{label:T.label,value:T.value}]),d("");return}o(C(T)?t.filter(A=>A.value!==T.value):[...t,{label:T.label,value:T.value}])},S=T=>{var A;d(T),(A=r.onSearch)==null||A.call(r,T)},H=i===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:i===1?xs(t[0].label):`${i} Selected`})]});return e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:i>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i>0?e.jsx(I.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(I.Icon,{name:"ChevronSmallDown"}),children:H})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Vr,{onClear:n,onRemove:l})]}),children:e.jsxs(f.Box,{direction:"column",gap:"sm",children:[c&&e.jsx(Er.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:s,searchAble:!0,searchValue:a,onSearch:S,value:t,onChange:o,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(T=>e.jsx(z.MenuItem,{closeOnSelect:!s,selected:C(T),startIcon:T.avatar,endIcon:C(T)?e.jsx(I.Icon,{name:"Check"}):void 0,description:T.description,onClick:()=>w(T),children:T.label},T.value))})]})})})]})},Il=18,Ss=r=>r.length>Il?`${r.slice(0,Il)}...`:r,Ll=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(fr.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),ks=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=new Set(t.map(p=>p.value)),i=t.length,c=r.options.length>0&&r.options.every(p=>s.has(p.value)),a=i>0&&!c,d=p=>{o(s.has(p.value)?t.filter(C=>C.value!==p.value):[...t,{label:p.label,value:p.value}])},g=()=>{o(c?[]:r.options.map(p=>({label:p.label,value:p.value})))},b=i===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(k.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(k.Text,{as:"span",children:i===1?Ss(t[0].label):`${i} Selected`})]});return e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:i>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i>0?e.jsx(I.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(I.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsx(z.MenuLists,{children:e.jsxs(z.MenuBody,{style:{width:240},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Vr,{onClear:n,onRemove:l})]}),children:[e.jsx(z.MenuItem,{closeOnSelect:!1,selected:c,onClick:g,startIcon:e.jsx(Ll,{checked:c||a,indeterminate:a}),children:"Select All"}),r.options.map(p=>e.jsx(z.MenuItem,{closeOnSelect:!1,selected:s.has(p.value),onClick:()=>d(p),startIcon:e.jsx(Ll,{checked:s.has(p.value)}),children:p.label},p.value))]})})]})},Ml=18,Bs=r=>r.length>Ml?`${r.slice(0,Ml)}...`:r,ms=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const[s,i]=h.useState(t??""),c=ke.useDebounce(s,r.debounceMs??300);h.useEffect(()=>{c!==(t??"")&&o(c)},[c]),h.useEffect(()=>{i(t??"")},[t]);const a=!!t,d=a?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Bs(t)})]}):r.label;return e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:a?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:a?e.jsx(I.Icon,{name:"Search",size:"sm"}):void 0,iconRight:e.jsx(I.Icon,{name:"ChevronSmallDown"}),children:d})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Vr,{onClear:n,onRemove:l})]}),children:e.jsx(hr.Input,{size:"sm",fullWidth:!0,value:s,placeholder:r.placeholder??"Cari…",leftIcon:e.jsx(I.Icon,{name:"Search",width:16,height:16}),onChange:g=>i(g.target.value)})})})]})},Tl=({activeKeys:r,configByKey:t,getValue:o,setValue:n,clearValue:l,removeFilter:s})=>e.jsx(e.Fragment,{children:r.map(i=>{const c=t[i];if(!c)return null;const a=o(c),d=c.locked?void 0:()=>s(i);return c.type==="date"||c.type==="date-compact"?e.jsx(ps,{field:c,value:a,onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i):c.type==="text"?e.jsx(ms,{field:c,value:a||"",onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i):c.type==="checkbox-multiple"?e.jsx(ks,{field:c,value:a||[],onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i):e.jsx(Ds,{field:c,value:a||[],onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i)})}),Al=r=>`${r} Rows`,Es=({pagination:r,pageKey:t="page",perPageKey:o="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:l=10,showResultCount:s=!0,showPageSize:i=!0,showPagination:c=!0})=>{var T;const{searchQueries:a,setSearchParams:d,searchParams:g}=qe(),b=g.get(o),p=b?Number(b):l,C=A=>{d({...a,[t]:String(A)})},w=A=>{d({...a,[o]:A,[t]:"1"})},S=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),H=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[s&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${S}-${H} of ${((T=r==null?void 0:r.totalData)==null?void 0:T.toLocaleString())||0}`}),i&&e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(I.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Al(p)})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{children:n.map(A=>e.jsx(z.MenuItem,{selected:A===p,onClick:()=>w(String(A)),children:Al(A)},A))})})]}),c&&((r==null?void 0:r.totalPage)??0)>1&&e.jsx(f.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"sm",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(Pr.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:r!=null&&r.currentPage?Number(r.currentPage):1,totalPages:Number(r==null?void 0:r.totalPage),onPageChange:C})})]})};function Fs(r,t,o=!0){h.useEffect(()=>{if(!o)return;const n=l=>{var c;if(l.metaKey||l.ctrlKey||l.altKey||l.key!==r||Oe.isOverlayOpen())return;const s=l.target,i=(c=s==null?void 0:s.tagName)==null?void 0:c.toLowerCase();i==="input"||i==="textarea"||s!=null&&s.isContentEditable||(l.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,o])}const Is=240,Ol=({searchKey:r="q",filterKey:t="filter",pageKey:o="page",placeholder:n="Search",shortcut:l="/",collapsible:s=!0})=>{const{searchParams:i,setSearchParams:c,searchQueries:a}=qe(),d=ot(r,i,t)||"",[g,b]=h.useState(!s||!!d),[p,C]=h.useState(s&&!d),[w,S]=h.useState(d),H=ke.useDebounce(w,350),T=h.useRef(null);h.useEffect(()=>{S(d),d&&b(!0)},[d]),h.useEffect(()=>{g&&C(!1)},[g]),h.useEffect(()=>{H!==d&&Nr({value:H,name:r,type:"search",searchQueries:a,setSearchParams:c,filterKey:t,pageKey:o})},[H]);const A=h.useCallback(()=>{b(!0),requestAnimationFrame(()=>{var F;return(F=T.current)==null?void 0:F.focus()})},[]);Fs(l,A);const x=()=>{s&&!w&&b(!1)},B=F=>{var m;s&&F.key==="Escape"&&!w&&(b(!1),(m=T.current)==null||m.blur())},W=()=>{g||C(!0)};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(_.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(I.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:A}),e.jsxs(f.Box,{onTransitionEnd:W,style:{position:"relative",width:g?Is:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(hr.Input,{ref:T,size:"sm",fullWidth:!0,value:w,placeholder:n,leftIcon:e.jsx(I.Icon,{name:"Search",width:16,height:16}),onChange:F=>S(F.target.value),onKeyDown:B,onBlur:x,tabIndex:g?0:-1}),g&&!w&&e.jsx(f.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-hover, #f0f1f2)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(k.Text,{fontSize:"xs",color:"subtle",children:l})})]})]})},Wl=({columns:r,allVisible:t,onToggle:o,onReorder:n,onSetAllHidden:l})=>{const[s,i]=h.useState(null),[c,a]=h.useState(null),d=()=>{s!==null&&c!==null&&s!==c&&n(s,c),i(null),a(null)},g=(b,p)=>{const C=b+p;C<0||C>=r.length||n(b,C)};return e.jsxs(z.Menu,{position:"bottom-right",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(I.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{children:e.jsxs(f.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(_.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>l(t),children:t?"Hide All":"Show All"})]}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((b,p)=>{const C=!b.locked,w=c===p&&s!==null&&s!==p;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:C,onDragStart:()=>C&&i(p),onDragOver:S=>{S.preventDefault(),a(p)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:w?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(f.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:C?0:-1,"aria-label":`Reorder ${b.title}`,"aria-disabled":!C||void 0,color:"icon-subtlest",onKeyDown:S=>{C&&(S.key==="ArrowUp"?(S.preventDefault(),g(p,-1)):S.key==="ArrowDown"&&(S.preventDefault(),g(p,1)))},style:{display:"inline-flex",cursor:C?"grab":"default",opacity:C?1:.4},children:e.jsx(I.Icon,{name:"DragVertical",width:16,height:16})}),b.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:b.icon}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:b.title}),e.jsx(f.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(Lr.Toggle,{size:"sm",checked:b.visible,disabled:b.locked,onChange:()=>o(b.key),"aria-label":`Toggle ${b.title} column`})})]},b.key)})})]})})})]})},zl=({views:r,onApply:t,onDelete:o,onSave:n})=>{const[l,s]=h.useState(""),i=()=>{const c=l.trim();c&&(n(c),s(""))};return e.jsxs(z.Menu,{position:"bottom-right",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(I.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(z.MenuLists,{style:{width:"260px"},children:[e.jsx(z.MenuBody,{children:e.jsxs(f.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(f.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(k.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(c=>e.jsx(z.MenuItem,{startIcon:e.jsx(I.Icon,{name:"Bookmark"}),onClick:()=>t(c),endIcon:e.jsx(_.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(I.Icon,{name:"Trash2"}),"aria-label":`Delete ${c.name}`,onClick:a=>{a.stopPropagation(),o(c.id)}}),children:c.name},c.id))})]})}),e.jsx(z.MenuFooter,{children:e.jsxs(f.Box,{direction:"row",gap:"xs",children:[e.jsx(f.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(hr.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:l,onChange:c=>s(c.target.value),onKeyDown:c=>{c.key==="Enter"&&i()}})}),e.jsx(_.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!l.trim(),onClick:i,children:"Save"})]})})]})]})},Ls=({isOpen:r,onClose:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:i,onReset:c,getValue:a,setValue:d,clearValue:g,removeFilter:b})=>{const p=n.length;return e.jsx($r.Drawer,{position:"bottom",isShow:r,onHide:t,children:e.jsxs(f.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingInline:"md",paddingBlock:"sm",style:{borderBottom:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),p>0&&e.jsxs(k.Text,{fontSize:"sm",color:"subtle",children:["(",p,")"]})]}),e.jsx(_.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(I.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(f.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[p>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(f.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(Tl,{activeKeys:n,configByKey:l,getValue:a,setValue:d,clearValue:g,removeFilter:b})})]}),o.length>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(f.Box,{direction:"column",children:o.map(C=>{const w=n.includes(C.key),S=!!C.locked;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:S?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[C.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:C.icon}),e.jsx(k.Text,{fontSize:"sm",color:"primary",truncate:!0,children:C.label})]}),e.jsx(Lr.Toggle,{size:"sm",checked:w||S,disabled:S,onChange:()=>i(C.key),"aria-label":`Toggle ${C.label}`})]},C.key)})})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",gap:"sm",paddingInline:"md",paddingBlock:"sm",style:{borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsx(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(_.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!s,onClick:c,children:"Reset"})}),e.jsx(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(_.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},Ms=r=>`${r} Rows`,Ts=({perPageKey:r,pageKey:t,pageSizeOptions:o,defaultPerPage:n=10,showPageSize:l})=>{const{searchQueries:s,setSearchParams:i,searchParams:c}=qe(),a=c.get(r),d=a?Number(a):n,g=b=>{i({...s,[r]:b,[t]:"1"})};return l?e.jsxs(z.Menu,{position:"bottom-right",children:[e.jsx(z.MenuButton,{children:e.jsx(_.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(I.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(z.MenuLists,{children:e.jsxs(z.MenuBody,{style:{minWidth:200},children:[e.jsx(f.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),o.map(b=>e.jsx(z.MenuItem,{selected:b===d,endIcon:b===d?e.jsx(I.Icon,{name:"Check"}):void 0,onClick:()=>g(String(b)),children:Ms(b)},b))]})})]}):null},As=r=>{var oe;const{withPadding:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,toggleFilter:i,removeFilter:c,getValue:a,setValue:d,clearValue:g,onReset:b,searchable:p,searchKey:C,filterKey:w,pageKey:S,searchPlaceholder:H,searchShortcut:T,searchCollapsible:A,pagination:x,perPageKey:B,pageSizeOptions:W,defaultPerPage:F,showPagination:m,showResultCount:O,showPageSize:N,hasColumns:$,orderedColumns:M,allVisible:q,onToggleVisibility:J,onReorder:U,onSetAllHidden:K,showSavedViews:R,savedViews:ae,onApplyView:Q,onDeleteView:re,onSaveView:he,leadingActions:ve,trailingActions:Me}=r,[Ie,Ce]=h.useState(!1),{searchQueries:ye,setSearchParams:Ze}=qe(),ze=(x==null?void 0:x.rangeStart)??(((x==null?void 0:x.currentPage)||0)>1?(((x==null?void 0:x.currentPage)||0)-1)*((x==null?void 0:x.perPage)||0)+1:1),Ge=(x==null?void 0:x.rangeEnd)??((x==null?void 0:x.totalCurrentPage)!==(x==null?void 0:x.perPage)?x==null?void 0:x.totalData:((x==null?void 0:x.currentPage)||1)*((x==null?void 0:x.totalCurrentPage)||0)),ne=Fe=>{Ze({...ye,[S]:String(Fe)})},me=O||m&&!!(x!=null&&x.totalPage),we=()=>{b(),Ce(!1)};return e.jsxs(f.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[p&&e.jsx(Ol,{searchKey:C,filterKey:w,pageKey:S,placeholder:H,shortcut:T,collapsible:A}),e.jsx(_.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(I.Icon,{name:"FilterHorizontal"}),onClick:()=>Ce(!0),"aria-label":"Open filters",children:s?`Filter: ${n.length}`:null}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[ve,R&&e.jsx(zl,{views:ae,onApply:Q,onDelete:re,onSave:he}),$&&e.jsx(Wl,{columns:M,allVisible:q,onToggle:J,onReorder:U,onSetAllHidden:K}),e.jsx(Ts,{perPageKey:B,pageKey:S,pageSizeOptions:W,defaultPerPage:F,showPageSize:N}),Me]})]}),me&&e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[O?e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${ze}-${Ge} of ${((oe=x==null?void 0:x.totalData)==null?void 0:oe.toLocaleString())||0}`}):e.jsx(f.Box,{direction:"column"}),m&&!!(x!=null&&x.totalPage)&&e.jsx(Pr.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:x!=null&&x.currentPage?Number(x.currentPage):1,totalPages:Number(x.totalPage),onPageChange:ne})]}),e.jsx(Ls,{isOpen:Ie,onClose:()=>Ce(!1),configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:i,onReset:we,getValue:a,setValue:d,clearValue:g,removeFilter:c})]})},Os=({withPadding:r=!1,filterConfigs:t=[],filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:s="perPage",pageSizeOptions:i=[25,50,100],defaultPerPage:c,showPagination:a=!0,showResultCount:d=!0,showPageSize:g=!0,searchable:b=!1,searchKey:p="q",searchPlaceholder:C="Search",searchShortcut:w="/",searchPosition:S="right",searchCollapsible:H=!0,pagination:T,columns:A=[],onColumnsChange:x,columnsState:B,scopeId:W,savedViews:F,persistLastState:m=!0,persistSearch:O=!0,storage:N=$t,onReset:$,leadingActions:M,trailingActions:q})=>{const J=W??(F==null?void 0:F.scopeId),{activeKeys:U,configByKey:K,hasActiveFilter:R,toggleFilter:ae,removeFilter:Q,getValue:re,setValue:he,clearValue:ve,clearAll:Me}=Jt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:p}),Ie=ns({columns:A,scopeId:J,storage:N,onColumnsChange:x,value:B}),Ce=ss({scopeId:J,storage:N,snapshotKeys:[n,o,s],pageKey:l,getColumns:()=>Ie.state,applyColumns:Ie.applyState}),ye=cs({scopeId:J,storage:N,snapshotKeys:[n,o,l],enabled:m,filterKey:o,searchKey:p,persistSearch:O}),Ze=as({scopeId:J,storage:N,perPageKey:s,pageSizeOptions:i,enabled:m});hs({enabled:m&&!!J,snapshotKeys:[n,o,l],perPageKey:s,readSnapshot:ye.read,readPerPage:Ze.read});const ze=c??i[0]??25,Ge=!!(F!=null&&F.enabled)&&Ce.enabled,ne=()=>{Me(),ye.clear(),$==null||$()},me=ke.useMediaQuery("md"),we=b?e.jsx(Ol,{searchKey:p,filterKey:o,pageKey:l,placeholder:C,shortcut:w,collapsible:H}):null;return me?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(fs,{configs:t,activeKeys:U,onToggle:ae,hasActiveFilter:R,onReset:ne}),S==="left"&&we,e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Tl,{activeKeys:U,configByKey:K,getValue:re,setValue:he,clearValue:ve,removeFilter:Q}),R&&e.jsx(_.Button,{variant:"link",tone:"brand",size:"sm",onClick:ne,children:"Reset"})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[M,e.jsx(Es,{pagination:T,pageKey:l,perPageKey:s,pageSizeOptions:i,defaultPerPage:ze,showPagination:a,showResultCount:d,showPageSize:g}),S==="right"&&we,Ge&&e.jsx(zl,{views:Ce.views,onApply:Ce.applyView,onDelete:Ce.deleteView,onSave:Ce.saveView}),A.length>0&&e.jsx(Wl,{columns:Ie.orderedColumns,allVisible:Ie.allVisible,onToggle:Ie.toggleVisibility,onReorder:Ie.reorder,onSetAllHidden:Ie.setAllHidden}),q]})]}):e.jsx(As,{withPadding:r,configs:t,activeKeys:U,configByKey:K,hasActiveFilter:R,toggleFilter:ae,removeFilter:Q,getValue:re,setValue:he,clearValue:ve,onReset:ne,searchable:b,searchKey:p,filterKey:o,pageKey:l,searchPlaceholder:C,searchShortcut:w,searchCollapsible:H,pagination:T,perPageKey:s,pageSizeOptions:i,defaultPerPage:ze,showPagination:a,showResultCount:d,showPageSize:g,hasColumns:A.length>0,orderedColumns:Ie.orderedColumns,allVisible:Ie.allVisible,onToggleVisibility:Ie.toggleVisibility,onReorder:Ie.reorder,onSetAllHidden:Ie.setAllHidden,showSavedViews:Ge,savedViews:Ce.views,onApplyView:Ce.applyView,onDeleteView:Ce.deleteView,onSaveView:Ce.saveView,leadingActions:M,trailingActions:q})},Ws=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r[0];return(t==null?void 0:t.value)!=null?String(t.value):void 0},zs=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r.map(o=>(o==null?void 0:o.value)!=null?String(o.value):null).filter(o=>o!=null);return t.length?t:void 0},Hs=(r,t)=>{switch(r.type){case"dropdown":case"radio":return Ws(t);case"dropdown-multiple":case"checkbox-multiple":return zs(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;case"text":return typeof t=="string"&&t?t:void 0;default:return}},Hl=(r,t)=>{if(r==null||r==="")return t;const o=Number(r);return Number.isFinite(o)&&o>0?o:t},Ps=r=>{const{filterConfigs:t,filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:s="perPage",searchKey:i="q",defaultPage:c=1,defaultPerPage:a=10,paramKeys:d,serialize:g}=r,{activeKeys:b,configByKey:p,hasActiveFilter:C,getValue:w}=Jt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:i}),{searchParams:S}=qe(),H=S.toString();return h.useMemo(()=>{const A={},x={},B=Hl(S.get(l),c),W=Hl(S.get(s),a);A[(d==null?void 0:d.page)??"page"]=B,A[(d==null?void 0:d.perPage)??"perPage"]=W;const F=ot(i,S,o)||"";F&&(A[(d==null?void 0:d.search)??"search"]=F);let m=!1;for(const O of b){const N=p[O];if(!N)continue;const $=w(N);x[O]=$;const M=g==null?void 0:g[O],q=M?M($):Hs(N,$);if(q==null||Array.isArray(q)&&q.length===0)continue;const J=(d==null?void 0:d[O])??O;A[J]=q,m=!0}return{params:A,raw:x,hasActiveFilter:C||!!F||m}},[H,b.join("|"),o,n,l,s,i,c,a,d,g,p])},_s=["dropdown","dropdown-multiple","checkbox-multiple","radio"],js=({filterConfigs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l})=>{const{configByKey:s,getValue:i,setValue:c,removeFilter:a,clearAll:d,hasActiveFilter:g}=Jt({configs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l}),b=(x,B)=>{var F;const W=x.options;return((F=W==null?void 0:W.find(m=>m.value===B))==null?void 0:F.label)??B},p=h.useCallback(x=>{const B=s[x];if(!B)return[];const W=i(B);return Array.isArray(W)?W.map(F=>String(F.value)):[]},[s,i]),C=h.useCallback((x,B)=>{const W=s[x];if(!W||!_s.includes(W.type))return;const F=Array.isArray(B)?B:[B];if(F.length===0){a(x);return}c(W,F.map(m=>({label:b(W,m),value:m})))},[s,c,a]),w=h.useCallback((x,B)=>{const W=p(x);C(x,W.includes(B)?W.filter(F=>F!==B):[...W,B])},[p,C]),S=h.useCallback((x,B)=>p(x).includes(B),[p]),H=h.useCallback(x=>a(x),[a]),T=h.useCallback(x=>{const B=s[x];return B?i(B):void 0},[s,i]),A=h.useCallback((x,B)=>{const W=s[x];if(W){if(B==null){a(x);return}c(W,B)}},[s,c,a]);return{set:C,toggle:w,clear:H,clearAll:d,isActive:S,values:p,getRaw:T,setRaw:A,hasActiveFilter:g}},oo="var(--sa-background-brand, #04254f)",Ns="var(--sa-text-brand, #031f43)",Vs={padding:"6px 8px",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-xs, 4px)",font:"inherit",fontSize:13,outline:"none",width:"100%",boxSizing:"border-box"},lo={padding:"4px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",fontSize:13,color:Ns},Pl=(r,t)=>{if(r.type==="text"||r.type==="date")return!!t.getRaw(r.key);if(r.type==="date-compact"){const o=t.getRaw(r.key);return!!(o&&(o.date||o.from||o.to||o.relative||o.op==="is-empty"||o.op==="is-not-empty"))}return t.values(r.key).length>0},qs=({field:r,controls:t})=>{const[o,n]=h.useState(""),l=r.type==="dropdown"||r.type==="radio",s=r.type==="checkbox-multiple"?!1:r.searchable!==!1,i=t.values(r.key),c=s&&o.trim()?r.options.filter(d=>d.label.toLowerCase().includes(o.toLowerCase())):r.options,a=d=>{l?t.set(r.key,i.includes(d)?[]:d):t.toggle(r.key,d)};return e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:4,minWidth:200},children:[s&&e.jsx("input",{value:o,onChange:d=>{var g;n(d.target.value),(g=r.onSearch)==null||g.call(r,d.target.value)},placeholder:"Cari…",style:Vs}),e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:220,overflowY:"auto"},children:[c.map(d=>{const g=i.includes(d.value);return e.jsxs("button",{type:"button",onClick:()=>a(d.value),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",borderRadius:"var(--sa-radii-xs, 4px)"},children:[e.jsx("span",{style:{width:16,height:16,flexShrink:0,borderRadius:l?"50%":"var(--sa-radii-xs, 4px)",display:"inline-flex",alignItems:"center",justifyContent:"center",border:`1px solid ${g?oo:"var(--sa-border-subtle, #0b120e24)"}`,background:g&&!l?oo:"transparent"},children:g&&(l?e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:oo}}):e.jsx(I.Icon,{name:"Check",size:"xs",style:{color:"#fff"}}))}),e.jsx(k.Text,{as:"span",style:{fontSize:14},children:d.label})]},d.value)}),c.length===0&&e.jsx(k.Text,{as:"span",style:{fontSize:13,color:"var(--sa-text-subtlest, #8c8f97)",padding:"6px 8px"},children:"Tak ada hasil"})]}),i.length>0&&e.jsx("button",{type:"button",onClick:()=>t.clear(r.key),style:lo,children:"Clear"})]})},Zs=({field:r,controls:t})=>{const o=t.getRaw(r.key);return e.jsx(f.Box,{style:{minWidth:240},children:e.jsx(xr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:o,onChange:n=>t.setRaw(r.key,n??null),withPadding:!1})})},Gs=({field:r,controls:t})=>{const o=t.getRaw(r.key),n=r.ops&&r.ops.length>0?r.ops:Bl,l=r.defaultOp&&n.includes(r.defaultOp)?r.defaultOp:n[0],s=r.mode??"days",i=(o==null?void 0:o.op)??l,c=d=>t.setRaw(r.key,d),a=d=>{if(d!==i)return c(d==="is-empty"||d==="is-not-empty"?{op:d}:d==="is-relative-to-today"?{op:d,relative:(o==null?void 0:o.relative)??{direction:"past",count:1,period:"week"}}:d==="is-between"?{op:d,from:o==null?void 0:o.from,to:o==null?void 0:o.to}:{op:d,date:o==null?void 0:o.date})};return e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:6,minWidth:280},children:[e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(ml,{op:i,ops:n,onChange:a})]}),e.jsx(El,{value:o,op:i,mode:s,onChange:c}),Pl(r,t)&&e.jsx("button",{type:"button",onClick:()=>t.setRaw(r.key,null),style:lo,children:"Clear"})]})},Qs=({field:r,controls:t})=>{const o=t.getRaw(r.key)??"",[n,l]=h.useState(o),s=ke.useDebounce(n,r.debounceMs??300);return h.useEffect(()=>{const i=t.getRaw(r.key)??"";s!==i&&t.setRaw(r.key,s||null)},[s]),e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:6,minWidth:220},children:[e.jsx(hr.Input,{size:"sm",fullWidth:!0,value:n,placeholder:r.placeholder??"Cari…",leftIcon:e.jsx(I.Icon,{name:"Search",width:16,height:16}),onChange:i=>l(i.target.value)}),n&&e.jsx("button",{type:"button",onClick:()=>{l(""),t.setRaw(r.key,null)},style:lo,children:"Clear"})]})},Us=({field:r,controls:t})=>r.type==="text"?e.jsx(Qs,{field:r,controls:t}):r.type==="date"?e.jsx(Zs,{field:r,controls:t}):r.type==="date-compact"?e.jsx(Gs,{field:r,controls:t}):e.jsx(qs,{field:r,controls:t}),Ys=(r,t)=>{if(!r)return{};const{fromKey:o,toKey:n,opKey:l}=t,s={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(s[o]=new Date(r.date).toISOString()),l&&(s[l]=r.op),s;case"is-between":return r.from&&(s[o]=new Date(r.from).toISOString()),r.to&&(s[n]=new Date(r.to).toISOString()),s;case"is-relative-to-today":{if(!r.relative)return s;const{from:i,to:c}=xl(r.relative);return s[o]=i.toISOString(),s[n]=c.toISOString(),s}case"is-empty":case"is-not-empty":return l&&(s[l]=r.op==="is-empty"?"empty":"not-empty"),s;default:return s}},_l=({children:r,borderRadius:t,height:o})=>{const n=h.useRef(null),[l,s]=h.useState("100vh");return h.useEffect(()=>{if(o)return;const i=()=>{if(n.current){const c=n.current.getBoundingClientRect().top;s(`calc(100vh - ${c}px)`)}};return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[o]),e.jsx(f.Box,{ref:n,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:t||"rounded-xs",style:{height:o??l,display:"flex",flexDirection:"column"},children:r})},jl=({action:r,rightContent:t,leftContent:o,headerSlot:n,advanceFilter:l,showFilter:s=!0})=>{const i=ke.useMediaQuery("md"),c=s?e.jsx(vl,{...l}):null,a=()=>r?h.isValidElement(r)?r:e.jsx(f.Box,{style:{display:"flex",flexDirection:i?"row":"column",gap:"8px",width:i?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:d,icon:g,buttonProps:b,onClick:p},C)=>!d&&!g?null:e.jsx(_.Button,{fullWidth:!i,iconLeft:g?e.jsx(I.Icon,{name:g}):void 0,onClick:p,...b,children:d},`action-${C}`))}):null;return e.jsx(f.Box,{style:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center",paddingLeft:"8px",paddingRight:"8px",paddingTop:"8px",paddingBottom:"8px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0,position:"relative",zIndex:10,flexDirection:i?"row":"column-reverse",gap:"16px"},children:n?n({filter:c}):e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[c,o]}),e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},Xs=({totalData:r,withMarginBottom:t=!0,withMarginTop:o=!0})=>e.jsxs(f.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:o?"16px":void 0},children:[e.jsxs(tr.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(tr.Body1,{children:r||0})]}),Nl=({pagination:r,pageKey:t="page",perPageKey:o="perPage",defaultPerPage:n=10,showPagination:l=!0,totalData:s})=>{const{searchQueries:i,setSearchParams:c,searchParams:a}=qe(),d=a.get(o),g=w=>{c({...i,[t]:String(w)})},b=w=>{c({...i,[o]:w,[t]:"1"})},p=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),C=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsx(f.Box,{style:{display:"flex",width:"100%",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0},children:l?e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(k.Text,{children:"Rows Per Page: "}),e.jsx(Er.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:w=>{b(w[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(k.Text,{children:`${p}-${C} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(Pr.Pagination,{currentPage:r!=null&&r.currentPage?Number(r==null?void 0:r.currentPage):1,totalPages:r!=null&&r.totalPage?Number(r==null?void 0:r.totalPage):1,onPageChange:g})]}):e.jsx(Xs,{totalData:s,withMarginBottom:!1,withMarginTop:!1})})},Vl=({filter:r,columnTitle:t})=>{const[o,n]=h.useState(!1),l=h.useRef(null),s=h.useRef(null),i=h.useRef(null),[c,a]=h.useState(""),[d,g]=h.useState({top:0,left:0}),b=r.selectedValues,p=h.useMemo(()=>c?r.options.filter(S=>S.label.toLowerCase().includes(c.toLowerCase())):r.options,[r.options,c]);h.useEffect(()=>{if(o&&s.current){const S=s.current.getBoundingClientRect(),H=280,T={top:S.bottom+8};r.position==="left"||S.left+H>window.innerWidth?T.right=window.innerWidth-S.right:T.left=S.left,g(T)}},[o,r.position]),h.useEffect(()=>{o&&i.current?setTimeout(()=>{var S;return(S=i.current)==null?void 0:S.focus()},50):a("")},[o]),h.useEffect(()=>{const S=H=>{l.current&&!l.current.contains(H.target)&&s.current&&!s.current.contains(H.target)&&n(!1)};return o&&document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[o]);const C=S=>{const H=b.includes(S)?b.filter(T=>T!==S):[...b,S];r.onFilterChange(H)},w=()=>r.onFilterChange([]);return e.jsxs(f.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(f.Box,{ref:s,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:S=>{var H;S.stopPropagation(),o||(H=r.onOpen)==null||H.call(r),n(T=>!T)},children:e.jsx(I.Icon,{name:o?"ChevronUp":"ChevronDown",size:"sm",style:{color:b.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),o&&e.jsxs(f.Box,{ref:l,style:{position:"fixed",top:`${d.top}px`,...d.left!==void 0?{left:`${d.left}px`}:{right:`${d.right}px`},backgroundColor:"white",borderRadius:"var(--sa-radii-xs, 4px)",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(k.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),b.length>0&&e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(k.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:S=>{S.stopPropagation(),w()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(f.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(hr.Input,{ref:i,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(I.Icon,{name:"Search",size:"sm"}),value:c,onChange:S=>a(S.target.value),style:{fontSize:"14px"}})}),e.jsx(f.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:r.isLoadingOptions?e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(I.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):p.length>0?e.jsx(f.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:p.map(S=>e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"var(--sa-radii-md, 8px)",transition:"all 0.2s ease",backgroundColor:b.includes(S.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:H=>{H.stopPropagation(),C(S.value)},onMouseEnter:H=>{b.includes(S.value)||(H.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),H.currentTarget.style.transform="translateX(2px)"},onMouseLeave:H=>{H.currentTarget.style.backgroundColor=b.includes(S.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",H.currentTarget.style.transform="translateX(0)"},children:[e.jsx(fr.Checkbox,{checked:b.includes(S.value),onChange:()=>{}}),e.jsx(k.Text,{fontSize:"sm",fontWeight:b.includes(S.value)?"medium":"normal",color:b.includes(S.value)?"primary":"gray-700",children:S.label})]},S.value))}):e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(I.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),b.length>0&&e.jsx(f.Box,{direction:"column",style:{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",backgroundColor:"var(--sa-color-brand-50, #e6edf6)",marginTop:"auto"},children:e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(f.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"var(--sa-radii-lg, 12px)",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:b.length}),e.jsxs(k.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",b.length>1?"s":""," selected"]})]})})]})]})},Js=({direction:r})=>{const t="var(--sa-text-primary, #292a2e)",o="var(--sa-text-subtle, #8c8f97)",n=r==="asc"?t:o,l=r==="desc"?t:o,s=r==="asc"?1:.45,i=r==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:n,opacity:s,marginBottom:1},children:e.jsx("path",{d:"M4 0 L8 5 L0 5 Z",fill:"currentColor"})}),e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:l,opacity:i},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},$s=({frozen:r})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:r?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),no="var(--sa-background-primary, #ffffff)",ql="var(--sa-background-primary-inverse, #f8f8f8)",Zl=({columns:r,records:t,handleDetail:o,handleUpdate:n,handleDelete:l,isLoading:s,visibleHandleDelete:i,visibleHandleUpdate:c,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:g,frozenCount:b=0,onFrozenCountChange:p,customActions:C,actionsOrder:w=["detail","update","delete","custom"],customEmptyState:S,enableColumnResize:H=!1,defaultColumnWidths:T,onColumnWidthsChange:A,defaultMinColumnWidth:x=60,sort:B,defaultSort:W,onSortChange:F,showActionDivider:m=!1})=>{const O=B!==void 0,[N,$]=h.useState(W??null),M=O?B??null:N,q=P=>{if(P.sortKey)return P.sortKey;if(typeof P.accessor=="string")return P.accessor},J=P=>{const Y=q(P);if(!Y)return;let X;!M||M.key!==Y?X={key:Y,direction:"asc"}:M.direction==="asc"?X={key:Y,direction:"desc"}:X=null,O||$(X),F==null||F(X)},K=[o,n,l].filter(P=>P!==void 0).length,R=!!C,ae=!!o||!!n||!!l||R,Q="var(--sa-border-subtle, #0b120e24)",re=`1px solid ${Q}`,he=`inset 1px 0 0 ${Q}`,ve=`inset -1px 0 0 ${Q}`,Me=K===3?R?"178px":"140px":K===2?R?"140px":"102px":K===1?R?"112px":"74px":R?"74px":"",Ie=(P,Y)=>{if(!Y)return P;if(typeof Y=="function")return Y(P);if(typeof Y=="string")return P[Y]},[Ce,ye]=h.useState(!1);h.useEffect(()=>{if(!(g!=null&&g.current))return;const P=g.current;ye(P.scrollHeight>P.clientHeight)},[t,g]);const Ze=h.useRef(null),[ze,Ge]=h.useState([]),[ne,me]=h.useState(()=>T??{}),we=h.useRef(null);h.useLayoutEffect(()=>{if(!b||!Ze.current){Ge([]);return}const P=Array.from(Ze.current.querySelectorAll("thead tr th")),Y=[];let X=0;P.forEach((fe,Le)=>{Y[Le]=X,Le<b&&(X+=fe.offsetWidth)}),Ge(Y)},[b,r,t,ne]);const oe=P=>{p&&p(P<b?P:P+1)},Fe=(P,Y)=>{const X=ne[P];if(X!==void 0){const fe=`${X}px`;return{width:fe,minWidth:fe,maxWidth:fe}}return Y?{width:Y}:{}},Ke=P=>H&&(P.resizable??!0),or=(P,Y)=>{P.preventDefault(),P.stopPropagation();const X=P.currentTarget.closest("th");if(!X)return;const fe=Math.round(X.getBoundingClientRect().width);we.current={colIndex:Y,startX:P.clientX,startWidth:fe};const Le=document.body.style.userSelect,pe=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Pe=Ye=>{var Ee;const _e=we.current;if(!_e)return;const Xe=((Ee=r[_e.colIndex])==null?void 0:Ee.minWidth)??x,vr=Math.max(Xe,_e.startWidth+(Ye.clientX-_e.startX));me(je=>je[_e.colIndex]===vr?je:{...je,[_e.colIndex]:vr})},Re=()=>{document.removeEventListener("mousemove",Pe),document.removeEventListener("mouseup",Re),document.body.style.userSelect=Le,document.body.style.cursor=pe,we.current=null,A&&me(Ye=>(A(Ye),Ye))};document.addEventListener("mousemove",Pe),document.addEventListener("mouseup",Re)};return e.jsx("div",{ref:Ze,children:e.jsxs(G.Table,{fullWidth:!0,children:[e.jsx(G.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(G.Tr,{children:[r.map((P,Y)=>{var ur,Ar;const X=b>0&&Y<b,fe=ze[Y]??0,Le=Ke(P),Pe=Y===r.length-1&&ae&&m,Re=q(P),Ye=!!P.sortable&&!!Re,_e=Ye&&(M==null?void 0:M.key)===Re?M.direction:null,Xe=P.title||((ur=P.accessor)==null?void 0:ur.toString())||"",vr=(Ar=P.headerTooltip)!=null&&Ar.showIcon?e.jsx(I.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Ee=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Xe}),je=Ye?e.jsxs("button",{type:"button",onClick:()=>J(P),title:_e==="asc"?"Sorted ascending — click to sort descending":_e==="desc"?"Sorted descending — click to clear":"Click to sort ascending",style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4,background:"none",border:"none",padding:0,margin:0,font:"inherit",color:"inherit",cursor:"pointer",textAlign:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left"},children:[Ee,vr,e.jsx(Js,{direction:_e})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Ee,vr]});return e.jsxs(G.Th,{style:{position:"sticky",top:0,left:X?fe:void 0,zIndex:X?4:2,paddingLeft:Y===0?"12px":"",borderRight:d&&!Pe&&!X?re:void 0,borderBottom:d?re:void 0,boxShadow:d&&X?ve:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left",...Fe(Y,P.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[P.headerTooltip?e.jsx(Te.Tooltip,{label:P.headerTooltip.content,position:"bottom",children:je}):je,P.filter&&e.jsx(Vl,{filter:P.filter,columnTitle:P.title}),p&&e.jsx("button",{onClick:()=>oe(Y),title:X?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:X?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:X?1:.45,transition:"opacity 0.15s"},children:e.jsx($s,{frozen:X})})]}),Le&&e.jsx("div",{onMouseDown:lr=>or(lr,Y),onClick:lr=>lr.stopPropagation(),role:"separator","aria-orientation":"vertical",title:"Drag to resize",style:{position:"absolute",top:0,right:-3,width:6,height:"100%",cursor:"col-resize",userSelect:"none",zIndex:5,touchAction:"none"}})]},`table-head-${Y}`)}),ae?e.jsx(G.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?re:void 0,boxShadow:d&&m?he:void 0}}):null]})}),e.jsx(G.Tbody,{children:s?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:r.length+1,children:e.jsxs(f.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(rr.Skeleton,{variant:"list"}),e.jsx(rr.Skeleton,{variant:"list"}),e.jsx(rr.Skeleton,{variant:"list"}),e.jsx(rr.Skeleton,{variant:"list"}),e.jsx(rr.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&S?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:r.length+1,children:S})}):t==null?void 0:t.map((P,Y)=>e.jsxs(G.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:Y===t.length-1&&Ce?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:X=>{const fe=X.currentTarget;fe.style.backgroundColor=ql,Array.from(fe.querySelectorAll("td")).forEach(Le=>{Le.style.position==="sticky"&&(Le.style.backgroundColor=ql)})},onMouseLeave:X=>{const fe=X.currentTarget;fe.style.backgroundColor="",Array.from(fe.querySelectorAll("td")).forEach(Le=>{Le.style.position==="sticky"&&(Le.style.backgroundColor=no)})},children:[r.map((X,fe)=>{const Le=X.render?X.render(P,Y,t):Ie(P,X.accessor),pe=b>0&&fe<b,Pe=ze[fe]??0,Re=ne[fe]!==void 0,Ye=pe&&fe===b-1;return e.jsx(G.Td,{style:{position:pe?"sticky":void 0,left:pe?Pe:void 0,zIndex:pe?1:void 0,backgroundColor:pe?no:void 0,transition:pe?"background-color 0.3s ease":void 0,paddingLeft:fe===0?"12px":"",whiteSpace:"nowrap",overflow:Re?"hidden":void 0,borderLeft:X.showBorderLeft?re:void 0,borderRight:X.showBorderRight?re:void 0,boxShadow:Ye?ve:void 0,textAlign:X.textAlign==="text-right"?"right":X.textAlign==="text-center"?"center":"left",...Fe(fe,X.width)},children:typeof Le=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:X.textAlign==="text-right"?"right":X.textAlign==="text-center"?"center":"left"},children:Le}):Le},`row-${Y}-col-${fe}`)}),ae?e.jsx(G.Td,{style:{width:Me,position:"sticky",right:0,zIndex:1,backgroundColor:no,boxShadow:m?he:void 0,transition:"background-color 0.3s ease"},children:e.jsx(de.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:w.map(X=>{const fe=Y===t.length-1?"top":"bottom";return X==="detail"&&o&&(a==null?void 0:a(P))!==!1?e.jsx(Te.Tooltip,{label:"Detail",position:fe,children:e.jsx(_.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(P.id,P),iconLeft:e.jsx(I.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):X==="update"&&n&&(c==null?void 0:c(P))!==!1?e.jsx(Te.Tooltip,{label:"Update",position:fe,children:e.jsx(_.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(P),iconLeft:e.jsx(I.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):X==="delete"&&l&&(i==null?void 0:i(P))!==!1?e.jsx(Te.Tooltip,{label:"Delete",position:fe,children:e.jsx(_.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(P.id,P),iconLeft:e.jsx(I.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):X==="custom"?e.jsx(h.Fragment,{children:C==null?void 0:C(P)},"custom"):null})})}):null]},`${P}${Y}`))})]})})};let Gl=!1;const Ks=({wrapperProps:r,dataTableProps:t,headerProps:o,footerProps:n})=>{var b;process.env.NODE_ENV!=="production"&&!Gl&&(Gl=!0,console.warn("[@starasia/admin] `TableSection` deprecated — pakai `<FilterBar>` + `<TableLayout>`. Lihat skill `starasia-list-page-pattern`. Akan dihapus di salah satu major berikutnya."));const l=h.useRef(null),[s,i]=h.useState((t==null?void 0:t.defaultFrozenCount)??0),c=(o==null?void 0:o.show)??!0,a=h.useRef(null),d=(b=t==null?void 0:t.pagination)==null?void 0:b.totalData;typeof d=="number"&&(a.current=d);const g=(n==null?void 0:n.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(_l,{...r,children:[c&&e.jsx(jl,{...o}),e.jsx(f.Box,{direction:"column",ref:l,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(Zl,{...t,scrollParentRef:l,frozenCount:t!=null&&t.enableFreezeColumns?s:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?i:void 0}):null}),g&&e.jsx(Nl,{pagination:t==null?void 0:t.pagination,pageKey:t==null?void 0:t.pageKey,perPageKey:t==null?void 0:t.perPageKey,defaultPerPage:t==null?void 0:t.defaultPerPage,showPagination:t==null?void 0:t.showPagination,totalData:n==null?void 0:n.totalData})]})};function Rs(r){return h.memo(r)}const ei=Rs(Ks),Ql="(any-pointer: coarse)",ri=r=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const t=window.matchMedia(Ql);return t.addEventListener("change",r),()=>t.removeEventListener("change",r)},ti=()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(Ql).matches,oi=()=>!1;function Ul(){return h.useSyncExternalStore(ri,ti,oi)}const Yl=200,st="1px solid var(--sa-border-subtle, #0b120e24)",li=({sortDir:r,frozen:t,filterActive:o})=>r==="asc"?e.jsx(I.Icon,{name:"ChevronSmallUp"}):r==="desc"?e.jsx(I.Icon,{name:"ChevronSmallDown"}):t?e.jsx(I.Icon,{name:"LockOn",size:"xs"}):e.jsx(I.Icon,{name:"Filter",size:"xs",style:o?{color:"var(--sa-text-brand, #031f43)"}:void 0}),it=({icon:r,label:t,active:o,danger:n,onClick:l})=>{const s=n?"var(--sa-text-error, #a4133c)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:l,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:o?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:s,textAlign:"left"},onMouseEnter:i=>{o||(i.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:i=>{i.currentTarget.style.background=o?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(I.Icon,{name:r,size:"sm",style:{color:s,flexShrink:0}}),e.jsx(k.Text,{as:"span",style:{color:s},children:t})]})},ni=r=>{let t=(r==null?void 0:r.parentElement)??null;for(;t;){const o=getComputedStyle(t).overflowX;if((o==="auto"||o==="scroll")&&t.scrollWidth>t.clientWidth)return t;t=t.parentElement}return null},Xl=({active:r,canSort:t,canHide:o,sortDir:n,frozen:l,onSort:s,onClearSort:i,onToggleFreeze:c,onHide:a,filterSlot:d,filterActive:g})=>{const[b,p]=h.useState(!1),C=h.useRef(null),w=h.useRef(null),[S,H]=h.useState({top:0,left:0}),T=h.useCallback(()=>{var M;const x=C.current;if(!x)return;const B=x.getBoundingClientRect(),W=x.closest(".sa-tl-scroll")??ni(x),F=W==null?void 0:W.getBoundingClientRect();if(F&&(B.left<F.left||B.left>F.right)){p(!1);return}const m=Math.min(window.innerWidth-8,F?F.right:window.innerWidth),O=((M=w.current)==null?void 0:M.offsetWidth)||Yl,N=F?F.left:8,$=Math.max(N,Math.min(B.left,m-O));H({top:B.bottom+6,left:$})},[]);h.useEffect(()=>{if(!b)return;T();const x=()=>T();return window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}},[b,T]),h.useEffect(()=>{if(!b)return;const x=B=>{w.current&&!w.current.contains(B.target)&&C.current&&!C.current.contains(B.target)&&p(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[b]);const A=x=>{x(),p(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:C,type:"button",className:"sa-tl-menu-trigger","data-active":r||b?"true":"false",onClick:x=>{x.stopPropagation(),p(B=>!B)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:st,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(li,{sortDir:n,frozen:l,filterActive:g})}),b&&e.jsxs(f.Box,{ref:w,onClick:x=>x.stopPropagation(),style:{position:"fixed",top:`${S.top}px`,...S.left!==void 0?{left:`${S.left}px`}:{right:`${S.right}px`},minWidth:Yl,backgroundColor:"var(--sa-background-primary, #ffffff)",border:st,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-xl, 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[d!=null&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:"6px 12px 2px"},children:e.jsx(k.Text,{as:"span",style:{fontSize:12,fontWeight:500,color:"var(--sa-text-subtlest, #8c8f97)"},children:"Filter"})}),e.jsx("div",{style:{padding:"2px 8px 4px"},children:d}),e.jsx("div",{style:{borderTop:st,margin:"4px 0"}})]}),t&&e.jsxs(e.Fragment,{children:[e.jsx(it,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>A(()=>n==="asc"?i():s("asc"))}),e.jsx(it,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>A(()=>n==="desc"?i():s("desc"))}),e.jsx("div",{style:{borderTop:st,margin:"4px 0"}})]}),e.jsx(it,{icon:"Pin1",label:l?"Unfreeze":"Freeze",active:l,onClick:()=>A(c)}),o&&e.jsx(it,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>A(a)})]})]})},si=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ii={background:"var(--sa-background-warning-subtlest, #fef2e6)",color:"inherit",padding:0,borderRadius:"min(2px, var(--sa-radii-xs, 4px))"},Jl=({text:r,query:t,markStyle:o})=>{const n=t==null?void 0:t.trim();if(!n||!r)return e.jsx(e.Fragment,{children:r});const l=n.split(/\s+/).filter(Boolean);if(!l.length)return e.jsx(e.Fragment,{children:r});const s=new Set(l.map(a=>a.toLowerCase())),i=new RegExp(`(${l.map(si).join("|")})`,"gi"),c=r.split(i);return e.jsx(e.Fragment,{children:c.map((a,d)=>a&&s.has(a.toLowerCase())?e.jsx("mark",{style:{...ii,...o},children:a},d):e.jsx(h.Fragment,{children:a},d))})},qr="1px solid var(--sa-border-subtle, #0b120e24)",ci="var(--sa-text-subtle, #8c8f97)",Tr="var(--sa-background-neutral, #f0f1f2)",$l="2px 0 4px -2px var(--sa-border-subtle, #0b120e24)",Zr=40,so=5,ai=28,io=4,ct=16,co="var(--sa-background-brand-subtlest)",at={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Kl="sa-table-layout-styles",di=()=>{if(typeof document>"u"||document.getElementById(Kl))return;const r=document.createElement("style");r.id=Kl,r.textContent=`@layer starasia.components {
1
+ (function(u,Ar){typeof exports=="object"&&typeof module<"u"?Ar(exports,require("@starasia/alert"),require("@starasia/avatar"),require("@starasia/badges"),require("@starasia/box"),require("@starasia/breadcrumb"),require("@starasia/button"),require("@starasia/card"),require("@starasia/date"),require("@starasia/dialog"),require("@starasia/drawer"),require("@starasia/dropdown"),require("@starasia/hooks"),require("@starasia/http"),require("@starasia/input"),require("@starasia/menu"),require("@starasia/pagination"),require("@starasia/storage"),require("@starasia/table"),require("@starasia/tabs"),require("@starasia/textarea"),require("@starasia/theme"),require("@starasia/toast"),require("@starasia/toggle"),require("@starasia/tooltip"),require("@starasia/checkbox"),require("@starasia/radio"),require("@starasia/text"),require("@starasia/icon"),require("@starasia/flex"),require("@starasia/grid"),require("@starasia/progress"),require("@starasia/stepper"),require("@starasia/accordion"),require("@starasia/story-record"),require("@starasia/skeleton"),require("@starasia/progress-stepper"),require("react/jsx-runtime"),require("react"),require("react-dom"),require("react-easy-crop")):typeof define=="function"&&define.amd?define(["exports","@starasia/alert","@starasia/avatar","@starasia/badges","@starasia/box","@starasia/breadcrumb","@starasia/button","@starasia/card","@starasia/date","@starasia/dialog","@starasia/drawer","@starasia/dropdown","@starasia/hooks","@starasia/http","@starasia/input","@starasia/menu","@starasia/pagination","@starasia/storage","@starasia/table","@starasia/tabs","@starasia/textarea","@starasia/theme","@starasia/toast","@starasia/toggle","@starasia/tooltip","@starasia/checkbox","@starasia/radio","@starasia/text","@starasia/icon","@starasia/flex","@starasia/grid","@starasia/progress","@starasia/stepper","@starasia/accordion","@starasia/story-record","@starasia/skeleton","@starasia/progress-stepper","react/jsx-runtime","react","react-dom","react-easy-crop"],Ar):(u=typeof globalThis<"u"?globalThis:u||self,Ar(u["@starasia/admin"]={},u.alert,u.avatar,u.badges,u.box,u.breadcrumb,u.button,u.card,u.date,u.dialog,u.drawer,u.dropdown,u.hooks,u.http,u.input,u.menu,u.pagination,u.storage,u.table,u.tabs,u.textarea,u.theme,u.toast,u.toggle,u.tooltip,u.checkbox,u.radio,u.text,u.icon,u.flex,u.grid,u.progress,u.stepper,u.accordion,u.storyRecord,u.skeleton,u.progressStepper,u.jsxRuntime,u.React,u.ReactDOM,u.ReactEasyCrop))})(this,function(u,Ar,ft,or,f,Or,V,Nt,Sr,Oe,ut,Wr,Ee,zr,gr,z,Xr,$r,U,Mo,jt,Hr,Ao,_r,Ae,yr,Vt,m,F,he,Oo,Wo,zo,Ho,_o,lr,Po,e,h,gt,Ln){"use strict";const Mn={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},qt=h.createContext(Mn),Zt=()=>h.useContext(qt),No=r=>{const[t,o]=h.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:o}},jo=h.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),Vo=({children:r})=>{const[t,o]=h.useState({}),n=h.useCallback(c=>{o(a=>typeof c=="function"?c(a):c)},[]),l=h.useCallback((c,a)=>{o(d=>{const g=typeof a=="function"?a(d[c]):a;return{...d,[c]:g}})},[]),s=h.useCallback(c=>{o(a=>{if(!(c in a))return a;const d={...a};return delete d[c],d})},[]),i=h.useMemo(()=>({badges:t,setBadge:l,setBadges:n,clearBadge:s}),[t,l,n,s]);return e.jsx(jo.Provider,{value:i,children:r})},qo=()=>h.useContext(jo),Jr=(r,t)=>{const o=t!==void 0?t:r;return o==null?null:typeof o=="string"||typeof o=="number"?{value:o}:o},Gt=240,Qt=200,Ut=480,An="sa-sidebar-width",Yt=(r,t,o)=>Math.min(Math.max(r,t),o),On=(r,t,o,n)=>{if(typeof window>"u")return t;try{const l=window.localStorage.getItem(r);if(!l)return t;const s=parseInt(l,10);return Number.isFinite(s)?Yt(s,o,n):t}catch{return t}},Zo=(r,t)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(r,String(t))}catch{}},Go=h.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},width:Gt,setWidth:()=>{},resetWidth:()=>{},minWidth:Qt,maxWidth:Ut,mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),Qo=({children:r,defaultCollapsed:t=!1,defaultWidth:o=Gt,minWidth:n=Qt,maxWidth:l=Ut,widthStorageKey:s=An})=>{const[i,c]=h.useState(t),[a,d]=h.useState(!1),[g,b]=h.useState(()=>On(s,o,n,l)),p=h.useCallback(D=>{c(O=>typeof D=="function"?D(O):D)},[]),C=h.useCallback(()=>c(D=>!D),[]),B=h.useCallback(()=>c(!0),[]),x=h.useCallback(()=>c(!1),[]),W=h.useCallback(D=>{b(O=>{const q=typeof D=="function"?D(O):D,G=Yt(Math.round(q),n,l);return Zo(s,G),G})},[n,l,s]),L=h.useCallback(()=>{const D=Yt(o,n,l);Zo(s,D),b(D)},[o,n,l,s]),M=h.useCallback(D=>{d(O=>typeof D=="function"?D(O):D)},[]),S=h.useCallback(()=>d(!0),[]),E=h.useCallback(()=>d(!1),[]),A=h.useCallback(()=>d(D=>!D),[]),T=h.useMemo(()=>({collapsed:i,setCollapsed:p,toggle:C,collapse:B,expand:x,width:g,setWidth:W,resetWidth:L,minWidth:n,maxWidth:l,mobileOpen:a,setMobileOpen:M,openMobile:S,closeMobile:E,toggleMobile:A}),[i,p,C,B,x,g,W,L,n,l,a,M,S,E,A]);return e.jsx(Go.Provider,{value:T,children:r})},Uo=()=>h.useContext(Go),Yo=h.createContext(null),Xo=({adapter:r,children:t})=>e.jsx(Yo.Provider,{value:r,children:t}),cr=()=>{const r=h.useContext(Yo);if(!r)throw new Error("[@starasia/admin] Router adapter belum dipasang. Bungkus aplikasi dengan <App routerAdapter={...} /> atau <StarasiaRouterProvider adapter={...}>. Import adapter dari '@starasia/admin/adapters/react-router' atau '@starasia/admin/adapters/tanstack'.");return r},$o=({router:r,routerAdapter:t,menus:o=[],menuBottom:n,logo:l,appName:s="Workspace",initialUserData:i,theme:c})=>{const a=No({initialUserData:i}),{theme:d}=Hr.useTheme();return e.jsx(Xo,{adapter:t,children:e.jsx(qt.Provider,{value:{logo:l,appName:s,menus:o,userData:a.userData,setUserData:a.setUserData,menuBottom:n},children:e.jsx(Vo,{children:e.jsx(Qo,{children:c?e.jsx(Hr.ThemeProvider,{value:c,children:r}):d?e.jsx(Hr.ThemeProvider,{value:d,children:r}):r})})})})},Wn=h.memo($o);function Jo({collapsed:r=!1,children:t}){if(!t)return null;const o=typeof t=="function",n=o?t({collapsed:r}):t;return n==null||n===!1?null:e.jsx("div",{style:{position:"sticky",top:"var(--app-header-height, 4rem)",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:r?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingRight:r?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:o?n:e.jsx("div",{style:{opacity:r?0:1,transition:"opacity 0.3s",visibility:r?"hidden":"visible"},children:n})})}const Xt=h.createContext(null);function Ko({children:r}){const[t,o]=h.useState(null),[n,l]=h.useState(null),[s,i]=h.useState(null),[c,a]=h.useState(0),d=h.useCallback(()=>(a(g=>g+1),()=>a(g=>g-1)),[]);return e.jsx(Xt.Provider,{value:{prependNode:t,appendNode:n,replaceNode:s,setPrependNode:o,setAppendNode:l,setReplaceNode:i,replaceCount:c,registerReplace:d},children:r})}function Ro({children:r}){const t=h.useContext(Xt);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t.setPrependNode,style:{display:"contents"}}),t.replaceCount>0?e.jsx("div",{ref:t.setReplaceNode,style:{display:"contents"}}):r,e.jsx("div",{ref:t.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:r})}function zn({children:r,mode:t="append"}){const o=h.useContext(Xt);if(h.useEffect(()=>{if(!(t!=="replace"||!o))return o.registerReplace()},[t,o]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const n=t==="prepend"?o.prependNode:t==="replace"?o.replaceNode:o.appendNode;return n?gt.createPortal(r,n):null}const $t=h.createContext(null);function el({children:r}){const[t,o]=h.useState({}),[n,l]=h.useState({}),s=h.useCallback((a,d)=>{o(g=>g[a]===d?g:{...g,[a]:d})},[]),i=h.useCallback(a=>(l(d=>({...d,[a]:(d[a]??0)+1})),()=>l(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),c=h.useMemo(()=>({outletNodes:t,setOutletNode:s,slotCounts:n,registerSlot:i}),[t,s,n,i]);return e.jsx($t.Provider,{value:c,children:r})}function Jt({slotKey:r,fallback:t}){const o=h.useContext($t),n=o?(o.slotCounts[r]??0)>0:!1,l=h.useRef(o==null?void 0:o.setOutletNode);l.current=o==null?void 0:o.setOutletNode;const s=h.useCallback(i=>{var c;return(c=l.current)==null?void 0:c.call(l,r,i)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:s,style:{display:"contents"}}):t})}function Hn({slotKey:r,children:t}){const o=h.useContext($t),n=h.useRef(o==null?void 0:o.registerSlot);if(n.current=o==null?void 0:o.registerSlot,h.useEffect(()=>{var s;return(s=n.current)==null?void 0:s.call(n,r)},[r]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const l=o.outletNodes[r];return l?gt.createPortal(t,l):null}const yt="moduleSwitcherGroupId",Kt="sa-module-switcher-change";function rl(){if(typeof window>"u")return null;const r=window.localStorage.getItem(yt);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function tl(r){typeof window>"u"||(r===null?window.localStorage.removeItem(yt):window.localStorage.setItem(yt,String(r)),window.dispatchEvent(new CustomEvent(Kt,{detail:r})))}function _n(){tl(null)}function Rt(){const[r,t]=h.useState(()=>rl());return h.useEffect(()=>{const n=()=>{t(rl())},l=s=>{s.key===yt&&n()};return window.addEventListener(Kt,n),window.addEventListener("storage",l),()=>{window.removeEventListener(Kt,n),window.removeEventListener("storage",l)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{tl(n),t(n)}}}const eo="var(--sa-app-sidebar-bg, var(--sa-background-primary-inverse))",fe={row:"_row_1ctk8_37",rowIcon:"_rowIcon_1ctk8_62",chevron:"_chevron_1ctk8_73",label:"_label_1ctk8_82",popoverLabel:"_popoverLabel_1ctk8_87",badgeDotRing:"_badgeDotRing_1ctk8_92",indicator:"_indicator_1ctk8_99",submenu:"_submenu_1ctk8_125",submenuInner:"_submenuInner_1ctk8_146",submenuLine:"_submenuLine_1ctk8_159",childRow:"_childRow_1ctk8_168",groupHeader:"_groupHeader_1ctk8_188",groupLabel:"_groupLabel_1ctk8_201",groupToggle:"_groupToggle_1ctk8_218",groupChevron:"_groupChevron_1ctk8_241",groupBody:"_groupBody_1ctk8_270",groupItems:"_groupItems_1ctk8_284",menuArea:"_menuArea_1ctk8_306",locationPill:"_locationPill_1ctk8_314",locationPillIcon:"_locationPillIcon_1ctk8_338",locationPillText:"_locationPillText_1ctk8_346",railButton:"_railButton_1ctk8_374",railIcon:"_railIcon_1ctk8_384",railBadge:"_railBadge_1ctk8_415",railLabel:"_railLabel_1ctk8_420",railTabs:"_railTabs_1ctk8_428",railTab:"_railTab_1ctk8_428",railTabLabel:"_railTabLabel_1ctk8_463"},Pn="4.5rem",Nn="var(--app-header-height, 4rem)",ol=r=>r?Pn:Nn;function ll({icon:r,label:t,tooltip:o=t,selected:n,location:l=!1,badge:s,showLabel:i=!0,onClick:c}){const a=n===!0;return e.jsx(Ae.Tooltip,{fluid:!0,label:o,position:"right",children:e.jsxs(f.Box,{as:"button",position:"relative",onClick:c,"aria-label":o,"aria-pressed":n,className:fe.railButton,"data-active":a||void 0,"data-location":l||void 0,fullWidth:!0,direction:"column",align:"center",gap:"spacing-2",paddingBlock:"xs",children:[e.jsxs(f.Box,{position:"relative",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",borderRadius:a?"rounded-sm":"rounded-md",className:fe.railIcon,children:[e.jsx(F.Icon,{name:r,size:"sm"}),s&&!i&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",className:fe.badgeDotRing,children:e.jsx(or.BadgeDot,{tone:"error",variant:"solid",size:"xs"})}),s&&i&&e.jsx(f.Box,{position:"absolute",display:"inline-flex",className:fe.railBadge,children:e.jsx(or.Badge,{text:String(s.value),variant:s.variant??"info",size:"xs",border:!0})})]}),i&&e.jsx(m.Text,{as:"span",fontSize:"xs",fontWeight:a?"medium":"normal",textAlign:"center",truncate:!0,className:fe.railLabel,children:t})]})})}function jn({items:r,bottomItems:t,activeKey:o,locationKey:n,onSelect:l,onAction:s,logo:i,panelCollapsed:c,onExpandPanel:a,showLabels:d=!0,theme:g}){const[b,p]=h.useState(!1),C=c&&b;return e.jsxs(f.Box,{as:"nav","aria-label":"Primary navigation","data-slot":"app-rail","data-theme":g,bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:"0",style:{width:ol(d),height:"100%",backgroundColor:eo},children:[e.jsxs(f.Box,{onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),position:"relative",align:"center",justify:"center",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",flexShrink:"0",style:{height:"var(--app-header-height, 4rem)"},children:[e.jsx("img",{src:i,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",transition:"opacity 0.2s",opacity:C?0:1}}),c&&e.jsx(f.Box,{as:"button",onClick:a,"aria-label":"Expand sidebar",position:"absolute",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-sm",style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"var(--sa-text-primary, #292a2e)",opacity:C?1:0,pointerEvents:C?"auto":"none",transition:"opacity 0.2s"},children:e.jsx(F.Icon,{name:"LayoutLeft",size:"sm"})})]}),e.jsx(f.Box,{flex:"1",overflow:"overflow-y-auto",paddingBlock:"md",paddingInline:"xs",gap:"xs",children:r.map(B=>e.jsx(ll,{icon:B.icon,label:B.label,tooltip:B.tooltip,badge:B.badge,showLabel:d,selected:B.key===o,location:B.key===n,onClick:()=>l(B.key)},B.key))}),t&&t.length>0&&e.jsx(f.Box,{borderWidth:"border-t",borderStyle:"border-solid-t",borderColor:"border-base",paddingBlock:"md",paddingInline:"xs",gap:"xs",flexShrink:"0",children:t.map(B=>e.jsx(ll,{icon:B.icon,label:B.label,tooltip:B.tooltip,badge:B.badge,showLabel:d,onClick:()=>s(B)},B.key))})]})}function Vn({items:r,activeKey:t,locationKey:o,onSelect:n}){return e.jsx(f.Box,{role:"tablist","aria-label":"Primary navigation",direction:"row",gap:"xs",paddingInline:"md",paddingBlock:"sm",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",flexShrink:"0",className:fe.railTabs,children:r.map(l=>{const s=l.key===t,i=l.key===o;return e.jsxs(f.Box,{as:"button",role:"tab","aria-selected":s,className:fe.railTab,"data-active":s||void 0,"data-location":i||void 0,onClick:()=>n(l.key),position:"relative",direction:"row",align:"center",gap:"spacing-4",paddingInline:"sm",height:"height-32",flexShrink:"0",borderRadius:s?"rounded-sm":"rounded-md",hover:s?void 0:{bg:"neutral"},children:[e.jsx(F.Icon,{name:l.icon,size:"sm"}),e.jsx(m.Text,{as:"span",fontSize:"sm",fontWeight:s?"medium":"normal",className:fe.railTabLabel,children:l.label})]},l.key)})})}const ro=(r,t)=>!r.groupIds||r.groupIds.includes(t.id)||t.parentGroupId!==void 0&&r.groupIds.includes(t.parentGroupId),nl=(r,t)=>r.find(o=>o.groupIds&&ro(o,t))??r.find(o=>!o.groupIds);let pt=0,mr=!1,sl=new Set;const qn=r=>{try{const t=JSON.parse(localStorage.getItem(r)??"[]");return new Set(Array.isArray(t)?t.filter(o=>typeof o=="number"):[])}catch{return new Set}},il={error:4,warning:3,info:2,success:1,neutral:0},Zn=r=>r==="danger"||r==="error"?"error":r==="warning"?"warning":r==="success"?"success":r==="neutral"?"neutral":"info",Gn=(r,t)=>{try{localStorage.setItem(r,JSON.stringify([...t]))}catch{}},cl=new Set;function Qn(r,t){const[o,n]=h.useState(!1),l=h.useRef(null),s=h.useRef(null);return h.useLayoutEffect(()=>{const i=l.current;if(!i)return;let c=0;const a=()=>{c=0;const g=s.current;if(!g)return;const b=g.scrollWidth>i.clientWidth;n(p=>p===b?p:b)},d=new ResizeObserver(()=>{c||(c=requestAnimationFrame(a))});return d.observe(i),a(),()=>{c&&cancelAnimationFrame(c),d.disconnect()}},[r,t]),{containerRef:l,textRef:s,truncated:o}}function al({text:r,emphasis:t}){const{containerRef:o,textRef:n,truncated:l}=Qn(r,t),s=e.jsx(m.Text,{ref:n,as:"span",fontSize:"md",fontWeight:t==="location"?"semibold":t==="trail"?"medium":"normal",truncate:!0,className:fe.label,children:r});return e.jsx(f.Box,{ref:o,display:"block",flex:"1",minWidth:"width-0",children:l?e.jsx(Ae.Tooltip,{fluid:!0,label:r,position:"top",children:s}):s})}const Un=200,to="var(--app-header-height, 4rem)",dl="44px",hl=`calc((${to} - 2rem) / 2)`,fl=16;function Yn({children:r,headerLeftSlot:t,profile:o,isLoadingProfile:n,onLogout:l,isLoggingOut:s,loadingComponent:i,sidebarHeaderContent:c,headerActions:a,profileRole:d,profileMenuButtons:g,profileMenuItems:b,logoutButton:p,resizableSidebar:C=!0,collapsibleGroups:B=!1,rail:x,sidebarTheme:W}){var Qr,wr,at,Ur;const{useSearchParams:L,useNavigate:M,useLocation:S,Outlet:E}=cr(),[A]=L(),T=A.get("embed")==="true",D=Zt(),{badges:O}=qo(),q=M(),G=S(),H=!Ee.useMediaQuery("md"),[R,ee]=h.useState(!1),{collapsed:J,setCollapsed:K,width:de,setWidth:Q,resetWidth:le,minWidth:ue,maxWidth:De,mobileOpen:Fe,setMobileOpen:Se}=Uo(),[xe,ve]=h.useState(!1),[He,Re]=h.useState(()=>new Set(sl)),[ze,ae]=h.useState(null),{selectedGroupId:we,setSelectedGroupId:_e}=Rt(),ge=!!(x&&x.items.length>0),se=J&&!H&&!ge,qe=J&&!H&&ge;h.useEffect(()=>{sl=He},[He]);const Ze=h.useRef(null),P=h.useRef(null),$=h.useRef(null),[Y,ye]=h.useState(!1),[Le,Ce]=h.useState(null),Pe=C&&!H&&!J,sr=w=>Math.min(Math.max(w,ue),De),Ge=Le??de,Qe=w=>{var Me,je,Je;if(!Pe)return;w.preventDefault();const N=w.clientX,j=((Me=$.current)==null?void 0:Me.getBoundingClientRect().width)??de;(Je=(je=w.currentTarget).setPointerCapture)==null||Je.call(je,w.pointerId),ye(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize";let X=0,re=j;const ke=ir=>{re=j+(ir.clientX-N),X||(X=requestAnimationFrame(()=>{X=0,Ce(sr(re))}))},Te=()=>{X&&cancelAnimationFrame(X),window.removeEventListener("pointermove",ke),window.removeEventListener("pointerup",Te),document.body.style.userSelect="",document.body.style.cursor="",Ce(null),ye(!1),re<Un?K(!0):Q(sr(re))};window.addEventListener("pointermove",ke),window.addEventListener("pointerup",Te)},kr=w=>{Pe&&(w.key==="ArrowLeft"?(w.preventDefault(),Q(N=>N-fl)):w.key==="ArrowRight"?(w.preventDefault(),Q(N=>N+fl)):w.key==="Home"?(w.preventDefault(),Q(ue)):w.key==="End"&&(w.preventDefault(),Q(De)))};h.useEffect(()=>{const w=Ze.current;if(!w)return;const N=()=>{mr||(pt=w.scrollTop)};return w.addEventListener("scroll",N),()=>w.removeEventListener("scroll",N)},[]);const Xe=()=>{const w=Ze.current;w&&pt>0&&(mr=!0,w.scrollTop=pt,requestAnimationFrame(()=>{mr=!1}))};h.useLayoutEffect(()=>{mr=!0,Xe();const w=setTimeout(()=>{mr=!1},300);return()=>clearTimeout(w)},[]),h.useLayoutEffect(()=>{D.menus.length>0&&(pt>0?Xe():requestAnimationFrame(()=>{var N;const w=(N=Ze.current)==null?void 0:N.querySelector("[data-menu-active='true']");w&&w.scrollIntoView({block:"center",behavior:"instant"})}))},[D.menus]),h.useEffect(()=>{mr=!0,Xe();const w=setTimeout(Xe,0),N=setTimeout(Xe,50),j=setTimeout(Xe,100),X=setTimeout(Xe,200),re=setTimeout(()=>{mr=!1},300),ke=setTimeout(()=>{const Te=Ze.current,Me=Te==null?void 0:Te.querySelector("[data-menu-active='true']");if(Te&&Me){const je=Te.getBoundingClientRect(),Je=Me.getBoundingClientRect();Je.top>=je.top&&Je.bottom<=je.bottom||Me.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(w),clearTimeout(N),clearTimeout(j),clearTimeout(X),clearTimeout(re),clearTimeout(ke)}},[G.pathname]),h.useEffect(()=>{P.current&&(P.current.scrollTop=0)},[G.pathname]),h.useEffect(()=>{H&&Se(!1)},[G.pathname,H]),h.useEffect(()=>{H&&K(!0)},[H]),h.useEffect(()=>{const w=document.documentElement;return w.style.setProperty("--app-header-height",dl),()=>{w.style.removeProperty("--app-header-height")}},[]);const Ie=()=>{ee(!0)},Ne=()=>{ee(!1)},Er=()=>{ee(!1),l()},pr=w=>{const N=w.slotKey?[]:[w.to];return w.children&&N.push(...w.children.map(j=>j.to)),N},Fr=[...D.menus.flatMap(w=>w.items.flatMap(pr)),...((Qr=D.menuBottom)==null?void 0:Qr.flatMap(pr))??[]],$e=w=>{if(!G.pathname.startsWith(w))return!1;const N=Fr.filter(j=>G.pathname.startsWith(j)).sort((j,X)=>X.length-j.length)[0];return w===N},Cr=h.useRef(x);Cr.current=x;const Ue=()=>D.menus.find(w=>w.items.some(N=>pr(N).some($e))),nt=w=>{const N=Cr.current;if(!N||N.items.length===0)return null;const j=N.defaultKey??N.items[0].key,X=N.items.find(Te=>Te.key===w),re=Ue();if(!re)return X?X.key:j;if(X&&ro(X,re))return X.key;const ke=nl(N.items,re);return(ke==null?void 0:ke.key)??(X==null?void 0:X.key)??j},[Bo,st]=h.useState(()=>nt(null));h.useEffect(()=>{st(w=>nt(w))},[G.pathname,D.menus]);const er=ge?x.items.find(w=>w.key===Bo)??x.items[0]:void 0,Ot=ge?Ue():void 0,jr=Ot?(wr=nl(x.items,Ot))==null?void 0:wr.key:void 0,Wt=w=>{st(w),qe&&K(!1)},Ir=w=>{w.onClick?w.onClick():w.to&&q(w.to)};h.useEffect(()=>{var N;const w=j=>{var re;const X=j.defaultExpanded&&!cl.has(j.id);X&&cl.add(j.id),(X||(re=j.children)!=null&&re.some(ke=>G.pathname.startsWith(ke.to)))&&Re(ke=>{const Te=new Set(ke);return Te.add(j.id),Te})};D.menus.forEach(j=>{j.items.forEach(w)}),(N=D.menuBottom)==null||N.forEach(w)},[G.pathname,D.menus,D.menuBottom]);const zt=w=>{Re(N=>{const j=new Set(N);return j.has(w)?j.delete(w):j.add(w),j})};h.useEffect(()=>{D.menus.length!==0&&we!==null&&!D.menus.some(w=>w.id===we)&&_e(null)},[D.menus,we,_e]);const Br=h.useMemo(()=>{if(er!=null&&er.groupIds)return D.menus.filter(re=>ro(er,re));const w=D.menus,N=ge?null:we;if(N!==null)return w.filter(re=>re.id===N||re.parentGroupId===N);const j=w.filter(re=>re.parentGroupId===void 0),X=w.filter(re=>re.parentGroupId!==void 0).flatMap(re=>re.items);return X.length===0?j:[...j,{id:18,name:"Pengaturan",items:X,parentGroupId:void 0}]},[D.menus,we,er,ge]),Vr=B&&!se&&Br.length>1,Tr=`sa-sidebar-open-groups:${D.appName??"app"}`,[qr,Ht]=h.useState(()=>qn(Tr));h.useEffect(()=>{Gn(Tr,qr)},[Tr,qr]);const rr=(at=Br.find(w=>w.items.some(N=>pr(N).some($e))))==null?void 0:at.id;h.useEffect(()=>{!B||rr===void 0||Ht(w=>w.has(rr)?w:new Set(w).add(rr))},[B,rr,G.pathname]);const it=w=>Ht(N=>{const j=new Set(N);return j.has(w)?j.delete(w):j.add(w),j}),[Zr,ct]=h.useState(null);h.useEffect(()=>{const w=Ze.current,N=w==null?void 0:w.querySelector("[data-location-anchor]");if(!w||!N||se||qe){ct(null);return}const j=new IntersectionObserver(([X])=>{var ke;if(X.intersectionRatio>=.6){ct(null);return}const re=((ke=X.rootBounds)==null?void 0:ke.top)??w.getBoundingClientRect().top;ct(X.boundingClientRect.top<re?"up":"down")},{root:w,rootMargin:"-32px 0px 0px 0px",threshold:[0,.6,1]});return j.observe(N),()=>j.disconnect()},[G.pathname,qr,He,Br,se,qe]);const fr=()=>{var w,N;(N=(w=Ze.current)==null?void 0:w.querySelector("[data-location-anchor]"))==null||N.scrollIntoView({block:"center",behavior:"smooth"})},Gr=(()=>{var w;for(const N of Br)for(const j of N.items)if((w=j.children)!=null&&w.length){const X=j.children.find(re=>$e(re.to));if(X)return`${N.name} · ${X.title}`}else if(!j.slotKey&&$e(j.to))return`${N.name} · ${j.title}`;return null})();if(T)return e.jsx(f.Box,{as:"main",overflow:"overflow-y-auto",bg:"surface-inverse",style:{height:"100vh"},children:r||e.jsx(E,{})});const Lr=(w,N=!1)=>{const j=w.children&&w.children.length>0,X=!!w.slotKey,re=j||X,ke=He.has(w.id),Te=j?w.children.some(Mr=>$e(Mr.to)):X?!1:$e(w.to),Me=Te&&j&&ke&&!se,je=Te&&!Me,Je=Jr(w.badge,O[w.id]),ir=!!Je&&se;return e.jsxs(f.Box,{display:"block","data-menu-active":Te||void 0,children:[e.jsxs(f.Box,{as:"button",position:"relative",onClick:Mr=>{if(X&&se)q(w.to);else if(re)if(se){const br=Mr.currentTarget.getBoundingClientRect();ae({item:w,top:br.top,left:br.right+8})}else zt(w.id);else q(w.to)},fullWidth:!0,direction:"row",align:"center",justify:se?"center":void 0,gap:"sm",paddingInline:se?void 0:"sm",paddingBlock:"xs",height:"height-32",borderRadius:je?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",hover:je?void 0:{bg:"neutral"},title:se?w.title:void 0,className:`${fe.row} ${fe.indicator}`,"data-active":Te||void 0,"data-location":je||void 0,"data-trail":Me||void 0,"data-compact":se||void 0,"aria-current":je&&!j?"page":void 0,"aria-expanded":re&&!se?ke:void 0,"data-location-anchor":je&&!N||void 0,children:[e.jsxs(f.Box,{position:"relative",display:"inline-flex",align:"center",flexShrink:"0",children:[e.jsx(F.Icon,{name:w.icon,size:"sm",className:fe.rowIcon}),ir&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",className:fe.badgeDotRing,children:e.jsx(or.BadgeDot,{tone:"error",variant:"solid",size:"xs"})})]}),!se&&e.jsxs(e.Fragment,{children:[e.jsx(al,{text:w.title,emphasis:je?"location":Me?"trail":void 0}),Je&&e.jsx(or.Badge,{text:String(Je.value),variant:Je.variant??"info",size:"xs",border:!0}),re&&e.jsx(F.Icon,{name:"ChevronDown",size:"sm",className:fe.chevron})]})]}),re&&!se&&(()=>{const br=(w.children??[]).map(xr=>{const dt=Jr(xr.badge,O[xr.id]),Dr=$e(xr.to);return e.jsxs(f.Box,{as:"button",onClick:()=>q(xr.to),position:"relative",fullWidth:!0,direction:"row",align:"center",gap:"sm",paddingLeft:"sm",paddingRight:"sm",paddingBlock:"xs",height:"height-32",borderRadius:Dr?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",hover:Dr?void 0:{bg:"neutral"},className:`${fe.row} ${fe.childRow}`,"data-active":Dr||void 0,"data-location":Dr||void 0,"data-location-anchor":Dr&&ke&&!N||void 0,"aria-current":Dr?"page":void 0,children:[e.jsx(F.Icon,{name:xr.icon,size:"sm",className:fe.rowIcon}),e.jsx(al,{text:xr.title,emphasis:Dr?"location":void 0}),dt&&e.jsx(or.Badge,{text:String(dt.value),variant:dt.variant??"info",size:"xs",border:!0})]},xr.id)});return e.jsx(f.Box,{className:fe.submenu,"data-open":ke||void 0,children:e.jsxs(f.Box,{position:"relative",overflow:"overflow-hidden",className:fe.submenuInner,children:[e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",top:"top-0",fullHeight:!0,className:fe.submenuLine}),X?e.jsx(Jt,{slotKey:w.slotKey,fallback:br}):br]})})})()]},w.id)};return e.jsx(el,{children:e.jsxs(Ko,{children:[e.jsxs(f.Box,{direction:"row",position:"relative",style:{height:"100vh","--app-header-height":dl,"--app-sidebar-width":H?"0px":ge?`calc(${ol(x.showLabels??!0)} + ${qe?"0px":`${Ge}px`})`:J?to:`${Ge}px`,"--app-footer-zindex":H&&Fe?"40":"998"},children:[H&&e.jsx(f.Box,{position:"fixed",zIndex:"40",bg:"black-alpha-a50",style:{inset:0,opacity:Fe?.5:0,pointerEvents:Fe?"auto":"none",transition:"opacity 0.3s"},onClick:()=>Se(!1)}),ge&&!H&&e.jsx(jn,{items:x.items,bottomItems:x.bottomItems,activeKey:er.key,locationKey:jr,onSelect:Wt,onAction:Ir,logo:D.logo,panelCollapsed:qe,onExpandPanel:()=>K(!1),showLabels:x.showLabels??!0,theme:W}),e.jsxs(f.Box,{as:"aside",ref:$,"aria-hidden":qe||void 0,"data-slot":"app-sidebar","data-theme":W,bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:H?void 0:"0",style:{width:H?"16.375rem":qe?"0px":J?to:`${Ge}px`,...qe&&{borderRightWidth:0,overflow:"hidden",visibility:"hidden"},position:H?"fixed":"relative",...H&&{inset:0,zIndex:50,transform:Fe?"translateX(0)":"translateX(-100%)"},transition:Y?"none":"all 0.3s ease-in-out",minWidth:0,backgroundColor:eo},children:[e.jsx(f.Box,{onMouseEnter:()=>ve(!0),onMouseLeave:()=>ve(!1),direction:"row",align:"center",justify:"space-between",paddingInline:se?void 0:"lg",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",position:"relative",style:{height:"var(--app-header-height, 4rem)",...se?{paddingInline:hl}:null},children:(()=>{const w=ge&&!H,N=er!=null&&er.groupIds?er.tooltip??er.label:D.appName,j=!H&&J&&!Fe&&!ge,X=j&&xe;return e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flex:j?"1":void 0,justify:j?"center":void 0,style:{transition:"opacity 0.2s",opacity:X?0:1,pointerEvents:X?"none":"auto"},children:[!w&&e.jsx("img",{src:D.logo,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",flexShrink:0}}),(!J||Fe)&&e.jsx(m.Text,{as:"span",fontSize:"md",fontWeight:"semibold",color:"primary",truncate:!0,style:{transition:"opacity 0.3s"},children:w?N:D.appName})]}),!H&&!J&&e.jsx(f.Box,{as:"button",onClick:()=>K(!0),"aria-label":"Collapse sidebar",display:"inline-flex",align:"center",justify:"center",flexShrink:"0",style:{color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(F.Icon,{name:"LayoutLeft",size:"sm"})}),j&&e.jsx(f.Box,{as:"button",onClick:()=>K(!1),"aria-label":"Expand sidebar",position:"absolute",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-sm",style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"var(--sa-text-primary, #292a2e)",opacity:X?1:0,pointerEvents:X?"auto":"none",transition:"opacity 0.2s"},children:e.jsx(F.Icon,{name:"LayoutLeft",size:"sm"})}),H&&e.jsx(f.Box,{as:"button",onClick:()=>Se(!1),"aria-label":"Close menu",align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(F.Icon,{name:"Cross",size:"md"})})]})})()}),c&&e.jsx(Jo,{collapsed:H||ge?!1:J,children:c}),ge&&H&&e.jsx(Vn,{items:x.items,activeKey:er.key,locationKey:jr,onSelect:Wt}),e.jsxs(f.Box,{className:fe.menuArea,children:[e.jsx(f.Box,{ref:Ze,flex:"1",overflow:"overflow-y-auto",paddingBlock:"lg",children:Br.map(w=>{const N=w.items.some(Me=>pr(Me).some($e)),j=Vr&&!qr.has(w.id),X=j&&N;let re=null;if(j)for(const Me of w.items)for(const je of[Me,...Me.children??[]]){const Je=Jr(je.badge,O[je.id]);if(!Je)continue;const ir=Zn(Je.variant);(!re||il[ir]>il[re])&&(re=ir)}const ke=`sa-sidebar-group-${w.id}`,Te=e.jsx(m.Text,{fontSize:"sm",fontWeight:"semibold",color:"subtlest",textTransform:"uppercase",truncate:!0,className:fe.groupLabel,"data-active":N||void 0,children:w.name});return e.jsxs(f.Box,{marginBottom:j?"xs":"lg",children:[se?w.name&&e.jsx(f.Box,{"aria-label":w.name,direction:"row",align:"center",justify:"center",paddingBlock:"md",children:e.jsx(f.Box,{width:"width-16",style:{height:"2px",borderRadius:"min(1px, var(--sa-radii-xs, 4px))",backgroundColor:w.color??"var(--sa-background-brand, #04254f)"}})}):w.name&&e.jsx(f.Box,{className:fe.groupHeader,children:Vr?e.jsxs(f.Box,{as:"button",type:"button",fullWidth:!0,direction:"row",align:"center",gap:"sm",onClick:()=>it(w.id),className:fe.groupToggle,"aria-expanded":!j,"aria-controls":ke,"data-active":N||void 0,"data-location":X||void 0,"data-location-anchor":X||void 0,children:[Te,re&&e.jsx(or.BadgeDot,{tone:re,variant:"solid",size:"xs"}),e.jsx(F.Icon,{name:"ChevronDown",size:"sm",className:fe.groupChevron})]}):Te}),e.jsx(f.Box,{id:ke,className:fe.groupBody,"data-collapsible":Vr||void 0,"data-open":!j||void 0,children:e.jsx(f.Box,{paddingInline:se?void 0:"md",gap:"xs",className:fe.groupItems,"data-compact":se||void 0,children:w.slotKey?e.jsx(Jt,{slotKey:w.slotKey,fallback:w.items.map(Me=>Lr(Me,j))}):w.items.map(Me=>Lr(Me,j))})})]},w.id)})}),Zr&&Gr&&e.jsxs(f.Box,{as:"button",type:"button",onClick:fr,direction:"row",align:"center",gap:"xs",className:fe.locationPill,"data-dir":Zr,"aria-label":`Ke menu aktif: ${Gr}`,children:[e.jsx(F.Icon,{name:Zr==="up"?"ArrowUp":"ArrowDown",size:"xs",className:fe.locationPillIcon}),e.jsx(m.Text,{as:"span",fontSize:"xs",fontWeight:"medium",truncate:!0,className:fe.locationPillText,children:Gr})]})]}),D.menuBottom&&D.menuBottom.length>0&&e.jsx(f.Box,{borderWidth:"border-t",borderStyle:"border-solid-t",borderColor:"border-base",paddingBlock:"md",paddingInline:se?void 0:"md",bg:"surface-inverse",gap:"xs",flexShrink:"0",style:{backgroundColor:eo,...se?{paddingInline:hl}:null},children:D.menuBottom.map(w=>Lr(w))}),Pe&&e.jsx(f.Box,{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":de,"aria-valuemin":ue,"aria-valuemax":De,tabIndex:0,onPointerDown:Qe,onKeyDown:kr,onDoubleClick:le,title:"Drag to resize · double-click to reset",position:"absolute",top:"top-0",right:"right-0",fullHeight:!0,style:{width:"6px",transform:"translateX(50%)",cursor:"col-resize",zIndex:5,touchAction:"none",background:Y?"var(--sa-background-brand, #04254f)":"transparent",transition:"background 0.15s"},onMouseEnter:w=>{Y||(w.currentTarget.style.background="var(--sa-border-bold, #0b120e40)")},onMouseLeave:w=>{Y||(w.currentTarget.style.background="transparent")}})]}),e.jsxs(f.Box,{flex:"1",overflow:"overflow-hidden",children:[e.jsxs(f.Box,{as:"header",bg:"white",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",direction:"row",align:"center",justify:"space-between",paddingInline:"lg",flexShrink:"0",style:{height:"var(--app-header-height, 4rem)"},children:[e.jsxs(f.Box,{direction:"row",align:"center",gap:H?"lg":void 0,children:[H&&e.jsx(f.Box,{as:"button",onClick:()=>Se(!0),align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(F.Icon,{name:"MenuBurger",size:"lg"})}),e.jsx(Ro,{children:t})]}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"md",children:[a,e.jsxs(z.Menu,{position:"bottom-right",children:[e.jsx(z.MenuButton,{children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",cursor:"pointer",children:[!H&&e.jsxs(f.Box,{display:"block",textAlign:"right",customMaxWidth:"12.5rem",children:[e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",textAlign:"right",truncate:!0,lineHeight:"leading-none",children:n?"Loading...":(o==null?void 0:o.name)||"unknown"}),e.jsx(m.Text,{fontSize:"sm",color:"subtle",textAlign:"right",truncate:!0,children:n?"":(o==null?void 0:o.email)||"unknown"})]}),e.jsx(ft.Avatar,{size:"sm",src:(o==null?void 0:o.avatar)||void 0,name:o==null?void 0:o.name,initials:((o==null?void 0:o.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)"}),e.jsx(F.Icon,{name:"ChevronDown",size:"xs",color:"subtle"})]})}),e.jsxs(z.MenuLists,{width:280,style:{paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(z.MenuHeading,{children:e.jsxs(f.Box,{align:"center",textAlign:"center",paddingBlock:"sm",fullWidth:!0,children:[e.jsx(ft.Avatar,{customSize:64,src:(o==null?void 0:o.avatar)||void 0,name:o==null?void 0:o.name,initials:((o==null?void 0:o.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)",style:{fontSize:"1.25rem",marginBottom:"0.75rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)"}}),e.jsx(m.Text,{fontSize:"md",fontWeight:"semibold",color:"primary",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.name)||"unknown"}),e.jsx(m.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.email)||"unknown"}),d&&e.jsx(m.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:d})]})}),(g&&g.length>0||b)&&e.jsxs(z.MenuBody,{children:[g==null?void 0:g.map((w,N)=>e.jsx(z.MenuItem,{onClick:w.onClick,startIcon:e.jsx(F.Icon,{name:w.icon,size:"md"}),children:w.label},`${w.label}-${N}`)),b]}),p??e.jsx(z.MenuFooter,{children:e.jsx(z.MenuItem,{intent:"danger",onClick:Ie,startIcon:e.jsx(F.Icon,{name:"Logout",size:"md"}),children:"Logout"})})]})]})]})]}),e.jsx(f.Box,{as:"main",ref:P,flex:"1",overflow:"overflow-y-auto",children:r||e.jsx(E,{})})]})]}),s&&i&&e.jsx(f.Box,{position:"fixed",align:"center",justify:"center",bg:"black-alpha-a70",style:{inset:0,zIndex:9999},children:i}),e.jsxs(Oe.Dialog,{isShow:R,onHide:Ne,children:[e.jsx(Oe.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Oe.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Oe.DialogFooter,{children:e.jsx(f.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(he.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(f.Box,{direction:"column",children:e.jsx(V.Button,{secondary:!0,onClick:Ne,children:"Cancel"})}),e.jsx(f.Box,{direction:"column",children:e.jsx(V.Button,{primary:!0,onClick:Er,children:"Yes, Sure"})})]})})})]}),ze&&e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{onClick:()=>ae(null),position:"fixed",style:{inset:0,zIndex:60}}),e.jsxs(f.Box,{role:"dialog","aria-label":ze.item.title,position:"fixed",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-md",shadow:"shadow-lg",padding:"sm",gap:"spacing-2",style:{top:ze.top,left:ze.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem"},children:[e.jsx(m.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-500",textTransform:"uppercase",style:{padding:"0.25rem 0.5rem 0.5rem",letterSpacing:"0.05em"},children:ze.item.title}),(Ur=ze.item.children)==null?void 0:Ur.map(w=>{const N=$e(w.to),j=Jr(w.badge,O[w.id]);return e.jsxs(f.Box,{as:"button",onClick:()=>{q(w.to),ae(null)},fullWidth:!0,direction:"row",align:"center",gap:"md",paddingBlock:"sm",paddingInline:"md",borderRadius:"rounded-md",borderWidth:"border",borderStyle:"border-solid",hover:N?void 0:{bg:"primary-inverse"},className:fe.row,"data-active":N||void 0,"data-location":N||void 0,"aria-current":N?"page":void 0,children:[w.icon&&e.jsx(F.Icon,{name:w.icon,size:"sm",className:fe.rowIcon}),e.jsx(m.Text,{as:"span",fontSize:"md",fontWeight:N?"semibold":"normal",whiteSpace:"nowrap",className:fe.popoverLabel,children:w.title}),j&&e.jsx(or.Badge,{text:String(j.value),variant:j.variant??"info",size:"xs",border:!0})]},w.id)})]})]})]})})}const Kr=h.forwardRef(({children:r,...t},o)=>e.jsx(f.Box,{ref:o,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),ul=({title:r,iconName:t,textColor:o,iconColor:n,hoverTextColor:l,hoverIconColor:s})=>{const[i,c]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=o??"var(--sa-text-subtle, #8c8f97)",g=s??"var(--sa-text-subtle, #8c8f97)",b=l??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{cursor:"pointer"},children:[e.jsx(F.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:i?g:a,transition:"color 0.15s ease"}}),e.jsx(m.Text,{variant:"sub-h3",style:{color:i?b:d,transition:"color 0.15s ease"},children:r||"Back"})]})},Xn=({items:r,separator:t="/",iconName:o,iconColor:n,hoverIconColor:l})=>{const{Link:s}=cr(),[i,c]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=l??"var(--sa-text-subtle, #8c8f97)",g=r.length>1?r[0]:void 0,b=!!(g!=null&&g.to||g!=null&&g.onClick),p=e.jsx(F.Icon,{name:o||"ChevronLeft",size:"xs",onMouseEnter:b?()=>c(!0):void 0,onMouseLeave:b?()=>c(!1):void 0,style:{color:b&&i?d:a,transition:"color 0.15s ease",cursor:b?"pointer":void 0}}),C=g!=null&&g.to?e.jsx(s,{to:g.to,replace:!0,style:{textDecoration:"none"},children:p}):g!=null&&g.onClick?e.jsx(Kr,{onClick:g.onClick,children:p}):p;return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",children:[C,e.jsx(Or.Breadcrumb,{separator:t,size:"md",children:r.map((B,x)=>{const W=x===r.length-1;return B.to&&!W?e.jsx(Or.BreadcrumbItem,{children:e.jsx(s,{to:B.to,children:B.label})},x):e.jsx(Or.BreadcrumbItem,{currentPage:W,children:e.jsx(Or.BreadcrumbLink,{onClick:W?void 0:B.onClick,children:B.label})},x)})})]})},$n=r=>{const{Link:t}=cr(),{items:o,separator:n,onClick:l,navigateTo:s,...i}=r;return o&&o.length>0?e.jsx(Xn,{items:o,separator:n,iconName:i.iconName,iconColor:i.iconColor,hoverIconColor:i.hoverIconColor}):s?e.jsx(f.Box,{direction:"row",children:e.jsx(t,{to:s,replace:!0,style:{textDecoration:"none"},children:e.jsx(ul,{...i})})}):e.jsx(f.Box,{direction:"row",children:e.jsx(Kr,{onClick:l,children:e.jsx(ul,{...i})})})},oo=[{icon:"var(--sa-color-brand-400, #3366b7)",activeBg:"var(--sa-color-brand-50, #e6edf6)",activeBorder:"var(--sa-color-brand-300, #668cc9)",activeShadow:"rgba(51, 102, 183, 0.25)"},{icon:"var(--sa-color-warning-400, #ed9f30)",activeBg:"var(--sa-color-warning-50, #fef2e6)",activeBorder:"var(--sa-color-warning-300, #f1b259)",activeShadow:"rgba(237, 159, 48, 0.25)"},{icon:"var(--sa-color-secondary-300, #5468e1)",activeBg:"var(--sa-color-secondary-50, #e6e9fb)",activeBorder:"var(--sa-color-secondary-200, #8a98ea)",activeShadow:"rgba(84, 104, 225, 0.25)"},{icon:"var(--sa-color-info-500, #00abeb)",activeBg:"var(--sa-color-info-50, #effaff)",activeBorder:"var(--sa-color-info-300, #75dbff)",activeShadow:"rgba(0, 171, 235, 0.25)"},{icon:"var(--sa-color-success-500, #30ce84)",activeBg:"var(--sa-color-success-50, #ecfff6)",activeBorder:"var(--sa-color-success-300, #75dead)",activeShadow:"rgba(48, 206, 132, 0.25)"},{icon:"var(--sa-color-error-400, #ff758f)",activeBg:"var(--sa-color-error-50, #fff0f3)",activeBorder:"var(--sa-color-error-300, #ff8fa3)",activeShadow:"rgba(255, 117, 143, 0.25)"}];function gl(r,t,o){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:r?`2px solid ${o.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:r?o.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:r?t?`0 8px 20px ${o.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${o.activeShadow}`:t?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:t?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const yl={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-text-primary, #292a2e)",lineHeight:"1.3",maxWidth:"80px"},pl={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function bl({isShow:r,onHide:t,menus:o,selectedGroupId:n,onSelect:l}){const[s,i]=h.useState(void 0),c=d=>{l(d),t()},a=oo[0];return e.jsx(Oe.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Oe.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>c(null),onMouseEnter:()=>i("all"),onMouseLeave:()=>i(void 0),style:pl,children:[e.jsx("div",{style:gl(n===null,s==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(F.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:yl,children:"Semua"})]}),o.map((d,g)=>{var x;const b=n===d.id,p=s===d.id,C=((x=d.items[0])==null?void 0:x.icon)??"Grid",B=oo[(g+1)%oo.length];return e.jsxs("button",{onClick:()=>c(d.id),onMouseEnter:()=>i(d.id),onMouseLeave:()=>i(void 0),style:pl,children:[e.jsx("div",{style:gl(b,p,B),children:e.jsx("div",{style:{color:B.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(F.Icon,{name:C,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:yl,children:d.name})]},d.id)})]})})})}function Jn({onSelect:r,"aria-label":t="Pilih module"}={}){const o=Zt(),{useNavigate:n}=cr(),l=n(),{selectedGroupId:s,setSelectedGroupId:i}=Rt(),[c,a]=h.useState(!1),d=g=>{var b;if(i(g),g!==null){const p=o.menus.find(B=>B.id===g),C=(b=p==null?void 0:p.items[0])==null?void 0:b.to;C&&l(C)}r==null||r(g)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>a(!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2.25rem",height:"2.25rem",borderRadius:"var(--sa-radii-sm, 0.25rem)",border:"1px solid var(--sa-border-subtle, #0b120e24)",color:"var(--sa-text-subtle, #8c8f97)",backgroundColor:"transparent",cursor:"pointer"},"aria-label":t,onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent"},children:e.jsx(F.Icon,{name:"GridApplication",size:"sm"})}),s!==null&&e.jsx("span",{style:{position:"absolute",top:"0.25rem",right:"0.25rem",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-brand-500, #1a4fa0)"},"aria-hidden":"true"})]}),e.jsx(bl,{isShow:c,onHide:()=>a(!1),menus:o.menus.filter(g=>g.parentGroupId===void 0),selectedGroupId:s,onSelect:d})]})}const Kn=(r,t)=>{const o=[];if(t===0)return o.push(r),o;for(let n=0;n<r.length;n+=t){const l=r.slice(n,n+t);o.push(l)}return o},Rn=h.memo(({value:r,label:t,separator:o,labelWidth:n,lastIndex:l,labelAlign:s="top"})=>{const i=h.useMemo(()=>({padding:0,paddingBottom:l?0:12,verticalAlign:s}),[l,s]),c=h.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:l?0:12,verticalAlign:s}),[l,s]),a=()=>typeof t=="string"?e.jsx(m.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(m.Text,{color:"primary",fontWeight:"medium",children:r}):r,g=()=>typeof o=="string"||typeof o=="number"?e.jsx(m.Text,{fontWeight:"medium",color:"subtlest",children:o}):o;return e.jsxs(U.Tr,{children:[e.jsx(U.Td,{style:i,width:n,children:a()}),o?e.jsx(U.Td,{style:c,width:24,children:g()}):null,e.jsx(U.Td,{style:i,children:d()})]})}),es=h.memo(({fields:r,separator:t,labelWidth:o})=>e.jsx(U.Table,{withColumnBorder:!1,withRowBorder:!1,children:r.map((n,l)=>e.jsx(Rn,{separator:t,labelWidth:o,lastIndex:l===r.length-1,...n},`field-group-field-${l}`))})),rs=h.memo(({maxRow:r=0,maxColumn:t=2,separator:o=":",fields:n=[],labelWidth:l=150,bordered:s=!1})=>{const i=h.useMemo(()=>Kn(n,r),[n,r]),c=i.length>2,a=()=>{switch(t){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(f.Box,{gap:c?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:c?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:s?"border":void 0,borderStyle:s?"border-solid":void 0,borderColor:s?"border-subtle":void 0,children:i.map((d,g)=>e.jsx(f.Box,{direction:"column",flex:c?void 0:"1",width:c?a():void 0,marginBottom:c?"lg":void 0,children:e.jsx(es,{labelWidth:l,fields:d,separator:o})},g))})}),ts=({backButton:r})=>{const[t,o]=h.useState(!1),n=(r==null?void 0:r.iconColor)??"var(--sa-text-subtle, #8c8f97)",l=(r==null?void 0:r.textColor)??"var(--sa-text-subtle, #8c8f97)",s=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",i=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{cursor:"pointer"},children:[e.jsx(F.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?s:n,transition:"color 0.15s ease"}}),e.jsx(m.Text,{variant:"sub-h3",style:{color:t?i:l,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},vl=({backButton:r,title:t,titleIcon:o,titleTag:n,children:l,header:s=!0,headerBorder:i=!1,disableAnimation:c=!1,scrollable:a=!1,stickyHeader:d=!1,subHeaders:g,action:b,titleTagProps:p,containerProps:C,headerProps:B})=>{const x=Ee.useMediaQuery("md"),{Link:W,useNavigate:L}=cr(),M=L(),S=r==null?void 0:r.show,E=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}M(-1,{replace:!0})},A=()=>{if(!b)return null;if(h.isValidElement(b))return b;const _=b.filter(H=>H&&(H.title||H.icon));return _.length===0?null:x?e.jsx(f.Box,{direction:"row",gap:"md",children:_.map(({title:H,icon:R,buttonProps:ee,onClick:J},K)=>e.jsx(V.Button,{iconLeft:R?e.jsx(F.Icon,{name:R,size:"md"}):void 0,onClick:J,...ee,children:H},`action-${K}`))}):e.jsxs(z.Menu,{position:"bottom-right",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{minWidth:200},children:_.map(({title:H,icon:R,buttonProps:ee,onClick:J},K)=>{const de=(ee==null?void 0:ee.tone)==="error"||(ee==null?void 0:ee.danger)===!0;return e.jsx(z.MenuItem,{intent:de?"danger":void 0,disabled:ee==null?void 0:ee.disabled,startIcon:R?e.jsx(F.Icon,{name:R}):void 0,onClick:J,children:H},`action-${K}`)})})})]})},T=()=>{const _=e.jsx(ts,{backButton:r});return r!=null&&r.navigateTo?e.jsx(f.Box,{direction:"row",children:e.jsx(W,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:_})}):e.jsx(f.Box,{direction:"row",children:e.jsx(Kr,{onClick:E,children:_})})},D=()=>{const _=!!t,H=Array.isArray(b)&&b.length>0,R=h.isValidElement(b)?!0:H;if(!_&&!R&&!S)return null;const J=x||!x&&H;return e.jsxs(f.Box,{direction:"column",gap:"xs",paddingBlock:(B==null?void 0:B.paddingBlock)??"sm",paddingInline:(B==null?void 0:B.paddingInline)??"md",...B,style:{...i?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...B==null?void 0:B.style},children:[S&&T(),(_||R)&&e.jsxs(f.Box,{direction:J?"row":"column",gap:"sm",justify:"space-between",align:J?"center":"flex-start",children:[_?typeof t=="string"?e.jsxs(f.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[o&&e.jsx(F.Icon,{name:o,size:"md",color:"primary"}),e.jsx(m.Text,{variant:"h3",fontWeight:"semibold",children:t})]}),n&&e.jsx(or.Badge,{border:!0,size:"lg",text:n,...p})]}):t:null,A()]})]})},O=()=>{if(!g||g.length===0)return null;const _=g.filter(ee=>ee.show!==!1);if(_.length===0)return null;let H=0,R=-1/0;return _.forEach((ee,J)=>{const K=ee.order??0;K>=R&&(R=K,H=J)}),_.map(({content:ee,order:J,borderBottom:K=!0,keepBottomPadding:de=!1,paddingInline:Q=!0,paddingBlock:le=!0},ue)=>e.jsx(f.Box,{direction:"column",paddingTop:le?"sm":"spacing-0",paddingBottom:le&&(K||de||ue===H)?"sm":"spacing-0",paddingInline:Q?"md":"spacing-0",style:{...K?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...J!==void 0?{order:J}:{}},children:ee},`sub-header-${ue}`))},q=()=>{const _=s?D():null,H=O();return!_&&!H?null:e.jsxs(f.Box,{direction:"column",style:{...a?{position:"sticky",left:0,...d?{top:0}:{},zIndex:2,background:"var(--sa-background-primary, #ffffff)"}:{},marginBottom:H?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[_,H]})},G=()=>l;return e.jsxs(f.Box,{direction:"column",as:"main",...C,style:{...a?{height:"100%",minHeight:0,overflow:"auto"}:{},...(C==null?void 0:C.style)??{},...c?{}:{animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"}},children:[q(),G()]})},os=r=>{const{useLocation:t}=cr(),o=t();return e.jsx(vl,{...r},o.pathname)},ls=r=>r.remountOnRouteChange?e.jsx(os,{...r}):e.jsx(vl,{...r}),ns=h.memo(ls),ss={icon:"Cross",title:""},is=320,Cl=16,wl=4,cs=8,xl=h.forwardRef(({onHide:r,show:t,withBlur:o=!1,style:n,children:l,closeButton:s=ss,paddingHorizontal:i=!0,width:c,minWidth:a,maxWidth:d,hideBackdrop:g=!1,title:b,headerAction:p,header:C=!0,widthPresets:B,resizable:x=!0,resizeMin:W=is,resizeMax:L,onWidthChange:M},S)=>{const A=!Ee.useMediaQuery("md"),T=c??d??a??"357px",D=B??[],O=D.length>1,[q,G]=h.useState(()=>{const ae=D.indexOf(T);return ae>=0?ae:0}),[_,H]=h.useState(null),[R,ee]=h.useState(!1),[J,K]=h.useState(!1),de=h.useRef(null),Q=ae=>{de.current=ae,typeof S=="function"?S(ae):S&&(S.current=ae)},le=O?D[q]:T,ue=_!=null?`${_}px`:le,De=x&&!A,Fe=q===D.length-1,Se=()=>{const ae=(q+1)%D.length;H(null),G(ae),M==null||M(D[ae])},xe=h.useCallback(ae=>{const we=L??window.innerWidth;return Math.min(Math.max(ae,W),we)},[W,L]),ve=h.useRef(null),He=ae=>{if(!De)return;ae.preventDefault();const we=ae.currentTarget;we.setPointerCapture(ae.pointerId),ee(!0);const _e=document.body.style.cursor,ge=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let se=null;const qe=P=>{const $=xe(window.innerWidth-P.clientX);ve.current=$,se==null&&(se=window.requestAnimationFrame(()=>{se=null,ve.current!=null&&H(ve.current)}))},Ze=P=>{se!=null&&window.cancelAnimationFrame(se),ve.current!=null&&H(ve.current),we.releasePointerCapture(P.pointerId),we.removeEventListener("pointermove",qe),we.removeEventListener("pointerup",Ze),we.removeEventListener("pointercancel",Ze),document.body.style.cursor=_e,document.body.style.userSelect=ge,ee(!1),ve.current!=null&&(M==null||M(`${ve.current}px`))};we.addEventListener("pointermove",qe),we.addEventListener("pointerup",Ze),we.addEventListener("pointercancel",Ze)},Re=ae=>{var se;if(!De||ae.key!=="ArrowLeft"&&ae.key!=="ArrowRight")return;ae.preventDefault();const we=ae.key==="ArrowLeft"?Cl:-Cl,_e=_??((se=de.current)==null?void 0:se.offsetWidth)??W,ge=xe(_e+we);H(ge),M==null||M(`${ge}px`)},ze=()=>{De&&(H(null),M==null||M(le))};return e.jsx(ut.Drawer,{blur:o,isShow:t,position:"right",onHide:r,ref:Q,size:ue,style:n,flush:!0,radius:"none",hideBackdrop:g,children:e.jsxs(f.Box,{direction:"column",height:"height-full",children:[De?e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Ubah lebar panel",tabIndex:0,onPointerDown:He,onKeyDown:Re,onDoubleClick:ze,title:"Tarik untuk mengubah lebar — klik dua kali untuk reset",onPointerEnter:()=>K(!0),onPointerLeave:()=>K(!1),style:{position:"absolute",left:0,top:0,bottom:0,width:cs,cursor:"col-resize",zIndex:1,background:R||J?`linear-gradient(to right, var(--sa-border-brand, var(--sa-border-subtle)) 0 ${wl}px, transparent ${wl}px)`:"transparent",transition:"background 0.15s",touchAction:"none"}}):null,C?e.jsxs(f.Box,{direction:"row",align:"center",justify:"space-between",gap:"sm",paddingInline:"md",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",customHeight:"var(--app-header-height, 44px)",flexShrink:"0",children:[e.jsx(f.Box,{direction:"row",align:"center",gap:"sm",overflow:"overflow-hidden",children:typeof b=="string"?e.jsx(m.Text,{fontSize:"md",fontWeight:"bold",children:b}):b}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[p,O?e.jsx(V.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:Se,"aria-label":Fe?"Kecilkan panel":"Lebarkan panel",iconRight:e.jsx(F.Icon,{name:Fe?"ChevronRight":"ChevronLeft"})}):null,s?e.jsx(V.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:r,"aria-label":s.title||"Tutup",iconRight:e.jsx(F.Icon,{name:s.icon}),children:s.title||void 0}):null]})]}):null,e.jsx(f.Box,{direction:"column",paddingBlock:"md",paddingInline:i?"md":"spacing-0",overflow:"overflow-y-auto",style:{flex:1,minHeight:0},children:l})]})})}),lo=h.memo(({children:r,borderBottom:t=!0,padding:o=!0})=>{const n=Ee.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),no=h.memo(({children:r,borderTop:t=!0,padding:o=!0})=>{const n=Ee.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),as=h.memo(({children:r,...t})=>e.jsx(f.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),ds=h.memo(({children:r,title:t,titleTag:o,action:n,header:l,footer:s,actionContainer:i,containerProps:c,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:g={borderTop:!0},variantTag:b="info"})=>{const p=Ee.useMediaQuery("lg"),C=()=>o?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(m.Text,{fontWeight:"medium",children:t}),e.jsx(or.Badges,{border:!0,text:o,variant:b})]}):e.jsx(m.Text,{fontWeight:"medium",children:t}),B=()=>l||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:t?C():null}),e.jsx(f.Box,{direction:"column",style:p?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...i,children:n??null})]}),x=!!(l||t||n);return e.jsxs(f.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...c,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(c==null?void 0:c.style)??{}},children:[l!==null&&x?e.jsx(lo,{...d,children:B()}):null,e.jsx(as,{...a,children:r}),s?e.jsx(no,{...g,children:s}):null]})}),nr={H1:r=>e.jsx(m.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(m.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(m.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(m.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(m.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(m.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(m.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(m.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(m.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(m.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(m.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(m.Text,{variant:"body-3",children:r.children,...r.props})},Ye=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=cr(),[n,l]=r(),s=zr.searchParamsToObject(n.toString()),i=t(),c=o(),a=i.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,B)=>n.has(C)&&n.get(C)===B,getQueryParam:C=>n.get(C),getRouteParam:C=>i[C],params:i,location:c,id:a,hasId:!!a}},Dl=r=>JSON.stringify(r),Sl=r=>JSON.stringify(r),kl=r=>JSON.stringify(r),Bl=r=>JSON.stringify(r),hs=r=>r,fs=r=>JSON.stringify(r),ar=r=>{if(typeof r!="string"||r==="")return{};try{const t=JSON.parse(r);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}},dr=r=>{if(!(typeof r!="string"||r===""))try{return JSON.parse(r)}catch{return}},Rr=({value:r,name:t,type:o,withSearchParam:n=!0,setSearchParams:l,searchQueries:s,dropdownSearchKey:i,filterKey:c="filter",pageKey:a="page"})=>{if(n){let d;switch(o){case"search":d=hs(r);break;case"dropdown":case"dropdown-multiple":d=Dl(r);break;case"radio":d=Sl(r);break;case"date-range":d=kl(r);break;case"advanced-date-range":d=fs(r);break;case"date":d=Bl(r);break;default:d=r;break}if(typeof d<"u"){const g={...ar(s[c]),[t]:d},b={...s};i&&typeof i=="string"&&delete b[i],delete b[a];const p={...b,[c]:JSON.stringify(g)},C=new URLSearchParams(s).toString(),B=new URLSearchParams(p).toString();if(C===B)return;l(p)}}},bt=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{var c,a,d,g;const l=o.get(t)||void 0,s=l&&typeof l=="string"?ar(l):void 0,i=s?s[r]:void 0;return n==="label"&&i?(a=(c=dr(i))==null?void 0:c[0])==null?void 0:a.label:n==="value"&&i?(g=(d=dr(i))==null?void 0:d[0])==null?void 0:g.value:i},ml=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{var c,a;const l=o.get(t)||void 0,s=l&&typeof l=="string"?ar(l):void 0,i=s?s[r]:void 0;return n==="label"&&i?(c=dr(i))==null?void 0:c.map(d=>d.label):n==="value"&&i?(a=dr(i))==null?void 0:a.map(d=>d.value):n==="array"&&i?dr(i):i},us=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{var c,a,d;const l=o.get(t)||void 0,s=l&&typeof l=="string"?ar(l):void 0,i=s?s[r]:void 0;return n==="id"&&i?(c=dr(i))==null?void 0:c.id:n==="label"&&i?(a=dr(i))==null?void 0:a.label:n==="value"&&i?(d=dr(i))==null?void 0:d.value:i},vt=(r,t,o)=>{const n=t.get(o||"filter")||void 0,l=n&&typeof n=="string"?ar(n):void 0;return l?l[r]:void 0},gs=({name:r,filterKey:t="filter",searchParams:o})=>{var i,c;const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?ar(n):void 0,s=l?l[r]:void 0;return{start:s?(i=dr(s))==null?void 0:i.from:void 0,end:s?(c=dr(s))==null?void 0:c.to:void 0}},El=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?ar(n):void 0,s=l?l[r]:void 0;return s?dr(s):void 0},ys=(r,{filterKey:t="filter",perPageKey:o="perPage",pageKey:n="page"})=>{const l=r.get(t)||void 0,s=r.get(o)||void 0,i=r.get(n)||void 0;return!!l||!!s||!!i},Fl=({isOpen:r,onClose:t,filterKey:o,pageKey:n,filters:l})=>{const{searchParams:s,setSearchParams:i,searchQueries:c}=Ye(),[a,d]=h.useState({}),g=()=>{s.delete(o||"filter"),i(s)},b=(p,C)=>{switch(p.type){case"radio":{const{show:B=!0}=p;return B&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}case"dropdown":{const{show:B=!0}=p;return B&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}case"date-range":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C);case"date":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C);case"dropdown-multiple":{const{show:B=!0}=p;return B&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}default:return null}};return e.jsx(xl,{onHide:t,show:r||!1,children:e.jsxs(f.Box,{direction:"column",gap:"md",children:[e.jsxs(he.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(f.Box,{direction:"column",children:"Filter"}),e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},onClick:g,children:"Reset"})]}),l==null?void 0:l.map((p,C)=>b(p,C))]})})},Il=({searchKey:r="q",statusKey:t="status",searchPlaceholder:o="Search",searchHighlightPlaceholder:n,extendedFilter:l,showSearchFilter:s=!0,showStatusFilter:i=!0,filterKey:c="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:g,filterConfigs:b,buttonToggleProps:p,position:C="right",titleSearchLabel:B="Work Order",withTitleLabels:x=!1})=>{const L=(p==null?void 0:p.isShowLabel)??!0,[M,S]=h.useState(!1),[E,A]=h.useState(0),T=()=>{A(Q=>Q+1)},{searchParams:D,setSearchParams:O,getQueryParam:q}=Ye(),G=zr.searchParamsToObject(D.toString()),_=vt(r,D,c)||"",[H,R]=h.useState(_),ee=q(c),K=!!(ee&&!(()=>{if(ee)try{const Q=JSON.parse(ee);return Object.keys(Q).length===1&&Q[r]===""}catch(Q){console.error("Filter parameter is not a valid JSON:",Q)}return!1})()),de=Ee.useMediaQuery("md");return h.useEffect(()=>{R(_)},[_]),h.useEffect(()=>{if(H===_)return;const Q=window.setTimeout(()=>{Rr({value:H,name:r,type:"search",searchQueries:G,setSearchParams:O,filterKey:c,pageKey:a})},350);return()=>{window.clearTimeout(Q)}},[H,_,r,G,O,c,a]),e.jsxs(he.Flex,{gap:"md",style:{flexDirection:de&&C==="left"?"row":de&&C==="right"?"row-reverse":"column"},align:"flex-end",children:[K&&e.jsx(f.Box,{direction:"column",justify:"flex-end",children:e.jsx(V.Button,{onClick:()=>{const Q=new URLSearchParams(D);Q.delete(c),O(Q),R(""),T(),g&&g()},variant:"outline",tone:"neutral",children:e.jsx(m.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),l==null?void 0:l.map(({minWidth:Q,content:le,title:ue,onClickContainer:De},Fe)=>e.jsxs(f.Box,{direction:"column",gap:"sm",onClick:De,style:{minWidth:Q},children:[ue&&e.jsx(nr.SubH3,{children:ue}),le]},`extended-filter-${Fe}-${E}`)),!!(b!=null&&b.length)&&e.jsx(V.Button,{primary:K,secondary:!K,iconLeft:e.jsx(F.Icon,{size:"sm",name:(p==null?void 0:p.icon)||"FilterHorizontal",style:{color:ee?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!de,onClick:()=>S(!0),children:L?"Filter":void 0}),i&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[x&&e.jsx(nr.SubH3,{children:"Status"}),e.jsx(Wr.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:bt({get:"value",name:t,searchParams:D,filterKey:c})?[{label:bt({get:"value",name:t,searchParams:D,filterKey:c})==="active"?"Active":"InActive",value:bt({get:"value",name:t,searchParams:D,filterKey:c})}]:[],onChange:Q=>Rr({value:Q,name:t,type:"dropdown",searchQueries:G,setSearchParams:O,filterKey:c}),placeholder:x?"All":"All Status"},E)]}),s&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{width:d&&de?d:de?"310px":""},children:[x&&e.jsxs(nr.SubH3,{children:["Search for ",B]}),e.jsx(gr.Input,{placeholder:o,leftIcon:e.jsx(F.Icon,{name:"Search",width:20,height:20}),onChange:Q=>R(Q.target.value),value:H,fullWidth:!0},E+1+c)]}),e.jsx(Fl,{isOpen:M,onClose:()=>S(!1),filterKey:c,filters:b,pageKey:a})]})},ps=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r==="text"?"search":r;function so({configs:r,filterKey:t="filter",activeFilterKey:o="filters",pageKey:n="page",searchKey:l="q"}){const{searchParams:s,setSearchParams:i,searchQueries:c}=Ye(),a=h.useMemo(()=>Object.fromEntries(r.map(E=>[E.key,E])),[r]),d=h.useMemo(()=>{const E=(s.get(o)||"").split(",").map(T=>T.trim()).filter(Boolean),A=Object.keys(ar(s.get(t))).filter(T=>T!==l);return r.map(T=>T.key).filter(T=>{const D=a[T];return(D==null?void 0:D.locked)||E.includes(T)||A.includes(T)})},[s,o,t,l,r,a]),g=h.useCallback(E=>ar(E[t]),[t]),b=h.useCallback(E=>{const A={...c};E.length?A[o]=E.join(","):delete A[o],i(A)},[c,o,i]),p=h.useCallback(E=>{d.includes(E)||b([...d,E])},[d,b]),C=h.useCallback(E=>{var O;if((O=a[E])!=null&&O.locked)return;const A={...c},T=d.filter(q=>q!==E);T.length?A[o]=T.join(","):delete A[o];const D=g(A);E in D&&(delete D[E],Object.keys(D).length?A[t]=JSON.stringify(D):delete A[t]),delete A[n],i(A)},[c,d,o,t,n,g,i,a]),B=h.useCallback(E=>d.includes(E)?C(E):p(E),[d,p,C]),x=h.useCallback(E=>{switch(E.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return ml({name:E.key,get:"array",searchParams:s,filterKey:t})||[];case"date":{const A=El({name:E.key,searchParams:s,filterKey:t});return A?new Date(A):void 0}case"date-compact":{const T=g(Object.fromEntries(s.entries()))[E.key];return T&&typeof T=="object"?T:void 0}case"text":{const T=g(Object.fromEntries(s.entries()))[E.key];return typeof T=="string"?T:void 0}default:return}},[s,t,g]),W=h.useCallback((E,A)=>{if(E.type==="date-compact"||E.type==="text"){const T={...c},D=g(T);A==null||A===""?delete D[E.key]:D[E.key]=A,Object.keys(D).length?T[t]=JSON.stringify(D):delete T[t],delete T[n],i(T);return}Rr({value:A,name:E.key,type:ps(E.type),searchQueries:c,setSearchParams:i,filterKey:t,pageKey:n})},[c,i,t,n,g]),L=h.useCallback(E=>{const A={...c},T=g(A);E in T&&(delete T[E],Object.keys(T).length?A[t]=JSON.stringify(T):delete A[t]),delete A[n],i(A)},[c,t,n,g,i]),M=h.useCallback(()=>{const E={...c};delete E[t],delete E[o],delete E[n],i(E)},[c,t,o,n,i]),S=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:S,addFilter:p,removeFilter:C,toggleFilter:B,getValue:x,setValue:W,clearValue:L,clearAll:M}}const io={get(r){return $r.storage.get(r)??null},set(r,t){$r.storage.save(r,t)},remove(r){$r.storage.delete(r)}},Pr={columns:r=>`filterbar:colprefs:${r}`,savedViews:r=>`filterbar:views:${r}`,lastState:r=>`filterbar:last:${r}`,perPage:r=>`filterbar:perpage:${r}`,tableSort:r=>`tablelayout:sort:${r}`},Ct=(r,t)=>{const o=new Set(t.map(s=>s.key)),n=r.order.filter(s=>o.has(s));for(const s of t)n.includes(s.key)||n.push(s.key);const l=r.hidden.filter(s=>o.has(s));return{order:n,hidden:l}};function bs({columns:r,scopeId:t,storage:o,onColumnsChange:n,value:l}){const s=h.useMemo(()=>({order:r.map(D=>D.key),hidden:[]}),[r]),i=t?Pr.columns(t):void 0,c=(D,O)=>Ct({order:D.order??O,hidden:D.hidden??[]},r),[a,d]=h.useState(()=>{if(l&&(l.order||l.hidden))return c(l,r.map(D=>D.key));if(i){const D=o.get(i);if(D&&Array.isArray(D.order))return Ct(D,r)}return s}),g=r.map(D=>D.key).join("|");h.useEffect(()=>d(D=>Ct(D,r)),[g]);const b=h.useRef(a);b.current=a;const p=l?`${(l.order??[]).join("|")}~${(l.hidden??[]).join("|")}`:null,C=h.useRef(p);h.useEffect(()=>{if(p==null||C.current===p)return;C.current=p;const D=b.current,O=c(l,D.order);O.order.join("|")===D.order.join("|")&&O.hidden.join("|")===D.hidden.join("|")||(d(O),i&&o.set(i,O))},[p,g]);const B=h.useRef(!1);h.useEffect(()=>{B.current||(B.current=!0,n==null||n(a))},[]);const x=h.useCallback(D=>{d(D),i&&o.set(i,D),n==null||n(D)},[i,o,n]),W=h.useMemo(()=>{const D=new Map(r.map(O=>[O.key,O]));return a.order.filter(O=>D.has(O)).map(O=>({...D.get(O),visible:!a.hidden.includes(O)}))},[a,r]),L=h.useCallback(D=>{const O=a.hidden.includes(D)?a.hidden.filter(q=>q!==D):[...a.hidden,D];x({...a,hidden:O})},[a,x]),M=h.useCallback((D,O)=>{if(D===O)return;const q=[...a.order],[G]=q.splice(D,1);q.splice(O,0,G),x({...a,order:q})},[a,x]),S=h.useCallback(D=>{x({...a,hidden:D?r.filter(O=>!O.locked).map(O=>O.key):[]})},[a,r,x]),E=h.useCallback(()=>x(s),[x,s]),A=h.useCallback(D=>x(Ct(D,r)),[x,r]),T=a.hidden.length===0;return{state:a,orderedColumns:W,allVisible:T,toggleVisibility:L,reorder:M,setAllHidden:S,reset:E,applyState:A}}function vs({scopeId:r,storage:t,snapshotKeys:o,pageKey:n="page",getColumns:l,applyColumns:s}){const{searchParams:i,setSearchParams:c}=Ye(),a=r?Pr.savedViews(r):void 0,[d,g]=h.useState(()=>a?t.get(a)||[]:[]),b=h.useCallback(x=>{g(x),a&&t.set(a,x)},[a]),p=h.useCallback(x=>{const W=x.trim();if(!W)return;const L={};o.forEach(S=>{const E=i.get(S);E!=null&&(L[S]=E)});const M={id:`${Date.now()}`,name:W,query:L,columns:l==null?void 0:l(),createdAt:Date.now()};b([...d,M])},[o,i,l,b,d]),C=h.useCallback(x=>b(d.filter(W=>W.id!==x)),[b,d]),B=h.useCallback(x=>{const W=Object.fromEntries(i.entries());o.forEach(L=>delete W[L]),Object.assign(W,x.query),delete W[n],c(W),x.columns&&(s==null||s(x.columns))},[i,o,n,c,s]);return{enabled:!!a,views:d,saveView:p,deleteView:C,applyView:B}}function Cs(r,t){const o=ar(r);return delete o[t],Object.keys(o).length>0?JSON.stringify(o):void 0}function Tl(r,t,o){const n=r[t];if(n==null)return;const l=Cs(n,o);l===void 0?delete r[t]:r[t]=l}function ws({scopeId:r,storage:t,snapshotKeys:o,enabled:n=!0,filterKey:l="filter",searchKey:s="q",persistSearch:i=!0}){const{searchParams:c}=Ye(),a=r&&n?Pr.lastState(r):void 0,d=h.useRef(a),g=h.useRef(!1);h.useEffect(()=>{if(!a){d.current=a;return}if(d.current!==a){d.current=a,g.current=!1;return}const C={};if(o.forEach(B=>{const x=c.get(B);x!=null&&(C[B]=x)}),i||Tl(C,l,s),Object.keys(C).length===0){g.current&&t.remove(a);return}g.current=!0,t.set(a,C)},[c,a,o,t,i,l,s]);const b=h.useCallback(()=>{if(!a)return null;const C=t.get(a);if(!C||typeof C!="object"||Array.isArray(C)||Object.keys(C).length===0)return null;const B=C[l];return B!=null&&Object.keys(ar(B)).length===0&&delete C[l],i||Tl(C,l,s),Object.keys(C).length>0?C:null},[a,t,i,l,s]),p=h.useCallback(()=>{a&&t.remove(a)},[a,t]);return{enabled:!!a,read:b,clear:p}}function xs({scopeId:r,storage:t,perPageKey:o,pageSizeOptions:n,enabled:l=!0}){const{searchParams:s}=Ye(),i=r&&l?Pr.perPage(r):void 0,c=s.toString(),a=h.useRef(i);h.useEffect(()=>{if(!i){a.current=i;return}if(a.current!==i){a.current=i;return}const b=s.get(o);if(!b)return;const p=Number(b);!Number.isFinite(p)||p<=0||t.set(i,p)},[c,i,o,t]);const d=h.useCallback(()=>{if(!i)return null;const b=t.get(i);if(b==null)return null;const p=Number(b);return!Number.isFinite(p)||p<=0||n&&!n.includes(p)?null:String(p)},[i,t,n]),g=h.useCallback(()=>{i&&t.remove(i)},[i,t]);return{enabled:!!i,read:d,clear:g}}let co={},ao=!1,ho=null;const Ds=(r,t)=>{Object.assign(co,r),ho=t,!ao&&(ao=!0,queueMicrotask(()=>{const o=co,n=ho;co={},ao=!1,ho=null,!(!n||Object.keys(o).length===0)&&n(l=>{const s=new URLSearchParams(l);return Object.entries(o).forEach(([i,c])=>s.set(i,c)),s},{replace:!0})}))};function Ss({enabled:r,snapshotKeys:t,perPageKey:o,readSnapshot:n,readPerPage:l}){const{searchParams:s,setSearchParams:i,location:c}=Ye(),a=h.useRef(null);h.useEffect(()=>{if(!r||a.current===c.pathname)return;a.current=c.pathname;const d={};if(!s.has(o)){const g=l();g&&(d[o]=g)}if(!t.some(g=>s.has(g))){const g=n();g&&Object.assign(d,g)}Object.keys(d).length!==0&&Ds(d,i)},[c.pathname,r])}const ks=({configs:r,activeKeys:t,onToggle:o,hasActiveFilter:n,onReset:l})=>r.length?e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{minWidth:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&l&&e.jsx(V.Button,{variant:"link",tone:"brand",size:"xs",onClick:l,children:"Reset"})]}),children:r.map(s=>e.jsx(z.MenuItem,{selected:s.locked||t.includes(s.key),disabled:s.locked,closeOnSelect:!1,startIcon:s.icon??void 0,onClick:()=>{s.locked||o(s.key)},children:s.label},s.key))})})]}):null,et=({onClear:r,onRemove:t})=>e.jsxs(z.Menu,{position:"bottom-right",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(F.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(z.MenuLists,{children:e.jsxs(z.MenuBody,{style:{width:180},children:[e.jsx(z.MenuItem,{startIcon:e.jsx(F.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(z.MenuItem,{intent:"danger",startIcon:e.jsx(F.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),Bs=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},Ll=(r,t,o)=>{const n=new Date(r);return o==="day"?n.setDate(n.getDate()+t):o==="week"?n.setDate(n.getDate()+t*7):o==="month"?n.setMonth(n.getMonth()+t):n.setFullYear(n.getFullYear()+t),n},Ml=r=>{const t=Bs(new Date);if(r.direction==="this"){const n=new Date(t),l=new Date(t);return r.period==="week"?(n.setDate(t.getDate()-t.getDay()),l.setDate(n.getDate()+6)):r.period==="month"?(n.setDate(1),l.setMonth(l.getMonth()+1,0)):r.period==="year"&&(n.setMonth(0,1),l.setMonth(11,31)),{from:n,to:l}}const o=r.count??1;return r.direction==="past"?{from:Ll(t,-o,r.period),to:t}:{from:t,to:Ll(t,o,r.period)}},Al=24,Ol=r=>r.length>Al?`${r.slice(0,Al)}...`:r,Wl=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),fo=(r,t="days")=>t==="months"?r.toLocaleDateString(void 0,{month:"short",year:"numeric"}):t==="years"?String(r.getFullYear()):Wl(r),wt={is:"Is","is-before":"Is before","is-after":"Is after","is-on-or-before":"Is on or before","is-on-or-after":"Is on or after","is-between":"Is between","is-relative-to-today":"Is relative to today","is-empty":"Is empty","is-not-empty":"Is not empty"},zl=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],uo={past:"Past",next:"Next",this:"This"},ms=["day","week","month","year"],Es=["past","next","this"],Fs=r=>r.field.type==="date-compact"?e.jsx(Ls,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(Is,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),Is=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=t?Wl(new Date(t)):null,i=!!s,c=i?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Ol(s)})]}):r.label;return e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i?e.jsx(F.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:c})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(et,{onClear:n,onRemove:l})]}),children:e.jsx(Sr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():o(a),withPadding:!1})})})]})},Ts=(r,t="days")=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${wt[r.op]} ${fo(new Date(r.date),t)}`:null;case"is-between":return r.from&&r.to?`${fo(new Date(r.from),t)} - ${fo(new Date(r.to),t)}`:null;case"is-relative-to-today":{const o=r.relative;if(!o)return null;if(o.direction==="this")return`This ${o.period}`;const n=o.count??1,l=n===1?o.period:`${o.period}s`;return`${uo[o.direction]} ${n} ${l}`}case"is-empty":case"is-not-empty":return wt[r.op];default:return null}},Ls=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.ops&&r.ops.length>0?r.ops:zl,i=r.defaultOp&&s.includes(r.defaultOp)?r.defaultOp:s[0],c=r.mode??"days",a=(t==null?void 0:t.op)??i,d=t?Ts(t,c):null,g=!!d,b=g?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Ol(d)})]}):r.label,p=C=>{if(C!==a){if(C==="is-empty"||C==="is-not-empty"){o({op:C});return}if(C==="is-relative-to-today"){o({op:C,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(C==="is-between"){o({op:C,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}o({op:C,date:t==null?void 0:t.date})}};return e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:g?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:g?e.jsx(F.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsxs(z.MenuLists,{children:[e.jsx(z.MenuBody,{style:{width:320},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Hl,{op:a,ops:s,onChange:p})]}),e.jsx(et,{onClear:n,onRemove:l})]}),children:e.jsx(_l,{value:t,op:a,mode:c,onChange:o})}),a==="is-relative-to-today"&&e.jsx(z.MenuFooter,{children:e.jsx(m.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},Hl=({op:r,ops:t,onChange:o})=>e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:wt[r]})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{width:200},children:t.map(n=>e.jsx(z.MenuItem,{selected:r===n,onClick:()=>o(n),endIcon:r===n?e.jsx(F.Icon,{name:"Check"}):void 0,children:wt[n]},n))})})]}),_l=({value:r,op:t,mode:o="days",onChange:n})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(m.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const l=r!=null&&r.from||r!=null&&r.to?{from:r!=null&&r.from?new Date(r.from):null,to:r!=null&&r.to?new Date(r.to):null}:void 0;return e.jsx(Sr.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,filter:o,value:l,onChange:s=>{if(s==null){n({op:t});return}if(typeof s=="object"&&s!==null&&"from"in s&&"to"in s){let{from:i,to:c}=s;if(!i&&c&&(i=c,c=null),!i&&!c){n({op:t});return}n({op:t,from:i?i.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},`range-${o}`)}return t==="is-relative-to-today"?e.jsx(Ms,{value:r==null?void 0:r.relative,onChange:l=>n({op:t,relative:l})}):e.jsx(Sr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:o,value:r!=null&&r.date?new Date(r.date):void 0,onChange:l=>{if(l==null){n({op:t});return}l instanceof Date&&n({op:t,date:l.toISOString()})},withPadding:!1},`single-${o}`)},Ms=({value:r,onChange:t})=>{const o=(r==null?void 0:r.direction)??"past",n=(r==null?void 0:r.count)??1,l=(r==null?void 0:r.period)??"week",s=o!=="this",i=Ml({direction:o,count:n,period:l});return e.jsxs(f.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:uo[o]})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{width:140},children:Es.map(c=>e.jsx(z.MenuItem,{selected:o===c,endIcon:o===c?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>t(c==="this"?{direction:c,period:l}:{direction:c,count:n,period:l}),children:uo[c]},c))})})]}),s&&e.jsx(gr.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:c=>{const a=Number(c.target.value);t({direction:o,count:Number.isFinite(a)&&a>0?a:1,period:l})},style:{width:72}}),e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{width:140},children:ms.map(c=>e.jsx(z.MenuItem,{selected:l===c,endIcon:l===c?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>t(o==="this"?{direction:o,period:c}:{direction:o,count:n,period:c}),children:c},c))})})]})]}),e.jsx(Sr.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:i,onChange:()=>{},withPadding:!1},"relative-preview")]})},Pl=18,As=r=>r.length>Pl?`${r.slice(0,Pl)}...`:r,Os=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.type==="dropdown-multiple",i=t.length,c=r.searchable!==!1,[a,d]=h.useState(""),g=r.options,b=typeof r.onSearch=="function",p=(()=>{if(b)return g;const L=a.trim().toLowerCase();return L?g.filter(M=>M.label.toLowerCase().includes(L)):g})(),C=L=>t.some(M=>M.value===L.value),B=L=>{if(!s){o([{label:L.label,value:L.value}]),d("");return}o(C(L)?t.filter(M=>M.value!==L.value):[...t,{label:L.label,value:L.value}])},x=L=>{var M;d(L),(M=r.onSearch)==null||M.call(r,L)},W=i===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:i===1?As(t[0].label):`${i} Selected`})]});return e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:i>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i>0?e.jsx(F.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:W})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(et,{onClear:n,onRemove:l})]}),children:e.jsxs(f.Box,{direction:"column",gap:"sm",children:[c&&e.jsx(Wr.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:s,searchAble:!0,searchValue:a,onSearch:x,value:t,onChange:o,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(m.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(m.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(L=>e.jsx(z.MenuItem,{closeOnSelect:!s,selected:C(L),startIcon:L.avatar,endIcon:C(L)?e.jsx(F.Icon,{name:"Check"}):void 0,description:L.description,onClick:()=>B(L),children:L.label},L.value))})]})})})]})},Nl=18,Ws=r=>r.length>Nl?`${r.slice(0,Nl)}...`:r,jl=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(yr.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),zs=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=new Set(t.map(p=>p.value)),i=t.length,c=r.options.length>0&&r.options.every(p=>s.has(p.value)),a=i>0&&!c,d=p=>{o(s.has(p.value)?t.filter(C=>C.value!==p.value):[...t,{label:p.label,value:p.value}])},g=()=>{o(c?[]:r.options.map(p=>({label:p.label,value:p.value})))},b=i===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(m.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(m.Text,{as:"span",children:i===1?Ws(t[0].label):`${i} Selected`})]});return e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:i>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i>0?e.jsx(F.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsx(z.MenuLists,{children:e.jsxs(z.MenuBody,{style:{width:240},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(et,{onClear:n,onRemove:l})]}),children:[e.jsx(z.MenuItem,{closeOnSelect:!1,selected:c,onClick:g,startIcon:e.jsx(jl,{checked:c||a,indeterminate:a}),children:"Select All"}),r.options.map(p=>e.jsx(z.MenuItem,{closeOnSelect:!1,selected:s.has(p.value),onClick:()=>d(p),startIcon:e.jsx(jl,{checked:s.has(p.value)}),children:p.label},p.value))]})})]})},Vl=18,Hs=r=>r.length>Vl?`${r.slice(0,Vl)}...`:r,_s=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const[s,i]=h.useState(t??""),c=Ee.useDebounce(s,r.debounceMs??300);h.useEffect(()=>{c!==(t??"")&&o(c)},[c]),h.useEffect(()=>{i(t??"")},[t]);const a=!!t,d=a?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Hs(t)})]}):r.label;return e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:a?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:a?e.jsx(F.Icon,{name:"Search",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:d})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(et,{onClear:n,onRemove:l})]}),children:e.jsx(gr.Input,{size:"sm",fullWidth:!0,value:s,placeholder:r.placeholder??"Cari…",leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:g=>i(g.target.value)})})})]})},ql=({activeKeys:r,configByKey:t,getValue:o,setValue:n,clearValue:l,removeFilter:s})=>e.jsx(e.Fragment,{children:r.map(i=>{const c=t[i];if(!c)return null;const a=o(c),d=c.locked?void 0:()=>s(i);return c.type==="date"||c.type==="date-compact"?e.jsx(Fs,{field:c,value:a,onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i):c.type==="text"?e.jsx(_s,{field:c,value:a||"",onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i):c.type==="checkbox-multiple"?e.jsx(zs,{field:c,value:a||[],onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i):e.jsx(Os,{field:c,value:a||[],onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i)})}),Zl=r=>`${r} Rows`,Ps=({pagination:r,pageKey:t="page",perPageKey:o="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:l=10,showResultCount:s=!0,showPageSize:i=!0,showPagination:c=!0})=>{var L;const{searchQueries:a,setSearchParams:d,searchParams:g}=Ye(),b=g.get(o),p=b?Number(b):l,C=M=>{d({...a,[t]:String(M)})},B=M=>{d({...a,[o]:M,[t]:"1"})},x=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),W=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[s&&e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${x}-${W} of ${((L=r==null?void 0:r.totalData)==null?void 0:L.toLocaleString())||0}`}),i&&e.jsxs(z.Menu,{position:"bottom-left",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Zl(p)})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{children:n.map(M=>e.jsx(z.MenuItem,{selected:M===p,onClick:()=>B(String(M)),children:Zl(M)},M))})})]}),c&&((r==null?void 0:r.totalPage)??0)>1&&e.jsx(f.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"sm",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(Xr.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:r!=null&&r.currentPage?Number(r.currentPage):1,totalPages:Number(r==null?void 0:r.totalPage),onPageChange:C})})]})};function Ns(r,t,o=!0){h.useEffect(()=>{if(!o)return;const n=l=>{var c;if(l.metaKey||l.ctrlKey||l.altKey||l.key!==r||Oe.isOverlayOpen())return;const s=l.target,i=(c=s==null?void 0:s.tagName)==null?void 0:c.toLowerCase();i==="input"||i==="textarea"||s!=null&&s.isContentEditable||(l.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,o])}const js=240,Gl=({searchKey:r="q",filterKey:t="filter",pageKey:o="page",placeholder:n="Search",shortcut:l="/",collapsible:s=!0})=>{const{searchParams:i,setSearchParams:c,searchQueries:a}=Ye(),d=vt(r,i,t)||"",[g,b]=h.useState(!s||!!d),[p,C]=h.useState(s&&!d),[B,x]=h.useState(d),W=Ee.useDebounce(B,350),L=h.useRef(null);h.useEffect(()=>{x(d),d&&b(!0)},[d]),h.useEffect(()=>{g&&C(!1)},[g]),h.useEffect(()=>{W!==d&&Rr({value:W,name:r,type:"search",searchQueries:a,setSearchParams:c,filterKey:t,pageKey:o})},[W]);const M=h.useCallback(()=>{b(!0),requestAnimationFrame(()=>{var T;return(T=L.current)==null?void 0:T.focus()})},[]);Ns(l,M);const S=()=>{s&&!B&&b(!1)},E=T=>{var D;s&&T.key==="Escape"&&!B&&(b(!1),(D=L.current)==null||D.blur())},A=()=>{g||C(!0)};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:M}),e.jsxs(f.Box,{onTransitionEnd:A,style:{position:"relative",width:g?js:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(gr.Input,{ref:L,size:"sm",fullWidth:!0,value:B,placeholder:n,leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:T=>x(T.target.value),onKeyDown:E,onBlur:S,tabIndex:g?0:-1}),g&&!B&&e.jsx(f.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-hover, #f0f1f2)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(m.Text,{fontSize:"xs",color:"subtle",children:l})})]})]})},Ql=({columns:r,allVisible:t,onToggle:o,onReorder:n,onSetAllHidden:l})=>{const[s,i]=h.useState(null),[c,a]=h.useState(null),d=()=>{s!==null&&c!==null&&s!==c&&n(s,c),i(null),a(null)},g=(b,p)=>{const C=b+p;C<0||C>=r.length||n(b,C)};return e.jsxs(z.Menu,{position:"bottom-right",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(z.MenuLists,{children:e.jsx(z.MenuBody,{children:e.jsxs(f.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(m.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(V.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>l(t),children:t?"Hide All":"Show All"})]}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((b,p)=>{const C=!b.locked,B=c===p&&s!==null&&s!==p;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:C,onDragStart:()=>C&&i(p),onDragOver:x=>{x.preventDefault(),a(p)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:B?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(f.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:C?0:-1,"aria-label":`Reorder ${b.title}`,"aria-disabled":!C||void 0,color:"icon-subtlest",onKeyDown:x=>{C&&(x.key==="ArrowUp"?(x.preventDefault(),g(p,-1)):x.key==="ArrowDown"&&(x.preventDefault(),g(p,1)))},style:{display:"inline-flex",cursor:C?"grab":"default",opacity:C?1:.4},children:e.jsx(F.Icon,{name:"DragVertical",width:16,height:16})}),b.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:b.icon}),e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:b.title}),e.jsx(f.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(_r.Toggle,{size:"sm",checked:b.visible,disabled:b.locked,onChange:()=>o(b.key),"aria-label":`Toggle ${b.title} column`})})]},b.key)})})]})})})]})},Ul=({views:r,onApply:t,onDelete:o,onSave:n})=>{const[l,s]=h.useState(""),i=()=>{const c=l.trim();c&&(n(c),s(""))};return e.jsxs(z.Menu,{position:"bottom-right",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(F.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(z.MenuLists,{style:{width:"260px"},children:[e.jsx(z.MenuBody,{children:e.jsxs(f.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(m.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(f.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(m.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(c=>e.jsx(z.MenuItem,{startIcon:e.jsx(F.Icon,{name:"Bookmark"}),onClick:()=>t(c),endIcon:e.jsx(V.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Trash2"}),"aria-label":`Delete ${c.name}`,onClick:a=>{a.stopPropagation(),o(c.id)}}),children:c.name},c.id))})]})}),e.jsx(z.MenuFooter,{children:e.jsxs(f.Box,{direction:"row",gap:"xs",children:[e.jsx(f.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(gr.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:l,onChange:c=>s(c.target.value),onKeyDown:c=>{c.key==="Enter"&&i()}})}),e.jsx(V.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!l.trim(),onClick:i,children:"Save"})]})})]})]})},Vs=({isOpen:r,onClose:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:i,onReset:c,getValue:a,setValue:d,clearValue:g,removeFilter:b})=>{const p=n.length;return e.jsx(ut.Drawer,{position:"bottom",isShow:r,onHide:t,children:e.jsxs(f.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingInline:"md",paddingBlock:"sm",style:{borderBottom:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(m.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),p>0&&e.jsxs(m.Text,{fontSize:"sm",color:"subtle",children:["(",p,")"]})]}),e.jsx(V.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(f.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[p>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(m.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(f.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(ql,{activeKeys:n,configByKey:l,getValue:a,setValue:d,clearValue:g,removeFilter:b})})]}),o.length>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(m.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(f.Box,{direction:"column",children:o.map(C=>{const B=n.includes(C.key),x=!!C.locked;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:x?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[C.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:C.icon}),e.jsx(m.Text,{fontSize:"sm",color:"primary",truncate:!0,children:C.label})]}),e.jsx(_r.Toggle,{size:"sm",checked:B||x,disabled:x,onChange:()=>i(C.key),"aria-label":`Toggle ${C.label}`})]},C.key)})})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",gap:"sm",paddingInline:"md",paddingBlock:"sm",style:{borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsx(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!s,onClick:c,children:"Reset"})}),e.jsx(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(V.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},qs=r=>`${r} Rows`,Zs=({perPageKey:r,pageKey:t,pageSizeOptions:o,defaultPerPage:n=10,showPageSize:l})=>{const{searchQueries:s,setSearchParams:i,searchParams:c}=Ye(),a=c.get(r),d=a?Number(a):n,g=b=>{i({...s,[r]:b,[t]:"1"})};return l?e.jsxs(z.Menu,{position:"bottom-right",children:[e.jsx(z.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(z.MenuLists,{children:e.jsxs(z.MenuBody,{style:{minWidth:200},children:[e.jsx(f.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(m.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),o.map(b=>e.jsx(z.MenuItem,{selected:b===d,endIcon:b===d?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>g(String(b)),children:qs(b)},b))]})})]}):null},Gs=r=>{var ge;const{withPadding:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,toggleFilter:i,removeFilter:c,getValue:a,setValue:d,clearValue:g,onReset:b,searchable:p,searchKey:C,filterKey:B,pageKey:x,searchPlaceholder:W,searchShortcut:L,searchCollapsible:M,pagination:S,perPageKey:E,pageSizeOptions:A,defaultPerPage:T,showPagination:D,showResultCount:O,showPageSize:q,hasColumns:G,orderedColumns:_,allVisible:H,onToggleVisibility:R,onReorder:ee,onSetAllHidden:J,showSavedViews:K,savedViews:de,onApplyView:Q,onDeleteView:le,onSaveView:ue,leadingActions:De,trailingActions:Fe}=r,[Se,xe]=h.useState(!1),{searchQueries:ve,setSearchParams:He}=Ye(),Re=(S==null?void 0:S.rangeStart)??(((S==null?void 0:S.currentPage)||0)>1?(((S==null?void 0:S.currentPage)||0)-1)*((S==null?void 0:S.perPage)||0)+1:1),ze=(S==null?void 0:S.rangeEnd)??((S==null?void 0:S.totalCurrentPage)!==(S==null?void 0:S.perPage)?S==null?void 0:S.totalData:((S==null?void 0:S.currentPage)||1)*((S==null?void 0:S.totalCurrentPage)||0)),ae=se=>{He({...ve,[x]:String(se)})},we=O||D&&!!(S!=null&&S.totalPage),_e=()=>{b(),xe(!1)};return e.jsxs(f.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[p&&e.jsx(Gl,{searchKey:C,filterKey:B,pageKey:x,placeholder:W,shortcut:L,collapsible:M}),e.jsx(V.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),onClick:()=>xe(!0),"aria-label":"Open filters",children:s?`Filter: ${n.length}`:null}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[De,K&&e.jsx(Ul,{views:de,onApply:Q,onDelete:le,onSave:ue}),G&&e.jsx(Ql,{columns:_,allVisible:H,onToggle:R,onReorder:ee,onSetAllHidden:J}),e.jsx(Zs,{perPageKey:E,pageKey:x,pageSizeOptions:A,defaultPerPage:T,showPageSize:q}),Fe]})]}),we&&e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[O?e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Re}-${ze} of ${((ge=S==null?void 0:S.totalData)==null?void 0:ge.toLocaleString())||0}`}):e.jsx(f.Box,{direction:"column"}),D&&!!(S!=null&&S.totalPage)&&e.jsx(Xr.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:S!=null&&S.currentPage?Number(S.currentPage):1,totalPages:Number(S.totalPage),onPageChange:ae})]}),e.jsx(Vs,{isOpen:Se,onClose:()=>xe(!1),configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:i,onReset:_e,getValue:a,setValue:d,clearValue:g,removeFilter:c})]})},Qs=({withPadding:r=!1,filterConfigs:t=[],filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:s="perPage",pageSizeOptions:i=[25,50,100],defaultPerPage:c,showPagination:a=!0,showResultCount:d=!0,showPageSize:g=!0,searchable:b=!1,searchKey:p="q",searchPlaceholder:C="Search",searchShortcut:B="/",searchPosition:x="right",searchCollapsible:W=!0,pagination:L,columns:M=[],onColumnsChange:S,columnsState:E,scopeId:A,savedViews:T,persistLastState:D=!0,persistSearch:O=!0,storage:q=io,onReset:G,leadingActions:_,trailingActions:H})=>{const R=A??(T==null?void 0:T.scopeId),{activeKeys:ee,configByKey:J,hasActiveFilter:K,toggleFilter:de,removeFilter:Q,getValue:le,setValue:ue,clearValue:De,clearAll:Fe}=so({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:p}),Se=bs({columns:M,scopeId:R,storage:q,onColumnsChange:S,value:E}),xe=vs({scopeId:R,storage:q,snapshotKeys:[n,o,s],pageKey:l,getColumns:()=>Se.state,applyColumns:Se.applyState}),ve=ws({scopeId:R,storage:q,snapshotKeys:[n,o,l],enabled:D,filterKey:o,searchKey:p,persistSearch:O}),He=xs({scopeId:R,storage:q,perPageKey:s,pageSizeOptions:i,enabled:D});Ss({enabled:D&&!!R,snapshotKeys:[n,o,l],perPageKey:s,readSnapshot:ve.read,readPerPage:He.read});const Re=c??i[0]??25,ze=!!(T!=null&&T.enabled)&&xe.enabled,ae=()=>{Fe(),ve.clear(),G==null||G()},we=Ee.useMediaQuery("md"),_e=b?e.jsx(Gl,{searchKey:p,filterKey:o,pageKey:l,placeholder:C,shortcut:B,collapsible:W}):null;return we?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(ks,{configs:t,activeKeys:ee,onToggle:de,hasActiveFilter:K,onReset:ae}),x==="left"&&_e,e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(ql,{activeKeys:ee,configByKey:J,getValue:le,setValue:ue,clearValue:De,removeFilter:Q}),K&&e.jsx(V.Button,{variant:"link",tone:"brand",size:"sm",onClick:ae,children:"Reset"})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[_,e.jsx(Ps,{pagination:L,pageKey:l,perPageKey:s,pageSizeOptions:i,defaultPerPage:Re,showPagination:a,showResultCount:d,showPageSize:g}),x==="right"&&_e,ze&&e.jsx(Ul,{views:xe.views,onApply:xe.applyView,onDelete:xe.deleteView,onSave:xe.saveView}),M.length>0&&e.jsx(Ql,{columns:Se.orderedColumns,allVisible:Se.allVisible,onToggle:Se.toggleVisibility,onReorder:Se.reorder,onSetAllHidden:Se.setAllHidden}),H]})]}):e.jsx(Gs,{withPadding:r,configs:t,activeKeys:ee,configByKey:J,hasActiveFilter:K,toggleFilter:de,removeFilter:Q,getValue:le,setValue:ue,clearValue:De,onReset:ae,searchable:b,searchKey:p,filterKey:o,pageKey:l,searchPlaceholder:C,searchShortcut:B,searchCollapsible:W,pagination:L,perPageKey:s,pageSizeOptions:i,defaultPerPage:Re,showPagination:a,showResultCount:d,showPageSize:g,hasColumns:M.length>0,orderedColumns:Se.orderedColumns,allVisible:Se.allVisible,onToggleVisibility:Se.toggleVisibility,onReorder:Se.reorder,onSetAllHidden:Se.setAllHidden,showSavedViews:ze,savedViews:xe.views,onApplyView:xe.applyView,onDeleteView:xe.deleteView,onSaveView:xe.saveView,leadingActions:_,trailingActions:H})},Us=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r[0];return(t==null?void 0:t.value)!=null?String(t.value):void 0},Ys=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r.map(o=>(o==null?void 0:o.value)!=null?String(o.value):null).filter(o=>o!=null);return t.length?t:void 0},Xs=(r,t)=>{switch(r.type){case"dropdown":case"radio":return Us(t);case"dropdown-multiple":case"checkbox-multiple":return Ys(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;case"text":return typeof t=="string"&&t?t:void 0;default:return}},Yl=(r,t)=>{if(r==null||r==="")return t;const o=Number(r);return Number.isFinite(o)&&o>0?o:t},$s=r=>{const{filterConfigs:t,filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:s="perPage",searchKey:i="q",defaultPage:c=1,defaultPerPage:a=10,paramKeys:d,serialize:g}=r,{activeKeys:b,configByKey:p,hasActiveFilter:C,getValue:B}=so({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:i}),{searchParams:x}=Ye(),W=x.toString();return h.useMemo(()=>{const M={},S={},E=Yl(x.get(l),c),A=Yl(x.get(s),a);M[(d==null?void 0:d.page)??"page"]=E,M[(d==null?void 0:d.perPage)??"perPage"]=A;const T=vt(i,x,o)||"";T&&(M[(d==null?void 0:d.search)??"search"]=T);let D=!1;for(const O of b){const q=p[O];if(!q)continue;const G=B(q);S[O]=G;const _=g==null?void 0:g[O],H=_?_(G):Xs(q,G);if(H==null||Array.isArray(H)&&H.length===0)continue;const R=(d==null?void 0:d[O])??O;M[R]=H,D=!0}return{params:M,raw:S,hasActiveFilter:C||!!T||D}},[W,b.join("|"),o,n,l,s,i,c,a,d,g,p])},Js=["dropdown","dropdown-multiple","checkbox-multiple","radio"],Ks=({filterConfigs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l})=>{const{configByKey:s,getValue:i,setValue:c,removeFilter:a,clearAll:d,hasActiveFilter:g}=so({configs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l}),b=(S,E)=>{var T;const A=S.options;return((T=A==null?void 0:A.find(D=>D.value===E))==null?void 0:T.label)??E},p=h.useCallback(S=>{const E=s[S];if(!E)return[];const A=i(E);return Array.isArray(A)?A.map(T=>String(T.value)):[]},[s,i]),C=h.useCallback((S,E)=>{const A=s[S];if(!A||!Js.includes(A.type))return;const T=Array.isArray(E)?E:[E];if(T.length===0){a(S);return}c(A,T.map(D=>({label:b(A,D),value:D})))},[s,c,a]),B=h.useCallback((S,E)=>{const A=p(S);C(S,A.includes(E)?A.filter(T=>T!==E):[...A,E])},[p,C]),x=h.useCallback((S,E)=>p(S).includes(E),[p]),W=h.useCallback(S=>a(S),[a]),L=h.useCallback(S=>{const E=s[S];return E?i(E):void 0},[s,i]),M=h.useCallback((S,E)=>{const A=s[S];if(A){if(E==null){a(S);return}c(A,E)}},[s,c,a]);return{set:C,toggle:B,clear:W,clearAll:d,isActive:x,values:p,getRaw:L,setRaw:M,hasActiveFilter:g}},go="var(--sa-background-brand, #04254f)",Rs="var(--sa-text-brand, #031f43)",ei={padding:"6px 8px",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-xs, 4px)",font:"inherit",fontSize:13,outline:"none",width:"100%",boxSizing:"border-box"},yo={padding:"4px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",fontSize:13,color:Rs},Xl=(r,t)=>{if(r.type==="text"||r.type==="date")return!!t.getRaw(r.key);if(r.type==="date-compact"){const o=t.getRaw(r.key);return!!(o&&(o.date||o.from||o.to||o.relative||o.op==="is-empty"||o.op==="is-not-empty"))}return t.values(r.key).length>0},ri=({field:r,controls:t})=>{const[o,n]=h.useState(""),l=r.type==="dropdown"||r.type==="radio",s=r.type==="checkbox-multiple"?!1:r.searchable!==!1,i=t.values(r.key),c=s&&o.trim()?r.options.filter(d=>d.label.toLowerCase().includes(o.toLowerCase())):r.options,a=d=>{l?t.set(r.key,i.includes(d)?[]:d):t.toggle(r.key,d)};return e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:4,minWidth:200},children:[s&&e.jsx("input",{value:o,onChange:d=>{var g;n(d.target.value),(g=r.onSearch)==null||g.call(r,d.target.value)},placeholder:"Cari…",style:ei}),e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:220,overflowY:"auto"},children:[c.map(d=>{const g=i.includes(d.value);return e.jsxs("button",{type:"button",onClick:()=>a(d.value),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",borderRadius:"var(--sa-radii-xs, 4px)"},children:[e.jsx("span",{style:{width:16,height:16,flexShrink:0,borderRadius:l?"50%":"var(--sa-radii-xs, 4px)",display:"inline-flex",alignItems:"center",justifyContent:"center",border:`1px solid ${g?go:"var(--sa-border-subtle, #0b120e24)"}`,background:g&&!l?go:"transparent"},children:g&&(l?e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:go}}):e.jsx(F.Icon,{name:"Check",size:"xs",style:{color:"#fff"}}))}),e.jsx(m.Text,{as:"span",style:{fontSize:14},children:d.label})]},d.value)}),c.length===0&&e.jsx(m.Text,{as:"span",style:{fontSize:13,color:"var(--sa-text-subtlest, #8c8f97)",padding:"6px 8px"},children:"Tak ada hasil"})]}),i.length>0&&e.jsx("button",{type:"button",onClick:()=>t.clear(r.key),style:yo,children:"Clear"})]})},ti=({field:r,controls:t})=>{const o=t.getRaw(r.key);return e.jsx(f.Box,{style:{minWidth:240},children:e.jsx(Sr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:o,onChange:n=>t.setRaw(r.key,n??null),withPadding:!1})})},oi=({field:r,controls:t})=>{const o=t.getRaw(r.key),n=r.ops&&r.ops.length>0?r.ops:zl,l=r.defaultOp&&n.includes(r.defaultOp)?r.defaultOp:n[0],s=r.mode??"days",i=(o==null?void 0:o.op)??l,c=d=>t.setRaw(r.key,d),a=d=>{if(d!==i)return c(d==="is-empty"||d==="is-not-empty"?{op:d}:d==="is-relative-to-today"?{op:d,relative:(o==null?void 0:o.relative)??{direction:"past",count:1,period:"week"}}:d==="is-between"?{op:d,from:o==null?void 0:o.from,to:o==null?void 0:o.to}:{op:d,date:o==null?void 0:o.date})};return e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:6,minWidth:280},children:[e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Hl,{op:i,ops:n,onChange:a})]}),e.jsx(_l,{value:o,op:i,mode:s,onChange:c}),Xl(r,t)&&e.jsx("button",{type:"button",onClick:()=>t.setRaw(r.key,null),style:yo,children:"Clear"})]})},li=({field:r,controls:t})=>{const o=t.getRaw(r.key)??"",[n,l]=h.useState(o),s=Ee.useDebounce(n,r.debounceMs??300);return h.useEffect(()=>{const i=t.getRaw(r.key)??"";s!==i&&t.setRaw(r.key,s||null)},[s]),e.jsxs(f.Box,{style:{display:"flex",flexDirection:"column",gap:6,minWidth:220},children:[e.jsx(gr.Input,{size:"sm",fullWidth:!0,value:n,placeholder:r.placeholder??"Cari…",leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:i=>l(i.target.value)}),n&&e.jsx("button",{type:"button",onClick:()=>{l(""),t.setRaw(r.key,null)},style:yo,children:"Clear"})]})},ni=({field:r,controls:t})=>r.type==="text"?e.jsx(li,{field:r,controls:t}):r.type==="date"?e.jsx(ti,{field:r,controls:t}):r.type==="date-compact"?e.jsx(oi,{field:r,controls:t}):e.jsx(ri,{field:r,controls:t}),si=(r,t)=>{if(!r)return{};const{fromKey:o,toKey:n,opKey:l}=t,s={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(s[o]=new Date(r.date).toISOString()),l&&(s[l]=r.op),s;case"is-between":return r.from&&(s[o]=new Date(r.from).toISOString()),r.to&&(s[n]=new Date(r.to).toISOString()),s;case"is-relative-to-today":{if(!r.relative)return s;const{from:i,to:c}=Ml(r.relative);return s[o]=i.toISOString(),s[n]=c.toISOString(),s}case"is-empty":case"is-not-empty":return l&&(s[l]=r.op==="is-empty"?"empty":"not-empty"),s;default:return s}},$l=({children:r,borderRadius:t,height:o})=>{const n=h.useRef(null),[l,s]=h.useState("100vh");return h.useEffect(()=>{if(o)return;const i=()=>{if(n.current){const c=n.current.getBoundingClientRect().top;s(`calc(100vh - ${c}px)`)}};return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[o]),e.jsx(f.Box,{ref:n,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:t||"rounded-xs",style:{height:o??l,display:"flex",flexDirection:"column"},children:r})},Jl=({action:r,rightContent:t,leftContent:o,headerSlot:n,advanceFilter:l,showFilter:s=!0})=>{const i=Ee.useMediaQuery("md"),c=s?e.jsx(Il,{...l}):null,a=()=>r?h.isValidElement(r)?r:e.jsx(f.Box,{style:{display:"flex",flexDirection:i?"row":"column",gap:"8px",width:i?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:d,icon:g,buttonProps:b,onClick:p},C)=>!d&&!g?null:e.jsx(V.Button,{fullWidth:!i,iconLeft:g?e.jsx(F.Icon,{name:g}):void 0,onClick:p,...b,children:d},`action-${C}`))}):null;return e.jsx(f.Box,{style:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center",paddingLeft:"8px",paddingRight:"8px",paddingTop:"8px",paddingBottom:"8px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0,position:"relative",zIndex:10,flexDirection:i?"row":"column-reverse",gap:"16px"},children:n?n({filter:c}):e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[c,o]}),e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},ii=({totalData:r,withMarginBottom:t=!0,withMarginTop:o=!0})=>e.jsxs(f.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:o?"16px":void 0},children:[e.jsxs(nr.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(nr.Body1,{children:r||0})]}),Kl=({pagination:r,pageKey:t="page",perPageKey:o="perPage",defaultPerPage:n=10,showPagination:l=!0,totalData:s})=>{const{searchQueries:i,setSearchParams:c,searchParams:a}=Ye(),d=a.get(o),g=B=>{c({...i,[t]:String(B)})},b=B=>{c({...i,[o]:B,[t]:"1"})},p=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),C=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsx(f.Box,{style:{display:"flex",width:"100%",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0},children:l?e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(m.Text,{children:"Rows Per Page: "}),e.jsx(Wr.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:B=>{b(B[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(m.Text,{children:`${p}-${C} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(Xr.Pagination,{currentPage:r!=null&&r.currentPage?Number(r==null?void 0:r.currentPage):1,totalPages:r!=null&&r.totalPage?Number(r==null?void 0:r.totalPage):1,onPageChange:g})]}):e.jsx(ii,{totalData:s,withMarginBottom:!1,withMarginTop:!1})})},Rl=({filter:r,columnTitle:t})=>{const[o,n]=h.useState(!1),l=h.useRef(null),s=h.useRef(null),i=h.useRef(null),[c,a]=h.useState(""),[d,g]=h.useState({top:0,left:0}),b=r.selectedValues,p=h.useMemo(()=>c?r.options.filter(x=>x.label.toLowerCase().includes(c.toLowerCase())):r.options,[r.options,c]);h.useEffect(()=>{if(o&&s.current){const x=s.current.getBoundingClientRect(),W=280,L={top:x.bottom+8};r.position==="left"||x.left+W>window.innerWidth?L.right=window.innerWidth-x.right:L.left=x.left,g(L)}},[o,r.position]),h.useEffect(()=>{o&&i.current?setTimeout(()=>{var x;return(x=i.current)==null?void 0:x.focus()},50):a("")},[o]),h.useEffect(()=>{const x=W=>{l.current&&!l.current.contains(W.target)&&s.current&&!s.current.contains(W.target)&&n(!1)};return o&&document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]);const C=x=>{const W=b.includes(x)?b.filter(L=>L!==x):[...b,x];r.onFilterChange(W)},B=()=>r.onFilterChange([]);return e.jsxs(f.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(f.Box,{ref:s,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:x=>{var W;x.stopPropagation(),o||(W=r.onOpen)==null||W.call(r),n(L=>!L)},children:e.jsx(F.Icon,{name:o?"ChevronUp":"ChevronDown",size:"sm",style:{color:b.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),o&&e.jsxs(f.Box,{ref:l,style:{position:"fixed",top:`${d.top}px`,...d.left!==void 0?{left:`${d.left}px`}:{right:`${d.right}px`},backgroundColor:"white",borderRadius:"var(--sa-radii-xs, 4px)",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(m.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),b.length>0&&e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(m.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:x=>{x.stopPropagation(),B()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(f.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(gr.Input,{ref:i,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(F.Icon,{name:"Search",size:"sm"}),value:c,onChange:x=>a(x.target.value),style:{fontSize:"14px"}})}),e.jsx(f.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:r.isLoadingOptions?e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(F.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(m.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):p.length>0?e.jsx(f.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:p.map(x=>e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"var(--sa-radii-md, 8px)",transition:"all 0.2s ease",backgroundColor:b.includes(x.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:W=>{W.stopPropagation(),C(x.value)},onMouseEnter:W=>{b.includes(x.value)||(W.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),W.currentTarget.style.transform="translateX(2px)"},onMouseLeave:W=>{W.currentTarget.style.backgroundColor=b.includes(x.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",W.currentTarget.style.transform="translateX(0)"},children:[e.jsx(yr.Checkbox,{checked:b.includes(x.value),onChange:()=>{}}),e.jsx(m.Text,{fontSize:"sm",fontWeight:b.includes(x.value)?"medium":"normal",color:b.includes(x.value)?"primary":"gray-700",children:x.label})]},x.value))}):e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(F.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(m.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),b.length>0&&e.jsx(f.Box,{direction:"column",style:{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",backgroundColor:"var(--sa-color-brand-50, #e6edf6)",marginTop:"auto"},children:e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(f.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"var(--sa-radii-lg, 12px)",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:b.length}),e.jsxs(m.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",b.length>1?"s":""," selected"]})]})})]})]})},ci=({direction:r})=>{const t="var(--sa-text-primary, #292a2e)",o="var(--sa-text-subtle, #8c8f97)",n=r==="asc"?t:o,l=r==="desc"?t:o,s=r==="asc"?1:.45,i=r==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:n,opacity:s,marginBottom:1},children:e.jsx("path",{d:"M4 0 L8 5 L0 5 Z",fill:"currentColor"})}),e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:l,opacity:i},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},ai=({frozen:r})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:r?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),po="var(--sa-background-primary, #ffffff)",en="var(--sa-background-primary-inverse, #f8f8f8)",rn=({columns:r,records:t,handleDetail:o,handleUpdate:n,handleDelete:l,isLoading:s,visibleHandleDelete:i,visibleHandleUpdate:c,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:g,frozenCount:b=0,onFrozenCountChange:p,customActions:C,actionsOrder:B=["detail","update","delete","custom"],customEmptyState:x,enableColumnResize:W=!1,defaultColumnWidths:L,onColumnWidthsChange:M,defaultMinColumnWidth:S=60,sort:E,defaultSort:A,onSortChange:T,showActionDivider:D=!1})=>{const O=E!==void 0,[q,G]=h.useState(A??null),_=O?E??null:q,H=P=>{if(P.sortKey)return P.sortKey;if(typeof P.accessor=="string")return P.accessor},R=P=>{const $=H(P);if(!$)return;let Y;!_||_.key!==$?Y={key:$,direction:"asc"}:_.direction==="asc"?Y={key:$,direction:"desc"}:Y=null,O||G(Y),T==null||T(Y)},J=[o,n,l].filter(P=>P!==void 0).length,K=!!C,de=!!o||!!n||!!l||K,Q="var(--sa-border-subtle, #0b120e24)",le=`1px solid ${Q}`,ue=`inset 1px 0 0 ${Q}`,De=`inset -1px 0 0 ${Q}`,Fe=J===3?K?"178px":"140px":J===2?K?"140px":"102px":J===1?K?"112px":"74px":K?"74px":"",Se=(P,$)=>{if(!$)return P;if(typeof $=="function")return $(P);if(typeof $=="string")return P[$]},[xe,ve]=h.useState(!1);h.useEffect(()=>{if(!(g!=null&&g.current))return;const P=g.current;ve(P.scrollHeight>P.clientHeight)},[t,g]);const He=h.useRef(null),[Re,ze]=h.useState([]),[ae,we]=h.useState(()=>L??{}),_e=h.useRef(null);h.useLayoutEffect(()=>{if(!b||!He.current){ze([]);return}const P=Array.from(He.current.querySelectorAll("thead tr th")),$=[];let Y=0;P.forEach((ye,Le)=>{$[Le]=Y,Le<b&&(Y+=ye.offsetWidth)}),ze($)},[b,r,t,ae]);const ge=P=>{p&&p(P<b?P:P+1)},se=(P,$)=>{const Y=ae[P];if(Y!==void 0){const ye=`${Y}px`;return{width:ye,minWidth:ye,maxWidth:ye}}return $?{width:$}:{}},qe=P=>W&&(P.resizable??!0),Ze=(P,$)=>{P.preventDefault(),P.stopPropagation();const Y=P.currentTarget.closest("th");if(!Y)return;const ye=Math.round(Y.getBoundingClientRect().width);_e.current={colIndex:$,startX:P.clientX,startWidth:ye};const Le=document.body.style.userSelect,Ce=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Pe=Ge=>{var Ie;const Qe=_e.current;if(!Qe)return;const kr=((Ie=r[Qe.colIndex])==null?void 0:Ie.minWidth)??S,Xe=Math.max(kr,Qe.startWidth+(Ge.clientX-Qe.startX));we(Ne=>Ne[Qe.colIndex]===Xe?Ne:{...Ne,[Qe.colIndex]:Xe})},sr=()=>{document.removeEventListener("mousemove",Pe),document.removeEventListener("mouseup",sr),document.body.style.userSelect=Le,document.body.style.cursor=Ce,_e.current=null,M&&we(Ge=>(M(Ge),Ge))};document.addEventListener("mousemove",Pe),document.addEventListener("mouseup",sr)};return e.jsx("div",{ref:He,children:e.jsxs(U.Table,{fullWidth:!0,children:[e.jsx(U.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(U.Tr,{children:[r.map((P,$)=>{var Er,pr;const Y=b>0&&$<b,ye=Re[$]??0,Le=qe(P),Pe=$===r.length-1&&de&&D,sr=H(P),Ge=!!P.sortable&&!!sr,Qe=Ge&&(_==null?void 0:_.key)===sr?_.direction:null,kr=P.title||((Er=P.accessor)==null?void 0:Er.toString())||"",Xe=(pr=P.headerTooltip)!=null&&pr.showIcon?e.jsx(F.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Ie=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:kr}),Ne=Ge?e.jsxs("button",{type:"button",onClick:()=>R(P),title:Qe==="asc"?"Sorted ascending — click to sort descending":Qe==="desc"?"Sorted descending — click to clear":"Click to sort ascending",style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4,background:"none",border:"none",padding:0,margin:0,font:"inherit",color:"inherit",cursor:"pointer",textAlign:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left"},children:[Ie,Xe,e.jsx(ci,{direction:Qe})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Ie,Xe]});return e.jsxs(U.Th,{style:{position:"sticky",top:0,left:Y?ye:void 0,zIndex:Y?4:2,paddingLeft:$===0?"12px":"",borderRight:d&&!Pe&&!Y?le:void 0,borderBottom:d?le:void 0,boxShadow:d&&Y?De:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left",...se($,P.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[P.headerTooltip?e.jsx(Ae.Tooltip,{label:P.headerTooltip.content,position:"bottom",children:Ne}):Ne,P.filter&&e.jsx(Rl,{filter:P.filter,columnTitle:P.title}),p&&e.jsx("button",{onClick:()=>ge($),title:Y?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:Y?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:Y?1:.45,transition:"opacity 0.15s"},children:e.jsx(ai,{frozen:Y})})]}),Le&&e.jsx("div",{onMouseDown:Fr=>Ze(Fr,$),onClick:Fr=>Fr.stopPropagation(),role:"separator","aria-orientation":"vertical",title:"Drag to resize",style:{position:"absolute",top:0,right:-3,width:6,height:"100%",cursor:"col-resize",userSelect:"none",zIndex:5,touchAction:"none"}})]},`table-head-${$}`)}),de?e.jsx(U.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?le:void 0,boxShadow:d&&D?ue:void 0}}):null]})}),e.jsx(U.Tbody,{children:s?e.jsx(U.Tr,{children:e.jsx(U.Td,{colSpan:r.length+1,children:e.jsxs(f.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(lr.Skeleton,{variant:"list"}),e.jsx(lr.Skeleton,{variant:"list"}),e.jsx(lr.Skeleton,{variant:"list"}),e.jsx(lr.Skeleton,{variant:"list"}),e.jsx(lr.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&x?e.jsx(U.Tr,{children:e.jsx(U.Td,{colSpan:r.length+1,children:x})}):t==null?void 0:t.map((P,$)=>e.jsxs(U.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:$===t.length-1&&xe?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:Y=>{const ye=Y.currentTarget;ye.style.backgroundColor=en,Array.from(ye.querySelectorAll("td")).forEach(Le=>{Le.style.position==="sticky"&&(Le.style.backgroundColor=en)})},onMouseLeave:Y=>{const ye=Y.currentTarget;ye.style.backgroundColor="",Array.from(ye.querySelectorAll("td")).forEach(Le=>{Le.style.position==="sticky"&&(Le.style.backgroundColor=po)})},children:[r.map((Y,ye)=>{const Le=Y.render?Y.render(P,$,t):Se(P,Y.accessor),Ce=b>0&&ye<b,Pe=Re[ye]??0,sr=ae[ye]!==void 0,Ge=Ce&&ye===b-1;return e.jsx(U.Td,{style:{position:Ce?"sticky":void 0,left:Ce?Pe:void 0,zIndex:Ce?1:void 0,backgroundColor:Ce?po:void 0,transition:Ce?"background-color 0.3s ease":void 0,paddingLeft:ye===0?"12px":"",whiteSpace:"nowrap",overflow:sr?"hidden":void 0,borderLeft:Y.showBorderLeft?le:void 0,borderRight:Y.showBorderRight?le:void 0,boxShadow:Ge?De:void 0,textAlign:Y.textAlign==="text-right"?"right":Y.textAlign==="text-center"?"center":"left",...se(ye,Y.width)},children:typeof Le=="string"?e.jsx(m.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Y.textAlign==="text-right"?"right":Y.textAlign==="text-center"?"center":"left"},children:Le}):Le},`row-${$}-col-${ye}`)}),de?e.jsx(U.Td,{style:{width:Fe,position:"sticky",right:0,zIndex:1,backgroundColor:po,boxShadow:D?ue:void 0,transition:"background-color 0.3s ease"},children:e.jsx(he.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:B.map(Y=>{const ye=$===t.length-1?"top":"bottom";return Y==="detail"&&o&&(a==null?void 0:a(P))!==!1?e.jsx(Ae.Tooltip,{label:"Detail",position:ye,children:e.jsx(V.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(P.id,P),iconLeft:e.jsx(F.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):Y==="update"&&n&&(c==null?void 0:c(P))!==!1?e.jsx(Ae.Tooltip,{label:"Update",position:ye,children:e.jsx(V.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(P),iconLeft:e.jsx(F.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):Y==="delete"&&l&&(i==null?void 0:i(P))!==!1?e.jsx(Ae.Tooltip,{label:"Delete",position:ye,children:e.jsx(V.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(P.id,P),iconLeft:e.jsx(F.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):Y==="custom"?e.jsx(h.Fragment,{children:C==null?void 0:C(P)},"custom"):null})})}):null]},`${P}${$}`))})]})})};let tn=!1;const di=({wrapperProps:r,dataTableProps:t,headerProps:o,footerProps:n})=>{var b;process.env.NODE_ENV!=="production"&&!tn&&(tn=!0,console.warn("[@starasia/admin] `TableSection` deprecated — pakai `<FilterBar>` + `<TableLayout>`. Lihat skill `starasia-list-page-pattern`. Akan dihapus di salah satu major berikutnya."));const l=h.useRef(null),[s,i]=h.useState((t==null?void 0:t.defaultFrozenCount)??0),c=(o==null?void 0:o.show)??!0,a=h.useRef(null),d=(b=t==null?void 0:t.pagination)==null?void 0:b.totalData;typeof d=="number"&&(a.current=d);const g=(n==null?void 0:n.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs($l,{...r,children:[c&&e.jsx(Jl,{...o}),e.jsx(f.Box,{direction:"column",ref:l,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(rn,{...t,scrollParentRef:l,frozenCount:t!=null&&t.enableFreezeColumns?s:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?i:void 0}):null}),g&&e.jsx(Kl,{pagination:t==null?void 0:t.pagination,pageKey:t==null?void 0:t.pageKey,perPageKey:t==null?void 0:t.perPageKey,defaultPerPage:t==null?void 0:t.defaultPerPage,showPagination:t==null?void 0:t.showPagination,totalData:n==null?void 0:n.totalData})]})};function hi(r){return h.memo(r)}const fi=hi(di),on="(any-pointer: coarse)",ui=r=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const t=window.matchMedia(on);return t.addEventListener("change",r),()=>t.removeEventListener("change",r)},gi=()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(on).matches,yi=()=>!1;function ln(){return h.useSyncExternalStore(ui,gi,yi)}const nn=200,xt="1px solid var(--sa-border-subtle, #0b120e24)",pi=({sortDir:r,frozen:t,filterActive:o})=>r==="asc"?e.jsx(F.Icon,{name:"ChevronSmallUp"}):r==="desc"?e.jsx(F.Icon,{name:"ChevronSmallDown"}):t?e.jsx(F.Icon,{name:"LockOn",size:"xs"}):e.jsx(F.Icon,{name:"Filter",size:"xs",style:o?{color:"var(--sa-text-brand, #031f43)"}:void 0}),Dt=({icon:r,label:t,active:o,danger:n,onClick:l})=>{const s=n?"var(--sa-text-error, #a4133c)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:l,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:o?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:s,textAlign:"left"},onMouseEnter:i=>{o||(i.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:i=>{i.currentTarget.style.background=o?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(F.Icon,{name:r,size:"sm",style:{color:s,flexShrink:0}}),e.jsx(m.Text,{as:"span",style:{color:s},children:t})]})},bi=r=>{let t=(r==null?void 0:r.parentElement)??null;for(;t;){const o=getComputedStyle(t).overflowX;if((o==="auto"||o==="scroll")&&t.scrollWidth>t.clientWidth)return t;t=t.parentElement}return null},sn=({active:r,canSort:t,canHide:o,sortDir:n,frozen:l,onSort:s,onClearSort:i,onToggleFreeze:c,onHide:a,filterSlot:d,filterActive:g})=>{const[b,p]=h.useState(!1),C=h.useRef(null),B=h.useRef(null),[x,W]=h.useState({top:0,left:0}),L=h.useCallback(()=>{var _;const S=C.current;if(!S)return;const E=S.getBoundingClientRect(),A=S.closest(".sa-tl-scroll")??bi(S),T=A==null?void 0:A.getBoundingClientRect();if(T&&(E.left<T.left||E.left>T.right)){p(!1);return}const D=Math.min(window.innerWidth-8,T?T.right:window.innerWidth),O=((_=B.current)==null?void 0:_.offsetWidth)||nn,q=T?T.left:8,G=Math.max(q,Math.min(E.left,D-O));W({top:E.bottom+6,left:G})},[]);h.useEffect(()=>{if(!b)return;L();const S=()=>L();return window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),()=>{window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S)}},[b,L]),h.useEffect(()=>{if(!b)return;const S=E=>{B.current&&!B.current.contains(E.target)&&C.current&&!C.current.contains(E.target)&&p(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[b]);const M=S=>{S(),p(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:C,type:"button",className:"sa-tl-menu-trigger","data-active":r||b?"true":"false",onClick:S=>{S.stopPropagation(),p(E=>!E)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:xt,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(pi,{sortDir:n,frozen:l,filterActive:g})}),b&&e.jsxs(f.Box,{ref:B,onClick:S=>S.stopPropagation(),style:{position:"fixed",top:`${x.top}px`,...x.left!==void 0?{left:`${x.left}px`}:{right:`${x.right}px`},minWidth:nn,backgroundColor:"var(--sa-background-primary, #ffffff)",border:xt,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-xl, 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[d!=null&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:"6px 12px 2px"},children:e.jsx(m.Text,{as:"span",style:{fontSize:12,fontWeight:500,color:"var(--sa-text-subtlest, #8c8f97)"},children:"Filter"})}),e.jsx("div",{style:{padding:"2px 8px 4px"},children:d}),e.jsx("div",{style:{borderTop:xt,margin:"4px 0"}})]}),t&&e.jsxs(e.Fragment,{children:[e.jsx(Dt,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>M(()=>n==="asc"?i():s("asc"))}),e.jsx(Dt,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>M(()=>n==="desc"?i():s("desc"))}),e.jsx("div",{style:{borderTop:xt,margin:"4px 0"}})]}),e.jsx(Dt,{icon:"Pin1",label:l?"Unfreeze":"Freeze",active:l,onClick:()=>M(c)}),o&&e.jsx(Dt,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>M(a)})]})]})},vi=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ci={background:"var(--sa-background-warning-subtlest, #fef2e6)",color:"inherit",padding:0,borderRadius:"min(2px, var(--sa-radii-xs, 4px))"},cn=({text:r,query:t,markStyle:o})=>{const n=t==null?void 0:t.trim();if(!n||!r)return e.jsx(e.Fragment,{children:r});const l=n.split(/\s+/).filter(Boolean);if(!l.length)return e.jsx(e.Fragment,{children:r});const s=new Set(l.map(a=>a.toLowerCase())),i=new RegExp(`(${l.map(vi).join("|")})`,"gi"),c=r.split(i);return e.jsx(e.Fragment,{children:c.map((a,d)=>a&&s.has(a.toLowerCase())?e.jsx("mark",{style:{...Ci,...o},children:a},d):e.jsx(h.Fragment,{children:a},d))})},rt="1px solid var(--sa-border-subtle, #0b120e24)",wi="var(--sa-text-subtle, #8c8f97)",Nr="var(--sa-background-neutral, #f0f1f2)",an="2px 0 4px -2px var(--sa-border-subtle, #0b120e24)",tt=40,bo=5,xi=28,vo=4,St=16,Co="var(--sa-background-brand-subtlest)",kt={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},dn="sa-table-layout-styles",Di=()=>{if(typeof document>"u"||document.getElementById(dn))return;const r=document.createElement("style");r.id=dn,r.textContent=`@layer starasia.components {
2
2
  .sa-table-layout tbody td {
3
3
  transition: background-color 0.15s ease;
4
4
  background-color: var(--sa-tl-bg, transparent);
@@ -49,8 +49,8 @@
49
49
  .sa-table-layout tfoot.sa-tl-sticky-foot > tr:first-child > th {
50
50
  box-shadow: 0 -2px 4px -2px var(--sa-border-subtle, #0b120e24);
51
51
  }
52
- }`,document.head.appendChild(r)},Gr=r=>r==="right"?"right":r==="center"?"center":"left",hi=/^(#|rgb|hsl|var\()/,dt=r=>r?hi.test(r)?r:`var(--sa-background-${r})`:void 0,fi=(r,t)=>{if(t)return r[t]},ui=(r,t)=>r==null&&t==null?0:r==null?-1:t==null?1:typeof r=="number"&&typeof t=="number"?r-t:String(r).localeCompare(String(t)),gi=({columns:r,data:t,getRowKey:o,rowBg:n,size:l="md",resizable:s=!1,layout:i="auto",widthStorageKey:c,columnState:a,onColumnStateChange:d,columnMenu:g=!1,highlight:b,sort:p,defaultSort:C,onSortChange:w,height:S,mobileLayout:H="cards",mobileBreakpoint:T="md",groupSeparator:A,summary:x,footer:B,stickyFooter:W=!1,emptyState:F,loading:m=!1,loadingRows:O=8,rowActions:N,rowActionsMode:$="auto",selectable:M=!1,selectedKeys:q,defaultSelectedKeys:J,onSelectionChange:U,isRowSelectable:K})=>{di();const ae=!ke.useMediaQuery(T)&&H!=="scroll",Q=!!(N!=null&&N.length),re=Ul(),he=Q&&($==="column"||$==="auto"&&re),ve=Math.min((N==null?void 0:N.length)??0,so+1),Me=ve>so?1:ve,Ie=ct*2+Me*ai+Math.max(0,Me-1)*io,Ce=he?Ie:1,[ye,Ze]=h.useState(null);h.useEffect(()=>{if(!ye)return;const v=()=>Ze(null),D=setTimeout(()=>document.addEventListener("click",v),0);return()=>{clearTimeout(D),document.removeEventListener("click",v)}},[ye]);const[ze,Ge]=h.useState(()=>new Set),ne=a!==void 0,[me,we]=h.useState({}),oe=a??me,Fe=v=>{d==null||d(v),ne||we(v)},Ke=p!==void 0,[or,P]=h.useState(C??null),Y=Ke?p??null:or,X=!w,fe=v=>{w==null||w(v),Ke||P(v)},{headerGroups:Le,leafColumns:pe,hasGroups:Pe}=h.useMemo(()=>{var se;const v=new Set(oe.hidden??[]),D=(le,De)=>le.key??(typeof le.accessor=="string"?le.accessor:`col-${De}`),L=r.map((le,De)=>{var er;if((er=le.children)!=null&&er.length){const Xr=le.children.map((dr,Hr)=>({col:dr,key:D(dr,`${De}-${Hr}`)})).filter(dr=>!v.has(dr.key));return{col:le,key:le.key??`group-${De}`,isGroup:!0,leaves:Xr}}const Se={col:le,key:D(le,`${De}`)};return{col:le,key:Se.key,isGroup:!1,leaves:v.has(Se.key)?[]:[Se]}}).filter(le=>le.leaves.length>0),V=L.some(le=>le.isGroup);let te=L.flatMap(le=>le.leaves);if(!V&&((se=oe.order)!=null&&se.length)){const le=new Map(oe.order.map((De,Se)=>[De,Se]));te=[...te].sort((De,Se)=>(le.get(De.key)??1/0)-(le.get(Se.key)??1/0))}return{headerGroups:L,leafColumns:te,hasGroups:V}},[r,oe]),Re=h.useMemo(()=>new Map(pe.map((v,D)=>[v.key,D])),[pe]),Ye=!Pe&&pe.some(v=>(v.col.headerColSpan??1)>1),_e=pe.map(v=>v.key).join("|"),Xe=(v,D)=>{const L=v.sortKey??(typeof v.accessor=="string"?v.accessor:void 0);return L?D[L]:void 0},vr=v=>v.sortable??(!!v.sortKey||typeof v.accessor=="string"),Ee=h.useMemo(()=>{if(!X||!Y)return t;const v=pe.find(L=>L.key===Y.key);if(!v)return t;const D=Y.direction==="asc"?1:-1;return[...t].sort((L,V)=>ui(Xe(v.col,L),Xe(v.col,V))*D)},[t,X,Y,pe]),je=!Pe&&!Ye,ur=!!c&&je,[Ar,lr]=G.useColumnWidths(c??""),Dr=ur?Ar:void 0,Cr=h.useRef(null),[Ne,Ct]=h.useState();h.useLayoutEffect(()=>{Ct(void 0)},[_e]),h.useLayoutEffect(()=>{if(!je||Ne||!Cr.current)return;const v=Cr.current.querySelectorAll("th.sa-tl-leaf");Ct(Array.from(v).map(D=>D.offsetWidth))},[Ne,je]);const[wt,Qe]=h.useState(),[xt,Dt]=h.useState(0);h.useLayoutEffect(()=>{if(!Pe||!Cr.current)return;const v=Cr.current.querySelector(":scope > tr");v&&Dt(v.offsetHeight)},[Pe,_e]);const Or=(v,D)=>{if((Dr==null?void 0:Dr[D])!=null)return Dr[D];if(v.width!=null)return v.width;if((Ne==null?void 0:Ne[D])!=null)return Ne[D]},yo=(v,D)=>typeof v.width=="number"?v.width:Ne==null?void 0:Ne[D],kr=oe.frozenKey&&!Pe&&!Ye?pe.findIndex(v=>v.key===oe.frozenKey):-1,St=v=>v<=kr,Wr=M?Zr:0,Ur=v=>{const D=wt??Ne;if(!D)return Wr;let L=Wr;for(let V=0;V<v;V++)L+=D[V]??0;return L};h.useLayoutEffect(()=>{const v=Cr.current;if(!v||kr<0){Qe(void 0);return}let D=0;const L=()=>{D=0;const te=v.querySelectorAll("th.sa-tl-leaf"),se=Array.from(te).map(le=>le.getBoundingClientRect().width);Qe(le=>le&&le.length===se.length&&le.every((De,Se)=>Math.abs(De-se[Se])<.5)?le:se)},V=new ResizeObserver(()=>{D||(D=requestAnimationFrame(L))});return V.observe(v),v.querySelectorAll("th.sa-tl-leaf").forEach(te=>V.observe(te)),L(),()=>{D&&cancelAnimationFrame(D),V.disconnect()}},[_e,kr,M,Ne,Dr]);const zr=h.useRef(null),[kt,E]=h.useState("100vh");h.useLayoutEffect(()=>{if(S!==void 0)return;const v=()=>{if(zr.current){const D=zr.current.getBoundingClientRect().top;E(`calc(100vh - ${D}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[S]);const j=(v,D)=>o?o(v,D):D,Z=q!==void 0,[ie,ge]=h.useState(()=>new Set(J??[])),xe=h.useMemo(()=>Z?new Set(q):ie,[Z,q,ie]);h.useEffect(()=>{M&&!o&&process.env.NODE_ENV!=="production"&&console.warn("[@starasia/admin] TableLayout: `selectable` tanpa `getRowKey` — key default (index) membuat seleksi menempel ke POSISI baris, bukan datanya. Beri `getRowKey` yang stabil (mis. r => r.id).")},[M,!o]);const Ae=v=>{if(Z||ge(v),U){const D=Ee.filter((L,V)=>v.has(j(L,V)));U(Array.from(v),D)}},Ve=(v,D)=>M&&(K?K(v,D):!0),Je=v=>{const D=new Set(xe);D.has(v)?D.delete(v):D.add(v),Ae(D)},$e=h.useMemo(()=>M?Ee.map((v,D)=>({row:v,i:D,key:j(v,D)})).filter(({row:v,i:D})=>K?K(v,D):!0).map(({key:v})=>v):[],[M,Ee,K,o]),gr=$e.filter(v=>xe.has(v)),wr=$e.length>0&&gr.length===$e.length,yr=gr.length>0&&!wr,Yr=()=>{const v=new Set(xe);wr?$e.forEach(D=>v.delete(D)):$e.forEach(D=>v.add(D)),Ae(v)},pr=(v,D,L)=>{const V=v.render?v.render(D,L,Ee):fi(D,v.accessor);if(b&&!v.render&&typeof V=="string"){const te=v.key??(typeof v.accessor=="string"?v.accessor:void 0),se=te?b[te]:void 0;if(se)return e.jsx(Jl,{text:V,query:se})}return V},po=pe.length+(M?1:0)+(Q?1:0),yn=["80%","55%","70%","45%","90%","60%"],Uc=(v,D)=>yn[(v*7+D*3)%yn.length],Yc=(v,D)=>e.jsx(rr.Skeleton,{height:14,width:Uc(v,D),borderRadius:"rounded-sm"}),Xc=Array.from({length:O},(v,D)=>e.jsxs(G.Tr,{children:[M&&e.jsx(G.Td,{style:{width:Zr,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(rr.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),pe.map(({col:L,key:V},te)=>e.jsx(G.Td,{style:{textAlign:Gr(L.align)},children:Yc(D,te)},`sa-tl-sk-${D}-${V}`)),Q&&e.jsx(G.Td,{style:{width:Ce,padding:0,border:"none"}})]},`sa-tl-sk-${D}`)),Jc=(v,D)=>{D||Fe({...oe,hidden:[...oe.hidden??[],v]})},$c=v=>Fe({...oe,frozenKey:oe.frozenKey===v?void 0:v}),Bt=v=>(N??[]).filter(D=>{var L;return!((L=D.hidden)!=null&&L.call(D,v))}),pn=he?{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:io,paddingLeft:ct,paddingRight:ct,height:"100%"}:{position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:io,paddingRight:ct,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},mt=(v,D,L,V)=>{var er;const te=(er=v.disabled)==null?void 0:er.call(v,D),se=(V==null?void 0:V.showLabel)??v.showLabel,le=(V==null?void 0:V.size)??"xs",De=e.jsx(_.Button,{size:le,variant:v.variant??"tertiary",tone:v.tone??"neutral",disabled:te,onClick:()=>v.onClick(D,L),iconLeft:v.icon?e.jsx(I.Icon,{name:v.icon,size:"sm"}):void 0,children:se&&v.label}),Se=v.tooltip;return Se?e.jsx(Te.Tooltip,{label:Se,position:"top-end",children:De}):De},Kc=(v,D)=>{const L=Bt(v);if(!L.length)return null;if(L.length>so){const te=j(v,D),se=(ye==null?void 0:ye.rowKey)===te;return e.jsx("div",{className:"sa-tl-row-actions","data-mode":he?"column":"overlay",style:pn,onClick:le=>le.stopPropagation(),children:e.jsx(Te.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(_.Button,{size:"xs",variant:"tertiary",onClick:le=>{const De=le.currentTarget.getBoundingClientRect();Ze(se?null:{rowKey:te,top:De.bottom+4,right:window.innerWidth-De.right})},children:e.jsx(I.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions","data-mode":he?"column":"overlay",style:pn,children:L.map(te=>e.jsx(h.Fragment,{children:mt(te,v,D)},te.key))})},Rc=(v,D)=>{const L=Bt(v);return L.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:qr},children:L.map(V=>e.jsx(h.Fragment,{children:mt(V,v,D,{showLabel:!0,size:"sm"})},V.key))}):null},ea=(v,D)=>{const L=Bt(v);return L.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:L.map(V=>e.jsx(h.Fragment,{children:mt(V,v,D,{showLabel:!1})},V.key))}):null},bo=(v,D)=>{var Hr;const{col:L,key:V}=v,te=Re.get(V)??0,se=St(te),le=se&&te===kr,De=(Y==null?void 0:Y.key)===V?Y.direction:null,Se=g&&!L.disableMenu?e.jsx(Xl,{active:!!De||se||!!L.filterActive,canSort:vr(L),canHide:!L.locked,sortDir:De,frozen:se,onSort:Ft=>fe({key:V,direction:Ft}),onClearSort:()=>fe(null),onToggleFreeze:()=>$c(V),onHide:()=>Jc(V,L.locked),filterSlot:(Hr=L.renderFilter)==null?void 0:Hr.call(L),filterActive:L.filterActive}):null,er=L.align==="right",Xr=L.align==="right"?"flex-end":L.align==="center"?"center":"flex-start",dr=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Xr,overflow:"hidden"},children:[L.icon&&e.jsx(I.Icon,{name:L.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:at,children:L.title})]});return e.jsx(G.Th,{className:`sa-tl-leaf${se?" sa-tl-frozen":""}`,rowSpan:D==null?void 0:D.rowSpan,colSpan:D==null?void 0:D.colSpan,minWidth:L.minWidth,numeric:L.numeric,resizable:je?L.resizable:!1,defaultWidth:yo(L,te),style:{textAlign:Gr(L.align),width:Or(L,te),position:"sticky",top:(D==null?void 0:D.top)??0,left:se?Ur(te):void 0,zIndex:se?3:2,backgroundColor:Tr,boxShadow:le?$l:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:er?e.jsxs(e.Fragment,{children:[Se,dr]}):e.jsxs(e.Fragment,{children:[dr,Se]})})},`th-${V}`)},ra=()=>{const v=[];for(let D=0;D<pe.length;){const L=pe[D],V=L.col.headerColSpan??1,te=Math.max(1,Math.min(V,pe.length-D));v.push(bo(L,te>1?{colSpan:te}:void 0)),D+=te}return v},bn=v=>e.jsx(G.Th,{rowSpan:v==null?void 0:v.rowSpan,style:{width:Zr,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:Tr,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:D=>D.stopPropagation(),children:e.jsx(fr.Checkbox,{size:"sm",variant:yr?"indeterminate":"select",checked:wr||yr,disabled:$e.length===0,onChange:Yr,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),ta=(v,D,L)=>{const V=j(v,D);return e.jsx(G.Td,{className:"sa-tl-frozen",style:{width:Zr,padding:0,position:"sticky",left:0,zIndex:2,...L?{"--sa-tl-bg":L}:{}},children:Ve(v,D)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:te=>te.stopPropagation(),children:e.jsx(fr.Checkbox,{size:"sm",checked:xe.has(V),onChange:()=>Je(V),"aria-label":"Pilih baris"})})},`tl-select-${D}`)},vo=pe.filter(v=>!v.col.hideOnMobile),Co=vo.find(v=>v.col.primary)??vo[0],oa=vo.filter(v=>v!==Co),la=v=>Ge(D=>{const L=new Set(D);return L.has(v)?L.delete(v):L.add(v),L}),vn=(v,D)=>oa.map(({col:L,key:V})=>{const te=pr(L,v,D),se={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right",...L.numeric?{fontVariantNumeric:"tabular-nums"}:{}},le=typeof te=="string"||typeof te=="number"?e.jsx(k.Text,{style:se,children:te}):e.jsx("div",{style:se,children:te});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof L.title=="string"?e.jsx(k.Text,{color:"subtle",fontWeight:"medium",style:{color:ci,flexShrink:0},children:L.title}):e.jsx("div",{style:{flexShrink:0},children:L.title}),le]},V)}),wo=(v,D)=>{const L=Co?pr(Co.col,v,D):null;return typeof L=="string"||typeof L=="number"?e.jsx(k.Text,{as:"span",style:at,children:L}):e.jsx("span",{style:at,children:L})},na=e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:O},(v,D)=>e.jsxs(f.Box,{style:{border:qr,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(rr.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(rr.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(rr.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${D}`))}),Cn=e.jsx(f.Box,{fullWidth:!0,style:{minHeight:(F==null?void 0:F.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:F==null?void 0:F.content}),sa=m?na:Ee.length===0?Cn:H==="expand"?e.jsx(f.Box,{style:{display:"flex",flexDirection:"column"},children:Ee.map((v,D)=>{const L=j(v,D),V=ze.has(L),se=M&&xe.has(L)?co:dt(n==null?void 0:n(v,D));return e.jsxs("div",{style:{borderBottom:qr,backgroundColor:se},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[Ve(v,D)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(fr.Checkbox,{size:"sm",checked:xe.has(L),onChange:()=>Je(L),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>la(L),style:{flex:1,minWidth:0,display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"10px 12px",background:"none",border:"none",font:"inherit",color:"inherit",cursor:"pointer",textAlign:"left"},children:[wo(v,D),e.jsx(I.Icon,{name:V?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),Q&&ea(v,D)]}),V&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:vn(v,D)})]},L)})}):e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Ee.map((v,D)=>{const L=j(v,D),V=M&&xe.has(L);return e.jsxs(f.Box,{style:{border:qr,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:V?co:dt(n==null?void 0:n(v,D))},children:[Ve(v,D)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(fr.Checkbox,{size:"sm",checked:xe.has(L),onChange:()=>Je(L),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:wo(v,D)})]}):wo(v,D),vn(v,D),Q&&Rc(v,D)]},L)})}),ia=s&&je&&Ne!==void 0,wn=i==="fixed"&&!s&&(je?Ne!==void 0:!0),ca=wn&&!je,Et=B&&B.length>0?B.map((v,D)=>e.jsx(G.Tr,{children:v.cells.map((L,V)=>e.jsx(G.Td,{colSpan:L.colSpan,rowSpan:L.rowSpan,numeric:L.numeric,style:{textAlign:Gr(L.align)},children:L.content},`tl-foot-${D}-${V}`))},`tl-foot-${D}`)):null,aa=e.jsxs(G.Table,{className:"sa-table-layout",fullWidth:!0,size:l,resizable:ia,style:wn?{tableLayout:"fixed"}:void 0,onWidthsChange:ur?lr:void 0,children:[ca&&e.jsxs("colgroup",{children:[M&&e.jsx("col",{style:{width:Zr}}),pe.map(({col:v,key:D},L)=>e.jsx("col",{style:{width:Or(v,L)}},`col-${D}`)),Q&&e.jsx("col",{style:{width:Ce}})]}),e.jsx(G.Thead,{ref:Cr,children:Pe?e.jsxs(e.Fragment,{children:[e.jsxs(G.Tr,{children:[M&&bn({rowSpan:2}),Le.map(v=>v.isGroup?e.jsx(G.Th,{colSpan:v.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:Tr},children:e.jsx("span",{style:at,children:v.col.title})},`grp-${v.key}`):bo(v.leaves[0],{rowSpan:2})),Q&&e.jsx(G.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:Ce,padding:0,border:"none",backgroundColor:Tr}})]}),e.jsx(G.Tr,{children:Le.flatMap(v=>v.isGroup?v.leaves.map(D=>bo(D,{top:xt})):[])})]}):e.jsxs(G.Tr,{children:[M&&bn(),ra(),Q&&e.jsx(G.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:Ce,padding:0,border:"none",backgroundColor:Tr}})]})}),e.jsx(G.Tbody,{children:m?Xc:Ee.length===0?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:po,children:Cn})}):e.jsxs(e.Fragment,{children:[Ee.map((v,D)=>{const L=A==null?void 0:A(v,D,D>0?Ee[D-1]:void 0),te=M&&xe.has(j(v,D))?co:dt(n==null?void 0:n(v,D));return e.jsxs(h.Fragment,{children:[L!=null&&L!==!1&&e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:po,style:{backgroundColor:Tr},children:L})}),e.jsxs(G.Tr,{children:[M&&ta(v,D,te),pe.map(({col:se,key:le},De)=>{var xn;const Se=(xn=se.cellProps)==null?void 0:xn.call(se,v,D,Ee);if(Se!=null&&Se.hidden)return null;const er=St(De),Xr=er&&De===kr,dr=pr(se,v,D),Hr=typeof se.bg=="function"?se.bg(v,D,Ee):se.bg,Ft=dt(Hr)??te;return e.jsx(G.Td,{className:er?"sa-tl-frozen":void 0,colSpan:Se==null?void 0:Se.colSpan,rowSpan:Se==null?void 0:Se.rowSpan,numeric:se.numeric,style:{textAlign:Gr(se.align),width:Or(se,De),minWidth:se.minWidth,position:er?"sticky":void 0,left:er?Ur(De):void 0,zIndex:er?1:void 0,boxShadow:Xr?$l:void 0,...Ft?{"--sa-tl-bg":Ft}:{}},children:typeof dr=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Gr(se.align)},children:dr}):dr},`tl-cell-${D}-${le}`)}),Q&&e.jsx(G.Td,{className:he?"sa-tl-frozen":void 0,style:{position:"sticky",right:0,width:Ce,padding:0,overflow:he?void 0:"visible",zIndex:2,border:"none"},children:Kc(v,D)})]})]},j(v,D))}),x!=null&&e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:po,children:x})})]})}),Et&&e.jsx(G.Tfoot,{className:W?"sa-tl-sticky-foot":void 0,children:Et})]}),xo=ye?Ee.findIndex((v,D)=>j(v,D)===ye.rowKey):-1,Do=xo>=0?Ee[xo]:null;return e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{ref:zr,className:"sa-tl-scroll",fullWidth:!0,style:{overflow:"auto",height:S??kt},children:ae?e.jsxs(e.Fragment,{children:[sa,Et&&!m&&Ee.length>0&&e.jsx(f.Box,{style:{borderTop:qr},children:e.jsx(G.Table,{fullWidth:!0,size:l,className:"sa-table-layout",children:e.jsx(G.Tbody,{children:Et})})})]}):aa}),ye&&Do&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:ye.top,right:ye.right},onClick:v=>v.stopPropagation(),children:Bt(Do).map(v=>e.jsx("div",{style:{padding:"2px 4px"},children:mt(v,Do,xo,{showLabel:!0,size:"sm"})},v.key))})]})},ao=r=>r==="asc"||r==="desc",yi=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:o="sortOrder",pageKey:n="page",defaultSort:l=null,paramKeys:s,scopeId:i,storage:c=$t}=r,{searchParams:a,setSearchParams:d,searchQueries:g}=qe(),b=a.toString(),p=i?Mr.tableSort(i):void 0,C=h.useRef(!1);h.useEffect(()=>{if(C.current||(C.current=!0,!p)||a.has(t)||a.has(o))return;const x=c.get(p);!(x!=null&&x.key)||!ao(x.direction)||d({...Object.fromEntries(a.entries()),[t]:x.key,[o]:x.direction},{replace:!0})},[]);const w=h.useMemo(()=>{const x=a.get(t),B=a.get(o);return x&&ao(B)?{key:x,direction:B}:l},[b,t,o,l]);h.useEffect(()=>{if(!p)return;const x=a.get(t),B=a.get(o);x&&ao(B)?c.set(p,{key:x,direction:B}):c.remove(p)},[b,p,t,o,c]);const S=(s==null?void 0:s.sortBy)??"sortBy",H=(s==null?void 0:s.sortOrder)??"sortOrder",T=h.useMemo(()=>w?{[S]:w.key,[H]:w.direction}:{},[w,S,H]),A=h.useCallback(x=>{const B={...g};x?(B[t]=x.key,B[o]=x.direction):(delete B[t],delete B[o]),delete B[n],d(B)},[g,t,o,n,d]);return{sort:w,setSort:A,params:T}},ht=({of:r,render:t})=>h.Children.toArray(r==null?void 0:r.map((o,n,l)=>t(o,n,l))),ue=({condition:r,fallback:t,children:o,loading:n,isLoading:l})=>e.jsx(e.Fragment,{children:l?n:r?o:t}),be=r=>e.jsx(k.Text,{...r,fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),br=r=>e.jsx(k.Text,{color:"red-600",fontSize:"sm",children:r.message}),pi=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,d;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ue,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(de.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:l.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(ue,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Te.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(I.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ue,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(hr.Input,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default",fullWidth:!0}),!s&&l.errorMessage&&e.jsx(br,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},bi=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,d;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(ue,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(de.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:l.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(ue,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Te.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(I.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ue,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(f.Box,{direction:"column",style:{width:l.inputProps.fullWidth?"100%":t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(Er.Dropdown,{size:r,...l.inputProps,error:!!l.errorMessage})}),!s&&l.errorMessage&&e.jsx(br,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},vi=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Ci=r=>{var c;const[t,o]=h.useState(!1),n=a=>{a.preventDefault(),a.stopPropagation()},l=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&r.handleOnFileChange(a.dataTransfer.files.item(0))},s=a=>{a.preventDefault(),o(!0)},i=a=>{a.preventDefault(),o(!1)};return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:l,onDragEnter:s,onDragLeave:i,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${vi(r.errorMessage,r.status)}`},children:[e.jsx(I.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(de.Flex,{direction:"column",gap:"xs",children:[e.jsxs(de.Flex,{direction:"row",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(k.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",children:(c=r.fileSupports)==null?void 0:c.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function wi(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const Rl=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},xi=r=>{const t={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},o=r.split(" ");if(o.length!==3)return null;const n=parseInt(o[0],10),l=t[o[1]],s=parseInt(o[2],10);return isNaN(n)||isNaN(l)||isNaN(s)?null:new Date(s,l,n)};function Di(r,t=!0){if(!r)return"Rp 0";const o=typeof r=="number"?r.toString():r;if(isNaN(Number(o)))return"Rp 0";const n=o.split("."),l=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),s=n.length===2?l+"."+n[1]:l;return t?"Rp"+s:s}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},String.prototype.toNumber=function(){return Number(this)};const Si=r=>{const t=r.split(" ");let o=t[0].charAt(0);return t.length>1&&(o+=""+t[1].charAt(0)),o.toUpperCase()};function ki(r){const t=typeof r=="string"?new Date(r):r;if(isNaN(t.getTime()))throw new Error("Invalid date format");const o=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0");return`${o}-${n}-${l}`}const Bi="sa-admin",ar=r=>`var(--${Bi}-${r})`,mi={base:{borderColor:ar("base-border-color"),textColor:ar("base-text-color"),iconColor:ar("base-icon-color"),placeholderColor:ar("base-placeholder-color")},document:{bgColor:ar("document-bg-color")},sidebar:{bgColor:ar("sidebar-bg-color"),borderColor:ar("sidebar-border-color"),maxWidth:ar("sidebar-max-width"),width:ar("sidebar-width"),collapseWidth:ar("sidebar-collapse-width"),collapseV2Width:ar("sidebar-v2-collapse-width")}},Ei=24*60*60*1e3,Fi=r=>{const t="14px poppins",n=document.createElement("canvas").getContext("2d");n.font=t;const l=n.measureText(r).width;return Number(Math.ceil(l))},Ii=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Li=/--+/,Mi=/-$/;function Ti(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function Ai(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function Oi(r){return/^[A-Za-z\s]+$/.test(r)}const Wi=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&(r.key==="a"||r.key==="c"||r.key==="v")||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},zi=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},Hi=r=>{const t=/^[0-9.]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},Pi=r=>Ii.test(r);function _i(r){return!(Li.test(r)||Mi.test(r))}const ji=r=>{const t=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((r.ctrlKey||r.metaKey)&&["a","c","v","x"].includes(r.key.toLowerCase()))return;const o=r.currentTarget.value;/^[0-9]$/.test(r.key)||r.key==="."&&!o.includes(".")||r.key==="-"&&o.length===0&&!o.includes("-")||t.includes(r.key)||r.preventDefault()},Ni=r=>{const t=document.getElementById(r);if(t){const o=t.getBoundingClientRect(),n=window.scrollY+o.top-80;window.scrollTo({top:n,behavior:"smooth"})}};function Vi(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(s=>t.endsWith(s)))return r;const l=Number(r);if(isNaN(l))throw new Error("Invalid size format");return l>=1e6?`${(l/1e6).toFixed(2)}MB`:l>=1e3?`${(l/1e3).toFixed(2)}KB`:`${l}B`}function qi(r){const t=r.split("/");return t[t.length-1]}const Zi=r=>{var t,o;return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:r.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(de.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(I.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(de.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(k.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?qi(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(de.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(I.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(de.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:Vi(((o=r.fileSelected)==null?void 0:o.size.toString())||"100000")}),e.jsx(I.Icon,{name:"Dot",size:"xs"}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:Rl(new Date)})]})]})]}),e.jsx(_.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(I.Icon,{name:"Trash1"})})]})},en=({status:r="default",labelPosition:t="outside-top",...o})=>{var p;const n=h.useRef(null),l=()=>{if(o.defaultFile){window.open(o.defaultFile.url);return}n.current&&n.current.click()},s=ke.useMediaQuery("md"),i=r==="error"||typeof o.errorMessage=="string"&&!!o.errorMessage,c=o.label?e.jsxs(de.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(k.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:o.label}),o.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"var(--sa-radii-xs, 4px)",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),o.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=o.description?e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.description}):null,d=e.jsxs(e.Fragment,{children:[o.helperText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.helperText}),o.errorText&&r==="error"&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorText}),o.errorMessage&&!o.errorText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorMessage})]}),g=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:C=>{var w;return o.handleOnChangeFile(((w=C.target.files)==null?void 0:w.item(0))||null)},accept:(p=o.fileSupportOption)==null?void 0:p.map(C=>"."+(C==null?void 0:C.toLowerCase())).join(", ")}),b=e.jsxs(f.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...o.containerProps,children:[g,(o.fileSelected||o.defaultFile)&&e.jsx(Zi,{fileSelected:o.fileSelected,defaultFile:o.defaultFile,handleOnDeleteFile:o.handleOnDeleteFile,handleOnClickFile:l}),!o.fileSelected&&!o.defaultFile&&e.jsx(Ci,{fileSupports:o.fileSupportOption,isDesktop:s,errorMessage:i?o.errorText||o.errorMessage||" ":void 0,status:i?"error":"default",handleOnClick:l,handleOnFileChange:o.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(de.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(de.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[c,a]}),e.jsxs(de.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[b,d]})]}):e.jsxs(de.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[c,a,b,d]})},Gi=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,d;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ue,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(de.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:l.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(ue,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Te.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(I.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ue,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(de.Flex,{direction:"column",gap:"xs",children:[e.jsx(en,{...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(br,{message:l.errorMessage})]})]})},Qi=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...s})=>{var a,d,g,b;const i=s.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(ue,{condition:!!l,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(be,{children:s.title}),e.jsx(tr.Body3,{props:{color:"gray-500"},children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(de.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:s.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(ue,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Te.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(g=s.tooltip)==null?void 0:g.arrowPosition,focusable:!0,...s.tooltip,children:e.jsx(I.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ue,{condition:!!s.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsx(f.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(ht,{of:(b=s.checkBoxesList)==null?void 0:b.map(p=>({...p,isChecked:s.checkBoxesAreChecked.includes(p.id)})),render:p=>p.renderBadge?e.jsxs(f.Box,{direction:"row",justify:"space-between",gap:"lg",...s.badgeContainerProps,children:[e.jsx(fr.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:C=>s.onChecked(C.target.value,p),label:p.name,description:p.description}),p.renderBadge]}):e.jsx(fr.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:C=>s.onChecked(C.target.value,p),label:p.name,description:p.description})})}),!i&&s.errorMessage&&e.jsx(br,{message:s.errorMessage})]})},Ui=({position:r="vertical",size:t="md",fullWidth:o=!1,...n})=>{var s;const l=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(ue,{condition:!!n.description||!!n.title,children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[n.title&&e.jsx(be,{children:n.title}),e.jsx(ue,{condition:!!n.description,children:e.jsx(k.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(f.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(ht,{of:(s=n.radioList)==null?void 0:s.map(i=>({...i,isChecked:n.radioIsChecked===i.id})),render:({value:i,id:c,isChecked:a,subInput:d,label:g,description:b})=>e.jsxs(f.Box,{direction:"column",gap:"xs",customMaxWidth:l,children:[e.jsx(Mt.Radio,{id:`${c.toString()}-${i}`,name:n.groupName||g,label:g,value:i,checked:a,onChange:p=>n.onChecked({id:c,label:p.target.name,value:p.target.value}),disabled:n.disableAll},c),b&&e.jsx(k.Text,{color:"gray-500",style:{marginLeft:28},children:b}),d]})})}),n.errorMessage&&e.jsx(br,{message:n.errorMessage})]})},Yi=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,d;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ue,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(de.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:l.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(ue,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Te.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(I.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ue,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(de.Flex,{direction:"column",gap:"xs",children:[e.jsx(Lt.Textarea,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(br,{message:l.errorMessage})]})]})},Xi=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",required:n=!1,fullWidth:l=!1,...s})=>{var c,a,d;const i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(ue,{condition:n,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:l,children:[e.jsx(be,{children:s.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:l,children:[e.jsxs(de.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:s.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(ue,{condition:!!((c=s.tooltip)!=null&&c.label),children:e.jsx(Te.Tooltip,{label:(a=s.tooltip)==null?void 0:a.label,arrowPosition:(d=s.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...s.tooltip,children:e.jsx(I.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ue,{condition:!!s.titleDescription,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})})]})}),e.jsx(Lr.Toggle,{checked:s.checked,onChange:s.onChange,label:s.label,description:s.description}),s.errorMessage&&e.jsx(br,{message:s.errorMessage})]})},Ji=({variant:r="primary",size:t="md",...o})=>{const n=Ir.useColor(),l=i=>{var a,d,g,b,p,C;if(!i)return;const c=o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary"?"var(--sa-text-subtle, #8c8f97)":r==="secondary-danger"?(d=(a=n==null?void 0:n.computed)==null?void 0:a.red)==null?void 0:d[600]:r==="secondary-primary"?(b=(g=n==null?void 0:n.computed)==null?void 0:g.blue)==null?void 0:b[700]:(C=(p=n==null?void 0:n.computed)==null?void 0:p.gray)==null?void 0:C[50];return e.jsx(I.Icon,{name:i,size:t,style:{color:c}})},s=()=>{var c,a,d,g;if(r!=="secondary-danger"&&r!=="secondary-primary")return o.title;const i={color:o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(c=n==null?void 0:n.computed)==null?void 0:c.red)==null?void 0:a[600]:(g=(d=n==null?void 0:n.computed)==null?void 0:d.blue)==null?void 0:g[700]};switch(t){case"xs":return e.jsx(tr.Body2,{props:{style:i},children:o.title});case"sm":case"md":return e.jsx(tr.SubH3,{props:{style:i},children:o.title});case"lg":return e.jsx(tr.SubH2,{props:{style:i},children:o.title});default:return o.title}};return e.jsx(_.Button,{fullWidth:!0,disabled:o.disabled,primary:r==="primary",secondary:r==="secondary"||r==="secondary-danger"||r==="secondary-primary",success:r==="success",onClick:o.onClick,type:o.type,iconLeft:l(o.iconLeft),iconRight:l(o.iconRight),size:t,children:s()})},$i=r=>e.jsx(tr.H5,{props:{...r},children:r.title}),Ki=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,d;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(ue,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(de.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:l.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(ue,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Te.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(I.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ue,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(de.Flex,{direction:"column",gap:"xs",children:[e.jsx(f.Box,{direction:"column",style:{width:t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(xr.StarasiaDate,{size:r,...l.inputProps,status:l.errorMessage?"error":void 0})}),!s&&l.errorMessage&&e.jsx(br,{message:l.errorMessage})]})]})};async function Ri(r,t){const o=new Image;o.src=r,await new Promise((s,i)=>{o.onload=s,o.onerror=i});const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const l=n.getContext("2d",{alpha:!0});if(!l)throw new Error("No 2D context");return l.drawImage(o,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((s,i)=>{n.toBlob(c=>{if(!c)return i("Canvas is empty");const a=new File([c],"cropped.png",{type:"image/png"});s(a)},"image/png")})}const rn={"1:1":1,"4:3":4/3,"16:9":16/9,"3:4":3/4,"9:16":9/16,"2:3":2/3,"3:2":3/2,"32:9":32/9},tn=h.forwardRef(({handleUpload:r,urlImage:t,isUploading:o,croppedImage:n,setCroppedImage:l,size:s="96",aspect:i="1:1",containerProps:c,maxFileSize:a=2,onError:d},g)=>{const b=ke.useMediaQuery("md"),[p,C]=h.useState(!1),[w,S]=h.useState(null),[H,T]=h.useState(!1),[A,x]=h.useState({x:0,y:0}),[B,W]=h.useState(1),[F,m]=h.useState(null),[O,N]=h.useState(!1);h.useEffect(()=>{t===null&&l(null)},[t]);const $=h.useCallback((re,he)=>{m(he)},[]),M=re=>{var Me;const he=(Me=re.target.files)==null?void 0:Me[0];if(!he)return;const ve=new FileReader;ve.onload=()=>{S(ve.result),T(!0)},ve.readAsDataURL(he)},q=async()=>{if(!(!w||!F||O)){N(!0);try{const re=await Ri(w,F);if(a&&re.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(re);const he=URL.createObjectURL(re);l(he,re),T(!1)}catch{d==null||d("Gagal memproses gambar")}finally{N(!1)}}},J=h.useRef(null),U=()=>{J.current&&J.current.click()};h.useImperativeHandle(g,()=>({openFileDialog:()=>{var re;(re=J.current)==null||re.click()}}));const K=parseInt(s,10),R=rn[i];let ae,Q;return R>=1?(Q=K,ae=K*R):(ae=K,Q=K/R),e.jsxs(f.Box,{direction:"column",display:"flex",position:"relative",bg:(c==null?void 0:c.bg)||"gray-200",borderStyle:(c==null?void 0:c.borderStyle)||"border-none",borderColor:(c==null?void 0:c.borderColor)||"gray-200",borderWidth:(c==null?void 0:c.borderWidth)||"border-2",borderRadius:(c==null?void 0:c.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:c!=null&&c.fullWidth?"100%":`${ae}px`,height:c!=null&&c.fullWidth?"auto":`${Q}px`,aspectRatio:R,flexShrink:0},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:[n||t?e.jsx("img",{src:n||t||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(f.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(I.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(s)/2<40?Number(s)/2:40,height:Number(s)/2<40?Number(s)/2:40}})}),e.jsxs(f.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214c)",opacity:p?1:0,transition:"opacity 0.3s ease-in-out"},onClick:U,children:[e.jsx("input",{ref:J,type:"file",accept:"image/*",onChange:M,disabled:o,style:{display:"none"}}),e.jsxs(f.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(I.Icon,{name:"Edit3",style:{color:"var(--sa-text-primary, #292a2e)"}}),e.jsx(ue,{condition:s.toNumber()>80,children:e.jsx(k.Text,{color:"gray-50",fontSize:s.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),o&&e.jsx(f.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f6cc)"},children:e.jsx(f.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),H&&Kr.createPortal(e.jsx("div",{style:{position:"fixed",inset:0,zIndex:19999,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.6)"},onClick:()=>{O||T(!1)},children:e.jsxs("div",{style:{backgroundColor:"var(--sa-background-primary)",borderRadius:"var(--sa-radii-md)",boxShadow:"0 20px 60px rgba(0,0,0,0.3)",overflow:"hidden",width:b?i==="1:1"?"min(90vw, 480px)":`min(90vw, ${ae*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:re=>re.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:w&&e.jsx(Dn,{image:w,crop:A,zoom:B,aspect:i?rn[i]:void 0,onCropChange:x,onZoomChange:W,onCropComplete:$,objectFit:"contain",minZoom:.5,restrictPosition:!1})}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--sa-border-subtle)"},children:[e.jsx(_.Button,{size:"sm",secondary:!0,disabled:O,onClick:()=>T(!1),children:"Cancel"}),e.jsx(_.Button,{size:"sm",primary:!0,isLoading:O,onClick:q,children:"Crop"})]})]})}),document.body)]})}),ec=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...s})=>{var a,d,g;const i=s.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(ue,{condition:!!l,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(be,{children:s.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(de.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:s.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(ue,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Te.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(g=s.tooltip)==null?void 0:g.arrowPosition,focusable:!0,...s.tooltip,children:e.jsx(I.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ue,{condition:!!s.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsxs(de.Flex,{direction:"column",gap:"xs",children:[e.jsx(tn,{...s.inputProps}),!i&&s.errorMessage&&e.jsx(br,{message:s.errorMessage})]})]})},rc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,c,a;const s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ue,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(de.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:l.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(ue,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Te.Tooltip,{label:(c=l.tooltip)==null?void 0:c.label,arrowPosition:(a=l.tooltip)==null?void 0:a.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(I.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ue,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),l.inputProps.extended&&l.inputProps.extended]})},tc=({items:r,id:t,handleOnUpdate:o,width:n,toggleShow:l=!0,disabled:s=!1})=>{var g;const[i,c]=h.useState([]);h.useEffect(()=>{r&&c([...r.map(b=>({id:b.id,isActive:b.isActive}))])},[r]);const a=(g=i.find(b=>b.id===t))==null?void 0:g.isActive,d=h.useCallback(()=>{c(b=>b.map(p=>p.id===t?{...p,isActive:!p.isActive}:p)),o&&o(!a)},[t,o,a]);return e.jsx(f.Box,{direction:"row",gap:"md",style:{width:n},children:l&&e.jsx(Lr.Toggle,{disabled:s,checked:a,onChange:d,label:a?"Active":"Inactive"})})},oc={InputText:pi,InputDropdown:bi,InputSingleFile:Gi,CheckBoxOptions:Qi,RadioOptions:Ui,InputTextArea:Yi,ToggleForm:Xi,ActionButton:Ji,FormTitle:$i,InputDate:Ki,InputImgFile:ec,Custom:rc},on=({customBottom:r})=>{const[t,o]=h.useState(!1),n=()=>{window.scrollY>window.innerHeight?o(!0):o(!1)},l=()=>{window.scrollTo({top:0,behavior:"smooth"})};return h.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(f.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(f.Box,{direction:"column",position:"absolute",style:{bottom:r||"1.6rem",right:"2rem",transform:t?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(_.Button,{secondary:!0,size:"xs",onClick:l,type:"button",iconLeft:e.jsx(I.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Ue="sa-sidepanel-item",ln="sa-sidepanel-item-styles",lc=`@layer starasia.components {
53
- .${Ue} {
52
+ }`,document.head.appendChild(r)},ot=r=>r==="right"?"right":r==="center"?"center":"left",Si=/^(#|rgb|hsl|var\()/,Bt=r=>r?Si.test(r)?r:`var(--sa-background-${r})`:void 0,ki=(r,t)=>{if(t)return r[t]},Bi=(r,t)=>r==null&&t==null?0:r==null?-1:t==null?1:typeof r=="number"&&typeof t=="number"?r-t:String(r).localeCompare(String(t)),mi=({columns:r,data:t,getRowKey:o,rowBg:n,size:l="md",resizable:s=!1,layout:i="auto",widthStorageKey:c,columnState:a,onColumnStateChange:d,columnMenu:g=!1,highlight:b,sort:p,defaultSort:C,onSortChange:B,height:x,mobileLayout:W="cards",mobileBreakpoint:L="md",groupSeparator:M,summary:S,footer:E,stickyFooter:A=!1,emptyState:T,loading:D=!1,loadingRows:O=8,rowActions:q,rowActionsMode:G="auto",selectable:_=!1,selectedKeys:H,defaultSelectedKeys:R,onSelectionChange:ee,isRowSelectable:J})=>{Di();const de=!Ee.useMediaQuery(L)&&W!=="scroll",Q=!!(q!=null&&q.length),le=ln(),ue=Q&&(G==="column"||G==="auto"&&le),De=Math.min((q==null?void 0:q.length)??0,bo+1),Fe=De>bo?1:De,Se=St*2+Fe*xi+Math.max(0,Fe-1)*vo,xe=ue?Se:1,[ve,He]=h.useState(null);h.useEffect(()=>{if(!ve)return;const v=()=>He(null),k=setTimeout(()=>document.addEventListener("click",v),0);return()=>{clearTimeout(k),document.removeEventListener("click",v)}},[ve]);const[Re,ze]=h.useState(()=>new Set),ae=a!==void 0,[we,_e]=h.useState({}),ge=a??we,se=v=>{d==null||d(v),ae||_e(v)},qe=p!==void 0,[Ze,P]=h.useState(C??null),$=qe?p??null:Ze,Y=!B,ye=v=>{B==null||B(v),qe||P(v)},{headerGroups:Le,leafColumns:Ce,hasGroups:Pe}=h.useMemo(()=>{var ie;const v=new Set(ge.hidden??[]),k=(ne,Be)=>ne.key??(typeof ne.accessor=="string"?ne.accessor:`col-${Be}`),I=r.map((ne,Be)=>{var tr;if((tr=ne.children)!=null&&tr.length){const ht=ne.children.map((ur,Yr)=>({col:ur,key:k(ur,`${Be}-${Yr}`)})).filter(ur=>!v.has(ur.key));return{col:ne,key:ne.key??`group-${Be}`,isGroup:!0,leaves:ht}}const me={col:ne,key:k(ne,`${Be}`)};return{col:ne,key:me.key,isGroup:!1,leaves:v.has(me.key)?[]:[me]}}).filter(ne=>ne.leaves.length>0),Z=I.some(ne=>ne.isGroup);let oe=I.flatMap(ne=>ne.leaves);if(!Z&&((ie=ge.order)!=null&&ie.length)){const ne=new Map(ge.order.map((Be,me)=>[Be,me]));oe=[...oe].sort((Be,me)=>(ne.get(Be.key)??1/0)-(ne.get(me.key)??1/0))}return{headerGroups:I,leafColumns:oe,hasGroups:Z}},[r,ge]),sr=h.useMemo(()=>new Map(Ce.map((v,k)=>[v.key,k])),[Ce]),Ge=!Pe&&Ce.some(v=>(v.col.headerColSpan??1)>1),Qe=Ce.map(v=>v.key).join("|"),kr=(v,k)=>{const I=v.sortKey??(typeof v.accessor=="string"?v.accessor:void 0);return I?k[I]:void 0},Xe=v=>v.sortable??(!!v.sortKey||typeof v.accessor=="string"),Ie=h.useMemo(()=>{if(!Y||!$)return t;const v=Ce.find(I=>I.key===$.key);if(!v)return t;const k=$.direction==="asc"?1:-1;return[...t].sort((I,Z)=>Bi(kr(v.col,I),kr(v.col,Z))*k)},[t,Y,$,Ce]),Ne=!Pe&&!Ge,Er=!!c&&Ne,[pr,Fr]=U.useColumnWidths(c??""),$e=Er?pr:void 0,Cr=h.useRef(null),[Ue,nt]=h.useState();h.useLayoutEffect(()=>{nt(void 0)},[Qe]),h.useLayoutEffect(()=>{if(!Ne||Ue||!Cr.current)return;const v=Cr.current.querySelectorAll("th.sa-tl-leaf");nt(Array.from(v).map(k=>k.offsetWidth))},[Ue,Ne]);const[Bo,st]=h.useState(),[er,Ot]=h.useState(0);h.useLayoutEffect(()=>{if(!Pe||!Cr.current)return;const v=Cr.current.querySelector(":scope > tr");v&&Ot(v.offsetHeight)},[Pe,Qe]);const jr=(v,k)=>{if(($e==null?void 0:$e[k])!=null)return $e[k];if(v.width!=null)return v.width;if((Ue==null?void 0:Ue[k])!=null)return Ue[k]},Wt=(v,k)=>typeof v.width=="number"?v.width:Ue==null?void 0:Ue[k],Ir=ge.frozenKey&&!Pe&&!Ge?Ce.findIndex(v=>v.key===ge.frozenKey):-1,zt=v=>v<=Ir,Br=_?tt:0,Vr=v=>{const k=Bo??Ue;if(!k)return Br;let I=Br;for(let Z=0;Z<v;Z++)I+=k[Z]??0;return I};h.useLayoutEffect(()=>{const v=Cr.current;if(!v||Ir<0){st(void 0);return}let k=0;const I=()=>{k=0;const oe=v.querySelectorAll("th.sa-tl-leaf"),ie=Array.from(oe).map(ne=>ne.getBoundingClientRect().width);st(ne=>ne&&ne.length===ie.length&&ne.every((Be,me)=>Math.abs(Be-ie[me])<.5)?ne:ie)},Z=new ResizeObserver(()=>{k||(k=requestAnimationFrame(I))});return Z.observe(v),v.querySelectorAll("th.sa-tl-leaf").forEach(oe=>Z.observe(oe)),I(),()=>{k&&cancelAnimationFrame(k),Z.disconnect()}},[Qe,Ir,_,Ue,$e]);const Tr=h.useRef(null),[qr,Ht]=h.useState("100vh");h.useLayoutEffect(()=>{if(x!==void 0)return;const v=()=>{if(Tr.current){const k=Tr.current.getBoundingClientRect().top;Ht(`calc(100vh - ${k}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[x]);const rr=(v,k)=>o?o(v,k):k,it=H!==void 0,[Zr,ct]=h.useState(()=>new Set(R??[])),fr=h.useMemo(()=>it?new Set(H):Zr,[it,H,Zr]);h.useEffect(()=>{_&&!o&&process.env.NODE_ENV!=="production"&&console.warn("[@starasia/admin] TableLayout: `selectable` tanpa `getRowKey` — key default (index) membuat seleksi menempel ke POSISI baris, bukan datanya. Beri `getRowKey` yang stabil (mis. r => r.id).")},[_,!o]);const Gr=v=>{if(it||ct(v),ee){const k=Ie.filter((I,Z)=>v.has(rr(I,Z)));ee(Array.from(v),k)}},Lr=(v,k)=>_&&(J?J(v,k):!0),Qr=v=>{const k=new Set(fr);k.has(v)?k.delete(v):k.add(v),Gr(k)},wr=h.useMemo(()=>_?Ie.map((v,k)=>({row:v,i:k,key:rr(v,k)})).filter(({row:v,i:k})=>J?J(v,k):!0).map(({key:v})=>v):[],[_,Ie,J,o]),at=wr.filter(v=>fr.has(v)),Ur=wr.length>0&&at.length===wr.length,w=at.length>0&&!Ur,N=()=>{const v=new Set(fr);Ur?wr.forEach(k=>v.delete(k)):wr.forEach(k=>v.add(k)),Gr(v)},j=(v,k,I)=>{const Z=v.render?v.render(k,I,Ie):ki(k,v.accessor);if(b&&!v.render&&typeof Z=="string"){const oe=v.key??(typeof v.accessor=="string"?v.accessor:void 0),ie=oe?b[oe]:void 0;if(ie)return e.jsx(cn,{text:Z,query:ie})}return Z},X=Ce.length+(_?1:0)+(Q?1:0),re=["80%","55%","70%","45%","90%","60%"],ke=(v,k)=>re[(v*7+k*3)%re.length],Te=(v,k)=>e.jsx(lr.Skeleton,{height:14,width:ke(v,k),borderRadius:"rounded-sm"}),Me=Array.from({length:O},(v,k)=>e.jsxs(U.Tr,{children:[_&&e.jsx(U.Td,{style:{width:tt,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(lr.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),Ce.map(({col:I,key:Z},oe)=>e.jsx(U.Td,{style:{textAlign:ot(I.align)},children:Te(k,oe)},`sa-tl-sk-${k}-${Z}`)),Q&&e.jsx(U.Td,{style:{width:xe,padding:0,border:"none"}})]},`sa-tl-sk-${k}`)),je=(v,k)=>{k||se({...ge,hidden:[...ge.hidden??[],v]})},Je=v=>se({...ge,frozenKey:ge.frozenKey===v?void 0:v}),ir=v=>(q??[]).filter(k=>{var I;return!((I=k.hidden)!=null&&I.call(k,v))}),Mr=ue?{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:vo,paddingLeft:St,paddingRight:St,height:"100%"}:{position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:vo,paddingRight:St,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},br=(v,k,I,Z)=>{var tr;const oe=(tr=v.disabled)==null?void 0:tr.call(v,k),ie=(Z==null?void 0:Z.showLabel)??v.showLabel,ne=(Z==null?void 0:Z.size)??"xs",Be=e.jsx(V.Button,{size:ne,variant:v.variant??"tertiary",tone:v.tone??"neutral",disabled:oe,onClick:()=>v.onClick(k,I),iconLeft:v.icon?e.jsx(F.Icon,{name:v.icon,size:"sm"}):void 0,children:ie&&v.label}),me=v.tooltip;return me?e.jsx(Ae.Tooltip,{label:me,position:"top-end",children:Be}):Be},xr=(v,k)=>{const I=ir(v);if(!I.length)return null;if(I.length>bo){const oe=rr(v,k),ie=(ve==null?void 0:ve.rowKey)===oe;return e.jsx("div",{className:"sa-tl-row-actions","data-mode":ue?"column":"overlay",style:Mr,onClick:ne=>ne.stopPropagation(),children:e.jsx(Ae.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(V.Button,{size:"xs",variant:"tertiary",onClick:ne=>{const Be=ne.currentTarget.getBoundingClientRect();He(ie?null:{rowKey:oe,top:Be.bottom+4,right:window.innerWidth-Be.right})},children:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions","data-mode":ue?"column":"overlay",style:Mr,children:I.map(oe=>e.jsx(h.Fragment,{children:br(oe,v,k)},oe.key))})},dt=(v,k)=>{const I=ir(v);return I.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:rt},children:I.map(Z=>e.jsx(h.Fragment,{children:br(Z,v,k,{showLabel:!0,size:"sm"})},Z.key))}):null},Dr=(v,k)=>{const I=ir(v);return I.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:I.map(Z=>e.jsx(h.Fragment,{children:br(Z,v,k,{showLabel:!1})},Z.key))}):null},mo=(v,k)=>{var Yr;const{col:I,key:Z}=v,oe=sr.get(Z)??0,ie=zt(oe),ne=ie&&oe===Ir,Be=($==null?void 0:$.key)===Z?$.direction:null,me=g&&!I.disableMenu?e.jsx(sn,{active:!!Be||ie||!!I.filterActive,canSort:Xe(I),canHide:!I.locked,sortDir:Be,frozen:ie,onSort:Pt=>ye({key:Z,direction:Pt}),onClearSort:()=>ye(null),onToggleFreeze:()=>Je(Z),onHide:()=>je(Z,I.locked),filterSlot:(Yr=I.renderFilter)==null?void 0:Yr.call(I),filterActive:I.filterActive}):null,tr=I.align==="right",ht=I.align==="right"?"flex-end":I.align==="center"?"center":"flex-start",ur=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:ht,overflow:"hidden"},children:[I.icon&&e.jsx(F.Icon,{name:I.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:kt,children:I.title})]});return e.jsx(U.Th,{className:`sa-tl-leaf${ie?" sa-tl-frozen":""}`,rowSpan:k==null?void 0:k.rowSpan,colSpan:k==null?void 0:k.colSpan,minWidth:I.minWidth,numeric:I.numeric,resizable:Ne?I.resizable:!1,defaultWidth:Wt(I,oe),style:{textAlign:ot(I.align),width:jr(I,oe),position:"sticky",top:(k==null?void 0:k.top)??0,left:ie?Vr(oe):void 0,zIndex:ie?3:2,backgroundColor:Nr,boxShadow:ne?an:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:tr?e.jsxs(e.Fragment,{children:[me,ur]}):e.jsxs(e.Fragment,{children:[ur,me]})})},`th-${Z}`)},na=()=>{const v=[];for(let k=0;k<Ce.length;){const I=Ce[k],Z=I.col.headerColSpan??1,oe=Math.max(1,Math.min(Z,Ce.length-k));v.push(mo(I,oe>1?{colSpan:oe}:void 0)),k+=oe}return v},mn=v=>e.jsx(U.Th,{rowSpan:v==null?void 0:v.rowSpan,style:{width:tt,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:Nr,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:k=>k.stopPropagation(),children:e.jsx(yr.Checkbox,{size:"sm",variant:w?"indeterminate":"select",checked:Ur||w,disabled:wr.length===0,onChange:N,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),sa=(v,k,I)=>{const Z=rr(v,k);return e.jsx(U.Td,{className:"sa-tl-frozen",style:{width:tt,padding:0,position:"sticky",left:0,zIndex:2,...I?{"--sa-tl-bg":I}:{}},children:Lr(v,k)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:oe=>oe.stopPropagation(),children:e.jsx(yr.Checkbox,{size:"sm",checked:fr.has(Z),onChange:()=>Qr(Z),"aria-label":"Pilih baris"})})},`tl-select-${k}`)},Eo=Ce.filter(v=>!v.col.hideOnMobile),Fo=Eo.find(v=>v.col.primary)??Eo[0],ia=Eo.filter(v=>v!==Fo),ca=v=>ze(k=>{const I=new Set(k);return I.has(v)?I.delete(v):I.add(v),I}),En=(v,k)=>ia.map(({col:I,key:Z})=>{const oe=j(I,v,k),ie={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right",...I.numeric?{fontVariantNumeric:"tabular-nums"}:{}},ne=typeof oe=="string"||typeof oe=="number"?e.jsx(m.Text,{style:ie,children:oe}):e.jsx("div",{style:ie,children:oe});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof I.title=="string"?e.jsx(m.Text,{color:"subtle",fontWeight:"medium",style:{color:wi,flexShrink:0},children:I.title}):e.jsx("div",{style:{flexShrink:0},children:I.title}),ne]},Z)}),Io=(v,k)=>{const I=Fo?j(Fo.col,v,k):null;return typeof I=="string"||typeof I=="number"?e.jsx(m.Text,{as:"span",style:kt,children:I}):e.jsx("span",{style:kt,children:I})},aa=e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:O},(v,k)=>e.jsxs(f.Box,{style:{border:rt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(lr.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(lr.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(lr.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${k}`))}),Fn=e.jsx(f.Box,{fullWidth:!0,style:{minHeight:(T==null?void 0:T.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:T==null?void 0:T.content}),da=D?aa:Ie.length===0?Fn:W==="expand"?e.jsx(f.Box,{style:{display:"flex",flexDirection:"column"},children:Ie.map((v,k)=>{const I=rr(v,k),Z=Re.has(I),ie=_&&fr.has(I)?Co:Bt(n==null?void 0:n(v,k));return e.jsxs("div",{style:{borderBottom:rt,backgroundColor:ie},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[Lr(v,k)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(yr.Checkbox,{size:"sm",checked:fr.has(I),onChange:()=>Qr(I),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>ca(I),style:{flex:1,minWidth:0,display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"10px 12px",background:"none",border:"none",font:"inherit",color:"inherit",cursor:"pointer",textAlign:"left"},children:[Io(v,k),e.jsx(F.Icon,{name:Z?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),Q&&Dr(v,k)]}),Z&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:En(v,k)})]},I)})}):e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Ie.map((v,k)=>{const I=rr(v,k),Z=_&&fr.has(I);return e.jsxs(f.Box,{style:{border:rt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:Z?Co:Bt(n==null?void 0:n(v,k))},children:[Lr(v,k)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(yr.Checkbox,{size:"sm",checked:fr.has(I),onChange:()=>Qr(I),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:Io(v,k)})]}):Io(v,k),En(v,k),Q&&dt(v,k)]},I)})}),ha=s&&Ne&&Ue!==void 0,In=i==="fixed"&&!s&&(Ne?Ue!==void 0:!0),fa=In&&!Ne,_t=E&&E.length>0?E.map((v,k)=>e.jsx(U.Tr,{children:v.cells.map((I,Z)=>e.jsx(U.Td,{colSpan:I.colSpan,rowSpan:I.rowSpan,numeric:I.numeric,style:{textAlign:ot(I.align)},children:I.content},`tl-foot-${k}-${Z}`))},`tl-foot-${k}`)):null,ua=e.jsxs(U.Table,{className:"sa-table-layout",fullWidth:!0,size:l,resizable:ha,style:In?{tableLayout:"fixed"}:void 0,onWidthsChange:Er?Fr:void 0,children:[fa&&e.jsxs("colgroup",{children:[_&&e.jsx("col",{style:{width:tt}}),Ce.map(({col:v,key:k},I)=>e.jsx("col",{style:{width:jr(v,I)}},`col-${k}`)),Q&&e.jsx("col",{style:{width:xe}})]}),e.jsx(U.Thead,{ref:Cr,children:Pe?e.jsxs(e.Fragment,{children:[e.jsxs(U.Tr,{children:[_&&mn({rowSpan:2}),Le.map(v=>v.isGroup?e.jsx(U.Th,{colSpan:v.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:Nr},children:e.jsx("span",{style:kt,children:v.col.title})},`grp-${v.key}`):mo(v.leaves[0],{rowSpan:2})),Q&&e.jsx(U.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:xe,padding:0,border:"none",backgroundColor:Nr}})]}),e.jsx(U.Tr,{children:Le.flatMap(v=>v.isGroup?v.leaves.map(k=>mo(k,{top:er})):[])})]}):e.jsxs(U.Tr,{children:[_&&mn(),na(),Q&&e.jsx(U.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:xe,padding:0,border:"none",backgroundColor:Nr}})]})}),e.jsx(U.Tbody,{children:D?Me:Ie.length===0?e.jsx(U.Tr,{children:e.jsx(U.Td,{colSpan:X,children:Fn})}):e.jsxs(e.Fragment,{children:[Ie.map((v,k)=>{const I=M==null?void 0:M(v,k,k>0?Ie[k-1]:void 0),oe=_&&fr.has(rr(v,k))?Co:Bt(n==null?void 0:n(v,k));return e.jsxs(h.Fragment,{children:[I!=null&&I!==!1&&e.jsx(U.Tr,{children:e.jsx(U.Td,{colSpan:X,style:{backgroundColor:Nr},children:I})}),e.jsxs(U.Tr,{children:[_&&sa(v,k,oe),Ce.map(({col:ie,key:ne},Be)=>{var Tn;const me=(Tn=ie.cellProps)==null?void 0:Tn.call(ie,v,k,Ie);if(me!=null&&me.hidden)return null;const tr=zt(Be),ht=tr&&Be===Ir,ur=j(ie,v,k),Yr=typeof ie.bg=="function"?ie.bg(v,k,Ie):ie.bg,Pt=Bt(Yr)??oe;return e.jsx(U.Td,{className:tr?"sa-tl-frozen":void 0,colSpan:me==null?void 0:me.colSpan,rowSpan:me==null?void 0:me.rowSpan,numeric:ie.numeric,style:{textAlign:ot(ie.align),width:jr(ie,Be),minWidth:ie.minWidth,position:tr?"sticky":void 0,left:tr?Vr(Be):void 0,zIndex:tr?1:void 0,boxShadow:ht?an:void 0,...Pt?{"--sa-tl-bg":Pt}:{}},children:typeof ur=="string"?e.jsx(m.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:ot(ie.align)},children:ur}):ur},`tl-cell-${k}-${ne}`)}),Q&&e.jsx(U.Td,{className:ue?"sa-tl-frozen":void 0,style:{position:"sticky",right:0,width:xe,padding:0,overflow:ue?void 0:"visible",zIndex:2,border:"none"},children:xr(v,k)})]})]},rr(v,k))}),S!=null&&e.jsx(U.Tr,{children:e.jsx(U.Td,{colSpan:X,children:S})})]})}),_t&&e.jsx(U.Tfoot,{className:A?"sa-tl-sticky-foot":void 0,children:_t})]}),To=ve?Ie.findIndex((v,k)=>rr(v,k)===ve.rowKey):-1,Lo=To>=0?Ie[To]:null;return e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{ref:Tr,className:"sa-tl-scroll",fullWidth:!0,style:{overflow:"auto",height:x??qr},children:de?e.jsxs(e.Fragment,{children:[da,_t&&!D&&Ie.length>0&&e.jsx(f.Box,{style:{borderTop:rt},children:e.jsx(U.Table,{fullWidth:!0,size:l,className:"sa-table-layout",children:e.jsx(U.Tbody,{children:_t})})})]}):ua}),ve&&Lo&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:ve.top,right:ve.right},onClick:v=>v.stopPropagation(),children:ir(Lo).map(v=>e.jsx("div",{style:{padding:"2px 4px"},children:br(v,Lo,To,{showLabel:!0,size:"sm"})},v.key))})]})},wo=r=>r==="asc"||r==="desc",Ei=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:o="sortOrder",pageKey:n="page",defaultSort:l=null,paramKeys:s,scopeId:i,storage:c=io}=r,{searchParams:a,setSearchParams:d,searchQueries:g}=Ye(),b=a.toString(),p=i?Pr.tableSort(i):void 0,C=h.useRef(!1);h.useEffect(()=>{if(C.current||(C.current=!0,!p)||a.has(t)||a.has(o))return;const S=c.get(p);!(S!=null&&S.key)||!wo(S.direction)||d({...Object.fromEntries(a.entries()),[t]:S.key,[o]:S.direction},{replace:!0})},[]);const B=h.useMemo(()=>{const S=a.get(t),E=a.get(o);return S&&wo(E)?{key:S,direction:E}:l},[b,t,o,l]);h.useEffect(()=>{if(!p)return;const S=a.get(t),E=a.get(o);S&&wo(E)?c.set(p,{key:S,direction:E}):c.remove(p)},[b,p,t,o,c]);const x=(s==null?void 0:s.sortBy)??"sortBy",W=(s==null?void 0:s.sortOrder)??"sortOrder",L=h.useMemo(()=>B?{[x]:B.key,[W]:B.direction}:{},[B,x,W]),M=h.useCallback(S=>{const E={...g};S?(E[t]=S.key,E[o]=S.direction):(delete E[t],delete E[o]),delete E[n],d(E)},[g,t,o,n,d]);return{sort:B,setSort:M,params:L}},mt=({of:r,render:t})=>h.Children.toArray(r==null?void 0:r.map((o,n,l)=>t(o,n,l))),pe=({condition:r,fallback:t,children:o,loading:n,isLoading:l})=>e.jsx(e.Fragment,{children:l?n:r?o:t}),be=r=>e.jsx(m.Text,{...r,fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),vr=r=>e.jsx(m.Text,{color:"red-600",fontSize:"sm",children:r.message}),Fi=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,d;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(pe,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(m.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(he.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:l.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(pe,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Ae.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(pe,{condition:!!l.description,children:e.jsx(m.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(gr.Input,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default",fullWidth:!0}),!s&&l.errorMessage&&e.jsx(vr,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},Ii=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,d;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(pe,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(m.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(he.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:l.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(pe,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Ae.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(pe,{condition:!!l.description,children:e.jsx(m.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(f.Box,{direction:"column",style:{width:l.inputProps.fullWidth?"100%":t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(Wr.Dropdown,{size:r,...l.inputProps,error:!!l.errorMessage})}),!s&&l.errorMessage&&e.jsx(vr,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},Ti=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Li=r=>{var c;const[t,o]=h.useState(!1),n=a=>{a.preventDefault(),a.stopPropagation()},l=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&r.handleOnFileChange(a.dataTransfer.files.item(0))},s=a=>{a.preventDefault(),o(!0)},i=a=>{a.preventDefault(),o(!1)};return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:l,onDragEnter:s,onDragLeave:i,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${Ti(r.errorMessage,r.status)}`},children:[e.jsx(F.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(he.Flex,{direction:"column",gap:"xs",children:[e.jsxs(he.Flex,{direction:"row",gap:"xs",children:[e.jsx(m.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(m.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(m.Text,{fontSize:"sm",color:"gray-500",children:(c=r.fileSupports)==null?void 0:c.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function Mi(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const hn=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},Ai=r=>{const t={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},o=r.split(" ");if(o.length!==3)return null;const n=parseInt(o[0],10),l=t[o[1]],s=parseInt(o[2],10);return isNaN(n)||isNaN(l)||isNaN(s)?null:new Date(s,l,n)};function Oi(r,t=!0){if(!r)return"Rp 0";const o=typeof r=="number"?r.toString():r;if(isNaN(Number(o)))return"Rp 0";const n=o.split("."),l=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),s=n.length===2?l+"."+n[1]:l;return t?"Rp"+s:s}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},String.prototype.toNumber=function(){return Number(this)};const Wi=r=>{const t=r.split(" ");let o=t[0].charAt(0);return t.length>1&&(o+=""+t[1].charAt(0)),o.toUpperCase()};function zi(r){const t=typeof r=="string"?new Date(r):r;if(isNaN(t.getTime()))throw new Error("Invalid date format");const o=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0");return`${o}-${n}-${l}`}const Hi="sa-admin",hr=r=>`var(--${Hi}-${r})`,_i={base:{borderColor:hr("base-border-color"),textColor:hr("base-text-color"),iconColor:hr("base-icon-color"),placeholderColor:hr("base-placeholder-color")},document:{bgColor:hr("document-bg-color")},sidebar:{bgColor:hr("sidebar-bg-color"),borderColor:hr("sidebar-border-color"),maxWidth:hr("sidebar-max-width"),width:hr("sidebar-width"),collapseWidth:hr("sidebar-collapse-width"),collapseV2Width:hr("sidebar-v2-collapse-width")}},Pi=24*60*60*1e3,Ni=r=>{const t="14px poppins",n=document.createElement("canvas").getContext("2d");n.font=t;const l=n.measureText(r).width;return Number(Math.ceil(l))},ji=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Vi=/--+/,qi=/-$/;function Zi(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function Gi(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function Qi(r){return/^[A-Za-z\s]+$/.test(r)}const Ui=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&(r.key==="a"||r.key==="c"||r.key==="v")||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},Yi=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},Xi=r=>{const t=/^[0-9.]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},$i=r=>ji.test(r);function Ji(r){return!(Vi.test(r)||qi.test(r))}const Ki=r=>{const t=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((r.ctrlKey||r.metaKey)&&["a","c","v","x"].includes(r.key.toLowerCase()))return;const o=r.currentTarget.value;/^[0-9]$/.test(r.key)||r.key==="."&&!o.includes(".")||r.key==="-"&&o.length===0&&!o.includes("-")||t.includes(r.key)||r.preventDefault()},Ri=r=>{const t=document.getElementById(r);if(t){const o=t.getBoundingClientRect(),n=window.scrollY+o.top-80;window.scrollTo({top:n,behavior:"smooth"})}};function ec(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(s=>t.endsWith(s)))return r;const l=Number(r);if(isNaN(l))throw new Error("Invalid size format");return l>=1e6?`${(l/1e6).toFixed(2)}MB`:l>=1e3?`${(l/1e3).toFixed(2)}KB`:`${l}B`}function rc(r){const t=r.split("/");return t[t.length-1]}const tc=r=>{var t,o;return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:r.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(he.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(F.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(he.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(m.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?rc(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(he.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(F.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(he.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",children:ec(((o=r.fileSelected)==null?void 0:o.size.toString())||"100000")}),e.jsx(F.Icon,{name:"Dot",size:"xs"}),e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:hn(new Date)})]})]})]}),e.jsx(V.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(F.Icon,{name:"Trash1"})})]})},fn=({status:r="default",labelPosition:t="outside-top",...o})=>{var p;const n=h.useRef(null),l=()=>{if(o.defaultFile){window.open(o.defaultFile.url);return}n.current&&n.current.click()},s=Ee.useMediaQuery("md"),i=r==="error"||typeof o.errorMessage=="string"&&!!o.errorMessage,c=o.label?e.jsxs(he.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(m.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:o.label}),o.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"var(--sa-radii-xs, 4px)",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),o.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=o.description?e.jsx(m.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.description}):null,d=e.jsxs(e.Fragment,{children:[o.helperText&&e.jsx(m.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.helperText}),o.errorText&&r==="error"&&e.jsx(m.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorText}),o.errorMessage&&!o.errorText&&e.jsx(m.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorMessage})]}),g=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:C=>{var B;return o.handleOnChangeFile(((B=C.target.files)==null?void 0:B.item(0))||null)},accept:(p=o.fileSupportOption)==null?void 0:p.map(C=>"."+(C==null?void 0:C.toLowerCase())).join(", ")}),b=e.jsxs(f.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...o.containerProps,children:[g,(o.fileSelected||o.defaultFile)&&e.jsx(tc,{fileSelected:o.fileSelected,defaultFile:o.defaultFile,handleOnDeleteFile:o.handleOnDeleteFile,handleOnClickFile:l}),!o.fileSelected&&!o.defaultFile&&e.jsx(Li,{fileSupports:o.fileSupportOption,isDesktop:s,errorMessage:i?o.errorText||o.errorMessage||" ":void 0,status:i?"error":"default",handleOnClick:l,handleOnFileChange:o.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(he.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(he.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[c,a]}),e.jsxs(he.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[b,d]})]}):e.jsxs(he.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[c,a,b,d]})},oc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,d;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(pe,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(m.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(he.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:l.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(pe,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Ae.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(pe,{condition:!!l.description,children:e.jsx(m.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(he.Flex,{direction:"column",gap:"xs",children:[e.jsx(fn,{...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(vr,{message:l.errorMessage})]})]})},lc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...s})=>{var a,d,g,b;const i=s.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(pe,{condition:!!l,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(be,{children:s.title}),e.jsx(nr.Body3,{props:{color:"gray-500"},children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(he.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:s.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(pe,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Ae.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(g=s.tooltip)==null?void 0:g.arrowPosition,focusable:!0,...s.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(pe,{condition:!!s.description,children:e.jsx(m.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsx(f.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(mt,{of:(b=s.checkBoxesList)==null?void 0:b.map(p=>({...p,isChecked:s.checkBoxesAreChecked.includes(p.id)})),render:p=>p.renderBadge?e.jsxs(f.Box,{direction:"row",justify:"space-between",gap:"lg",...s.badgeContainerProps,children:[e.jsx(yr.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:C=>s.onChecked(C.target.value,p),label:p.name,description:p.description}),p.renderBadge]}):e.jsx(yr.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:C=>s.onChecked(C.target.value,p),label:p.name,description:p.description})})}),!i&&s.errorMessage&&e.jsx(vr,{message:s.errorMessage})]})},nc=({position:r="vertical",size:t="md",fullWidth:o=!1,...n})=>{var s;const l=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(pe,{condition:!!n.description||!!n.title,children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[n.title&&e.jsx(be,{children:n.title}),e.jsx(pe,{condition:!!n.description,children:e.jsx(m.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(f.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(mt,{of:(s=n.radioList)==null?void 0:s.map(i=>({...i,isChecked:n.radioIsChecked===i.id})),render:({value:i,id:c,isChecked:a,subInput:d,label:g,description:b})=>e.jsxs(f.Box,{direction:"column",gap:"xs",customMaxWidth:l,children:[e.jsx(Vt.Radio,{id:`${c.toString()}-${i}`,name:n.groupName||g,label:g,value:i,checked:a,onChange:p=>n.onChecked({id:c,label:p.target.name,value:p.target.value}),disabled:n.disableAll},c),b&&e.jsx(m.Text,{color:"gray-500",style:{marginLeft:28},children:b}),d]})})}),n.errorMessage&&e.jsx(vr,{message:n.errorMessage})]})},sc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,d;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(pe,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(m.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(he.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:l.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(pe,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Ae.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(pe,{condition:!!l.description,children:e.jsx(m.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(he.Flex,{direction:"column",gap:"xs",children:[e.jsx(jt.Textarea,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(vr,{message:l.errorMessage})]})]})},ic=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",required:n=!1,fullWidth:l=!1,...s})=>{var c,a,d;const i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(pe,{condition:n,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:l,children:[e.jsx(be,{children:s.title}),e.jsx(m.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:l,children:[e.jsxs(he.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:s.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(pe,{condition:!!((c=s.tooltip)!=null&&c.label),children:e.jsx(Ae.Tooltip,{label:(a=s.tooltip)==null?void 0:a.label,arrowPosition:(d=s.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...s.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(pe,{condition:!!s.titleDescription,children:e.jsx(m.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})})]})}),e.jsx(_r.Toggle,{checked:s.checked,onChange:s.onChange,label:s.label,description:s.description}),s.errorMessage&&e.jsx(vr,{message:s.errorMessage})]})},cc=({variant:r="primary",size:t="md",...o})=>{const n=Hr.useColor(),l=i=>{var a,d,g,b,p,C;if(!i)return;const c=o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary"?"var(--sa-text-subtle, #8c8f97)":r==="secondary-danger"?(d=(a=n==null?void 0:n.computed)==null?void 0:a.red)==null?void 0:d[600]:r==="secondary-primary"?(b=(g=n==null?void 0:n.computed)==null?void 0:g.blue)==null?void 0:b[700]:(C=(p=n==null?void 0:n.computed)==null?void 0:p.gray)==null?void 0:C[50];return e.jsx(F.Icon,{name:i,size:t,style:{color:c}})},s=()=>{var c,a,d,g;if(r!=="secondary-danger"&&r!=="secondary-primary")return o.title;const i={color:o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(c=n==null?void 0:n.computed)==null?void 0:c.red)==null?void 0:a[600]:(g=(d=n==null?void 0:n.computed)==null?void 0:d.blue)==null?void 0:g[700]};switch(t){case"xs":return e.jsx(nr.Body2,{props:{style:i},children:o.title});case"sm":case"md":return e.jsx(nr.SubH3,{props:{style:i},children:o.title});case"lg":return e.jsx(nr.SubH2,{props:{style:i},children:o.title});default:return o.title}};return e.jsx(V.Button,{fullWidth:!0,disabled:o.disabled,primary:r==="primary",secondary:r==="secondary"||r==="secondary-danger"||r==="secondary-primary",success:r==="success",onClick:o.onClick,type:o.type,iconLeft:l(o.iconLeft),iconRight:l(o.iconRight),size:t,children:s()})},ac=r=>e.jsx(nr.H5,{props:{...r},children:r.title}),dc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,d;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(pe,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(m.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(he.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:l.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(pe,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Ae.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(pe,{condition:!!l.description,children:e.jsx(m.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(he.Flex,{direction:"column",gap:"xs",children:[e.jsx(f.Box,{direction:"column",style:{width:t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(Sr.StarasiaDate,{size:r,...l.inputProps,status:l.errorMessage?"error":void 0})}),!s&&l.errorMessage&&e.jsx(vr,{message:l.errorMessage})]})]})};async function hc(r,t){const o=new Image;o.src=r,await new Promise((s,i)=>{o.onload=s,o.onerror=i});const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const l=n.getContext("2d",{alpha:!0});if(!l)throw new Error("No 2D context");return l.drawImage(o,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((s,i)=>{n.toBlob(c=>{if(!c)return i("Canvas is empty");const a=new File([c],"cropped.png",{type:"image/png"});s(a)},"image/png")})}const un={"1:1":1,"4:3":4/3,"16:9":16/9,"3:4":3/4,"9:16":9/16,"2:3":2/3,"3:2":3/2,"32:9":32/9},gn=h.forwardRef(({handleUpload:r,urlImage:t,isUploading:o,croppedImage:n,setCroppedImage:l,size:s="96",aspect:i="1:1",containerProps:c,maxFileSize:a=2,onError:d},g)=>{const b=Ee.useMediaQuery("md"),[p,C]=h.useState(!1),[B,x]=h.useState(null),[W,L]=h.useState(!1),[M,S]=h.useState({x:0,y:0}),[E,A]=h.useState(1),[T,D]=h.useState(null),[O,q]=h.useState(!1);h.useEffect(()=>{t===null&&l(null)},[t]);const G=h.useCallback((le,ue)=>{D(ue)},[]),_=le=>{var Fe;const ue=(Fe=le.target.files)==null?void 0:Fe[0];if(!ue)return;const De=new FileReader;De.onload=()=>{x(De.result),L(!0)},De.readAsDataURL(ue)},H=async()=>{if(!(!B||!T||O)){q(!0);try{const le=await hc(B,T);if(a&&le.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(le);const ue=URL.createObjectURL(le);l(ue,le),L(!1)}catch{d==null||d("Gagal memproses gambar")}finally{q(!1)}}},R=h.useRef(null),ee=()=>{R.current&&R.current.click()};h.useImperativeHandle(g,()=>({openFileDialog:()=>{var le;(le=R.current)==null||le.click()}}));const J=parseInt(s,10),K=un[i];let de,Q;return K>=1?(Q=J,de=J*K):(de=J,Q=J/K),e.jsxs(f.Box,{direction:"column",display:"flex",position:"relative",bg:(c==null?void 0:c.bg)||"gray-200",borderStyle:(c==null?void 0:c.borderStyle)||"border-none",borderColor:(c==null?void 0:c.borderColor)||"gray-200",borderWidth:(c==null?void 0:c.borderWidth)||"border-2",borderRadius:(c==null?void 0:c.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:c!=null&&c.fullWidth?"100%":`${de}px`,height:c!=null&&c.fullWidth?"auto":`${Q}px`,aspectRatio:K,flexShrink:0},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:[n||t?e.jsx("img",{src:n||t||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(f.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(F.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(s)/2<40?Number(s)/2:40,height:Number(s)/2<40?Number(s)/2:40}})}),e.jsxs(f.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214c)",opacity:p?1:0,transition:"opacity 0.3s ease-in-out"},onClick:ee,children:[e.jsx("input",{ref:R,type:"file",accept:"image/*",onChange:_,disabled:o,style:{display:"none"}}),e.jsxs(f.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(F.Icon,{name:"Edit3",style:{color:"var(--sa-text-primary, #292a2e)"}}),e.jsx(pe,{condition:s.toNumber()>80,children:e.jsx(m.Text,{color:"gray-50",fontSize:s.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),o&&e.jsx(f.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f6cc)"},children:e.jsx(f.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),W&&gt.createPortal(e.jsx("div",{style:{position:"fixed",inset:0,zIndex:19999,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.6)"},onClick:()=>{O||L(!1)},children:e.jsxs("div",{style:{backgroundColor:"var(--sa-background-primary)",borderRadius:"var(--sa-radii-md)",boxShadow:"0 20px 60px rgba(0,0,0,0.3)",overflow:"hidden",width:b?i==="1:1"?"min(90vw, 480px)":`min(90vw, ${de*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:le=>le.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:B&&e.jsx(Ln,{image:B,crop:M,zoom:E,aspect:i?un[i]:void 0,onCropChange:S,onZoomChange:A,onCropComplete:G,objectFit:"contain",minZoom:.5,restrictPosition:!1})}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--sa-border-subtle)"},children:[e.jsx(V.Button,{size:"sm",secondary:!0,disabled:O,onClick:()=>L(!1),children:"Cancel"}),e.jsx(V.Button,{size:"sm",primary:!0,isLoading:O,onClick:H,children:"Crop"})]})]})}),document.body)]})}),fc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...s})=>{var a,d,g;const i=s.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(pe,{condition:!!l,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(be,{children:s.title}),e.jsx(m.Text,{fontSize:r,color:"gray-500",children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(he.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:s.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(pe,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Ae.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(g=s.tooltip)==null?void 0:g.arrowPosition,focusable:!0,...s.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(pe,{condition:!!s.description,children:e.jsx(m.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsxs(he.Flex,{direction:"column",gap:"xs",children:[e.jsx(gn,{...s.inputProps}),!i&&s.errorMessage&&e.jsx(vr,{message:s.errorMessage})]})]})},uc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,c,a;const s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(pe,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(m.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(he.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(be,{fontSize:r,children:l.title}),e.jsx(be,{color:"error",fontSize:r,children:o}),e.jsx(pe,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Ae.Tooltip,{label:(c=l.tooltip)==null?void 0:c.label,arrowPosition:(a=l.tooltip)==null?void 0:a.arrowPosition,focusable:!0,...l.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(pe,{condition:!!l.description,children:e.jsx(m.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),l.inputProps.extended&&l.inputProps.extended]})},gc=({items:r,id:t,handleOnUpdate:o,width:n,toggleShow:l=!0,disabled:s=!1})=>{var g;const[i,c]=h.useState([]);h.useEffect(()=>{r&&c([...r.map(b=>({id:b.id,isActive:b.isActive}))])},[r]);const a=(g=i.find(b=>b.id===t))==null?void 0:g.isActive,d=h.useCallback(()=>{c(b=>b.map(p=>p.id===t?{...p,isActive:!p.isActive}:p)),o&&o(!a)},[t,o,a]);return e.jsx(f.Box,{direction:"row",gap:"md",style:{width:n},children:l&&e.jsx(_r.Toggle,{disabled:s,checked:a,onChange:d,label:a?"Active":"Inactive"})})},yc={InputText:Fi,InputDropdown:Ii,InputSingleFile:oc,CheckBoxOptions:lc,RadioOptions:nc,InputTextArea:sc,ToggleForm:ic,ActionButton:cc,FormTitle:ac,InputDate:dc,InputImgFile:fc,Custom:uc},yn=({customBottom:r})=>{const[t,o]=h.useState(!1),n=()=>{window.scrollY>window.innerHeight?o(!0):o(!1)},l=()=>{window.scrollTo({top:0,behavior:"smooth"})};return h.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(f.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(f.Box,{direction:"column",position:"absolute",style:{bottom:r||"1.6rem",right:"2rem",transform:t?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(V.Button,{secondary:!0,size:"xs",onClick:l,type:"button",iconLeft:e.jsx(F.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Ke="sa-sidepanel-item",pn="sa-sidepanel-item-styles",pc=`@layer starasia.components {
53
+ .${Ke} {
54
54
  display: block;
55
55
  box-sizing: border-box;
56
56
  width: 100%;
@@ -65,39 +65,39 @@
65
65
  outline: none;
66
66
  transition: background-color 140ms ease, box-shadow 140ms ease;
67
67
  }
68
- .${Ue}[data-divider="true"] {
68
+ .${Ke}[data-divider="true"] {
69
69
  border-bottom: 1px solid var(--sa-border-subtle, #0b120e24);
70
70
  }
71
71
  /* The first row also gets a top line so the list is bounded on its own,
72
72
  without relying on a wrapping container's border. Adjacent rows still
73
73
  share a single 1px line (only border-bottom), never a doubled 2px one. */
74
- .${Ue}[data-divider="true"]:first-child {
74
+ .${Ke}[data-divider="true"]:first-child {
75
75
  border-top: 1px solid var(--sa-border-subtle, #0b120e24);
76
76
  }
77
- .${Ue}:hover {
77
+ .${Ke}:hover {
78
78
  background: var(--sa-background-neutral, #f0f1f2);
79
79
  }
80
- .${Ue}:focus-visible,
81
- .${Ue}[data-active="true"] {
80
+ .${Ke}:focus-visible,
81
+ .${Ke}[data-active="true"] {
82
82
  background: var(--sa-background-brand-subtlest, #e6edf6);
83
83
  }
84
- .${Ue}:focus-visible {
84
+ .${Ke}:focus-visible {
85
85
  background: var(--sa-background-neutral, #f0f1f2);
86
86
  }
87
87
  /* Accent bar — sign of the offset picks the edge it hugs. */
88
- .${Ue}[data-accent="left"]:focus-visible,
89
- .${Ue}[data-accent="left"][data-active="true"] {
88
+ .${Ke}[data-accent="left"]:focus-visible,
89
+ .${Ke}[data-accent="left"][data-active="true"] {
90
90
  box-shadow: inset 3.5px 0 0 0 var(--sa-border-focused, #1a4fa0);
91
91
  }
92
- .${Ue}[data-accent="right"]:focus-visible,
93
- .${Ue}[data-accent="right"][data-active="true"] {
92
+ .${Ke}[data-accent="right"]:focus-visible,
93
+ .${Ke}[data-accent="right"][data-active="true"] {
94
94
  box-shadow: inset -3.5px 0 0 0 var(--sa-border-focused, #1a4fa0);
95
95
  }
96
- .${Ue}[data-active="true"]:hover {
96
+ .${Ke}[data-active="true"]:hover {
97
97
  background: var(--sa-background-brand-subtlest, #e6edf6);
98
98
  }
99
- .${Ue}:disabled {
99
+ .${Ke}:disabled {
100
100
  cursor: not-allowed;
101
101
  opacity: 0.55;
102
102
  }
103
- }`;function nc(){if(typeof document>"u"||document.getElementById(ln))return;const r=document.createElement("style");r.id=ln,r.textContent=lc,document.head.appendChild(r)}const sc=({active:r=!1,accentSide:t="left",onClick:o,title:n,badge:l,heading:s,meta:i,children:c,divider:a=!0,disabled:d,className:g,style:b,"aria-label":p})=>(h.useEffect(nc,[]),e.jsx("button",{type:"button",className:[Ue,g].filter(Boolean).join(" "),"data-active":r?"true":"false","data-accent":t,"data-divider":a?"true":"false","aria-current":r?"true":void 0,"aria-label":p,disabled:d,onClick:o,style:b,children:c??e.jsxs(f.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(n||l)&&e.jsxs(de.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[n?e.jsx(k.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:n}):e.jsx("span",{}),l?e.jsx(f.Box,{style:{flexShrink:0},children:l}):null]}),s?e.jsx(k.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:s}):null,i?e.jsx(k.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:i}):null]})})),ho=18,ic=40,nn="280ms cubic-bezier(0.4, 0, 0.2, 1)",sn="var(--sa-border-subtle, #0b120e24)",cc=`1px solid ${sn}`,cn="var(--sa-background-primary, #ffffff)",ac=({children:r,header:t,collapsed:o,defaultCollapsed:n=!1,onToggle:l,width:s=337,side:i="left",offsetTop:c="var(--app-header-height, 4rem)",height:a,showToggle:d=!0,togglePosition:g="top",toggleOffset:b=40,toggleLabel:p,style:C,bodyStyle:w,className:S,pageLayout:H,overlay:T="mobile",wrapperProps:A,contentProps:x})=>{const B=ke.useMediaQuery("md"),W=o!==void 0,[F,m]=h.useState(n),O=W?o:F,N=()=>{const re=!O;W||m(re),l==null||l(re)},$=i==="left",M=typeof c=="number"?`${c}px`:c,q=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${M})`,J=p??{collapse:"Collapse panel",expand:"Expand panel"},U=g==="center"?{top:"50%",transform:"translateY(-50%)"}:g==="bottom"?{bottom:b}:{top:b},K=O?$?"ChevronRight":"ChevronLeft":$?"ChevronLeft":"ChevronRight",R=H!==void 0&&(T==="mobile"?!B:T),ae=R?{position:"absolute",top:0,bottom:0,width:s,transform:`translateX(${O?$?"-100%":"100%":"0"})`,transition:`transform ${nn}`,zIndex:50,...$?{left:0}:{right:0},...C}:{position:"sticky",top:M,alignSelf:"flex-start",width:O?0:s,flexShrink:0,height:q,transition:`width ${nn}`,...C},Q=e.jsxs(f.Box,{className:S,style:ae,children:[e.jsx(f.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:O?void 0:$?"border-solid-r":"border-solid-l",borderWidth:O?void 0:$?"border-r":"border-l",style:{backgroundColor:cn,borderColor:sn},children:e.jsxs(f.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:s,customMinWidth:s,style:$?void 0:{marginLeft:"auto"},children:[t?e.jsx(f.Box,{padding:"md",style:{flexShrink:0},children:t}):null,e.jsx(f.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...w},children:r})]})}),d&&e.jsx(jr,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:N,"aria-label":O?J.expand:J.collapse,"aria-expanded":!O,"aria-pressed":O,customWidth:ho,customHeight:ic,style:{...U,backgroundColor:cn,border:cc,zIndex:5,...$?{right:-ho,borderLeft:"none",borderRadius:"0 var(--sa-radii-md, 8px) var(--sa-radii-md, 8px) 0"}:{left:-ho,borderRight:"none",borderRadius:"var(--sa-radii-md, 8px) 0 0 var(--sa-radii-md, 8px)"}},children:e.jsx(I.Icon,{name:K,size:"sm"})})]});return H===void 0?Q:e.jsxs(f.Box,{direction:"row",position:"relative",...A,style:{height:`calc(100vh - ${M})`,overflow:"hidden",...(A==null?void 0:A.style)??{}},children:[!R&&$?Q:null,e.jsx(f.Box,{display:"block",...x,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(x==null?void 0:x.style)??{}},children:H}),!R&&!$?Q:null,R&&e.jsxs(e.Fragment,{children:[!O&&e.jsx("div",{onClick:N,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),Q]})]})},fo="--app-aside-width",dc=r=>typeof r=="number"?`${r}px`:r,hc=({pageLayout:r,children:t,wrapperProps:o,containerProps:n})=>{const l=ke.useMediaQuery("md"),s=(n==null?void 0:n.customWidth)??264;return h.useLayoutEffect(()=>{const i=document.documentElement;return i.style.setProperty(fo,l?dc(s):"0px"),()=>i.style.removeProperty(fo)},[l,s]),e.jsxs(f.Box,{display:"block",direction:"row",...o,style:{marginRight:l?s:24,...(o==null?void 0:o.style)??{}},children:[r,e.jsx(f.Box,{direction:"column",show:"desktop",as:"aside",position:"fixed",top:"top-0",bottom:"bottom-0",right:"right-0",customWidth:264,borderStyle:"border-solid-l",borderWidth:"border-l",...n,style:{marginTop:"var(--app-header-height, 4rem)",backgroundColor:"var(--sa-background-primary, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},uo="--sa-floating-footer-height",fc=r=>typeof r=="number"?`${r}px`:r,uc=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:o,respectAside:n=!1,offsetRight:l,containerProps:s})=>{const i=h.useRef(null),c=l!=null?fc(l):n?"var(--app-aside-width, 0px)":"0px";return h.useLayoutEffect(()=>{const a=document.documentElement,d=()=>{var p;const b=((p=i.current)==null?void 0:p.getBoundingClientRect().height)??0;a.style.setProperty(uo,`${b}px`)};d();const g=new ResizeObserver(d);return i.current&&g.observe(i.current),()=>{g.disconnect(),a.style.removeProperty(uo)}},[]),e.jsx(f.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(f.Box,{ref:i,position:"fixed",bottom:"bottom-0",bg:"white",direction:"row",align:"center",display:"flex",paddingBlock:"sm",paddingInline:"md",borderColor:"border-subtle",style:{left:"var(--app-sidebar-width, 0px)",right:c,transition:"left 0.3s ease-in-out, right 0.3s ease-in-out"},justify:(s==null?void 0:s.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx(on,{...o,customBottom:(o==null?void 0:o.customBottom)||"5.7rem"}),r]})})},gc=({fields:r})=>e.jsx(f.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(ht,{of:r,render:(t,o)=>e.jsx(yc,{...t},o)})}),yc=({title:r,value:t,icon:o})=>e.jsxs(f.Box,{display:"flex",direction:"column",gap:"sm",children:[o?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(I.Icon,{name:o,color:"subtle"}),e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(k.Text,{variant:"sub-h3",children:t}):t]}),We={silhouette:"#A7B0AC",accent:"#78867F"};function pc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r||"100",height:t||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:We.silhouette}),e.jsx("path",{d:"M33.2089 38.8535C31.3993 38.8535 29.9263 40.3453 29.9263 42.1805C29.9263 44.0156 31.3982 45.5062 33.2089 45.5062C35.0196 45.5062 36.4903 44.0145 36.4903 42.1805C36.4903 40.3465 35.0184 38.8535 33.2089 38.8535ZM33.2089 43.1625C32.6735 43.1625 32.2388 42.7219 32.2388 42.1805C32.2388 41.6391 32.6735 41.1973 33.2089 41.1973C33.7442 41.1973 34.1778 41.6379 34.1778 42.1805C34.1778 42.723 33.7431 43.1625 33.2089 43.1625Z",fill:We.silhouette}),e.jsx("path",{d:"M33.2089 54.6777C31.3993 54.6777 29.9263 56.1695 29.9263 58.0047C29.9263 59.8398 31.3982 61.3316 33.2089 61.3316C35.0196 61.3316 36.4903 59.8398 36.4903 58.0047C36.4903 56.1695 35.0184 54.6777 33.2089 54.6777ZM33.2089 58.9879C32.6735 58.9879 32.2388 58.5473 32.2388 58.0047C32.2388 57.4621 32.6735 57.0215 33.2089 57.0215C33.7442 57.0215 34.1778 57.4621 34.1778 58.0047C34.1778 58.5473 33.7431 58.9879 33.2089 58.9879Z",fill:We.silhouette}),e.jsx("path",{d:"M33.2089 70.5C31.3993 70.5 29.9263 71.9918 29.9263 73.827C29.9263 75.6621 31.3982 77.1539 33.2089 77.1539C35.0196 77.1539 36.4903 75.6621 36.4903 73.827C36.4903 71.9918 35.0184 70.5 33.2089 70.5ZM33.2089 74.8102C32.6735 74.8102 32.2388 74.3695 32.2388 73.827C32.2388 73.2844 32.6735 72.8438 33.2089 72.8438C33.7442 72.8438 34.1778 73.2844 34.1778 73.827C34.1778 74.3695 33.7431 74.8102 33.2089 74.8102Z",fill:We.silhouette}),e.jsx("path",{d:"M70.0215 38.2852C69.3821 38.2852 68.8652 38.809 68.8652 39.457V44.3332C68.8652 44.9812 69.3821 45.5051 70.0215 45.5051C70.6609 45.5051 71.1777 44.9812 71.1777 44.3332V39.457C71.1777 38.809 70.6609 38.2852 70.0215 38.2852Z",fill:We.silhouette}),e.jsx("path",{d:"M70.0215 54.3926C69.3821 54.3926 68.8652 54.9164 68.8652 55.5645V60.4406C68.8652 61.0887 69.3821 61.6125 70.0215 61.6125C70.6609 61.6125 71.1777 61.0887 71.1777 60.4406V55.5645C71.1777 54.9164 70.6609 54.3926 70.0215 54.3926Z",fill:We.silhouette}),e.jsx("path",{d:"M70.0215 70.5C69.3821 70.5 68.8652 71.0238 68.8652 71.6719V76.5492C68.8652 77.1973 69.3821 77.7211 70.0215 77.7211C70.6609 77.7211 71.1777 77.1973 71.1777 76.5492V71.6719C71.1777 71.0238 70.6609 70.5 70.0215 70.5Z",fill:We.silhouette}),e.jsx("path",{d:"M65.77 39.7617C65.1306 39.7617 64.6138 40.2855 64.6138 40.9336V45.8098C64.6138 46.4578 65.1306 46.9816 65.77 46.9816C66.4094 46.9816 66.9263 46.4578 66.9263 45.8098V40.9336C66.9263 40.2855 66.4094 39.7617 65.77 39.7617Z",fill:We.silhouette}),e.jsx("path",{d:"M65.77 55.8691C65.1306 55.8691 64.6138 56.393 64.6138 57.041V61.9172C64.6138 62.5652 65.1306 63.0891 65.77 63.0891C66.4094 63.0891 66.9263 62.5652 66.9263 61.9172V57.041C66.9263 56.393 66.4094 55.8691 65.77 55.8691Z",fill:We.silhouette}),e.jsx("path",{d:"M65.77 71.9766C65.1306 71.9766 64.6138 72.5004 64.6138 73.1484V78.0246C64.6138 78.6727 65.1306 79.1965 65.77 79.1965C66.4094 79.1965 66.9263 78.6727 66.9263 78.0246V73.1484C66.9263 72.5004 66.4094 71.9766 65.77 71.9766Z",fill:We.silhouette}),e.jsx("path",{d:"M61.2939 40.7246C60.6545 40.7246 60.1377 41.2484 60.1377 41.8965V46.7727C60.1377 47.4207 60.6545 47.9445 61.2939 47.9445C61.9334 47.9445 62.4502 47.4207 62.4502 46.7727V41.8965C62.4502 41.2484 61.9334 40.7246 61.2939 40.7246Z",fill:We.silhouette}),e.jsx("path",{d:"M61.2939 56.832C60.6545 56.832 60.1377 57.3559 60.1377 58.0039V62.8801C60.1377 63.5281 60.6545 64.052 61.2939 64.052C61.9334 64.052 62.4502 63.5281 62.4502 62.8801V58.0039C62.4502 57.3559 61.9334 56.832 61.2939 56.832Z",fill:We.silhouette}),e.jsx("path",{d:"M61.2939 72.9395C60.6545 72.9395 60.1377 73.4633 60.1377 74.1113V78.9875C60.1377 79.6355 60.6545 80.1594 61.2939 80.1594C61.9334 80.1594 62.4502 79.6355 62.4502 78.9875V74.1113C62.4502 73.4633 61.9334 72.9395 61.2939 72.9395Z",fill:We.silhouette}),e.jsx("path",{d:"M39.0489 24.4037C39.131 24.4037 39.2154 24.3944 39.2986 24.3768C42.7316 23.6127 46.6755 23.185 51.0207 23.11C51.659 23.0983 52.1677 22.5651 52.1561 21.917C52.1446 21.2701 51.652 20.7451 50.9791 20.7662C46.4813 20.8448 42.3835 21.2889 38.8015 22.0881C38.1782 22.2264 37.7828 22.8522 37.9204 23.4838C38.0395 24.0311 38.5182 24.4037 39.0489 24.4037Z",fill:We.silhouette}),e.jsx("path",{d:"M32.5406 26.6215C32.7407 26.6215 32.9442 26.57 33.128 26.4586C33.1315 26.4563 33.5096 26.2336 34.2889 25.9055C34.8786 25.6582 35.1584 24.9727 34.9144 24.3739C34.6704 23.775 33.9917 23.4926 33.4032 23.7399C32.4632 24.1348 31.9926 24.4149 31.9417 24.4465C31.396 24.7782 31.219 25.4942 31.544 26.0485C31.7613 26.4164 32.1452 26.6204 32.5395 26.6204L32.5406 26.6215Z",fill:We.silhouette}),e.jsx("path",{d:"M92.7251 26.7272L82.3845 29.3124C81.6929 29.4856 80.9911 29.0642 80.8179 28.3727C80.6447 27.6799 81.066 26.978 81.7576 26.8048L92.0982 24.2196C92.791 24.0464 93.4929 24.4678 93.6661 25.1593C93.8393 25.8521 93.4179 26.554 92.7251 26.7272Z",fill:We.accent,fillOpacity:"0.65"}),e.jsx("path",{d:"M94.4649 11.0082L80.2465 21.3488C79.6701 21.7676 78.8609 21.6409 78.4408 21.0632C78.022 20.4867 78.1487 19.6775 78.7265 19.2574L92.9448 8.91682C93.5213 8.49803 94.3305 8.6247 94.7505 9.20248C95.1693 9.77897 95.0414 10.5881 94.4649 11.0082Z",fill:We.accent,fillOpacity:"0.65"}),e.jsx("path",{d:"M78.0091 10.6269L74.1314 17.0898C73.7643 17.7025 72.9706 17.9002 72.358 17.5331C71.7466 17.1673 71.5475 16.3724 71.9146 15.7597L75.7923 9.29684C76.1594 8.68545 76.9544 8.48769 77.5657 8.85349C78.1784 9.22058 78.3762 10.0155 78.0091 10.6269Z",fill:We.accent,fillOpacity:"0.65"})]})})}const bc=({title:r="create",children:t,onClickAction:o,variant:n="primary",variantTitle:l,leftIcon:s,showButton:i=!0,customHeight:c,childrenButton:a,customIcon:d})=>{const g=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:s?e.jsx(_.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(_.Button,{primary:!0,onClick:o,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:s?e.jsx(_.Button,{secondary:!0,iconLeft:s,onClick:o,children:l?e.jsx(k.Text,{fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(_.Button,{secondary:!0,onClick:o,children:a||r})});case"success":return e.jsx(e.Fragment,{children:s?e.jsx(_.Button,{success:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(_.Button,{success:!0,onClick:o,children:a||r})});default:return e.jsx(e.Fragment,{children:s?e.jsx(_.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(_.Button,{primary:!0,onClick:o,children:a||r})})}};return e.jsxs(f.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:c,children:[d||e.jsx(pc,{}),e.jsx(f.Box,{direction:"column",children:t.map((b,p)=>e.jsx(tr.Body1,{props:{align:"center",textAlign:"center"},children:p>2?null:b},p))}),i?g():null]})},ee={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function vc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:ee.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("path",{d:"M233.438 165.217C233.438 132.764 239.035 107.198 250.231 88.5189C261.596 69.8396 279.832 60.5 304.938 60.5C330.043 60.5 348.194 69.8396 359.389 88.5189C370.755 107.198 376.438 132.764 376.438 165.217C376.438 198.047 370.755 223.802 359.389 242.481C348.194 261.16 330.043 270.5 304.938 270.5C279.832 270.5 261.596 261.16 250.231 242.481C239.035 223.802 233.438 198.047 233.438 165.217ZM333.69 165.217C333.69 146.16 331.824 131.538 328.092 121.349C324.36 110.972 316.642 105.783 304.938 105.783C293.233 105.783 285.515 110.972 281.783 121.349C278.051 131.538 276.185 146.16 276.185 165.217C276.185 178.047 276.863 188.708 278.22 197.198C279.577 205.5 282.292 212.292 286.363 217.575C290.604 222.67 296.795 225.217 304.938 225.217C313.08 225.217 319.187 222.67 323.258 217.575C327.499 212.292 330.298 205.5 331.655 197.198C333.012 188.708 333.69 178.047 333.69 165.217Z",fill:ee.cD0E5F7}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.4375 235.124V194.28L138.96 60.5H192.466V191.32H215.438V235.124H192.466V249.5H144.563V235.124H50.4375ZM100.862 191.32L147.925 116.143V191.32H100.862Z",fill:ee.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M394.438 235.124V194.28L482.96 60.5H536.466V191.32H559.438V235.124H536.466V249.5H488.563V235.124H394.438ZM444.862 191.32L491.925 116.143V191.32H444.862Z",fill:ee.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:ee.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:ee.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:ee.c98B4CB}),e.jsx("path",{d:"M244.719 200.89V264.5H363.574V200.89M244.719 200.89H233.438L244.719 186.396M244.719 200.89H363.574M363.574 200.89H372.437L363.574 186.396M244.719 186.396L261.64 171.5M244.719 186.396H261.64M363.574 186.396L349.472 171.5M363.574 186.396H349.472M261.64 171.5H349.472M261.64 171.5V186.396M349.472 171.5V186.396M349.472 186.396H261.64",stroke:ee.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:ee.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:ee.cFFFFFF}),e.jsx("path",{d:"M332.438 129.846C332.438 141.175 329.183 152.403 323.949 160.772C318.699 169.168 311.592 174.5 303.938 174.5C296.283 174.5 289.176 169.168 283.926 160.772C278.692 152.403 275.438 141.175 275.438 129.846C275.438 118.458 277.838 109.628 282.543 103.663C287.216 97.7387 294.274 94.5 303.938 94.5C313.601 94.5 320.659 97.7387 325.332 103.663C330.037 109.628 332.438 118.458 332.438 129.846Z",fill:ee.cFFFFFF,stroke:ee.c000000,strokeWidth:"2"}),e.jsx("path",{d:"M281.438 145.5C284.032 154.136 285.762 158.682 290.951 164.591M292.681 166.409C293.624 167.647 295.708 169.591 297.438 170.5",stroke:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.438 175C299.54 176.339 297.208 177.876 293.938 182.5M304.438 175C301.183 178.041 299.537 178.883 299.438 182.5M304.438 175C308.173 177.107 309.635 178.834 311.438 182.5",stroke:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.936 175.5C303.438 180 302.529 181.628 304.936 186.5",stroke:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.178 120.981C289.969 120.93 290.921 121.313 292.167 122.754",stroke:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:ee.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:ee.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:ee.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:ee.c001A72,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M265.437 115.5L260.438 120.5M260.438 115.5L265.438 120.5",stroke:ee.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.437 87.5L283.438 92.5M283.438 87.5L288.438 92.5",stroke:ee.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M305.437 83.5L298.438 90.5M298.438 83.5L305.438 90.5",stroke:ee.c001A72,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M342.437 145.5L337.438 150.5M337.438 145.5L342.438 150.5",stroke:ee.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:ee.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:ee.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:ee.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:ee.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:ee.c001A72})]})})}function Cc({onClick:r}){const t=ke.useMediaQuery("md");return e.jsxs(f.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(vc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(_.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const ce={c46F16B:"#46F16B",c48504C:"#48504C",c64B5F6:"#64B5F6",c67AEE6:"#67AEE6",c86512B:"#86512B",c956847:"#956847",cBBC3F5:"#BBC3F5",cBBDEFB:"#BBDEFB",cC0B2A2:"#C0B2A2",cC8CEF4:"#C8CEF4",cCABEB1:"#CABEB1",cD5C7BD:"#D5C7BD",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cE5EE80:"#E5EE80",cEE8080:"#EE8080",cEFF3F8:"#EFF3F8",cF4F4F4:"#F4F4F4",cFFFFFF:"#FFFFFF"};function wc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:ce.cD6EBFD}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M75 238.124V197.28L163.523 63.5H217.029V194.32H240V238.124H217.029V252.5H169.126V238.124H75ZM125.424 194.32L172.487 119.143V194.32H125.424Z",fill:ce.cBBDEFB,fillOpacity:"0.6"}),e.jsxs("g",{clipPath:"url(#clip0_2949_9690)",children:[e.jsx("path",{d:"M334.5 274.5C381.168 274.5 419 227.266 419 169C419 110.734 381.168 63.5 334.5 63.5C287.832 63.5 250 110.734 250 169C250 227.266 287.832 274.5 334.5 274.5Z",fill:ce.cEFF3F8,stroke:ce.c67AEE6,strokeWidth:"5"}),e.jsx("path",{d:"M413 197.5C411.397 211.835 402.919 230.898 389.361 246.49C375.596 262.32 356.651 274.5 334.496 274.5C311.331 274.5 292.389 261.672 278.878 245.52C265.592 229.638 257.606 210.603 256 197.5H413Z",fill:ce.cD5C7BD}),e.jsx("path",{d:"M278.887 211.766H391.104L392.583 222.856C392.687 223.635 392.08 224.328 391.294 224.328H277.961C277.14 224.328 276.525 223.577 276.686 222.773L278.887 211.766Z",fill:ce.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:ce.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:ce.c956847,stroke:ce.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:ce.c956847,stroke:ce.c48504C}),e.jsx("path",{d:"M285.902 212.103L284.935 186.306H279.606C278.151 186.306 277.004 187.542 277.113 188.993L278.673 209.79C278.77 211.095 279.857 212.103 281.166 212.103H285.902Z",fill:ce.cC8CEF4,stroke:ce.c48504C}),e.jsx("path",{d:"M383.256 212.103L384.638 186.306H389.556C391.007 186.306 392.153 187.537 392.05 188.984L390.564 209.782C390.471 211.09 389.382 212.103 388.07 212.103H383.256Z",fill:ce.cC8CEF4,stroke:ce.c48504C}),e.jsx("path",{d:"M284.497 178.155C284.455 176.194 286.034 174.581 287.996 174.581H381.904C383.895 174.581 385.485 176.24 385.401 178.23L384.066 209.59C383.987 211.463 382.445 212.941 380.569 212.941H288.663C286.759 212.941 285.205 211.419 285.164 209.515L284.497 178.155Z",fill:ce.cC8CEF4,stroke:ce.c48504C}),e.jsx("path",{d:"M284.845 181.524C284.792 179.279 286.598 177.431 288.844 177.431H380.687C382.948 177.431 384.76 179.304 384.684 181.565L383.774 208.737C383.701 210.893 381.933 212.603 379.776 212.603H289.48C287.307 212.603 285.532 210.869 285.481 208.697L284.845 181.524Z",fill:ce.cBBC3F5}),e.jsx("mask",{id:"mask0_2949_9690",maskUnits:"userSpaceOnUse",x:"301",y:"144",width:"68",height:"17",style:{maskType:"luminance"},children:e.jsx("path",{d:"M301 146.5C301 145.395 301.887 144.5 302.98 144.5H367.02C368.114 144.5 369 145.395 369 146.5V160.411H301V146.5Z",fill:ce.cFFFFFF})}),e.jsxs("g",{mask:"url(#mask0_2949_9690)",children:[e.jsx("path",{d:"M301 146.191C301 145.257 301.748 144.5 302.671 144.5H356.701C357.624 144.5 358.372 145.257 358.372 146.191V157.949H301V146.191Z",fill:ce.cFFFFFF}),e.jsx("path",{d:"M301.336 146.607C301.336 145.673 302.08 144.916 302.999 144.916H367.01C367.929 144.916 368.673 145.673 368.673 146.607V152.523H301.336V146.607Z",fill:ce.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:ce.cF4F4F4}),e.jsx("path",{d:"M307.685 150.417C308.607 150.417 309.356 149.66 309.356 148.726C309.356 147.793 308.607 147.036 307.685 147.036C306.762 147.036 306.014 147.793 306.014 148.726C306.014 149.66 306.762 150.417 307.685 150.417Z",fill:ce.cEE8080}),e.jsx("path",{d:"M313.532 150.417C314.455 150.417 315.203 149.66 315.203 148.726C315.203 147.793 314.455 147.036 313.532 147.036C312.609 147.036 311.861 147.793 311.861 148.726C311.861 149.66 312.609 150.417 313.532 150.417Z",fill:ce.cE5EE80}),e.jsx("path",{d:"M318.546 150.417C319.469 150.417 320.217 149.66 320.217 148.726C320.217 147.793 319.469 147.036 318.546 147.036C317.623 147.036 316.875 147.793 316.875 148.726C316.875 149.66 317.623 150.417 318.546 150.417Z",fill:ce.c46F16B})]}),e.jsx("path",{d:"M301.16 146C301.16 145.172 301.832 144.5 302.66 144.5H367.33C368.159 144.5 368.83 145.172 368.83 146V174.419H301.16V146Z",stroke:ce.c48504C}),e.jsx("path",{d:"M395.29 207.579H423.344M354.255 236.889H369.329M327.038 222.234H347.556M350.905 222.234H358.024M288.097 230.19H304.846M253.344 210.091H272.605M278.467 246.938H295.216M297.309 246.938H303.59M337.088 252.801H354.255",stroke:ce.c86512B,strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("path",{d:"M430.241 125.78C430.987 105.807 437.521 90.4065 449.841 79.5799C462.161 68.7532 478.867 63.3398 499.961 63.3398C513.961 63.3398 525.907 65.7665 535.801 70.6199C545.881 75.4732 553.441 82.0998 558.481 90.4998C563.707 98.8998 566.321 108.327 566.321 118.78C566.321 131.1 563.241 141.18 557.081 149.02C550.921 156.673 543.734 161.9 535.521 164.7V165.82C546.161 169.367 554.561 175.247 560.721 183.46C566.881 191.673 569.961 202.22 569.961 215.1C569.961 226.673 567.254 236.94 561.841 245.9C560.436 248.258 558.849 250.481 557.081 252.569L443.5 252.662C432.5 241 427.721 230.5 427.721 207.82H474.201C474.387 216.033 476.721 222.567 481.201 227.42C485.681 232.087 492.214 234.42 500.801 234.42C508.081 234.42 513.681 232.367 517.601 228.26C521.707 223.967 523.761 218.367 523.761 211.46C523.761 202.5 520.867 196.06 515.081 192.14C509.481 188.033 500.427 185.98 487.921 185.98H478.961V147.06H487.921C497.441 147.06 505.094 145.473 510.881 142.3C516.854 138.94 519.841 133.06 519.841 124.66C519.841 117.94 517.974 112.713 514.241 108.98C510.507 105.247 505.374 103.38 498.841 103.38C491.747 103.38 486.427 105.527 482.881 109.82C479.521 114.113 477.561 119.433 477.001 125.78H430.241Z",fill:ce.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:ce.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:ce.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:ce.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:ce.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:ce.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:ce.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:ce.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_2949_9690",children:e.jsx("rect",{width:"179",height:"192",fill:ce.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function xc({onClick:r}){const t=ke.useMediaQuery("md");return e.jsxs(f.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(wc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(_.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const y={c000D58:"#000D58",c001174:"#001174",c28AC6E:"#28AC6E",c48504C:"#48504C",c64B5F6:"#64B5F6",c90CAF9:"#90CAF9",cC9184A:"#C9184A",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cD9D9D9:"#D9D9D9",cDEECF8:"#DEECF8",cE7EAE9:"#E7EAE9",cF3F8FD:"#F3F8FD",cFFE18B:"#FFE18B",cFFFFFF:"#FFFFFF"};function Dc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:y.cD6EBFD}),e.jsx("path",{d:"M246.562 180.558C246.562 148.105 252.16 122.539 263.356 103.86C274.721 85.1804 292.957 75.8408 318.063 75.8408C343.168 75.8408 361.319 85.1804 372.514 103.86C383.88 122.539 389.562 148.105 389.562 180.558C389.562 213.388 383.88 239.143 372.514 257.822C361.319 276.501 343.168 285.841 318.063 285.841C292.957 285.841 274.721 276.501 263.356 257.822C252.16 239.143 246.562 213.388 246.562 180.558ZM346.815 180.558C346.815 161.501 344.949 146.879 341.217 136.69C337.485 126.313 329.767 121.124 318.063 121.124C306.358 121.124 298.64 126.313 294.908 136.69C291.176 146.879 289.31 161.501 289.31 180.558C289.31 193.388 289.988 204.048 291.345 212.539C292.702 220.841 295.417 227.633 299.488 232.916C303.729 238.011 309.92 240.558 318.063 240.558C326.205 240.558 332.312 238.011 336.383 232.916C340.624 227.633 343.423 220.841 344.78 212.539C346.137 204.048 346.815 193.388 346.815 180.558Z",fill:y.cD6EBFD}),e.jsx("path",{d:"M222.808 118.703H128.062V159.858C132.111 155.484 137.779 151.905 145.067 149.122C152.356 146.338 160.251 144.946 168.754 144.946C183.938 144.946 196.49 148.326 206.41 155.086C216.532 161.846 223.922 170.594 228.578 181.329C233.234 192.065 235.562 203.696 235.562 216.221C235.562 239.483 228.882 257.972 215.52 271.691C202.158 285.21 183.357 282.89 159.062 282.89C142.867 282.89 131.098 284.939 116.826 283.918C104.881 278.351 95.6695 270.697 89.1911 260.955C82.7127 251.213 79.1698 239.98 78.5625 227.256H129.276C130.491 233.419 133.426 238.588 138.083 242.763C142.739 246.739 149.116 248.728 157.214 248.728C166.729 248.728 173.815 245.745 178.472 239.781C183.128 233.817 185.456 225.864 185.456 215.923C185.456 206.181 183.027 198.726 178.168 193.557C173.309 188.387 166.223 185.803 156.911 185.803C150.027 185.803 144.359 187.493 139.905 190.873C135.451 194.054 132.515 198.328 131.098 203.696H80.9919V73.9697H222.808V118.703Z",fill:y.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:y.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:y.cFFFFFF,stroke:y.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 200.539C269.878 200.263 270.101 200.039 270.377 200.039L305.476 199.955C305.753 199.955 305.978 200.179 305.978 200.455V206.461H269.878V200.539Z",stroke:y.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:y.cFFFFFF,stroke:y.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 235.871C269.878 235.595 270.101 235.372 270.377 235.371L305.476 235.288C305.753 235.287 305.978 235.511 305.978 235.788V241.794H269.878V235.871Z",stroke:y.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:y.cFFFFFF,stroke:y.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 272.088C269.878 271.812 270.101 271.589 270.377 271.588L305.476 271.505C305.753 271.504 305.978 271.728 305.978 272.005V278.011H269.878V272.088Z",stroke:y.c001174}),e.jsx("path",{d:"M279.095 176.348H364.373C365.459 176.348 366.125 176.992 366.986 178.252V202.985C366.986 202.985 366.986 203.869 366.545 204.752C366.103 205.635 365.661 206.077 365.661 206.077L306.478 206.163V199.452L279.095 199.518V176.348Z",fill:y.cF3F8FD}),e.jsx("path",{d:"M279.095 211.093H364.373C365.459 211.093 366.125 211.736 366.986 212.997V237.73C366.986 237.73 366.986 238.613 366.545 239.497C366.103 240.38 365.661 240.822 365.661 240.822L306.478 240.908V234.197L279.095 234.262V211.093Z",fill:y.cF3F8FD}),e.jsx("path",{d:"M279.095 248.008H364.373C365.459 248.008 366.125 248.652 366.986 249.912V274.646C366.986 274.646 366.986 275.529 366.545 276.412C366.103 277.296 365.661 277.737 365.661 277.737L306.478 277.824V271.112L279.095 271.178V248.008Z",fill:y.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:y.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:y.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:y.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:y.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:y.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:y.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:y.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:y.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:y.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:y.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:y.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:y.cDEECF8}),e.jsx("path",{d:"M268.053 210.494C268.483 209.112 268.564 208.343 268.053 206.961H362.569C361.955 208.363 361.972 209.136 362.569 210.494H268.053Z",fill:y.c000D58,stroke:y.c001174}),e.jsx("path",{d:"M268.053 246.269C268.483 244.887 268.564 244.118 268.053 242.736H362.569C361.955 244.138 361.972 244.911 362.569 246.269H268.053Z",fill:y.c000D58,stroke:y.c001174}),e.jsx("path",{d:"M283.312 130.775C283.312 129.64 283.987 128.72 284.82 128.72H349.805C350.638 128.72 351.312 129.64 351.312 130.775V169.72H283.312V130.775Z",fill:y.cFFFFFF,stroke:y.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M279.574 171.847C279.381 171.283 279.267 170.624 279.33 169.72H355.195C355.423 170.925 355.287 171.695 355.063 172.241C354.834 172.802 354.506 173.186 354.101 173.66C354.084 173.68 354.067 173.7 354.05 173.72H280.503C280.468 173.658 280.434 173.598 280.4 173.539C280.051 172.922 279.774 172.434 279.574 171.847Z",stroke:y.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M350.312 133.72V129.726L284.812 129.72C284.312 129.726 284.312 129.726 284.312 130.125V133.72H350.312Z",fill:y.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:y.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:y.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:y.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:y.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:y.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:y.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:y.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:y.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:y.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:y.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:y.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Sc({onClick:r}){const t=ke.useMediaQuery("md");return e.jsxs(f.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Dc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(_.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const kc=r=>{var o,n,l,s,i;const t=ke.useMediaQuery("md");return e.jsxs(Oe.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(Oe.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(k.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Oe.DialogBody,{children:typeof r.description=="string"?e.jsx(k.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(Oe.DialogFooter,{children:e.jsx(f.Box,{display:"flex",direction:((o=r.containerConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((n=r.containerConfirmBtnProps)==null?void 0:n.justify)||"flex-end",...r.containerConfirmBtnProps,children:e.jsxs(f.Box,{display:"flex",direction:((l=r.wrapperConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((s=r.wrapperConfirmBtnProps)==null?void 0:s.justify)||"flex-end",gap:((i=r.wrapperConfirmBtnProps)==null?void 0:i.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(_.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(f.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(_.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},Bc=h.memo(({children:r,height:t,minHeight:o,customHeight:n,paddingInline:l="spacing-0",paddingBlock:s="spacing-0",header:i,footer:c,title:a,titleTag:d,action:g,actionContainer:b,containerProps:p,bodyProps:C,headerProps:w={borderBottom:!0},footerProps:S={borderTop:!0},variantTag:H="info"})=>{const T=h.useRef(null),[A,x]=h.useState("100vh");h.useEffect(()=>{const m=()=>{if(T.current){const O=T.current.getBoundingClientRect().top;x(`calc(100vh - ${O}px)`)}};return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const B=()=>d?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:a}),e.jsx(nr.Badges,{border:!0,text:d,variant:H})]}):e.jsx(k.Text,{fontWeight:"medium",children:a}),W=()=>i||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:a?B():null}),e.jsx(f.Box,{direction:"column",...b,children:g??null})]}),F=!!(i||a||g);return e.jsxs(f.Box,{ref:T,height:t,customMinHeight:o,customHeight:n,paddingBlock:s,paddingInline:l,bg:"white",direction:"column",...p,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:A,...(p==null?void 0:p.style)??{}},children:[i!==null&&F?e.jsx(Yt,{...w,children:W()}):null,e.jsx(f.Box,{direction:"column",padding:"spacing-0",...C,style:{flex:1,overflow:"auto",...(C==null?void 0:C.style)??{}},children:r}),c?e.jsx(Xt,{...S,children:c}):null]})}),mc=h.memo(({value:r,options:t=[],onChange:o,multiple:n})=>{const l=(r==null?void 0:r.map(c=>c.value))||[],s=(t==null?void 0:t.filter(c=>l.includes(c.value)))||[],i=c=>{const a=[...s];let d=[];n?d=l.includes(c.value)?a.filter(g=>g.value!==c.value):[...a,c]:d=[c],o==null||o(d)};return e.jsx(f.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((c,a)=>e.jsx(_.Button,{...l.includes(c.value)?{primary:!0}:{secondary:!0},onClick:()=>i(c),children:c.label},a))})});function ft(r){return null}ft.displayName="LayoutDialog.Header";function ut(r){return null}ut.displayName="LayoutDialog.Body";function gt(r){return null}gt.displayName="LayoutDialog.Aside";function yt(r){return null}yt.displayName="LayoutDialog.Footer";const He={"lyd-root":"_lyd-root_jyp0m_6","lyd-backdrop":"_lyd-backdrop_jyp0m_43","lyd-panel":"_lyd-panel_jyp0m_52","lyd-modal":"_lyd-modal_jyp0m_63","lyd-fullscreen":"_lyd-fullscreen_jyp0m_77","lyd-sidebar":"_lyd-sidebar_jyp0m_85","lyd-header":"_lyd-header_jyp0m_115","lyd-header-content":"_lyd-header-content_jyp0m_126","lyd-header-actions":"_lyd-header-actions_jyp0m_134","lyd-main":"_lyd-main_jyp0m_141","lyd-body":"_lyd-body_jyp0m_148","lyd-aside":"_lyd-aside_jyp0m_154","lyd-footer":"_lyd-footer_jyp0m_170","lyd-vm-group":"_lyd-vm-group_jyp0m_183","lyd-vm-btn":"_lyd-vm-btn_jyp0m_191","lyd-close-btn":"_lyd-close-btn_jyp0m_214"},Ec=[{mode:"sidebar",label:"Sidebar",renderIcon:()=>e.jsx(Ic,{})},{mode:"modal",label:"Modal",renderIcon:()=>e.jsx(I.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",renderIcon:()=>e.jsx(I.Icon,{name:"Fullscreen",size:"sm"})}];function Fc({value:r,onChange:t}){return e.jsx("div",{className:He["lyd-vm-group"],role:"group","aria-label":"View mode",children:Ec.map(o=>e.jsx("button",{type:"button",className:He["lyd-vm-btn"],"data-active":r===o.mode,"aria-label":`Switch to ${o.label} view`,"aria-pressed":r===o.mode,onClick:()=>t(o.mode),children:o.renderIcon()},o.mode))})}function Ic(){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),e.jsx("line",{x1:"15",y1:"4",x2:"15",y2:"20"})]})}const go={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Lc(r){return r?r in go?go[r]:r:go.xl}function pt(r,t){let o=null;return h.Children.forEach(r,n=>{h.isValidElement(n)&&n.type===t&&(o=n.props.children??null)}),o}function Mc(r){const{isOpen:t,onClose:o,viewMode:n,defaultViewMode:l="modal",onViewModeChange:s,showViewModeToggle:i=!0,showCloseButton:c=!0,size:a,asideWidth:d,disableEscapeClose:g=!1,disableBackdropClose:b=!1,lockBodyScroll:p=!0,children:C}=r,[w,S]=h.useState(l),H=n??w,A=ke.useMediaQuery("md")?H:"fullscreen",x=h.useCallback(J=>{n===void 0&&S(J),s==null||s(J)},[n,s]),B=h.useRef(null);h.useEffect(()=>{if(!(!t||!p))return B.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=B.current??""}},[t,p]);const W=h.useRef(o);W.current=o,h.useEffect(()=>{if(t)return Oe.registerOverlay({onEscape:g?void 0:()=>W.current()})},[t,g]);const F=h.useMemo(()=>pt(C,ft),[C]),m=h.useMemo(()=>pt(C,ut),[C]),O=h.useMemo(()=>pt(C,gt),[C]),N=h.useMemo(()=>pt(C,yt),[C]);if(!t)return null;const $=[He["lyd-panel"],A==="modal"&&He["lyd-modal"],A==="fullscreen"&&He["lyd-fullscreen"],A==="sidebar"&&He["lyd-sidebar"]].filter(Boolean).join(" "),M={"--lyd-max-w":Lc(a),...d!==void 0&&{"--lyd-aside-w":d}},q=()=>{b||o()};return typeof document>"u"?null:Kr.createPortal(e.jsxs("div",{className:He["lyd-root"],style:M,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:He["lyd-backdrop"],onClick:q,"aria-hidden":"true"}),e.jsxs("div",{className:$,children:[e.jsxs("div",{className:He["lyd-header"],children:[e.jsx("div",{className:He["lyd-header-content"],children:F}),e.jsxs("div",{className:He["lyd-header-actions"],children:[i&&e.jsx(Fc,{value:H,onChange:x}),c&&e.jsx("button",{type:"button",className:He["lyd-close-btn"],onClick:o,"aria-label":"Close dialog",children:e.jsx(I.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:He["lyd-main"],children:[e.jsx("div",{className:He["lyd-body"],children:m}),O&&e.jsx("aside",{className:He["lyd-aside"],children:O})]}),N&&e.jsx("div",{className:He["lyd-footer"],children:N})]})]}),document.body)}const Qr=Mc;Qr.Header=ft,Qr.Body=ut,Qr.Aside=gt,Qr.Footer=yt;function Tc({url:r,filename:t,onClose:o}){const n=h.useRef(o);return n.current=o,h.useEffect(()=>Oe.registerOverlay({onEscape:()=>n.current()}),[]),e.jsxs("div",{onClick:o,style:{position:"fixed",inset:0,zIndex:9999,backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[e.jsxs("div",{onClick:l=>l.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:r,download:t,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:r,alt:t,onClick:l=>l.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:t})]})}const Ac=/\.(jpe?g|png|gif|webp|bmp|svg|avif)(\?|#|$)/i,Oc=/\.pdf(\?|#|$)/i,Wc=/\.(mp4|webm|ogv|mov|m4v)(\?|#|$)/i,zc=/\.(mp3|wav|ogg|m4a|aac|flac)(\?|#|$)/i;function Hc(r,t){if(t)return t;const o=r.mimeType??"",n=l=>l.test(r.fileName??"")||l.test(r.fileUrl??"");return o.startsWith("image/")||n(Ac)?"image":o==="application/pdf"||n(Oc)?"pdf":o.startsWith("video/")||n(Wc)?"video":o.startsWith("audio/")||n(zc)?"audio":"other"}const an={display:"block",maxWidth:"100%",maxHeight:"70vh",margin:"0 auto",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)"},Pc={width:"100%",height:"75vh",border:"none",borderRadius:"var(--sa-radii-sm, 6px)"};function _c({kind:r,attachment:t,openLabel:o,unsupportedLabel:n}){const{fileUrl:l,fileName:s}=t;switch(r){case"image":return e.jsx("img",{src:l,alt:s,style:an});case"pdf":return e.jsx("iframe",{src:l,title:s,style:Pc});case"video":return e.jsx("video",{src:l,controls:!0,style:{...an,width:"100%"}});case"audio":return e.jsx(f.Box,{padding:"lg",align:"center",justify:"center",fullWidth:!0,children:e.jsx("audio",{src:l,controls:!0,style:{width:"100%"}})});default:return e.jsxs(f.Box,{direction:"column",align:"center",justify:"center",gap:"md",padding:"3xl",fullWidth:!0,children:[e.jsx(I.Icon,{name:"DocumentDetail",size:"lg"}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",children:n}),e.jsx(_.Button,{type:"button",variant:"link",iconLeft:e.jsx(I.Icon,{name:"SquareArrowExpand"}),onClick:()=>window.open(l,"_blank","noopener"),children:o})]})}}const jc=({attachment:r,onClose:t,onDownload:o,isDownloading:n,kind:l,maxWidth:s,labels:i})=>{if(!r)return null;const c=Hc(r,l),a=s??(c==="pdf"?"min(80vw, 1100px)":"min(90vw, 900px)"),d={download:(i==null?void 0:i.download)??"Download",close:(i==null?void 0:i.close)??"Close",openInNewTab:(i==null?void 0:i.openInNewTab)??"Open in new tab",unsupported:(i==null?void 0:i.unsupported)??"This file type cannot be previewed."};return e.jsxs(Oe.Dialog,{isShow:!0,onHide:t,maxWidth:a,children:[e.jsx(Oe.DialogTitle,{children:e.jsxs(f.Box,{direction:"row",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[e.jsx(k.Text,{fontWeight:"semibold",truncate:!0,children:r.fileName}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[o?e.jsx(_.Button,{type:"button",variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(I.Icon,{name:"Download"}),disabled:n,isLoading:n,onClick:o,children:d.download}):null,e.jsx(_.Button,{type:"button",variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(I.Icon,{name:"Cross"}),"aria-label":d.close,onClick:t})]})]})}),e.jsx(Oe.DialogBody,{children:e.jsx(_c,{kind:c,attachment:r,openLabel:d.openInNewTab,unsupportedLabel:d.unsupported})})]})},dn="var(--sa-border-subtle, #e5e7eb)",bt=()=>e.jsx(f.Box,{style:{width:1,height:22,backgroundColor:dn}}),Nc=r=>typeof r=="number"?`${r}px`:r;function hn({count:r,children:t,label:o,onClear:n,clearLabel:l="Clear selection",clearDisabled:s=!1,bottom:i=20,zIndex:c=50,style:a,className:d}){if(r===0)return null;const g=typeof o=="function"?o(r):o??`${r} selected`;return e.jsx(f.Box,{direction:"row",justify:"center",style:{position:"fixed",bottom:Nc(i),left:0,right:0,zIndex:c,pointerEvents:"none"},children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"xs",padding:"spacing-8",className:d,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",pointerEvents:"auto",borderRadius:"min(10px, var(--sa-radii-lg, 12px))",border:`1px solid ${dn}`,boxShadow:"var(--sa-shadow-xl, 0 10px 25px -5px rgb(0 0 0/0.15))",...a},children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",whiteSpace:"nowrap",style:{paddingInline:6},children:g}),e.jsx(bt,{}),t,n&&e.jsxs(e.Fragment,{children:[e.jsx(bt,{}),e.jsx(Te.Tooltip,{label:l,position:"top",children:e.jsx(_.Button,{variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(I.Icon,{name:"Cross",size:"xs"}),"aria-label":l,onClick:n,disabled:s})})]})]})})}hn.Divider=bt;const vt=r=>{const{variant:t="outlined",overflow:o="hidden",style:n,children:l,...s}=r;return e.jsx(It.Card,{variant:t,overflow:o,style:{display:"flex",flexDirection:"column",...n},...s,children:l})},Vc=r=>r==null?void 0:typeof r=="number"?`${r}px`:r,fn=({src:r,alt:t="",height:o=140,bg:n="var(--sa-background-neutral, #f0f1f2)",avatar:l,children:s})=>e.jsxs(f.Box,{style:{position:"relative",marginBottom:l?24:void 0},children:[e.jsx(f.Box,{style:{height:Vc(o),background:r?void 0:n,overflow:"hidden"},children:r?e.jsx("img",{src:r,alt:t,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null}),s?e.jsx(f.Box,{style:{position:"absolute",inset:0,pointerEvents:"none"},children:s}):null,l?e.jsx(f.Box,{style:{position:"absolute",left:16,bottom:0,transform:"translateY(50%)"},children:l}):null]}),un=({avatar:r,title:t,subtitle:o,action:n,divided:l=!1,children:s})=>e.jsx(f.Box,{padding:"md",style:{borderBottom:l?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:s??e.jsxs(de.Flex,{direction:"row",align:"center",gap:"sm",children:[r,e.jsxs(f.Box,{flex:"1",style:{minWidth:0},children:[t!=null&&e.jsx(k.Text,{fontWeight:"semibold",truncate:!0,children:t}),o!=null&&e.jsx(k.Text,{fontSize:"sm",color:"subtlest",truncate:!0,children:o})]}),n!=null&&e.jsx(f.Box,{style:{flexShrink:0},children:n})]})}),gn=({left:r,right:t,divided:o=!0,children:n})=>e.jsx(f.Box,{padding:"md",style:{marginTop:"auto",borderTop:o?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:n??e.jsxs(de.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",children:[e.jsx(f.Box,{style:{minWidth:0},children:r}),e.jsx(f.Box,{style:{flexShrink:0},children:t})]})});vt.Media=fn,vt.Header=un,vt.Footer=gn;const qc=r=>{const{defaultTab:t=0,paramKey:o="tab"}=r||{},{useSearchParams:n}=sr(),[l,s]=n(),i=Fr.searchParamsToObject(l.toString());return{activeTab:i[o]?parseInt(i[o]):t,handleTabChange:d=>{s({...i,[o]:d.toString()})},searchQueries:i}};function Zc({appName:r,menuConfig:t,formatTitle:o}){const{useLocation:n}=sr(),l=n();h.useEffect(()=>{let s=null,i=null;for(const d of t){const g=d.items.find(b=>b.to?b.to==="/"?l.pathname==="/":!!(b.to===l.pathname||l.pathname.startsWith(b.to+"/")):!1);if(g){s=g,i=d;break}}const c=[];s!=null&&s.title&&c.push(s.title),i!=null&&i.name&&c.push(i.name.toTitleCase());const a=(d,g)=>d.length>0?`${d.join(" - ")} | ${g}`:g;document.title=(o||a)(c,r)},[l.pathname])}const Gc=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=sr(),[n,l]=r(),s=Fr.searchParamsToObject(n.toString()),i=t(),c=o(),a=i.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,w)=>n.has(C)&&n.get(C)===w,getQueryParam:C=>n.get(C),getRouteParam:C=>i[C],params:i,location:c,id:a,hasId:!!a}};function Qc(r){var n,l;const t=r.decodedAccessToken;return h.useMemo(()=>{var a,d;const s=((d=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:d.code)??"",i=Object.keys(r.role).reduce((g,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,C=>C.replace("_","").toUpperCase())}`;return{...g,[p]:!1}},{});return{...Object.keys(r.role).reduce((g,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,C=>C.replace("_","").toUpperCase())}`;return{...g,[p]:s===r.role[b]}},i),hasRole:g=>s===r.role[g],getRoleKey:()=>s}},[(l=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:l.code,r])}u.ASIDE_WIDTH_VAR=fo,u.AdvanceFilterBar=vl,u.App=mn,u.AppComponent=No,u.AppContext=Tt,u.AppLayout=zn,u.AsideBar=hc,u.AttachmentPreview=jc,u.BackButton=Pn,u.ColumnFilterDropdown=Vl,u.ColumnHeaderFilter=Us,u.ColumnMenu=Xl,u.ConfirmationDialog=kc,u.DataTable=Zl,u.DecisionWrapper=ue,u.EachUtils=ht,u.EmptyStatePage=bc,u.EntityCard=vt,u.EntityCardFooter=gn,u.EntityCardHeader=un,u.EntityCardMedia=fn,u.FLOATING_FOOTER_HEIGHT_VAR=uo,u.FilterBar=Os,u.FilterDrawer=bl,u.FloatingFooter=uc,u.ForbiddenPage=xc,u.Form=oc,u.FullSection=Bc,u.HeaderLeftSlot=En,u.HeaderLeftSlotOutlet=Zo,u.HeaderLeftSlotProvider=qo,u.Highlight=Jl,u.HorizontalField=qn,u.ImagePreview=Tc,u.InputFile=en,u.InputImage=tn,u.LayoutDialog=Qr,u.LayoutDialogAside=gt,u.LayoutDialogBody=ut,u.LayoutDialogFooter=yt,u.LayoutDialogHeader=ft,u.ModuleSwitcher=_n,u.ModuleSwitcherModal=sl,u.NotFoundPage=Cc,u.PageLayout=Un,u.Pressable=jr,u.RightDrawer=dl,u.SIDEBAR_DEFAULT_WIDTH=Ot,u.SIDEBAR_MAX_WIDTH=zt,u.SIDEBAR_MIN_WIDTH=Wt,u.ScrollToTopButton=on,u.Section=Kn,u.SectionFooter=Xt,u.SectionHeader=Yt,u.SelectButton=mc,u.SelectionActionBar=hn,u.SelectionActionBarDivider=bt,u.ServerErrorPage=Sc,u.SidePanel=ac,u.SidePanelItem=sc,u.SidebarBadgesProvider=Ao,u.SidebarGroupSlot=Fn,u.SidebarGroupSlotOutlet=jt,u.SidebarGroupSlotProvider=Go,u.SidebarHeaderSlot=Vo,u.SidebarProvider=Ho,u.StarasiaRouterProvider=jo,u.TableFooter=Nl,u.TableHeader=jl,u.TableLayout=gi,u.TableSection=ei,u.TableWrapper=_l,u.ToggleStatus=tc,u.Typography=tr,u.VerticalField=gc,u.clearModuleSelection=In,u.createInitialFromUserName=wi,u.cssVars=mi,u.expandDateCompact=Ys,u.formHasChanged=Ti,u.formatDate=ki,u.formatDateToIndonesian=Rl,u.formatRupiah=Di,u.getDateFilterValue=pl,u.getDateRangeFilterValue=ts,u.getInitials=Si,u.getValueDropdownMultipleFilter=yl,u.getValueRadioFilter=rs,u.getValueSearch=ot,u.getValuesFilter=tt,u.handleChangeFilter=Nr,u.handleOnScroll=Ni,u.isColumnFilterActive=Pl,u.isEmail=Pi,u.isFilterActive=os,u.isOnlyLettersAndSpaces=Oi,u.isPhoneNumber=Ai,u.isSlug=_i,u.localStorageAdapter=$t,u.oneDayInMs=Ei,u.parseIndonesianDateToDate=xi,u.preventNonCoordinateInput=ji,u.preventNonNumberAndDecimalInput=Hi,u.preventNonNumberInput=Wi,u.preventNumberInput=zi,u.resolveDateRangeValueToString=ul,u.resolveDateValueToString=gl,u.resolveDropdownValueToString=hl,u.resolveRadioValueToString=fl,u.resolveSidebarBadge=Rr,u.storageKeys=Mr,u.textWidth=Fi,u.useApp=At,u.useAppState=Mo,u.useAuthRole=Qc,u.useCoarsePointer=Ul,u.useDynamicTitle=Zc,u.useFilterBarApiParams=Ps,u.useFilterBarControls=js,u.useModuleSelection=Vt,u.useRouteInfo=qe,u.useRouteParams=Gc,u.useRouterAdapter=sr,u.useSidebar=Po,u.useSidebarBadges=Oo,u.useTabState=qc,u.useTableSortApiParams=yi,Object.keys(Br).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Br[r]})}),Object.keys(Jr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Jr[r]})}),Object.keys(nr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>nr[r]})}),Object.keys(f).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>f[r]})}),Object.keys(mr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>mr[r]})}),Object.keys(_).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>_[r]})}),Object.keys(It).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>It[r]})}),Object.keys(xr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>xr[r]})}),Object.keys(Oe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Oe[r]})}),Object.keys($r).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>$r[r]})}),Object.keys(Er).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Er[r]})}),Object.keys(ke).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ke[r]})}),Object.keys(Fr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Fr[r]})}),Object.keys(hr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>hr[r]})}),Object.keys(z).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>z[r]})}),Object.keys(Pr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Pr[r]})}),Object.keys(_r).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>_r[r]})}),Object.keys(G).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>G[r]})}),Object.keys(So).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>So[r]})}),Object.keys(Lt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Lt[r]})}),Object.keys(Ir).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ir[r]})}),Object.keys(ko).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ko[r]})}),Object.keys(Lr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Lr[r]})}),Object.keys(Te).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Te[r]})}),Object.keys(fr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>fr[r]})}),Object.keys(Mt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Mt[r]})}),Object.keys(k).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>k[r]})}),Object.keys(I).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>I[r]})}),Object.keys(de).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>de[r]})}),Object.keys(Bo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Bo[r]})}),Object.keys(mo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>mo[r]})}),Object.keys(Eo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Eo[r]})}),Object.keys(Fo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Fo[r]})}),Object.keys(Io).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Io[r]})}),Object.keys(rr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>rr[r]})}),Object.keys(Lo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Lo[r]})}),Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
103
+ }`;function bc(){if(typeof document>"u"||document.getElementById(pn))return;const r=document.createElement("style");r.id=pn,r.textContent=pc,document.head.appendChild(r)}const vc=({active:r=!1,accentSide:t="left",onClick:o,title:n,badge:l,heading:s,meta:i,children:c,divider:a=!0,disabled:d,className:g,style:b,"aria-label":p})=>(h.useEffect(bc,[]),e.jsx("button",{type:"button",className:[Ke,g].filter(Boolean).join(" "),"data-active":r?"true":"false","data-accent":t,"data-divider":a?"true":"false","aria-current":r?"true":void 0,"aria-label":p,disabled:d,onClick:o,style:b,children:c??e.jsxs(f.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(n||l)&&e.jsxs(he.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[n?e.jsx(m.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:n}):e.jsx("span",{}),l?e.jsx(f.Box,{style:{flexShrink:0},children:l}):null]}),s?e.jsx(m.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:s}):null,i?e.jsx(m.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:i}):null]})})),xo=18,Cc=40,bn="280ms cubic-bezier(0.4, 0, 0.2, 1)",vn="var(--sa-border-subtle, #0b120e24)",wc=`1px solid ${vn}`,Cn="var(--sa-background-primary, #ffffff)",xc=({children:r,header:t,collapsed:o,defaultCollapsed:n=!1,onToggle:l,width:s=337,side:i="left",offsetTop:c="var(--app-header-height, 4rem)",height:a,showToggle:d=!0,togglePosition:g="top",toggleOffset:b=40,toggleLabel:p,style:C,bodyStyle:B,className:x,pageLayout:W,overlay:L="mobile",wrapperProps:M,contentProps:S})=>{const E=Ee.useMediaQuery("md"),A=o!==void 0,[T,D]=h.useState(n),O=A?o:T,q=()=>{const le=!O;A||D(le),l==null||l(le)},G=i==="left",_=typeof c=="number"?`${c}px`:c,H=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${_})`,R=p??{collapse:"Collapse panel",expand:"Expand panel"},ee=g==="center"?{top:"50%",transform:"translateY(-50%)"}:g==="bottom"?{bottom:b}:{top:b},J=O?G?"ChevronRight":"ChevronLeft":G?"ChevronLeft":"ChevronRight",K=W!==void 0&&(L==="mobile"?!E:L),de=K?{position:"absolute",top:0,bottom:0,width:s,transform:`translateX(${O?G?"-100%":"100%":"0"})`,transition:`transform ${bn}`,zIndex:50,...G?{left:0}:{right:0},...C}:{position:"sticky",top:_,alignSelf:"flex-start",width:O?0:s,flexShrink:0,height:H,transition:`width ${bn}`,...C},Q=e.jsxs(f.Box,{className:x,style:de,children:[e.jsx(f.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:O?void 0:G?"border-solid-r":"border-solid-l",borderWidth:O?void 0:G?"border-r":"border-l",style:{backgroundColor:Cn,borderColor:vn},children:e.jsxs(f.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:s,customMinWidth:s,style:G?void 0:{marginLeft:"auto"},children:[t?e.jsx(f.Box,{padding:"md",style:{flexShrink:0},children:t}):null,e.jsx(f.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...B},children:r})]})}),d&&e.jsx(Kr,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:q,"aria-label":O?R.expand:R.collapse,"aria-expanded":!O,"aria-pressed":O,customWidth:xo,customHeight:Cc,style:{...ee,backgroundColor:Cn,border:wc,zIndex:5,...G?{right:-xo,borderLeft:"none",borderRadius:"0 var(--sa-radii-md, 8px) var(--sa-radii-md, 8px) 0"}:{left:-xo,borderRight:"none",borderRadius:"var(--sa-radii-md, 8px) 0 0 var(--sa-radii-md, 8px)"}},children:e.jsx(F.Icon,{name:J,size:"sm"})})]});return W===void 0?Q:e.jsxs(f.Box,{direction:"row",position:"relative",...M,style:{height:`calc(100vh - ${_})`,overflow:"hidden",...(M==null?void 0:M.style)??{}},children:[!K&&G?Q:null,e.jsx(f.Box,{display:"block",...S,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(S==null?void 0:S.style)??{}},children:W}),!K&&!G?Q:null,K&&e.jsxs(e.Fragment,{children:[!O&&e.jsx("div",{onClick:q,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),Q]})]})},Do="--app-aside-width",Dc=r=>typeof r=="number"?`${r}px`:r,Sc=({pageLayout:r,children:t,wrapperProps:o,containerProps:n})=>{const l=Ee.useMediaQuery("md"),s=(n==null?void 0:n.customWidth)??264;return h.useLayoutEffect(()=>{const i=document.documentElement;return i.style.setProperty(Do,l?Dc(s):"0px"),()=>i.style.removeProperty(Do)},[l,s]),e.jsxs(f.Box,{display:"block",direction:"row",...o,style:{marginRight:l?s:24,...(o==null?void 0:o.style)??{}},children:[r,e.jsx(f.Box,{direction:"column",show:"desktop",as:"aside",position:"fixed",top:"top-0",bottom:"bottom-0",right:"right-0",customWidth:264,borderStyle:"border-solid-l",borderWidth:"border-l",...n,style:{marginTop:"var(--app-header-height, 4rem)",backgroundColor:"var(--sa-background-primary, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},So="--sa-floating-footer-height",kc=r=>typeof r=="number"?`${r}px`:r,Bc=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:o,respectAside:n=!1,offsetRight:l,containerProps:s})=>{const i=h.useRef(null),c=l!=null?kc(l):n?"var(--app-aside-width, 0px)":"0px";return h.useLayoutEffect(()=>{const a=document.documentElement,d=()=>{var p;const b=((p=i.current)==null?void 0:p.getBoundingClientRect().height)??0;a.style.setProperty(So,`${b}px`)};d();const g=new ResizeObserver(d);return i.current&&g.observe(i.current),()=>{g.disconnect(),a.style.removeProperty(So)}},[]),e.jsx(f.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(f.Box,{ref:i,position:"fixed",bottom:"bottom-0",bg:"white",direction:"row",align:"center",display:"flex",paddingBlock:"sm",paddingInline:"md",borderColor:"border-subtle",style:{left:"var(--app-sidebar-width, 0px)",right:c,transition:"left 0.3s ease-in-out, right 0.3s ease-in-out"},justify:(s==null?void 0:s.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx(yn,{...o,customBottom:(o==null?void 0:o.customBottom)||"5.7rem"}),r]})})},mc=({fields:r})=>e.jsx(f.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(mt,{of:r,render:(t,o)=>e.jsx(Ec,{...t},o)})}),Ec=({title:r,value:t,icon:o})=>e.jsxs(f.Box,{display:"flex",direction:"column",gap:"sm",children:[o?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(F.Icon,{name:o,color:"subtle"}),e.jsx(m.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(m.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(m.Text,{variant:"sub-h3",children:t}):t]}),We={silhouette:"#A7B0AC",accent:"#78867F"};function Fc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r||"100",height:t||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:We.silhouette}),e.jsx("path",{d:"M33.2089 38.8535C31.3993 38.8535 29.9263 40.3453 29.9263 42.1805C29.9263 44.0156 31.3982 45.5062 33.2089 45.5062C35.0196 45.5062 36.4903 44.0145 36.4903 42.1805C36.4903 40.3465 35.0184 38.8535 33.2089 38.8535ZM33.2089 43.1625C32.6735 43.1625 32.2388 42.7219 32.2388 42.1805C32.2388 41.6391 32.6735 41.1973 33.2089 41.1973C33.7442 41.1973 34.1778 41.6379 34.1778 42.1805C34.1778 42.723 33.7431 43.1625 33.2089 43.1625Z",fill:We.silhouette}),e.jsx("path",{d:"M33.2089 54.6777C31.3993 54.6777 29.9263 56.1695 29.9263 58.0047C29.9263 59.8398 31.3982 61.3316 33.2089 61.3316C35.0196 61.3316 36.4903 59.8398 36.4903 58.0047C36.4903 56.1695 35.0184 54.6777 33.2089 54.6777ZM33.2089 58.9879C32.6735 58.9879 32.2388 58.5473 32.2388 58.0047C32.2388 57.4621 32.6735 57.0215 33.2089 57.0215C33.7442 57.0215 34.1778 57.4621 34.1778 58.0047C34.1778 58.5473 33.7431 58.9879 33.2089 58.9879Z",fill:We.silhouette}),e.jsx("path",{d:"M33.2089 70.5C31.3993 70.5 29.9263 71.9918 29.9263 73.827C29.9263 75.6621 31.3982 77.1539 33.2089 77.1539C35.0196 77.1539 36.4903 75.6621 36.4903 73.827C36.4903 71.9918 35.0184 70.5 33.2089 70.5ZM33.2089 74.8102C32.6735 74.8102 32.2388 74.3695 32.2388 73.827C32.2388 73.2844 32.6735 72.8438 33.2089 72.8438C33.7442 72.8438 34.1778 73.2844 34.1778 73.827C34.1778 74.3695 33.7431 74.8102 33.2089 74.8102Z",fill:We.silhouette}),e.jsx("path",{d:"M70.0215 38.2852C69.3821 38.2852 68.8652 38.809 68.8652 39.457V44.3332C68.8652 44.9812 69.3821 45.5051 70.0215 45.5051C70.6609 45.5051 71.1777 44.9812 71.1777 44.3332V39.457C71.1777 38.809 70.6609 38.2852 70.0215 38.2852Z",fill:We.silhouette}),e.jsx("path",{d:"M70.0215 54.3926C69.3821 54.3926 68.8652 54.9164 68.8652 55.5645V60.4406C68.8652 61.0887 69.3821 61.6125 70.0215 61.6125C70.6609 61.6125 71.1777 61.0887 71.1777 60.4406V55.5645C71.1777 54.9164 70.6609 54.3926 70.0215 54.3926Z",fill:We.silhouette}),e.jsx("path",{d:"M70.0215 70.5C69.3821 70.5 68.8652 71.0238 68.8652 71.6719V76.5492C68.8652 77.1973 69.3821 77.7211 70.0215 77.7211C70.6609 77.7211 71.1777 77.1973 71.1777 76.5492V71.6719C71.1777 71.0238 70.6609 70.5 70.0215 70.5Z",fill:We.silhouette}),e.jsx("path",{d:"M65.77 39.7617C65.1306 39.7617 64.6138 40.2855 64.6138 40.9336V45.8098C64.6138 46.4578 65.1306 46.9816 65.77 46.9816C66.4094 46.9816 66.9263 46.4578 66.9263 45.8098V40.9336C66.9263 40.2855 66.4094 39.7617 65.77 39.7617Z",fill:We.silhouette}),e.jsx("path",{d:"M65.77 55.8691C65.1306 55.8691 64.6138 56.393 64.6138 57.041V61.9172C64.6138 62.5652 65.1306 63.0891 65.77 63.0891C66.4094 63.0891 66.9263 62.5652 66.9263 61.9172V57.041C66.9263 56.393 66.4094 55.8691 65.77 55.8691Z",fill:We.silhouette}),e.jsx("path",{d:"M65.77 71.9766C65.1306 71.9766 64.6138 72.5004 64.6138 73.1484V78.0246C64.6138 78.6727 65.1306 79.1965 65.77 79.1965C66.4094 79.1965 66.9263 78.6727 66.9263 78.0246V73.1484C66.9263 72.5004 66.4094 71.9766 65.77 71.9766Z",fill:We.silhouette}),e.jsx("path",{d:"M61.2939 40.7246C60.6545 40.7246 60.1377 41.2484 60.1377 41.8965V46.7727C60.1377 47.4207 60.6545 47.9445 61.2939 47.9445C61.9334 47.9445 62.4502 47.4207 62.4502 46.7727V41.8965C62.4502 41.2484 61.9334 40.7246 61.2939 40.7246Z",fill:We.silhouette}),e.jsx("path",{d:"M61.2939 56.832C60.6545 56.832 60.1377 57.3559 60.1377 58.0039V62.8801C60.1377 63.5281 60.6545 64.052 61.2939 64.052C61.9334 64.052 62.4502 63.5281 62.4502 62.8801V58.0039C62.4502 57.3559 61.9334 56.832 61.2939 56.832Z",fill:We.silhouette}),e.jsx("path",{d:"M61.2939 72.9395C60.6545 72.9395 60.1377 73.4633 60.1377 74.1113V78.9875C60.1377 79.6355 60.6545 80.1594 61.2939 80.1594C61.9334 80.1594 62.4502 79.6355 62.4502 78.9875V74.1113C62.4502 73.4633 61.9334 72.9395 61.2939 72.9395Z",fill:We.silhouette}),e.jsx("path",{d:"M39.0489 24.4037C39.131 24.4037 39.2154 24.3944 39.2986 24.3768C42.7316 23.6127 46.6755 23.185 51.0207 23.11C51.659 23.0983 52.1677 22.5651 52.1561 21.917C52.1446 21.2701 51.652 20.7451 50.9791 20.7662C46.4813 20.8448 42.3835 21.2889 38.8015 22.0881C38.1782 22.2264 37.7828 22.8522 37.9204 23.4838C38.0395 24.0311 38.5182 24.4037 39.0489 24.4037Z",fill:We.silhouette}),e.jsx("path",{d:"M32.5406 26.6215C32.7407 26.6215 32.9442 26.57 33.128 26.4586C33.1315 26.4563 33.5096 26.2336 34.2889 25.9055C34.8786 25.6582 35.1584 24.9727 34.9144 24.3739C34.6704 23.775 33.9917 23.4926 33.4032 23.7399C32.4632 24.1348 31.9926 24.4149 31.9417 24.4465C31.396 24.7782 31.219 25.4942 31.544 26.0485C31.7613 26.4164 32.1452 26.6204 32.5395 26.6204L32.5406 26.6215Z",fill:We.silhouette}),e.jsx("path",{d:"M92.7251 26.7272L82.3845 29.3124C81.6929 29.4856 80.9911 29.0642 80.8179 28.3727C80.6447 27.6799 81.066 26.978 81.7576 26.8048L92.0982 24.2196C92.791 24.0464 93.4929 24.4678 93.6661 25.1593C93.8393 25.8521 93.4179 26.554 92.7251 26.7272Z",fill:We.accent,fillOpacity:"0.65"}),e.jsx("path",{d:"M94.4649 11.0082L80.2465 21.3488C79.6701 21.7676 78.8609 21.6409 78.4408 21.0632C78.022 20.4867 78.1487 19.6775 78.7265 19.2574L92.9448 8.91682C93.5213 8.49803 94.3305 8.6247 94.7505 9.20248C95.1693 9.77897 95.0414 10.5881 94.4649 11.0082Z",fill:We.accent,fillOpacity:"0.65"}),e.jsx("path",{d:"M78.0091 10.6269L74.1314 17.0898C73.7643 17.7025 72.9706 17.9002 72.358 17.5331C71.7466 17.1673 71.5475 16.3724 71.9146 15.7597L75.7923 9.29684C76.1594 8.68545 76.9544 8.48769 77.5657 8.85349C78.1784 9.22058 78.3762 10.0155 78.0091 10.6269Z",fill:We.accent,fillOpacity:"0.65"})]})})}const Ic=({title:r="create",children:t,onClickAction:o,variant:n="primary",variantTitle:l,leftIcon:s,showButton:i=!0,customHeight:c,childrenButton:a,customIcon:d})=>{const g=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:s?e.jsx(V.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(V.Button,{primary:!0,onClick:o,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:s?e.jsx(V.Button,{secondary:!0,iconLeft:s,onClick:o,children:l?e.jsx(m.Text,{fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(V.Button,{secondary:!0,onClick:o,children:a||r})});case"success":return e.jsx(e.Fragment,{children:s?e.jsx(V.Button,{success:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(V.Button,{success:!0,onClick:o,children:a||r})});default:return e.jsx(e.Fragment,{children:s?e.jsx(V.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(V.Button,{primary:!0,onClick:o,children:a||r})})}};return e.jsxs(f.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:c,children:[d||e.jsx(Fc,{}),e.jsx(f.Box,{direction:"column",children:t.map((b,p)=>e.jsx(nr.Body1,{props:{align:"center",textAlign:"center"},children:p>2?null:b},p))}),i?g():null]})},te={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function Tc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:te.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("path",{d:"M233.438 165.217C233.438 132.764 239.035 107.198 250.231 88.5189C261.596 69.8396 279.832 60.5 304.938 60.5C330.043 60.5 348.194 69.8396 359.389 88.5189C370.755 107.198 376.438 132.764 376.438 165.217C376.438 198.047 370.755 223.802 359.389 242.481C348.194 261.16 330.043 270.5 304.938 270.5C279.832 270.5 261.596 261.16 250.231 242.481C239.035 223.802 233.438 198.047 233.438 165.217ZM333.69 165.217C333.69 146.16 331.824 131.538 328.092 121.349C324.36 110.972 316.642 105.783 304.938 105.783C293.233 105.783 285.515 110.972 281.783 121.349C278.051 131.538 276.185 146.16 276.185 165.217C276.185 178.047 276.863 188.708 278.22 197.198C279.577 205.5 282.292 212.292 286.363 217.575C290.604 222.67 296.795 225.217 304.938 225.217C313.08 225.217 319.187 222.67 323.258 217.575C327.499 212.292 330.298 205.5 331.655 197.198C333.012 188.708 333.69 178.047 333.69 165.217Z",fill:te.cD0E5F7}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.4375 235.124V194.28L138.96 60.5H192.466V191.32H215.438V235.124H192.466V249.5H144.563V235.124H50.4375ZM100.862 191.32L147.925 116.143V191.32H100.862Z",fill:te.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M394.438 235.124V194.28L482.96 60.5H536.466V191.32H559.438V235.124H536.466V249.5H488.563V235.124H394.438ZM444.862 191.32L491.925 116.143V191.32H444.862Z",fill:te.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:te.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:te.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:te.c98B4CB}),e.jsx("path",{d:"M244.719 200.89V264.5H363.574V200.89M244.719 200.89H233.438L244.719 186.396M244.719 200.89H363.574M363.574 200.89H372.437L363.574 186.396M244.719 186.396L261.64 171.5M244.719 186.396H261.64M363.574 186.396L349.472 171.5M363.574 186.396H349.472M261.64 171.5H349.472M261.64 171.5V186.396M349.472 171.5V186.396M349.472 186.396H261.64",stroke:te.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:te.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:te.cFFFFFF}),e.jsx("path",{d:"M332.438 129.846C332.438 141.175 329.183 152.403 323.949 160.772C318.699 169.168 311.592 174.5 303.938 174.5C296.283 174.5 289.176 169.168 283.926 160.772C278.692 152.403 275.438 141.175 275.438 129.846C275.438 118.458 277.838 109.628 282.543 103.663C287.216 97.7387 294.274 94.5 303.938 94.5C313.601 94.5 320.659 97.7387 325.332 103.663C330.037 109.628 332.438 118.458 332.438 129.846Z",fill:te.cFFFFFF,stroke:te.c000000,strokeWidth:"2"}),e.jsx("path",{d:"M281.438 145.5C284.032 154.136 285.762 158.682 290.951 164.591M292.681 166.409C293.624 167.647 295.708 169.591 297.438 170.5",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.438 175C299.54 176.339 297.208 177.876 293.938 182.5M304.438 175C301.183 178.041 299.537 178.883 299.438 182.5M304.438 175C308.173 177.107 309.635 178.834 311.438 182.5",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.936 175.5C303.438 180 302.529 181.628 304.936 186.5",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.178 120.981C289.969 120.93 290.921 121.313 292.167 122.754",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:te.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:te.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:te.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:te.c001A72,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M265.437 115.5L260.438 120.5M260.438 115.5L265.438 120.5",stroke:te.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.437 87.5L283.438 92.5M283.438 87.5L288.438 92.5",stroke:te.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M305.437 83.5L298.438 90.5M298.438 83.5L305.438 90.5",stroke:te.c001A72,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M342.437 145.5L337.438 150.5M337.438 145.5L342.438 150.5",stroke:te.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:te.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:te.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:te.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:te.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:te.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:te.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:te.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:te.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:te.c001A72})]})})}function Lc({onClick:r}){const t=Ee.useMediaQuery("md");return e.jsxs(f.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Tc,{width:t?600:300}),e.jsx(m.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(m.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(V.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const ce={c46F16B:"#46F16B",c48504C:"#48504C",c64B5F6:"#64B5F6",c67AEE6:"#67AEE6",c86512B:"#86512B",c956847:"#956847",cBBC3F5:"#BBC3F5",cBBDEFB:"#BBDEFB",cC0B2A2:"#C0B2A2",cC8CEF4:"#C8CEF4",cCABEB1:"#CABEB1",cD5C7BD:"#D5C7BD",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cE5EE80:"#E5EE80",cEE8080:"#EE8080",cEFF3F8:"#EFF3F8",cF4F4F4:"#F4F4F4",cFFFFFF:"#FFFFFF"};function Mc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:ce.cD6EBFD}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M75 238.124V197.28L163.523 63.5H217.029V194.32H240V238.124H217.029V252.5H169.126V238.124H75ZM125.424 194.32L172.487 119.143V194.32H125.424Z",fill:ce.cBBDEFB,fillOpacity:"0.6"}),e.jsxs("g",{clipPath:"url(#clip0_2949_9690)",children:[e.jsx("path",{d:"M334.5 274.5C381.168 274.5 419 227.266 419 169C419 110.734 381.168 63.5 334.5 63.5C287.832 63.5 250 110.734 250 169C250 227.266 287.832 274.5 334.5 274.5Z",fill:ce.cEFF3F8,stroke:ce.c67AEE6,strokeWidth:"5"}),e.jsx("path",{d:"M413 197.5C411.397 211.835 402.919 230.898 389.361 246.49C375.596 262.32 356.651 274.5 334.496 274.5C311.331 274.5 292.389 261.672 278.878 245.52C265.592 229.638 257.606 210.603 256 197.5H413Z",fill:ce.cD5C7BD}),e.jsx("path",{d:"M278.887 211.766H391.104L392.583 222.856C392.687 223.635 392.08 224.328 391.294 224.328H277.961C277.14 224.328 276.525 223.577 276.686 222.773L278.887 211.766Z",fill:ce.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:ce.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:ce.c956847,stroke:ce.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:ce.c956847,stroke:ce.c48504C}),e.jsx("path",{d:"M285.902 212.103L284.935 186.306H279.606C278.151 186.306 277.004 187.542 277.113 188.993L278.673 209.79C278.77 211.095 279.857 212.103 281.166 212.103H285.902Z",fill:ce.cC8CEF4,stroke:ce.c48504C}),e.jsx("path",{d:"M383.256 212.103L384.638 186.306H389.556C391.007 186.306 392.153 187.537 392.05 188.984L390.564 209.782C390.471 211.09 389.382 212.103 388.07 212.103H383.256Z",fill:ce.cC8CEF4,stroke:ce.c48504C}),e.jsx("path",{d:"M284.497 178.155C284.455 176.194 286.034 174.581 287.996 174.581H381.904C383.895 174.581 385.485 176.24 385.401 178.23L384.066 209.59C383.987 211.463 382.445 212.941 380.569 212.941H288.663C286.759 212.941 285.205 211.419 285.164 209.515L284.497 178.155Z",fill:ce.cC8CEF4,stroke:ce.c48504C}),e.jsx("path",{d:"M284.845 181.524C284.792 179.279 286.598 177.431 288.844 177.431H380.687C382.948 177.431 384.76 179.304 384.684 181.565L383.774 208.737C383.701 210.893 381.933 212.603 379.776 212.603H289.48C287.307 212.603 285.532 210.869 285.481 208.697L284.845 181.524Z",fill:ce.cBBC3F5}),e.jsx("mask",{id:"mask0_2949_9690",maskUnits:"userSpaceOnUse",x:"301",y:"144",width:"68",height:"17",style:{maskType:"luminance"},children:e.jsx("path",{d:"M301 146.5C301 145.395 301.887 144.5 302.98 144.5H367.02C368.114 144.5 369 145.395 369 146.5V160.411H301V146.5Z",fill:ce.cFFFFFF})}),e.jsxs("g",{mask:"url(#mask0_2949_9690)",children:[e.jsx("path",{d:"M301 146.191C301 145.257 301.748 144.5 302.671 144.5H356.701C357.624 144.5 358.372 145.257 358.372 146.191V157.949H301V146.191Z",fill:ce.cFFFFFF}),e.jsx("path",{d:"M301.336 146.607C301.336 145.673 302.08 144.916 302.999 144.916H367.01C367.929 144.916 368.673 145.673 368.673 146.607V152.523H301.336V146.607Z",fill:ce.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:ce.cF4F4F4}),e.jsx("path",{d:"M307.685 150.417C308.607 150.417 309.356 149.66 309.356 148.726C309.356 147.793 308.607 147.036 307.685 147.036C306.762 147.036 306.014 147.793 306.014 148.726C306.014 149.66 306.762 150.417 307.685 150.417Z",fill:ce.cEE8080}),e.jsx("path",{d:"M313.532 150.417C314.455 150.417 315.203 149.66 315.203 148.726C315.203 147.793 314.455 147.036 313.532 147.036C312.609 147.036 311.861 147.793 311.861 148.726C311.861 149.66 312.609 150.417 313.532 150.417Z",fill:ce.cE5EE80}),e.jsx("path",{d:"M318.546 150.417C319.469 150.417 320.217 149.66 320.217 148.726C320.217 147.793 319.469 147.036 318.546 147.036C317.623 147.036 316.875 147.793 316.875 148.726C316.875 149.66 317.623 150.417 318.546 150.417Z",fill:ce.c46F16B})]}),e.jsx("path",{d:"M301.16 146C301.16 145.172 301.832 144.5 302.66 144.5H367.33C368.159 144.5 368.83 145.172 368.83 146V174.419H301.16V146Z",stroke:ce.c48504C}),e.jsx("path",{d:"M395.29 207.579H423.344M354.255 236.889H369.329M327.038 222.234H347.556M350.905 222.234H358.024M288.097 230.19H304.846M253.344 210.091H272.605M278.467 246.938H295.216M297.309 246.938H303.59M337.088 252.801H354.255",stroke:ce.c86512B,strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("path",{d:"M430.241 125.78C430.987 105.807 437.521 90.4065 449.841 79.5799C462.161 68.7532 478.867 63.3398 499.961 63.3398C513.961 63.3398 525.907 65.7665 535.801 70.6199C545.881 75.4732 553.441 82.0998 558.481 90.4998C563.707 98.8998 566.321 108.327 566.321 118.78C566.321 131.1 563.241 141.18 557.081 149.02C550.921 156.673 543.734 161.9 535.521 164.7V165.82C546.161 169.367 554.561 175.247 560.721 183.46C566.881 191.673 569.961 202.22 569.961 215.1C569.961 226.673 567.254 236.94 561.841 245.9C560.436 248.258 558.849 250.481 557.081 252.569L443.5 252.662C432.5 241 427.721 230.5 427.721 207.82H474.201C474.387 216.033 476.721 222.567 481.201 227.42C485.681 232.087 492.214 234.42 500.801 234.42C508.081 234.42 513.681 232.367 517.601 228.26C521.707 223.967 523.761 218.367 523.761 211.46C523.761 202.5 520.867 196.06 515.081 192.14C509.481 188.033 500.427 185.98 487.921 185.98H478.961V147.06H487.921C497.441 147.06 505.094 145.473 510.881 142.3C516.854 138.94 519.841 133.06 519.841 124.66C519.841 117.94 517.974 112.713 514.241 108.98C510.507 105.247 505.374 103.38 498.841 103.38C491.747 103.38 486.427 105.527 482.881 109.82C479.521 114.113 477.561 119.433 477.001 125.78H430.241Z",fill:ce.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:ce.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:ce.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:ce.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:ce.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:ce.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:ce.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:ce.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_2949_9690",children:e.jsx("rect",{width:"179",height:"192",fill:ce.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function Ac({onClick:r}){const t=Ee.useMediaQuery("md");return e.jsxs(f.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Mc,{width:t?600:300}),e.jsx(m.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(V.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const y={c000D58:"#000D58",c001174:"#001174",c28AC6E:"#28AC6E",c48504C:"#48504C",c64B5F6:"#64B5F6",c90CAF9:"#90CAF9",cC9184A:"#C9184A",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cD9D9D9:"#D9D9D9",cDEECF8:"#DEECF8",cE7EAE9:"#E7EAE9",cF3F8FD:"#F3F8FD",cFFE18B:"#FFE18B",cFFFFFF:"#FFFFFF"};function Oc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:y.cD6EBFD}),e.jsx("path",{d:"M246.562 180.558C246.562 148.105 252.16 122.539 263.356 103.86C274.721 85.1804 292.957 75.8408 318.063 75.8408C343.168 75.8408 361.319 85.1804 372.514 103.86C383.88 122.539 389.562 148.105 389.562 180.558C389.562 213.388 383.88 239.143 372.514 257.822C361.319 276.501 343.168 285.841 318.063 285.841C292.957 285.841 274.721 276.501 263.356 257.822C252.16 239.143 246.562 213.388 246.562 180.558ZM346.815 180.558C346.815 161.501 344.949 146.879 341.217 136.69C337.485 126.313 329.767 121.124 318.063 121.124C306.358 121.124 298.64 126.313 294.908 136.69C291.176 146.879 289.31 161.501 289.31 180.558C289.31 193.388 289.988 204.048 291.345 212.539C292.702 220.841 295.417 227.633 299.488 232.916C303.729 238.011 309.92 240.558 318.063 240.558C326.205 240.558 332.312 238.011 336.383 232.916C340.624 227.633 343.423 220.841 344.78 212.539C346.137 204.048 346.815 193.388 346.815 180.558Z",fill:y.cD6EBFD}),e.jsx("path",{d:"M222.808 118.703H128.062V159.858C132.111 155.484 137.779 151.905 145.067 149.122C152.356 146.338 160.251 144.946 168.754 144.946C183.938 144.946 196.49 148.326 206.41 155.086C216.532 161.846 223.922 170.594 228.578 181.329C233.234 192.065 235.562 203.696 235.562 216.221C235.562 239.483 228.882 257.972 215.52 271.691C202.158 285.21 183.357 282.89 159.062 282.89C142.867 282.89 131.098 284.939 116.826 283.918C104.881 278.351 95.6695 270.697 89.1911 260.955C82.7127 251.213 79.1698 239.98 78.5625 227.256H129.276C130.491 233.419 133.426 238.588 138.083 242.763C142.739 246.739 149.116 248.728 157.214 248.728C166.729 248.728 173.815 245.745 178.472 239.781C183.128 233.817 185.456 225.864 185.456 215.923C185.456 206.181 183.027 198.726 178.168 193.557C173.309 188.387 166.223 185.803 156.911 185.803C150.027 185.803 144.359 187.493 139.905 190.873C135.451 194.054 132.515 198.328 131.098 203.696H80.9919V73.9697H222.808V118.703Z",fill:y.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:y.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:y.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:y.cFFFFFF,stroke:y.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 200.539C269.878 200.263 270.101 200.039 270.377 200.039L305.476 199.955C305.753 199.955 305.978 200.179 305.978 200.455V206.461H269.878V200.539Z",stroke:y.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:y.cFFFFFF,stroke:y.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 235.871C269.878 235.595 270.101 235.372 270.377 235.371L305.476 235.288C305.753 235.287 305.978 235.511 305.978 235.788V241.794H269.878V235.871Z",stroke:y.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:y.cFFFFFF,stroke:y.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 272.088C269.878 271.812 270.101 271.589 270.377 271.588L305.476 271.505C305.753 271.504 305.978 271.728 305.978 272.005V278.011H269.878V272.088Z",stroke:y.c001174}),e.jsx("path",{d:"M279.095 176.348H364.373C365.459 176.348 366.125 176.992 366.986 178.252V202.985C366.986 202.985 366.986 203.869 366.545 204.752C366.103 205.635 365.661 206.077 365.661 206.077L306.478 206.163V199.452L279.095 199.518V176.348Z",fill:y.cF3F8FD}),e.jsx("path",{d:"M279.095 211.093H364.373C365.459 211.093 366.125 211.736 366.986 212.997V237.73C366.986 237.73 366.986 238.613 366.545 239.497C366.103 240.38 365.661 240.822 365.661 240.822L306.478 240.908V234.197L279.095 234.262V211.093Z",fill:y.cF3F8FD}),e.jsx("path",{d:"M279.095 248.008H364.373C365.459 248.008 366.125 248.652 366.986 249.912V274.646C366.986 274.646 366.986 275.529 366.545 276.412C366.103 277.296 365.661 277.737 365.661 277.737L306.478 277.824V271.112L279.095 271.178V248.008Z",fill:y.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:y.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:y.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:y.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:y.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:y.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:y.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:y.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:y.cE7EAE9,stroke:y.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:y.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:y.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:y.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:y.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:y.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:y.cDEECF8}),e.jsx("path",{d:"M268.053 210.494C268.483 209.112 268.564 208.343 268.053 206.961H362.569C361.955 208.363 361.972 209.136 362.569 210.494H268.053Z",fill:y.c000D58,stroke:y.c001174}),e.jsx("path",{d:"M268.053 246.269C268.483 244.887 268.564 244.118 268.053 242.736H362.569C361.955 244.138 361.972 244.911 362.569 246.269H268.053Z",fill:y.c000D58,stroke:y.c001174}),e.jsx("path",{d:"M283.312 130.775C283.312 129.64 283.987 128.72 284.82 128.72H349.805C350.638 128.72 351.312 129.64 351.312 130.775V169.72H283.312V130.775Z",fill:y.cFFFFFF,stroke:y.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M279.574 171.847C279.381 171.283 279.267 170.624 279.33 169.72H355.195C355.423 170.925 355.287 171.695 355.063 172.241C354.834 172.802 354.506 173.186 354.101 173.66C354.084 173.68 354.067 173.7 354.05 173.72H280.503C280.468 173.658 280.434 173.598 280.4 173.539C280.051 172.922 279.774 172.434 279.574 171.847Z",stroke:y.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M350.312 133.72V129.726L284.812 129.72C284.312 129.726 284.312 129.726 284.312 130.125V133.72H350.312Z",fill:y.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:y.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:y.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:y.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:y.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:y.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:y.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:y.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:y.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:y.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:y.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:y.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Wc({onClick:r}){const t=Ee.useMediaQuery("md");return e.jsxs(f.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Oc,{width:t?600:300}),e.jsx(m.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(m.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(V.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const zc=r=>{var o,n,l,s,i;const t=Ee.useMediaQuery("md");return e.jsxs(Oe.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(Oe.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(m.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Oe.DialogBody,{children:typeof r.description=="string"?e.jsx(m.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(Oe.DialogFooter,{children:e.jsx(f.Box,{display:"flex",direction:((o=r.containerConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((n=r.containerConfirmBtnProps)==null?void 0:n.justify)||"flex-end",...r.containerConfirmBtnProps,children:e.jsxs(f.Box,{display:"flex",direction:((l=r.wrapperConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((s=r.wrapperConfirmBtnProps)==null?void 0:s.justify)||"flex-end",gap:((i=r.wrapperConfirmBtnProps)==null?void 0:i.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(V.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(f.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(V.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},Hc=h.memo(({children:r,height:t,minHeight:o,customHeight:n,paddingInline:l="spacing-0",paddingBlock:s="spacing-0",header:i,footer:c,title:a,titleTag:d,action:g,actionContainer:b,containerProps:p,bodyProps:C,headerProps:B={borderBottom:!0},footerProps:x={borderTop:!0},variantTag:W="info"})=>{const L=h.useRef(null),[M,S]=h.useState("100vh");h.useEffect(()=>{const D=()=>{if(L.current){const O=L.current.getBoundingClientRect().top;S(`calc(100vh - ${O}px)`)}};return D(),window.addEventListener("resize",D),()=>window.removeEventListener("resize",D)},[]);const E=()=>d?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(m.Text,{fontWeight:"medium",children:a}),e.jsx(or.Badges,{border:!0,text:d,variant:W})]}):e.jsx(m.Text,{fontWeight:"medium",children:a}),A=()=>i||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:a?E():null}),e.jsx(f.Box,{direction:"column",...b,children:g??null})]}),T=!!(i||a||g);return e.jsxs(f.Box,{ref:L,height:t,customMinHeight:o,customHeight:n,paddingBlock:s,paddingInline:l,bg:"white",direction:"column",...p,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:M,...(p==null?void 0:p.style)??{}},children:[i!==null&&T?e.jsx(lo,{...B,children:A()}):null,e.jsx(f.Box,{direction:"column",padding:"spacing-0",...C,style:{flex:1,overflow:"auto",...(C==null?void 0:C.style)??{}},children:r}),c?e.jsx(no,{...x,children:c}):null]})}),_c=h.memo(({value:r,options:t=[],onChange:o,multiple:n})=>{const l=(r==null?void 0:r.map(c=>c.value))||[],s=(t==null?void 0:t.filter(c=>l.includes(c.value)))||[],i=c=>{const a=[...s];let d=[];n?d=l.includes(c.value)?a.filter(g=>g.value!==c.value):[...a,c]:d=[c],o==null||o(d)};return e.jsx(f.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((c,a)=>e.jsx(V.Button,{...l.includes(c.value)?{primary:!0}:{secondary:!0},onClick:()=>i(c),children:c.label},a))})});function Et(r){return null}Et.displayName="LayoutDialog.Header";function Ft(r){return null}Ft.displayName="LayoutDialog.Body";function It(r){return null}It.displayName="LayoutDialog.Aside";function Tt(r){return null}Tt.displayName="LayoutDialog.Footer";const Ve={"lyd-root":"_lyd-root_jyp0m_6","lyd-backdrop":"_lyd-backdrop_jyp0m_43","lyd-panel":"_lyd-panel_jyp0m_52","lyd-modal":"_lyd-modal_jyp0m_63","lyd-fullscreen":"_lyd-fullscreen_jyp0m_77","lyd-sidebar":"_lyd-sidebar_jyp0m_85","lyd-header":"_lyd-header_jyp0m_115","lyd-header-content":"_lyd-header-content_jyp0m_126","lyd-header-actions":"_lyd-header-actions_jyp0m_134","lyd-main":"_lyd-main_jyp0m_141","lyd-body":"_lyd-body_jyp0m_148","lyd-aside":"_lyd-aside_jyp0m_154","lyd-footer":"_lyd-footer_jyp0m_170","lyd-vm-group":"_lyd-vm-group_jyp0m_183","lyd-vm-btn":"_lyd-vm-btn_jyp0m_191","lyd-close-btn":"_lyd-close-btn_jyp0m_214"},Pc=[{mode:"sidebar",label:"Sidebar",renderIcon:()=>e.jsx(jc,{})},{mode:"modal",label:"Modal",renderIcon:()=>e.jsx(F.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",renderIcon:()=>e.jsx(F.Icon,{name:"Fullscreen",size:"sm"})}];function Nc({value:r,onChange:t}){return e.jsx("div",{className:Ve["lyd-vm-group"],role:"group","aria-label":"View mode",children:Pc.map(o=>e.jsx("button",{type:"button",className:Ve["lyd-vm-btn"],"data-active":r===o.mode,"aria-label":`Switch to ${o.label} view`,"aria-pressed":r===o.mode,onClick:()=>t(o.mode),children:o.renderIcon()},o.mode))})}function jc(){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),e.jsx("line",{x1:"15",y1:"4",x2:"15",y2:"20"})]})}const ko={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Vc(r){return r?r in ko?ko[r]:r:ko.xl}function Lt(r,t){let o=null;return h.Children.forEach(r,n=>{h.isValidElement(n)&&n.type===t&&(o=n.props.children??null)}),o}function qc(r){const{isOpen:t,onClose:o,viewMode:n,defaultViewMode:l="modal",onViewModeChange:s,showViewModeToggle:i=!0,showCloseButton:c=!0,size:a,asideWidth:d,disableEscapeClose:g=!1,disableBackdropClose:b=!1,lockBodyScroll:p=!0,children:C}=r,[B,x]=h.useState(l),W=n??B,M=Ee.useMediaQuery("md")?W:"fullscreen",S=h.useCallback(R=>{n===void 0&&x(R),s==null||s(R)},[n,s]),E=h.useRef(null);h.useEffect(()=>{if(!(!t||!p))return E.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=E.current??""}},[t,p]);const A=h.useRef(o);A.current=o,h.useEffect(()=>{if(t)return Oe.registerOverlay({onEscape:g?void 0:()=>A.current()})},[t,g]);const T=h.useMemo(()=>Lt(C,Et),[C]),D=h.useMemo(()=>Lt(C,Ft),[C]),O=h.useMemo(()=>Lt(C,It),[C]),q=h.useMemo(()=>Lt(C,Tt),[C]);if(!t)return null;const G=[Ve["lyd-panel"],M==="modal"&&Ve["lyd-modal"],M==="fullscreen"&&Ve["lyd-fullscreen"],M==="sidebar"&&Ve["lyd-sidebar"]].filter(Boolean).join(" "),_={"--lyd-max-w":Vc(a),...d!==void 0&&{"--lyd-aside-w":d}},H=()=>{b||o()};return typeof document>"u"?null:gt.createPortal(e.jsxs("div",{className:Ve["lyd-root"],style:_,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:Ve["lyd-backdrop"],onClick:H,"aria-hidden":"true"}),e.jsxs("div",{className:G,children:[e.jsxs("div",{className:Ve["lyd-header"],children:[e.jsx("div",{className:Ve["lyd-header-content"],children:T}),e.jsxs("div",{className:Ve["lyd-header-actions"],children:[i&&e.jsx(Nc,{value:W,onChange:S}),c&&e.jsx("button",{type:"button",className:Ve["lyd-close-btn"],onClick:o,"aria-label":"Close dialog",children:e.jsx(F.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:Ve["lyd-main"],children:[e.jsx("div",{className:Ve["lyd-body"],children:D}),O&&e.jsx("aside",{className:Ve["lyd-aside"],children:O})]}),q&&e.jsx("div",{className:Ve["lyd-footer"],children:q})]})]}),document.body)}const lt=qc;lt.Header=Et,lt.Body=Ft,lt.Aside=It,lt.Footer=Tt;function Zc({url:r,filename:t,onClose:o}){const n=h.useRef(o);return n.current=o,h.useEffect(()=>Oe.registerOverlay({onEscape:()=>n.current()}),[]),e.jsxs("div",{onClick:o,style:{position:"fixed",inset:0,zIndex:9999,backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[e.jsxs("div",{onClick:l=>l.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:r,download:t,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:r,alt:t,onClick:l=>l.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:t})]})}const Gc=/\.(jpe?g|png|gif|webp|bmp|svg|avif)(\?|#|$)/i,Qc=/\.pdf(\?|#|$)/i,Uc=/\.(mp4|webm|ogv|mov|m4v)(\?|#|$)/i,Yc=/\.(mp3|wav|ogg|m4a|aac|flac)(\?|#|$)/i;function Xc(r,t){if(t)return t;const o=r.mimeType??"",n=l=>l.test(r.fileName??"")||l.test(r.fileUrl??"");return o.startsWith("image/")||n(Gc)?"image":o==="application/pdf"||n(Qc)?"pdf":o.startsWith("video/")||n(Uc)?"video":o.startsWith("audio/")||n(Yc)?"audio":"other"}const wn={display:"block",maxWidth:"100%",maxHeight:"70vh",margin:"0 auto",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)"},$c={width:"100%",height:"75vh",border:"none",borderRadius:"var(--sa-radii-sm, 6px)"};function Jc({kind:r,attachment:t,openLabel:o,unsupportedLabel:n}){const{fileUrl:l,fileName:s}=t;switch(r){case"image":return e.jsx("img",{src:l,alt:s,style:wn});case"pdf":return e.jsx("iframe",{src:l,title:s,style:$c});case"video":return e.jsx("video",{src:l,controls:!0,style:{...wn,width:"100%"}});case"audio":return e.jsx(f.Box,{padding:"lg",align:"center",justify:"center",fullWidth:!0,children:e.jsx("audio",{src:l,controls:!0,style:{width:"100%"}})});default:return e.jsxs(f.Box,{direction:"column",align:"center",justify:"center",gap:"md",padding:"3xl",fullWidth:!0,children:[e.jsx(F.Icon,{name:"DocumentDetail",size:"lg"}),e.jsx(m.Text,{fontSize:"sm",color:"gray-500",children:n}),e.jsx(V.Button,{type:"button",variant:"link",iconLeft:e.jsx(F.Icon,{name:"SquareArrowExpand"}),onClick:()=>window.open(l,"_blank","noopener"),children:o})]})}}const Kc=({attachment:r,onClose:t,onDownload:o,isDownloading:n,kind:l,maxWidth:s,labels:i})=>{if(!r)return null;const c=Xc(r,l),a=s??(c==="pdf"?"min(80vw, 1100px)":"min(90vw, 900px)"),d={download:(i==null?void 0:i.download)??"Download",close:(i==null?void 0:i.close)??"Close",openInNewTab:(i==null?void 0:i.openInNewTab)??"Open in new tab",unsupported:(i==null?void 0:i.unsupported)??"This file type cannot be previewed."};return e.jsxs(Oe.Dialog,{isShow:!0,onHide:t,maxWidth:a,children:[e.jsx(Oe.DialogTitle,{children:e.jsxs(f.Box,{direction:"row",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[e.jsx(m.Text,{fontWeight:"semibold",truncate:!0,children:r.fileName}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[o?e.jsx(V.Button,{type:"button",variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Download"}),disabled:n,isLoading:n,onClick:o,children:d.download}):null,e.jsx(V.Button,{type:"button",variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Cross"}),"aria-label":d.close,onClick:t})]})]})}),e.jsx(Oe.DialogBody,{children:e.jsx(Jc,{kind:c,attachment:r,openLabel:d.openInNewTab,unsupportedLabel:d.unsupported})})]})},xn="var(--sa-border-subtle, #e5e7eb)",Mt=()=>e.jsx(f.Box,{style:{width:1,height:22,backgroundColor:xn}}),Rc=r=>typeof r=="number"?`${r}px`:r;function Dn({count:r,children:t,label:o,onClear:n,clearLabel:l="Clear selection",clearDisabled:s=!1,bottom:i=20,zIndex:c=50,style:a,className:d}){if(r===0)return null;const g=typeof o=="function"?o(r):o??`${r} selected`;return e.jsx(f.Box,{direction:"row",justify:"center",style:{position:"fixed",bottom:Rc(i),left:0,right:0,zIndex:c,pointerEvents:"none"},children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"xs",padding:"spacing-8",className:d,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",pointerEvents:"auto",borderRadius:"min(10px, var(--sa-radii-lg, 12px))",border:`1px solid ${xn}`,boxShadow:"var(--sa-shadow-xl, 0 10px 25px -5px rgb(0 0 0/0.15))",...a},children:[e.jsx(m.Text,{fontSize:"sm",fontWeight:"medium",whiteSpace:"nowrap",style:{paddingInline:6},children:g}),e.jsx(Mt,{}),t,n&&e.jsxs(e.Fragment,{children:[e.jsx(Mt,{}),e.jsx(Ae.Tooltip,{label:l,position:"top",children:e.jsx(V.Button,{variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Cross",size:"xs"}),"aria-label":l,onClick:n,disabled:s})})]})]})})}Dn.Divider=Mt;const At=r=>{const{variant:t="outlined",overflow:o="hidden",style:n,children:l,...s}=r;return e.jsx(Nt.Card,{variant:t,overflow:o,style:{display:"flex",flexDirection:"column",...n},...s,children:l})},ea=r=>r==null?void 0:typeof r=="number"?`${r}px`:r,Sn=({src:r,alt:t="",height:o=140,bg:n="var(--sa-background-neutral, #f0f1f2)",avatar:l,children:s})=>e.jsxs(f.Box,{style:{position:"relative",marginBottom:l?24:void 0},children:[e.jsx(f.Box,{style:{height:ea(o),background:r?void 0:n,overflow:"hidden"},children:r?e.jsx("img",{src:r,alt:t,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null}),s?e.jsx(f.Box,{style:{position:"absolute",inset:0,pointerEvents:"none"},children:s}):null,l?e.jsx(f.Box,{style:{position:"absolute",left:16,bottom:0,transform:"translateY(50%)"},children:l}):null]}),kn=({avatar:r,title:t,subtitle:o,action:n,divided:l=!1,children:s})=>e.jsx(f.Box,{padding:"md",style:{borderBottom:l?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:s??e.jsxs(he.Flex,{direction:"row",align:"center",gap:"sm",children:[r,e.jsxs(f.Box,{flex:"1",style:{minWidth:0},children:[t!=null&&e.jsx(m.Text,{fontWeight:"semibold",truncate:!0,children:t}),o!=null&&e.jsx(m.Text,{fontSize:"sm",color:"subtlest",truncate:!0,children:o})]}),n!=null&&e.jsx(f.Box,{style:{flexShrink:0},children:n})]})}),Bn=({left:r,right:t,divided:o=!0,children:n})=>e.jsx(f.Box,{padding:"md",style:{marginTop:"auto",borderTop:o?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:n??e.jsxs(he.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",children:[e.jsx(f.Box,{style:{minWidth:0},children:r}),e.jsx(f.Box,{style:{flexShrink:0},children:t})]})});At.Media=Sn,At.Header=kn,At.Footer=Bn;const ra=r=>{const{defaultTab:t=0,paramKey:o="tab"}=r||{},{useSearchParams:n}=cr(),[l,s]=n(),i=zr.searchParamsToObject(l.toString());return{activeTab:i[o]?parseInt(i[o]):t,handleTabChange:d=>{s({...i,[o]:d.toString()})},searchQueries:i}};function ta({appName:r,menuConfig:t,formatTitle:o}){const{useLocation:n}=cr(),l=n();h.useEffect(()=>{let s=null,i=null;for(const d of t){const g=d.items.find(b=>b.to?b.to==="/"?l.pathname==="/":!!(b.to===l.pathname||l.pathname.startsWith(b.to+"/")):!1);if(g){s=g,i=d;break}}const c=[];s!=null&&s.title&&c.push(s.title),i!=null&&i.name&&c.push(i.name.toTitleCase());const a=(d,g)=>d.length>0?`${d.join(" - ")} | ${g}`:g;document.title=(o||a)(c,r)},[l.pathname])}const oa=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=cr(),[n,l]=r(),s=zr.searchParamsToObject(n.toString()),i=t(),c=o(),a=i.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,B)=>n.has(C)&&n.get(C)===B,getQueryParam:C=>n.get(C),getRouteParam:C=>i[C],params:i,location:c,id:a,hasId:!!a}};function la(r){var n,l;const t=r.decodedAccessToken;return h.useMemo(()=>{var a,d;const s=((d=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:d.code)??"",i=Object.keys(r.role).reduce((g,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,C=>C.replace("_","").toUpperCase())}`;return{...g,[p]:!1}},{});return{...Object.keys(r.role).reduce((g,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,C=>C.replace("_","").toUpperCase())}`;return{...g,[p]:s===r.role[b]}},i),hasRole:g=>s===r.role[g],getRoleKey:()=>s}},[(l=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:l.code,r])}u.ASIDE_WIDTH_VAR=Do,u.AdvanceFilterBar=Il,u.App=Wn,u.AppComponent=$o,u.AppContext=qt,u.AppLayout=Yn,u.AsideBar=Sc,u.AttachmentPreview=Kc,u.BackButton=$n,u.ColumnFilterDropdown=Rl,u.ColumnHeaderFilter=ni,u.ColumnMenu=sn,u.ConfirmationDialog=zc,u.DataTable=rn,u.DecisionWrapper=pe,u.EachUtils=mt,u.EmptyStatePage=Ic,u.EntityCard=At,u.EntityCardFooter=Bn,u.EntityCardHeader=kn,u.EntityCardMedia=Sn,u.FLOATING_FOOTER_HEIGHT_VAR=So,u.FilterBar=Qs,u.FilterDrawer=Fl,u.FloatingFooter=Bc,u.ForbiddenPage=Ac,u.Form=yc,u.FullSection=Hc,u.HeaderLeftSlot=zn,u.HeaderLeftSlotOutlet=Ro,u.HeaderLeftSlotProvider=Ko,u.Highlight=cn,u.HorizontalField=rs,u.ImagePreview=Zc,u.InputFile=fn,u.InputImage=gn,u.LayoutDialog=lt,u.LayoutDialogAside=It,u.LayoutDialogBody=Ft,u.LayoutDialogFooter=Tt,u.LayoutDialogHeader=Et,u.ModuleSwitcher=Jn,u.ModuleSwitcherModal=bl,u.NotFoundPage=Lc,u.PageLayout=ns,u.Pressable=Kr,u.RightDrawer=xl,u.SIDEBAR_DEFAULT_WIDTH=Gt,u.SIDEBAR_MAX_WIDTH=Ut,u.SIDEBAR_MIN_WIDTH=Qt,u.ScrollToTopButton=yn,u.Section=ds,u.SectionFooter=no,u.SectionHeader=lo,u.SelectButton=_c,u.SelectionActionBar=Dn,u.SelectionActionBarDivider=Mt,u.ServerErrorPage=Wc,u.SidePanel=xc,u.SidePanelItem=vc,u.SidebarBadgesProvider=Vo,u.SidebarGroupSlot=Hn,u.SidebarGroupSlotOutlet=Jt,u.SidebarGroupSlotProvider=el,u.SidebarHeaderSlot=Jo,u.SidebarProvider=Qo,u.StarasiaRouterProvider=Xo,u.TableFooter=Kl,u.TableHeader=Jl,u.TableLayout=mi,u.TableSection=fi,u.TableWrapper=$l,u.ToggleStatus=gc,u.Typography=nr,u.VerticalField=mc,u.clearModuleSelection=_n,u.createInitialFromUserName=Mi,u.cssVars=_i,u.expandDateCompact=si,u.formHasChanged=Zi,u.formatDate=zi,u.formatDateToIndonesian=hn,u.formatRupiah=Oi,u.getDateFilterValue=El,u.getDateRangeFilterValue=gs,u.getInitials=Wi,u.getValueDropdownMultipleFilter=ml,u.getValueRadioFilter=us,u.getValueSearch=vt,u.getValuesFilter=bt,u.handleChangeFilter=Rr,u.handleOnScroll=Ri,u.isColumnFilterActive=Xl,u.isEmail=$i,u.isFilterActive=ys,u.isOnlyLettersAndSpaces=Qi,u.isPhoneNumber=Gi,u.isSlug=Ji,u.localStorageAdapter=io,u.oneDayInMs=Pi,u.parseIndonesianDateToDate=Ai,u.preventNonCoordinateInput=Ki,u.preventNonNumberAndDecimalInput=Xi,u.preventNonNumberInput=Ui,u.preventNumberInput=Yi,u.resolveDateRangeValueToString=kl,u.resolveDateValueToString=Bl,u.resolveDropdownValueToString=Dl,u.resolveRadioValueToString=Sl,u.resolveSidebarBadge=Jr,u.storageKeys=Pr,u.textWidth=Ni,u.useApp=Zt,u.useAppState=No,u.useAuthRole=la,u.useCoarsePointer=ln,u.useDynamicTitle=ta,u.useFilterBarApiParams=$s,u.useFilterBarControls=Ks,u.useModuleSelection=Rt,u.useRouteInfo=Ye,u.useRouteParams=oa,u.useRouterAdapter=cr,u.useSidebar=Uo,u.useSidebarBadges=qo,u.useTabState=ra,u.useTableSortApiParams=Ei,Object.keys(Ar).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ar[r]})}),Object.keys(ft).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ft[r]})}),Object.keys(or).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>or[r]})}),Object.keys(f).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>f[r]})}),Object.keys(Or).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Or[r]})}),Object.keys(V).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>V[r]})}),Object.keys(Nt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Nt[r]})}),Object.keys(Sr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Sr[r]})}),Object.keys(Oe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Oe[r]})}),Object.keys(ut).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ut[r]})}),Object.keys(Wr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Wr[r]})}),Object.keys(Ee).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ee[r]})}),Object.keys(zr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>zr[r]})}),Object.keys(gr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>gr[r]})}),Object.keys(z).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>z[r]})}),Object.keys(Xr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Xr[r]})}),Object.keys($r).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>$r[r]})}),Object.keys(U).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>U[r]})}),Object.keys(Mo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Mo[r]})}),Object.keys(jt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>jt[r]})}),Object.keys(Hr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Hr[r]})}),Object.keys(Ao).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ao[r]})}),Object.keys(_r).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>_r[r]})}),Object.keys(Ae).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ae[r]})}),Object.keys(yr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>yr[r]})}),Object.keys(Vt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Vt[r]})}),Object.keys(m).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>m[r]})}),Object.keys(F).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>F[r]})}),Object.keys(he).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>he[r]})}),Object.keys(Oo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Oo[r]})}),Object.keys(Wo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Wo[r]})}),Object.keys(zo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>zo[r]})}),Object.keys(Ho).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ho[r]})}),Object.keys(_o).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>_o[r]})}),Object.keys(lr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>lr[r]})}),Object.keys(Po).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Po[r]})}),Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});