@starasia/admin 14.48.0 → 14.49.1
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/components/AppLayout/index.d.ts +5 -0
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +963 -935
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(u,mr){typeof exports=="object"&&typeof module<"u"?mr(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"],mr):(u=typeof globalThis<"u"?globalThis:u||self,mr(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,mr,Qr,rr,f,Er,j,Dt,pr,Oe,Ur,Fr,ke,Ir,hr,W,zr,Hr,Q,vo,St,Mr,Co,Tr,Le,fr,kt,S,F,ae,xo,wo,Do,So,ko,Ke,Bo,e,h,Yr,vn){"use strict";const Cn={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Bt=h.createContext(Cn),mt=()=>h.useContext(Bt),mo=r=>{const[t,o]=h.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:o}},Eo=h.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),Fo=({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(Eo.Provider,{value:i,children:r})},Io=()=>h.useContext(Eo),Xr=(r,t)=>{const o=t!==void 0?t:r;return o==null?null:typeof o=="string"||typeof o=="number"?{value:o}:o},Et=240,Ft=200,It=480,xn="sa-sidebar-width",Mt=(r,t,o)=>Math.min(Math.max(r,t),o),wn=(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)?Mt(s,o,n):t}catch{return t}},Mo=(r,t)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(r,String(t))}catch{}},To=h.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},width:Et,setWidth:()=>{},resetWidth:()=>{},minWidth:Ft,maxWidth:It,mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),Lo=({children:r,defaultCollapsed:t=!1,defaultWidth:o=Et,minWidth:n=Ft,maxWidth:l=It,widthStorageKey:s=xn})=>{const[i,c]=h.useState(t),[a,d]=h.useState(!1),[g,b]=h.useState(()=>wn(s,o,n,l)),p=h.useCallback(B=>{c(O=>typeof B=="function"?B(O):B)},[]),C=h.useCallback(()=>c(B=>!B),[]),k=h.useCallback(()=>c(!0),[]),D=h.useCallback(()=>c(!1),[]),z=h.useCallback(B=>{b(O=>{const U=typeof B=="function"?B(O):B,V=Mt(Math.round(U),n,l);return Mo(s,V),V})},[n,l,s]),A=h.useCallback(()=>{const B=Mt(o,n,l);Mo(s,B),b(B)},[o,n,l,s]),L=h.useCallback(B=>{d(O=>typeof B=="function"?B(O):B)},[]),x=h.useCallback(()=>d(!0),[]),m=h.useCallback(()=>d(!1),[]),I=h.useCallback(()=>d(B=>!B),[]),T=h.useMemo(()=>({collapsed:i,setCollapsed:p,toggle:C,collapse:k,expand:D,width:g,setWidth:z,resetWidth:A,minWidth:n,maxWidth:l,mobileOpen:a,setMobileOpen:L,openMobile:x,closeMobile:m,toggleMobile:I}),[i,p,C,k,D,g,z,A,n,l,a,L,x,m,I]);return e.jsx(To.Provider,{value:T,children:r})},Ao=()=>h.useContext(To),Oo=h.createContext(null),Wo=({adapter:r,children:t})=>e.jsx(Oo.Provider,{value:r,children:t}),tr=()=>{const r=h.useContext(Oo);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},zo=({router:r,routerAdapter:t,menus:o=[],menuBottom:n,logo:l,appName:s="Workspace",initialUserData:i,theme:c})=>{const a=mo({initialUserData:i}),{theme:d}=Mr.useTheme();return e.jsx(Wo,{adapter:t,children:e.jsx(Bt.Provider,{value:{logo:l,appName:s,menus:o,userData:a.userData,setUserData:a.setUserData,menuBottom:n},children:e.jsx(Fo,{children:e.jsx(Lo,{children:c?e.jsx(Mr.ThemeProvider,{value:c,children:r}):d?e.jsx(Mr.ThemeProvider,{value:d,children:r}):r})})})})},Dn=h.memo(zo);function Ho({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 Tt=h.createContext(null);function Po({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(Tt.Provider,{value:{prependNode:t,appendNode:n,replaceNode:s,setPrependNode:o,setAppendNode:l,setReplaceNode:i,replaceCount:c,registerReplace:d},children:r})}function Vo({children:r}){const t=h.useContext(Tt);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 Sn({children:r,mode:t="append"}){const o=h.useContext(Tt);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?Yr.createPortal(r,n):null}const Lt=h.createContext(null);function jo({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(Lt.Provider,{value:c,children:r})}function At({slotKey:r,fallback:t}){const o=h.useContext(Lt),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 kn({slotKey:r,children:t}){const o=h.useContext(Lt),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?Yr.createPortal(t,l):null}const Jr="moduleSwitcherGroupId",Ot="sa-module-switcher-change";function No(){if(typeof window>"u")return null;const r=window.localStorage.getItem(Jr);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function _o(r){typeof window>"u"||(r===null?window.localStorage.removeItem(Jr):window.localStorage.setItem(Jr,String(r)),window.dispatchEvent(new CustomEvent(Ot,{detail:r})))}function Bn(){_o(null)}function Wt(){const[r,t]=h.useState(()=>No());return h.useEffect(()=>{const n=()=>{t(No())},l=s=>{s.key===Jr&&n()};return window.addEventListener(Ot,n),window.addEventListener("storage",l),()=>{window.removeEventListener(Ot,n),window.removeEventListener("storage",l)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{_o(n),t(n)}}}const mn="4.5rem",En="var(--app-header-height, 4rem)",qo=r=>r?mn:En;function Zo({icon:r,label:t,tooltip:o=t,active:n=!1,badge:l,showLabel:s=!0,onClick:i}){const[c,a]=h.useState(!1);return e.jsx(Le.Tooltip,{fluid:!0,label:o,position:"right",children:e.jsxs(f.Box,{as:"button",onClick:i,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),"aria-label":o,"aria-current":n?"page":void 0,fullWidth:!0,direction:"column",align:"center",gap:"spacing-2",paddingBlock:"xs",style:{color:n?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)"},children:[e.jsxs(f.Box,{position:"relative",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",borderRadius:n?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:n?"white":c?"neutral":void 0,style:{borderColor:n?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsx(F.Icon,{name:r,size:"sm"}),l&&!s&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",style:{boxShadow:"0 0 0 1px var(--sa-background-primary, #ffffff)"},children:e.jsx(rr.BadgeDot,{tone:"error",variant:"solid",size:"xs"})}),l&&s&&e.jsx(f.Box,{position:"absolute",display:"inline-flex",style:{top:"-0.375rem",left:"1.5rem"},children:e.jsx(rr.Badge,{text:String(l.value),variant:l.variant??"info",size:"xs",border:!0})})]}),s&&e.jsx(S.Text,{as:"span",fontSize:"xs",fontWeight:n?"medium":"normal",textAlign:"center",truncate:!0,style:{display:"block",maxWidth:"100%",color:"inherit"},children:t})]})})}function Fn({items:r,bottomItems:t,activeKey:o,onSelect:n,onAction:l,logo:s,panelCollapsed:i,onExpandPanel:c,showLabels:a=!0}){const[d,g]=h.useState(!1),b=i&&d;return e.jsxs(f.Box,{as:"nav","aria-label":"Primary navigation",bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:"0",style:{width:qo(a),height:"100%"},children:[e.jsxs(f.Box,{onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!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:s,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",transition:"opacity 0.2s",opacity:b?0:1}}),i&&e.jsx(f.Box,{as:"button",onClick:c,"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:b?1:0,pointerEvents:b?"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(p=>e.jsx(Zo,{icon:p.icon,label:p.label,tooltip:p.tooltip,badge:p.badge,showLabel:a,active:p.key===o,onClick:()=>n(p.key)},p.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(p=>e.jsx(Zo,{icon:p.icon,label:p.label,tooltip:p.tooltip,badge:p.badge,showLabel:a,onClick:()=>l(p)},p.key))})]})}function In({items:r,activeKey:t,onSelect:o}){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",style:{overflowX:"auto",scrollbarWidth:"none"},children:r.map(n=>{const l=n.key===t;return e.jsxs(f.Box,{as:"button",role:"tab","aria-selected":l,onClick:()=>o(n.key),direction:"row",align:"center",gap:"spacing-4",paddingInline:"sm",height:"height-32",flexShrink:"0",borderRadius:l?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:l?"white":void 0,hover:l?void 0:{bg:"neutral"},style:{whiteSpace:"nowrap",color:l?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:l?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsx(F.Icon,{name:n.icon,size:"sm"}),e.jsx(S.Text,{as:"span",fontSize:"sm",fontWeight:l?"medium":"normal",style:{color:"inherit"},children:n.label})]},n.key)})})}const zt=(r,t)=>!r.groupIds||r.groupIds.includes(t.id)||t.parentGroupId!==void 0&&r.groupIds.includes(t.parentGroupId);let $r=0,Dr=!1,Go=new Set;const Qo=new Set;function Mn(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 Uo({text:r,textStyle:t,active:o=!1}){const{containerRef:n,textRef:l,truncated:s}=Mn(r,o),i=e.jsx(S.Text,{ref:l,as:"span",fontSize:"md",fontWeight:o?"medium":"normal",truncate:!0,style:{display:"block",...t},children:r});return e.jsx(f.Box,{ref:n,display:"block",style:{flex:1,minWidth:0},children:s?e.jsx(Le.Tooltip,{fluid:!0,label:r,position:"top",children:i}):i})}const Tn=200,Ht="var(--app-header-height, 4rem)",Yo="44px",Pt=`calc((${Ht} - 2rem) / 2)`,Xo=16;function Ln({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:k}){var bt,wr;const{useSearchParams:D,useNavigate:z,useLocation:A,Outlet:L}=tr(),[x]=D(),m=x.get("embed")==="true",I=mt(),{badges:T}=Io(),B=z(),O=A(),V=!ke.useMediaQuery("md"),[H,N]=h.useState(!1),{collapsed:G,setCollapsed:Y,width:te,setWidth:K,resetWidth:ee,minWidth:_,maxWidth:ge,mobileOpen:fe,setMobileOpen:Fe}=Ao(),[qe,Be]=h.useState(!1),[ve,Ce]=h.useState(()=>new Set(Go)),[Ae,Ze]=h.useState(null),{selectedGroupId:He,setSelectedGroupId:ie}=Wt(),de=!!(k&&k.items.length>0),pe=G&&!V&&!de,we=G&&!V&&de;h.useEffect(()=>{Go=ve},[ve]);const Ie=h.useRef(null),sr=h.useRef(null),ir=h.useRef(null),[P,$]=h.useState(!1),[X,he]=h.useState(null),me=C&&!V&&!G,xe=E=>Math.min(Math.max(E,_),ge),Pe=X??te,cr=E=>{var Xe,Ne,Je;if(!me)return;E.preventDefault();const Z=E.clientX,J=((Xe=ir.current)==null?void 0:Xe.getBoundingClientRect().width)??te;(Je=(Ne=E.currentTarget).setPointerCapture)==null||Je.call(Ne,E.pointerId),$(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize";let ne=0,ye=J;const Te=Qe=>{ye=J+(Qe.clientX-Z),ne||(ne=requestAnimationFrame(()=>{ne=0,he(xe(ye))}))},ce=()=>{ne&&cancelAnimationFrame(ne),window.removeEventListener("pointermove",Te),window.removeEventListener("pointerup",ce),document.body.style.userSelect="",document.body.style.cursor="",he(null),$(!1),ye<Tn?Y(!0):K(xe(ye))};window.addEventListener("pointermove",Te),window.addEventListener("pointerup",ce)},Ye=E=>{me&&(E.key==="ArrowLeft"?(E.preventDefault(),K(Z=>Z-Xo)):E.key==="ArrowRight"?(E.preventDefault(),K(Z=>Z+Xo)):E.key==="Home"?(E.preventDefault(),K(_)):E.key==="End"&&(E.preventDefault(),K(ge)))};h.useEffect(()=>{const E=Ie.current;if(!E)return;const Z=()=>{Dr||($r=E.scrollTop)};return E.addEventListener("scroll",Z),()=>E.removeEventListener("scroll",Z)},[]);const Me=()=>{const E=Ie.current;E&&$r>0&&(Dr=!0,E.scrollTop=$r,requestAnimationFrame(()=>{Dr=!1}))};h.useLayoutEffect(()=>{Dr=!0,Me();const E=setTimeout(()=>{Dr=!1},300);return()=>clearTimeout(E)},[]),h.useLayoutEffect(()=>{I.menus.length>0&&($r>0?Me():requestAnimationFrame(()=>{var Z;const E=(Z=Ie.current)==null?void 0:Z.querySelector("[data-menu-active='true']");E&&E.scrollIntoView({block:"center",behavior:"instant"})}))},[I.menus]),h.useEffect(()=>{Dr=!0,Me();const E=setTimeout(Me,0),Z=setTimeout(Me,50),J=setTimeout(Me,100),ne=setTimeout(Me,200),ye=setTimeout(()=>{Dr=!1},300),Te=setTimeout(()=>{const ce=Ie.current,Xe=ce==null?void 0:ce.querySelector("[data-menu-active='true']");if(ce&&Xe){const Ne=ce.getBoundingClientRect(),Je=Xe.getBoundingClientRect();Je.top>=Ne.top&&Je.bottom<=Ne.bottom||Xe.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(E),clearTimeout(Z),clearTimeout(J),clearTimeout(ne),clearTimeout(ye),clearTimeout(Te)}},[O.pathname]),h.useEffect(()=>{sr.current&&(sr.current.scrollTop=0)},[O.pathname]),h.useEffect(()=>{V&&Fe(!1)},[O.pathname,V]),h.useEffect(()=>{V&&Y(!0)},[V]),h.useEffect(()=>{const E=document.documentElement;return E.style.setProperty("--app-header-height",Yo),()=>{E.style.removeProperty("--app-header-height")}},[]);const br=()=>{N(!0)},ur=()=>{N(!1)},Ee=()=>{N(!1),l()},ze=E=>{const Z=E.slotKey?[]:[E.to];return E.children&&Z.push(...E.children.map(J=>J.to)),Z},Sr=[...I.menus.flatMap(E=>E.items.flatMap(ze)),...((bt=I.menuBottom)==null?void 0:bt.flatMap(ze))??[]],ar=E=>{if(!O.pathname.startsWith(E))return!1;const Z=Sr.filter(J=>O.pathname.startsWith(J)).sort((J,ne)=>ne.length-J.length)[0];return E===Z},vr=h.useRef(k);vr.current=k;const Cr=E=>{const Z=vr.current;if(!Z||Z.items.length===0)return null;const J=Z.defaultKey??Z.items[0].key,ne=Z.items.find(ce=>ce.key===E),ye=I.menus.find(ce=>ce.items.some(Xe=>ze(Xe).some(ar)));if(!ye)return ne?ne.key:J;if(ne&&zt(ne,ye))return ne.key;const Te=Z.items.find(ce=>ce.groupIds&&zt(ce,ye))??Z.items.find(ce=>!ce.groupIds);return(Te==null?void 0:Te.key)??(ne==null?void 0:ne.key)??J},[xr,je]=h.useState(()=>Cr(null));h.useEffect(()=>{je(E=>Cr(E))},[O.pathname,I.menus]);const Ge=de?k.items.find(E=>E.key===xr)??k.items[0]:void 0,yt=E=>{je(E),we&&Y(!1)},pt=E=>{E.onClick?E.onClick():E.to&&B(E.to)};h.useEffect(()=>{var Z;const E=J=>{var ye;const ne=J.defaultExpanded&&!Qo.has(J.id);ne&&Qo.add(J.id),(ne||(ye=J.children)!=null&&ye.some(Te=>O.pathname.startsWith(Te.to)))&&Ce(Te=>{const ce=new Set(Te);return ce.add(J.id),ce})};I.menus.forEach(J=>{J.items.forEach(E)}),(Z=I.menuBottom)==null||Z.forEach(E)},[O.pathname,I.menus,I.menuBottom]);const so=E=>{Ce(Z=>{const J=new Set(Z);return J.has(E)?J.delete(E):J.add(E),J})};h.useEffect(()=>{I.menus.length!==0&&He!==null&&!I.menus.some(E=>E.id===He)&&ie(null)},[I.menus,He,ie]);const io=h.useMemo(()=>{if(Ge!=null&&Ge.groupIds)return I.menus.filter(ye=>zt(Ge,ye));const E=I.menus,Z=de?null:He;if(Z!==null)return E.filter(ye=>ye.id===Z||ye.parentGroupId===Z);const J=E.filter(ye=>ye.parentGroupId===void 0),ne=E.filter(ye=>ye.parentGroupId!==void 0).flatMap(ye=>ye.items);return ne.length===0?J:[...J,{id:18,name:"Pengaturan",items:ne,parentGroupId:void 0}]},[I.menus,He,Ge,de]);if(m)return e.jsx(f.Box,{as:"main",overflow:"overflow-y-auto",bg:"surface-inverse",style:{height:"100vh"},children:r||e.jsx(L,{})});const kr=E=>{const Z=E.children&&E.children.length>0,J=!!E.slotKey,ne=Z||J,ye=ve.has(E.id),Te=Z?E.children.some(Ne=>ar(Ne.to)):J?!1:ar(E.to),ce=Xr(E.badge,T[E.id]),Xe=!!ce&&pe;return e.jsxs(f.Box,{display:"block","data-menu-active":Te||void 0,children:[e.jsxs(f.Box,{as:"button",onClick:Ne=>{if(J&&pe)B(E.to);else if(ne)if(pe){const Je=Ne.currentTarget.getBoundingClientRect();Ze({item:E,top:Je.top,left:Je.right+8})}else so(E.id);else B(E.to)},fullWidth:!0,direction:"row",align:"center",justify:pe?"center":void 0,gap:"sm",paddingInline:pe?void 0:"sm",paddingBlock:"xs",height:"height-32",borderRadius:Te?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:Te?"white":void 0,hover:Te?void 0:{bg:"neutral"},title:pe?E.title:void 0,style:{textAlign:"left",color:Te?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:Te?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsxs(f.Box,{position:"relative",display:"inline-flex",flexShrink:"0",style:{alignItems:"center"},children:[e.jsx(F.Icon,{name:E.icon,size:"sm",style:{flexShrink:0}}),Xe&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",style:{boxShadow:"0 0 0 1px var(--sa-background-primary, #ffffff)"},children:e.jsx(rr.BadgeDot,{tone:"error",variant:"solid",size:"xs"})})]}),!pe&&e.jsxs(e.Fragment,{children:[e.jsx(Uo,{text:E.title,active:Te,textStyle:{transition:"opacity 0.3s"}}),ce&&e.jsx(rr.Badge,{text:String(ce.value),variant:ce.variant??"info",size:"xs",border:!0}),ne&&e.jsx(F.Icon,{name:"ChevronDown",size:"sm",style:{flexShrink:0,transition:"transform 0.2s",transform:ye?"rotate(180deg)":"rotate(0deg)"}})]})]}),ne&&!pe&&(()=>{const Ne=E.children??[],Je=J?-1:Ne.findIndex(er=>ar(er.to)),Qe=Ne.map(er=>{const Br=Xr(er.badge,T[er.id]),gr=ar(er.to);return e.jsxs(f.Box,{as:"button",onClick:()=>B(er.to),fullWidth:!0,direction:"row",align:"center",gap:"sm",paddingLeft:"sm",paddingRight:"sm",paddingBlock:"xs",height:"height-32",borderRadius:gr?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:gr?"white":void 0,hover:gr?void 0:{bg:"neutral"},style:{textAlign:"left",color:gr?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:gr?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsx(F.Icon,{name:er.icon,size:"sm",style:{flexShrink:0}}),e.jsx(Uo,{text:er.title,active:gr}),Br&&e.jsx(rr.Badge,{text:String(Br.value),variant:Br.variant??"info",size:"xs",border:!0})]},er.id)});return e.jsxs(f.Box,{position:"relative",overflow:"overflow-hidden",style:{marginLeft:"1rem",paddingLeft:"0.75rem",transition:"all 0.3s ease-in-out",maxHeight:ye?J?"none":`${Ne.length*36}px`:"0px",opacity:ye?1:0,marginTop:ye?"0.25rem":"0px"},children:[e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",top:"top-0",fullHeight:!0,style:{width:"1.5px",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),Je>=0&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",height:"height-32",zIndex:"10",style:{top:`${Je*32}px`,width:"1.5px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none"}}),J?e.jsx(At,{slotKey:E.slotKey,fallback:Qe}):Qe]})})()]},E.id)};return e.jsx(jo,{children:e.jsxs(Po,{children:[e.jsxs(f.Box,{direction:"row",position:"relative",style:{height:"100vh","--app-header-height":Yo,"--app-sidebar-width":V?"0px":de?`calc(${qo(k.showLabels??!0)} + ${we?"0px":`${Pe}px`})`:G?Ht:`${Pe}px`,"--app-footer-zindex":V&&fe?"40":"998"},children:[V&&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:()=>Fe(!1)}),de&&!V&&e.jsx(Fn,{items:k.items,bottomItems:k.bottomItems,activeKey:Ge.key,onSelect:yt,onAction:pt,logo:I.logo,panelCollapsed:we,onExpandPanel:()=>Y(!1),showLabels:k.showLabels??!0}),e.jsxs(f.Box,{as:"aside",ref:ir,"aria-hidden":we||void 0,bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:V?void 0:"0",style:{width:V?"16.375rem":we?"0px":G?Ht:`${Pe}px`,...we&&{borderRightWidth:0,overflow:"hidden",visibility:"hidden"},position:V?"fixed":"relative",...V&&{inset:0,zIndex:50,transform:fe?"translateX(0)":"translateX(-100%)"},transition:P?"none":"all 0.3s ease-in-out",minWidth:0},children:[e.jsx(f.Box,{onMouseEnter:()=>Be(!0),onMouseLeave:()=>Be(!1),direction:"row",align:"center",justify:"space-between",paddingInline:pe?void 0:"lg",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",position:"relative",style:{height:"var(--app-header-height, 4rem)",...pe?{paddingInline:Pt}:null},children:(()=>{const E=de&&!V,Z=Ge!=null&&Ge.groupIds?Ge.tooltip??Ge.label:I.appName,J=!V&&G&&!fe&&!de,ne=J&&qe;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:ne?0:1,pointerEvents:ne?"none":"auto"},children:[!E&&e.jsx("img",{src:I.logo,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",flexShrink:0}}),(!G||fe)&&e.jsx(S.Text,{as:"span",fontSize:"md",fontWeight:"semibold",color:"primary",truncate:!0,style:{transition:"opacity 0.3s"},children:E?Z:I.appName})]}),!V&&!G&&e.jsx(f.Box,{as:"button",onClick:()=>Y(!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:()=>Y(!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:ne?1:0,pointerEvents:ne?"auto":"none",transition:"opacity 0.2s"},children:e.jsx(F.Icon,{name:"LayoutLeft",size:"sm"})}),V&&e.jsx(f.Box,{as:"button",onClick:()=>Fe(!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(Ho,{collapsed:V||de?!1:G,children:c}),de&&V&&e.jsx(In,{items:k.items,activeKey:Ge.key,onSelect:yt}),e.jsx(f.Box,{ref:Ie,flex:"1",overflow:"overflow-y-auto",paddingBlock:"lg",children:io.map(E=>e.jsxs(f.Box,{marginBottom:"lg",children:[pe?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(S.Text,{fontSize:"sm",fontWeight:"semibold",color:"subtlest",textTransform:"uppercase",truncate:!0,style:{letterSpacing:"0.06em",paddingLeft:"1.25rem",paddingRight:"0.75rem",paddingBottom:"0.25rem",transition:"opacity 0.3s"},children:E.name}),e.jsx(f.Box,{paddingInline:pe?void 0:"md",gap:"xs",style:pe?{paddingInline:Pt}:void 0,children:E.slotKey?e.jsx(At,{slotKey:E.slotKey,fallback:E.items.map(Z=>kr(Z))}):E.items.map(Z=>kr(Z))})]},E.id))}),I.menuBottom&&I.menuBottom.length>0&&e.jsx(f.Box,{borderWidth:"border-t",borderStyle:"border-solid-t",borderColor:"border-base",paddingBlock:"md",paddingInline:pe?void 0:"md",bg:"surface-inverse",gap:"xs",flexShrink:"0",style:pe?{paddingInline:Pt}:void 0,children:I.menuBottom.map(E=>kr(E))}),me&&e.jsx(f.Box,{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":te,"aria-valuemin":_,"aria-valuemax":ge,tabIndex:0,onPointerDown:cr,onKeyDown:Ye,onDoubleClick:ee,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:P?"var(--sa-background-brand, #04254f)":"transparent",transition:"background 0.15s"},onMouseEnter:E=>{P||(E.currentTarget.style.background="var(--sa-border-bold, #0b120e40)")},onMouseLeave:E=>{P||(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:V?"lg":void 0,children:[V&&e.jsx(f.Box,{as:"button",onClick:()=>Fe(!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(Vo,{children:t})]}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"md",children:[a,e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",cursor:"pointer",children:[!V&&e.jsxs(f.Box,{display:"block",textAlign:"right",customMaxWidth:"12.5rem",children:[e.jsx(S.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(S.Text,{fontSize:"sm",color:"subtle",textAlign:"right",truncate:!0,children:n?"":(o==null?void 0:o.email)||"unknown"})]}),e.jsx(Qr.Avatar,{size:"sm",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(W.MenuLists,{width:280,style:{paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(W.MenuHeading,{children:e.jsxs(f.Box,{align:"center",textAlign:"center",paddingBlock:"sm",fullWidth:!0,children:[e.jsx(Qr.Avatar,{customSize:64,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(S.Text,{fontSize:"md",fontWeight:"semibold",color:"primary",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.name)||"unknown"}),e.jsx(S.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.email)||"unknown"}),d&&e.jsx(S.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:d})]})}),(g&&g.length>0||b)&&e.jsxs(W.MenuBody,{children:[g==null?void 0:g.map((E,Z)=>e.jsx(W.MenuItem,{onClick:E.onClick,startIcon:e.jsx(F.Icon,{name:E.icon,size:"md"}),children:E.label},`${E.label}-${Z}`)),b]}),p??e.jsx(W.MenuFooter,{children:e.jsx(W.MenuItem,{intent:"danger",onClick:br,startIcon:e.jsx(F.Icon,{name:"Logout",size:"md"}),children:"Logout"})})]})]})]})]}),e.jsx(f.Box,{as:"main",ref:sr,flex:"1",overflow:"overflow-y-auto",children:r||e.jsx(L,{})})]})]}),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:H,onHide:ur,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(ae.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(f.Box,{direction:"column",children:e.jsx(j.Button,{secondary:!0,onClick:ur,children:"Cancel"})}),e.jsx(f.Box,{direction:"column",children:e.jsx(j.Button,{primary:!0,onClick:Ee,children:"Yes, Sure"})})]})})})]}),Ae&&e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{onClick:()=>Ze(null),position:"fixed",style:{inset:0,zIndex:60}}),e.jsxs(f.Box,{role:"dialog","aria-label":Ae.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:Ae.top,left:Ae.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem"},children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-500",textTransform:"uppercase",style:{padding:"0.25rem 0.5rem 0.5rem",letterSpacing:"0.05em"},children:Ae.item.title}),(wr=Ae.item.children)==null?void 0:wr.map(E=>{const Z=ar(E.to),J=Xr(E.badge,T[E.id]);return e.jsxs(f.Box,{as:"button",onClick:()=>{B(E.to),Ze(null)},fullWidth:!0,direction:"row",align:"center",gap:"md",paddingBlock:"sm",paddingInline:"md",borderRadius:"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:Z?"primary-inverse":void 0,hover:Z?void 0:{bg:"primary-inverse"},style:{textAlign:"left",borderColor:"transparent",color:Z?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)"},children:[E.icon&&e.jsx(F.Icon,{name:E.icon,size:"sm",style:{flexShrink:0}}),e.jsx(S.Text,{as:"span",fontSize:"md",fontWeight:Z?"medium":"normal",whiteSpace:"nowrap",style:{flex:1},children:E.title}),J&&e.jsx(rr.Badge,{text:String(J.value),variant:J.variant??"info",size:"xs",border:!0})]},E.id)})]})]})]})})}const Pr=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})),Jo=({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(S.Text,{variant:"sub-h3",style:{color:i?b:d,transition:"color 0.15s ease"},children:r||"Back"})]})},An=({items:r,separator:t="/",iconName:o,iconColor:n,hoverIconColor:l})=>{const{Link:s}=tr(),[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(Pr,{onClick:g.onClick,children:p}):p;return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",children:[C,e.jsx(Er.Breadcrumb,{separator:t,size:"md",children:r.map((k,D)=>{const z=D===r.length-1;return k.to&&!z?e.jsx(Er.BreadcrumbItem,{children:e.jsx(s,{to:k.to,children:k.label})},D):e.jsx(Er.BreadcrumbItem,{currentPage:z,children:e.jsx(Er.BreadcrumbLink,{onClick:z?void 0:k.onClick,children:k.label})},D)})})]})},On=r=>{const{Link:t}=tr(),{items:o,separator:n,onClick:l,navigateTo:s,...i}=r;return o&&o.length>0?e.jsx(An,{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(Jo,{...i})})}):e.jsx(f.Box,{direction:"row",children:e.jsx(Pr,{onClick:l,children:e.jsx(Jo,{...i})})})},Vt=[{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 $o(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 Ko={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-text-primary, #292a2e)",lineHeight:"1.3",maxWidth:"80px"},Ro={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function el({isShow:r,onHide:t,menus:o,selectedGroupId:n,onSelect:l}){const[s,i]=h.useState(void 0),c=d=>{l(d),t()},a=Vt[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:Ro,children:[e.jsx("div",{style:$o(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:Ko,children:"Semua"})]}),o.map((d,g)=>{var D;const b=n===d.id,p=s===d.id,C=((D=d.items[0])==null?void 0:D.icon)??"Grid",k=Vt[(g+1)%Vt.length];return e.jsxs("button",{onClick:()=>c(d.id),onMouseEnter:()=>i(d.id),onMouseLeave:()=>i(void 0),style:Ro,children:[e.jsx("div",{style:$o(b,p,k),children:e.jsx("div",{style:{color:k.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:Ko,children:d.name})]},d.id)})]})})})}function Wn({onSelect:r,"aria-label":t="Pilih module"}={}){const o=mt(),{useNavigate:n}=tr(),l=n(),{selectedGroupId:s,setSelectedGroupId:i}=Wt(),[c,a]=h.useState(!1),d=g=>{var b;if(i(g),g!==null){const p=o.menus.find(k=>k.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(el,{isShow:c,onHide:()=>a(!1),menus:o.menus.filter(g=>g.parentGroupId===void 0),selectedGroupId:s,onSelect:d})]})}const zn=(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},Hn=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(S.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(S.Text,{color:"primary",fontWeight:"medium",children:r}):r,g=()=>typeof o=="string"||typeof o=="number"?e.jsx(S.Text,{fontWeight:"medium",color:"subtlest",children:o}):o;return e.jsxs(Q.Tr,{children:[e.jsx(Q.Td,{style:i,width:n,children:a()}),o?e.jsx(Q.Td,{style:c,width:24,children:g()}):null,e.jsx(Q.Td,{style:i,children:d()})]})}),Pn=h.memo(({fields:r,separator:t,labelWidth:o})=>e.jsx(Q.Table,{withColumnBorder:!1,withRowBorder:!1,children:r.map((n,l)=>e.jsx(Hn,{separator:t,labelWidth:o,lastIndex:l===r.length-1,...n},`field-group-field-${l}`))})),Vn=h.memo(({maxRow:r=0,maxColumn:t=2,separator:o=":",fields:n=[],labelWidth:l=150,bordered:s=!1})=>{const i=h.useMemo(()=>zn(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(Pn,{labelWidth:l,fields:d,separator:o})},g))})}),jn=({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(S.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"})]})},rl=({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:k})=>{const D=ke.useMediaQuery("md"),{Link:z,useNavigate:A}=tr(),L=A(),x=r==null?void 0:r.show,m=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}L(-1,{replace:!0})},I=()=>{if(!b)return null;if(h.isValidElement(b))return b;const H=b.filter(N=>N&&(N.title||N.icon));return H.length===0?null:D?e.jsx(f.Box,{direction:"row",gap:"md",children:H.map(({title:N,icon:G,buttonProps:Y,onClick:te},K)=>e.jsx(j.Button,{iconLeft:G?e.jsx(F.Icon,{name:G,size:"md"}):void 0,onClick:te,...Y,children:N},`action-${K}`))}):e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{minWidth:200},children:H.map(({title:N,icon:G,buttonProps:Y,onClick:te},K)=>{const ee=(Y==null?void 0:Y.tone)==="error"||(Y==null?void 0:Y.danger)===!0;return e.jsx(W.MenuItem,{intent:ee?"danger":void 0,disabled:Y==null?void 0:Y.disabled,startIcon:G?e.jsx(F.Icon,{name:G}):void 0,onClick:te,children:N},`action-${K}`)})})})]})},T=()=>{const H=e.jsx(jn,{backButton:r});return r!=null&&r.navigateTo?e.jsx(f.Box,{direction:"row",children:e.jsx(z,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:H})}):e.jsx(f.Box,{direction:"row",children:e.jsx(Pr,{onClick:m,children:H})})},B=()=>{const H=!!t,N=Array.isArray(b)&&b.length>0,G=h.isValidElement(b)?!0:N;if(!H&&!G&&!x)return null;const te=D||!D&&N;return e.jsxs(f.Box,{direction:"column",gap:"xs",paddingBlock:(k==null?void 0:k.paddingBlock)??"sm",paddingInline:(k==null?void 0:k.paddingInline)??"md",...k,style:{...i?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...k==null?void 0:k.style},children:[x&&T(),(H||G)&&e.jsxs(f.Box,{direction:te?"row":"column",gap:"sm",justify:"space-between",align:te?"center":"flex-start",children:[H?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(S.Text,{variant:"h3",fontWeight:"semibold",children:t})]}),n&&e.jsx(rr.Badge,{border:!0,size:"lg",text:n,...p})]}):t:null,I()]})]})},O=()=>{if(!g||g.length===0)return null;const H=g.filter(Y=>Y.show!==!1);if(H.length===0)return null;let N=0,G=-1/0;return H.forEach((Y,te)=>{const K=Y.order??0;K>=G&&(G=K,N=te)}),H.map(({content:Y,order:te,borderBottom:K=!0,keepBottomPadding:ee=!1,paddingInline:_=!0,paddingBlock:ge=!0},fe)=>e.jsx(f.Box,{direction:"column",paddingTop:ge?"sm":"spacing-0",paddingBottom:ge&&(K||ee||fe===N)?"sm":"spacing-0",paddingInline:_?"md":"spacing-0",style:{...K?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...te!==void 0?{order:te}:{}},children:Y},`sub-header-${fe}`))},U=()=>{const H=s?B():null,N=O();return!H&&!N?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:N?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[H,N]})},V=()=>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:[U(),V()]})},Nn=r=>{const{useLocation:t}=tr(),o=t();return e.jsx(rl,{...r},o.pathname)},_n=r=>r.remountOnRouteChange?e.jsx(Nn,{...r}):e.jsx(rl,{...r}),qn=h.memo(_n),Zn={icon:"Cross",title:""},Gn=320,tl=16,ol=4,Qn=8,ll=h.forwardRef(({onHide:r,show:t,withBlur:o=!1,style:n,children:l,closeButton:s=Zn,paddingHorizontal:i=!0,width:c,minWidth:a,maxWidth:d,hideBackdrop:g=!1,title:b,headerAction:p,header:C=!0,widthPresets:k,resizable:D=!0,resizeMin:z=Gn,resizeMax:A,onWidthChange:L},x)=>{const I=!ke.useMediaQuery("md"),T=c??d??a??"357px",B=k??[],O=B.length>1,[U,V]=h.useState(()=>{const ie=B.indexOf(T);return ie>=0?ie:0}),[H,N]=h.useState(null),[G,Y]=h.useState(!1),[te,K]=h.useState(!1),ee=h.useRef(null),_=ie=>{ee.current=ie,typeof x=="function"?x(ie):x&&(x.current=ie)},ge=O?B[U]:T,fe=H!=null?`${H}px`:ge,Fe=D&&!I,qe=U===B.length-1,Be=()=>{const ie=(U+1)%B.length;N(null),V(ie),L==null||L(B[ie])},ve=h.useCallback(ie=>{const de=A??window.innerWidth;return Math.min(Math.max(ie,z),de)},[z,A]),Ce=h.useRef(null),Ae=ie=>{if(!Fe)return;ie.preventDefault();const de=ie.currentTarget;de.setPointerCapture(ie.pointerId),Y(!0);const pe=document.body.style.cursor,we=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let Ie=null;const sr=P=>{const $=ve(window.innerWidth-P.clientX);Ce.current=$,Ie==null&&(Ie=window.requestAnimationFrame(()=>{Ie=null,Ce.current!=null&&N(Ce.current)}))},ir=P=>{Ie!=null&&window.cancelAnimationFrame(Ie),Ce.current!=null&&N(Ce.current),de.releasePointerCapture(P.pointerId),de.removeEventListener("pointermove",sr),de.removeEventListener("pointerup",ir),de.removeEventListener("pointercancel",ir),document.body.style.cursor=pe,document.body.style.userSelect=we,Y(!1),Ce.current!=null&&(L==null||L(`${Ce.current}px`))};de.addEventListener("pointermove",sr),de.addEventListener("pointerup",ir),de.addEventListener("pointercancel",ir)},Ze=ie=>{var Ie;if(!Fe||ie.key!=="ArrowLeft"&&ie.key!=="ArrowRight")return;ie.preventDefault();const de=ie.key==="ArrowLeft"?tl:-tl,pe=H??((Ie=ee.current)==null?void 0:Ie.offsetWidth)??z,we=ve(pe+de);N(we),L==null||L(`${we}px`)},He=()=>{Fe&&(N(null),L==null||L(ge))};return e.jsx(Ur.Drawer,{blur:o,isShow:t,position:"right",onHide:r,ref:_,size:fe,style:n,flush:!0,radius:"none",hideBackdrop:g,children:e.jsxs(f.Box,{direction:"column",height:"height-full",children:[Fe?e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Ubah lebar panel",tabIndex:0,onPointerDown:Ae,onKeyDown:Ze,onDoubleClick:He,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:Qn,cursor:"col-resize",zIndex:1,background:G||te?`linear-gradient(to right, var(--sa-border-brand, var(--sa-border-subtle)) 0 ${ol}px, transparent ${ol}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(S.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(j.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:Be,"aria-label":qe?"Kecilkan panel":"Lebarkan panel",iconRight:e.jsx(F.Icon,{name:qe?"ChevronRight":"ChevronLeft"})}):null,s?e.jsx(j.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})]})})}),jt=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})}),Nt=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})}),Un=h.memo(({children:r,...t})=>e.jsx(f.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),Yn=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(S.Text,{fontWeight:"medium",children:t}),e.jsx(rr.Badges,{border:!0,text:o,variant:b})]}):e.jsx(S.Text,{fontWeight:"medium",children:t}),k=()=>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})]}),D=!!(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&&D?e.jsx(jt,{...d,children:k()}):null,e.jsx(Un,{...a,children:r}),s?e.jsx(Nt,{...g,children:s}):null]})}),Re={H1:r=>e.jsx(S.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(S.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(S.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(S.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(S.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(S.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(S.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(S.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(S.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(S.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(S.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(S.Text,{variant:"body-3",children:r.children,...r.props})},_e=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=tr(),[n,l]=r(),s=Ir.searchParamsToObject(n.toString()),i=t(),c=o(),a=i.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,k)=>n.has(C)&&n.get(C)===k,getQueryParam:C=>n.get(C),getRouteParam:C=>i[C],params:i,location:c,id:a,hasId:!!a}},nl=r=>JSON.stringify(r),sl=r=>JSON.stringify(r),il=r=>JSON.stringify(r),cl=r=>JSON.stringify(r),Xn=r=>r,Jn=r=>JSON.stringify(r),or=r=>{if(typeof r!="string"||r==="")return{};try{const t=JSON.parse(r);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}},lr=r=>{if(!(typeof r!="string"||r===""))try{return JSON.parse(r)}catch{return}},Vr=({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=Xn(r);break;case"dropdown":case"dropdown-multiple":d=nl(r);break;case"radio":d=sl(r);break;case"date-range":d=il(r);break;case"advanced-date-range":d=Jn(r);break;case"date":d=cl(r);break;default:d=r;break}if(typeof d<"u"){const g={...or(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(),k=new URLSearchParams(p).toString();if(C===k)return;l(p)}}},Kr=({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"?or(l):void 0,i=s?s[r]:void 0;return n==="label"&&i?(a=(c=lr(i))==null?void 0:c[0])==null?void 0:a.label:n==="value"&&i?(g=(d=lr(i))==null?void 0:d[0])==null?void 0:g.value:i},al=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{var c,a;const l=o.get(t)||void 0,s=l&&typeof l=="string"?or(l):void 0,i=s?s[r]:void 0;return n==="label"&&i?(c=lr(i))==null?void 0:c.map(d=>d.label):n==="value"&&i?(a=lr(i))==null?void 0:a.map(d=>d.value):n==="array"&&i?lr(i):i},$n=({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"?or(l):void 0,i=s?s[r]:void 0;return n==="id"&&i?(c=lr(i))==null?void 0:c.id:n==="label"&&i?(a=lr(i))==null?void 0:a.label:n==="value"&&i?(d=lr(i))==null?void 0:d.value:i},Rr=(r,t,o)=>{const n=t.get(o||"filter")||void 0,l=n&&typeof n=="string"?or(n):void 0;return l?l[r]:void 0},Kn=({name:r,filterKey:t="filter",searchParams:o})=>{var i,c;const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?or(n):void 0,s=l?l[r]:void 0;return{start:s?(i=lr(s))==null?void 0:i.from:void 0,end:s?(c=lr(s))==null?void 0:c.to:void 0}},dl=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?or(n):void 0,s=l?l[r]:void 0;return s?lr(s):void 0},Rn=(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},hl=({isOpen:r,onClose:t,filterKey:o,pageKey:n,filters:l})=>{const{searchParams:s,setSearchParams:i,searchQueries:c}=_e(),[a,d]=h.useState({}),g=()=>{s.delete(o||"filter"),i(s)},b=(p,C)=>{switch(p.type){case"radio":{const{show:k=!0}=p;return k&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}case"dropdown":{const{show:k=!0}=p;return k&&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:k=!0}=p;return k&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}default:return null}};return e.jsx(ll,{onHide:t,show:r||!1,children:e.jsxs(f.Box,{direction:"column",gap:"md",children:[e.jsxs(ae.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))]})})},fl=({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:k="Work Order",withTitleLabels:D=!1})=>{const A=(p==null?void 0:p.isShowLabel)??!0,[L,x]=h.useState(!1),[m,I]=h.useState(0),T=()=>{I(_=>_+1)},{searchParams:B,setSearchParams:O,getQueryParam:U}=_e(),V=Ir.searchParamsToObject(B.toString()),H=Rr(r,B,c)||"",[N,G]=h.useState(H),Y=U(c),K=!!(Y&&!(()=>{if(Y)try{const _=JSON.parse(Y);return Object.keys(_).length===1&&_[r]===""}catch(_){console.error("Filter parameter is not a valid JSON:",_)}return!1})()),ee=ke.useMediaQuery("md");return h.useEffect(()=>{G(H)},[H]),h.useEffect(()=>{if(N===H)return;const _=window.setTimeout(()=>{Vr({value:N,name:r,type:"search",searchQueries:V,setSearchParams:O,filterKey:c,pageKey:a})},350);return()=>{window.clearTimeout(_)}},[N,H,r,V,O,c,a]),e.jsxs(ae.Flex,{gap:"md",style:{flexDirection:ee&&C==="left"?"row":ee&&C==="right"?"row-reverse":"column"},align:"flex-end",children:[K&&e.jsx(f.Box,{direction:"column",justify:"flex-end",children:e.jsx(j.Button,{onClick:()=>{const _=new URLSearchParams(B);_.delete(c),O(_),G(""),T(),g&&g()},variant:"outline",tone:"neutral",children:e.jsx(S.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),l==null?void 0:l.map(({minWidth:_,content:ge,title:fe,onClickContainer:Fe},qe)=>e.jsxs(f.Box,{direction:"column",gap:"sm",onClick:Fe,style:{minWidth:_},children:[fe&&e.jsx(Re.SubH3,{children:fe}),ge]},`extended-filter-${qe}-${m}`)),!!(b!=null&&b.length)&&e.jsx(j.Button,{primary:K,secondary:!K,iconLeft:e.jsx(F.Icon,{size:"sm",name:(p==null?void 0:p.icon)||"FilterHorizontal",style:{color:Y?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!ee,onClick:()=>x(!0),children:A?"Filter":void 0}),i&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[D&&e.jsx(Re.SubH3,{children:"Status"}),e.jsx(Fr.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Kr({get:"value",name:t,searchParams:B,filterKey:c})?[{label:Kr({get:"value",name:t,searchParams:B,filterKey:c})==="active"?"Active":"InActive",value:Kr({get:"value",name:t,searchParams:B,filterKey:c})}]:[],onChange:_=>Vr({value:_,name:t,type:"dropdown",searchQueries:V,setSearchParams:O,filterKey:c}),placeholder:D?"All":"All Status"},m)]}),s&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{width:d&&ee?d:ee?"310px":""},children:[D&&e.jsxs(Re.SubH3,{children:["Search for ",k]}),e.jsx(hr.Input,{placeholder:o,leftIcon:e.jsx(F.Icon,{name:"Search",width:20,height:20}),onChange:_=>G(_.target.value),value:N,fullWidth:!0},m+1+c)]}),e.jsx(hl,{isOpen:L,onClose:()=>x(!1),filterKey:c,filters:b,pageKey:a})]})},es=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r==="text"?"search":r;function _t({configs:r,filterKey:t="filter",activeFilterKey:o="filters",pageKey:n="page",searchKey:l="q"}){const{searchParams:s,setSearchParams:i,searchQueries:c}=_e(),a=h.useMemo(()=>Object.fromEntries(r.map(m=>[m.key,m])),[r]),d=h.useMemo(()=>{const m=(s.get(o)||"").split(",").map(T=>T.trim()).filter(Boolean),I=Object.keys(or(s.get(t))).filter(T=>T!==l);return r.map(T=>T.key).filter(T=>{const B=a[T];return(B==null?void 0:B.locked)||m.includes(T)||I.includes(T)})},[s,o,t,l,r,a]),g=h.useCallback(m=>or(m[t]),[t]),b=h.useCallback(m=>{const I={...c};m.length?I[o]=m.join(","):delete I[o],i(I)},[c,o,i]),p=h.useCallback(m=>{d.includes(m)||b([...d,m])},[d,b]),C=h.useCallback(m=>{var O;if((O=a[m])!=null&&O.locked)return;const I={...c},T=d.filter(U=>U!==m);T.length?I[o]=T.join(","):delete I[o];const B=g(I);m in B&&(delete B[m],Object.keys(B).length?I[t]=JSON.stringify(B):delete I[t]),delete I[n],i(I)},[c,d,o,t,n,g,i,a]),k=h.useCallback(m=>d.includes(m)?C(m):p(m),[d,p,C]),D=h.useCallback(m=>{switch(m.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return al({name:m.key,get:"array",searchParams:s,filterKey:t})||[];case"date":{const I=dl({name:m.key,searchParams:s,filterKey:t});return I?new Date(I):void 0}case"date-compact":{const T=g(Object.fromEntries(s.entries()))[m.key];return T&&typeof T=="object"?T:void 0}case"text":{const T=g(Object.fromEntries(s.entries()))[m.key];return typeof T=="string"?T:void 0}default:return}},[s,t,g]),z=h.useCallback((m,I)=>{if(m.type==="date-compact"||m.type==="text"){const T={...c},B=g(T);I==null||I===""?delete B[m.key]:B[m.key]=I,Object.keys(B).length?T[t]=JSON.stringify(B):delete T[t],delete T[n],i(T);return}Vr({value:I,name:m.key,type:es(m.type),searchQueries:c,setSearchParams:i,filterKey:t,pageKey:n})},[c,i,t,n,g]),A=h.useCallback(m=>{const I={...c},T=g(I);m in T&&(delete T[m],Object.keys(T).length?I[t]=JSON.stringify(T):delete I[t]),delete I[n],i(I)},[c,t,n,g,i]),L=h.useCallback(()=>{const m={...c};delete m[t],delete m[o],delete m[n],i(m)},[c,t,o,n,i]),x=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:x,addFilter:p,removeFilter:C,toggleFilter:k,getValue:D,setValue:z,clearValue:A,clearAll:L}}const qt={get(r){return Hr.storage.get(r)??null},set(r,t){Hr.storage.save(r,t)},remove(r){Hr.storage.delete(r)}},Lr={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}`},et=(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 rs({columns:r,scopeId:t,storage:o,onColumnsChange:n,value:l}){const s=h.useMemo(()=>({order:r.map(B=>B.key),hidden:[]}),[r]),i=t?Lr.columns(t):void 0,c=(B,O)=>et({order:B.order??O,hidden:B.hidden??[]},r),[a,d]=h.useState(()=>{if(l&&(l.order||l.hidden))return c(l,r.map(B=>B.key));if(i){const B=o.get(i);if(B&&Array.isArray(B.order))return et(B,r)}return s}),g=r.map(B=>B.key).join("|");h.useEffect(()=>d(B=>et(B,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 B=b.current,O=c(l,B.order);O.order.join("|")===B.order.join("|")&&O.hidden.join("|")===B.hidden.join("|")||(d(O),i&&o.set(i,O))},[p,g]);const k=h.useRef(!1);h.useEffect(()=>{k.current||(k.current=!0,n==null||n(a))},[]);const D=h.useCallback(B=>{d(B),i&&o.set(i,B),n==null||n(B)},[i,o,n]),z=h.useMemo(()=>{const B=new Map(r.map(O=>[O.key,O]));return a.order.filter(O=>B.has(O)).map(O=>({...B.get(O),visible:!a.hidden.includes(O)}))},[a,r]),A=h.useCallback(B=>{const O=a.hidden.includes(B)?a.hidden.filter(U=>U!==B):[...a.hidden,B];D({...a,hidden:O})},[a,D]),L=h.useCallback((B,O)=>{if(B===O)return;const U=[...a.order],[V]=U.splice(B,1);U.splice(O,0,V),D({...a,order:U})},[a,D]),x=h.useCallback(B=>{D({...a,hidden:B?r.filter(O=>!O.locked).map(O=>O.key):[]})},[a,r,D]),m=h.useCallback(()=>D(s),[D,s]),I=h.useCallback(B=>D(et(B,r)),[D,r]),T=a.hidden.length===0;return{state:a,orderedColumns:z,allVisible:T,toggleVisibility:A,reorder:L,setAllHidden:x,reset:m,applyState:I}}function ts({scopeId:r,storage:t,snapshotKeys:o,pageKey:n="page",getColumns:l,applyColumns:s}){const{searchParams:i,setSearchParams:c}=_e(),a=r?Lr.savedViews(r):void 0,[d,g]=h.useState(()=>a?t.get(a)||[]:[]),b=h.useCallback(D=>{g(D),a&&t.set(a,D)},[a]),p=h.useCallback(D=>{const z=D.trim();if(!z)return;const A={};o.forEach(x=>{const m=i.get(x);m!=null&&(A[x]=m)});const L={id:`${Date.now()}`,name:z,query:A,columns:l==null?void 0:l(),createdAt:Date.now()};b([...d,L])},[o,i,l,b,d]),C=h.useCallback(D=>b(d.filter(z=>z.id!==D)),[b,d]),k=h.useCallback(D=>{const z=Object.fromEntries(i.entries());o.forEach(A=>delete z[A]),Object.assign(z,D.query),delete z[n],c(z),D.columns&&(s==null||s(D.columns))},[i,o,n,c,s]);return{enabled:!!a,views:d,saveView:p,deleteView:C,applyView:k}}function os(r,t){const o=or(r);return delete o[t],Object.keys(o).length>0?JSON.stringify(o):void 0}function ul(r,t,o){const n=r[t];if(n==null)return;const l=os(n,o);l===void 0?delete r[t]:r[t]=l}function ls({scopeId:r,storage:t,snapshotKeys:o,enabled:n=!0,filterKey:l="filter",searchKey:s="q",persistSearch:i=!0}){const{searchParams:c}=_e(),a=r&&n?Lr.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(k=>{const D=c.get(k);D!=null&&(C[k]=D)}),i||ul(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 k=C[l];return k!=null&&Object.keys(or(k)).length===0&&delete C[l],i||ul(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 ns({scopeId:r,storage:t,perPageKey:o,pageSizeOptions:n,enabled:l=!0}){const{searchParams:s}=_e(),i=r&&l?Lr.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 Zt={},Gt=!1,Qt=null;const ss=(r,t)=>{Object.assign(Zt,r),Qt=t,!Gt&&(Gt=!0,queueMicrotask(()=>{const o=Zt,n=Qt;Zt={},Gt=!1,Qt=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 is({enabled:r,snapshotKeys:t,perPageKey:o,readSnapshot:n,readPerPage:l}){const{searchParams:s,setSearchParams:i,location:c}=_e(),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&&ss(d,i)},[c.pathname,r])}const cs=({configs:r,activeKeys:t,onToggle:o,hasActiveFilter:n,onReset:l})=>r.length?e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{minWidth:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&l&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"xs",onClick:l,children:"Reset"})]}),children:r.map(s=>e.jsx(W.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,jr=({onClear:r,onRemove:t})=>e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(F.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(W.MenuLists,{children:e.jsxs(W.MenuBody,{style:{width:180},children:[e.jsx(W.MenuItem,{startIcon:e.jsx(F.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(W.MenuItem,{intent:"danger",startIcon:e.jsx(F.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),as=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},gl=(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},yl=r=>{const t=as(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:gl(t,-o,r.period),to:t}:{from:t,to:gl(t,o,r.period)}},pl=24,bl=r=>r.length>pl?`${r.slice(0,pl)}...`:r,vl=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Ut=(r,t="days")=>t==="months"?r.toLocaleDateString(void 0,{month:"short",year:"numeric"}):t==="years"?String(r.getFullYear()):vl(r),rt={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"},Cl=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],Yt={past:"Past",next:"Next",this:"This"},ds=["day","week","month","year"],hs=["past","next","this"],fs=r=>r.field.type==="date-compact"?e.jsx(ys,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(us,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),us=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=t?vl(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:bl(s)})]}):r.label;return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.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(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(jr,{onClear:n,onRemove:l})]}),children:e.jsx(pr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():o(a),withPadding:!1})})})]})},gs=(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?`${rt[r.op]} ${Ut(new Date(r.date),t)}`:null;case"is-between":return r.from&&r.to?`${Ut(new Date(r.from),t)} - ${Ut(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`${Yt[o.direction]} ${n} ${l}`}case"is-empty":case"is-not-empty":return rt[r.op];default:return null}},ys=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.ops&&r.ops.length>0?r.ops:Cl,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?gs(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:bl(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(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.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(W.MenuLists,{children:[e.jsx(W.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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(xl,{op:a,ops:s,onChange:p})]}),e.jsx(jr,{onClear:n,onRemove:l})]}),children:e.jsx(wl,{value:t,op:a,mode:c,onChange:o})}),a==="is-relative-to-today"&&e.jsx(W.MenuFooter,{children:e.jsx(S.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},xl=({op:r,ops:t,onChange:o})=>e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:rt[r]})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:200},children:t.map(n=>e.jsx(W.MenuItem,{selected:r===n,onClick:()=>o(n),endIcon:r===n?e.jsx(F.Icon,{name:"Check"}):void 0,children:rt[n]},n))})})]}),wl=({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(S.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(pr.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(ps,{value:r==null?void 0:r.relative,onChange:l=>n({op:t,relative:l})}):e.jsx(pr.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}`)},ps=({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=yl({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(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:Yt[o]})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:140},children:hs.map(c=>e.jsx(W.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:Yt[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(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:140},children:ds.map(c=>e.jsx(W.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(pr.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:i,onChange:()=>{},withPadding:!1},"relative-preview")]})},Dl=18,bs=r=>r.length>Dl?`${r.slice(0,Dl)}...`:r,vs=({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 A=a.trim().toLowerCase();return A?g.filter(L=>L.label.toLowerCase().includes(A)):g})(),C=A=>t.some(L=>L.value===A.value),k=A=>{if(!s){o([{label:A.label,value:A.value}]),d("");return}o(C(A)?t.filter(L=>L.value!==A.value):[...t,{label:A.label,value:A.value}])},D=A=>{var L;d(A),(L=r.onSearch)==null||L.call(r,A)},z=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?bs(t[0].label):`${i} Selected`})]});return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.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:z})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(jr,{onClear:n,onRemove:l})]}),children:e.jsxs(f.Box,{direction:"column",gap:"sm",children:[c&&e.jsx(Fr.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:s,searchAble:!0,searchValue:a,onSearch:D,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(S.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(S.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(A=>e.jsx(W.MenuItem,{closeOnSelect:!s,selected:C(A),startIcon:A.avatar,endIcon:C(A)?e.jsx(F.Icon,{name:"Check"}):void 0,description:A.description,onClick:()=>k(A),children:A.label},A.value))})]})})})]})},Sl=18,Cs=r=>r.length>Sl?`${r.slice(0,Sl)}...`:r,kl=({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"})}),xs=({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(S.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(S.Text,{as:"span",children:i===1?Cs(t[0].label):`${i} Selected`})]});return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.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(W.MenuLists,{children:e.jsxs(W.MenuBody,{style:{width:240},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(jr,{onClear:n,onRemove:l})]}),children:[e.jsx(W.MenuItem,{closeOnSelect:!1,selected:c,onClick:g,startIcon:e.jsx(kl,{checked:c||a,indeterminate:a}),children:"Select All"}),r.options.map(p=>e.jsx(W.MenuItem,{closeOnSelect:!1,selected:s.has(p.value),onClick:()=>d(p),startIcon:e.jsx(kl,{checked:s.has(p.value)}),children:p.label},p.value))]})})]})},Bl=18,ws=r=>r.length>Bl?`${r.slice(0,Bl)}...`:r,Ds=({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:ws(t)})]}):r.label;return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.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(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(jr,{onClear:n,onRemove:l})]}),children:e.jsx(hr.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)})})})]})},ml=({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(Ds,{field:c,value:a||"",onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i):c.type==="checkbox-multiple"?e.jsx(xs,{field:c,value:a||[],onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i):e.jsx(vs,{field:c,value:a||[],onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i)})}),El=r=>`${r} Rows`,Ss=({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 A;const{searchQueries:a,setSearchParams:d,searchParams:g}=_e(),b=g.get(o),p=b?Number(b):l,C=L=>{d({...a,[t]:String(L)})},k=L=>{d({...a,[o]:L,[t]:"1"})},D=(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),z=(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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${D}-${z} of ${((A=r==null?void 0:r.totalData)==null?void 0:A.toLocaleString())||0}`}),i&&e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:El(p)})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{children:n.map(L=>e.jsx(W.MenuItem,{selected:L===p,onClick:()=>k(String(L)),children:El(L)},L))})})]}),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(zr.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 ks(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 Bs=240,Fl=({searchKey:r="q",filterKey:t="filter",pageKey:o="page",placeholder:n="Search",shortcut:l="/",collapsible:s=!0})=>{const{searchParams:i,setSearchParams:c,searchQueries:a}=_e(),d=Rr(r,i,t)||"",[g,b]=h.useState(!s||!!d),[p,C]=h.useState(s&&!d),[k,D]=h.useState(d),z=ke.useDebounce(k,350),A=h.useRef(null);h.useEffect(()=>{D(d),d&&b(!0)},[d]),h.useEffect(()=>{g&&C(!1)},[g]),h.useEffect(()=>{z!==d&&Vr({value:z,name:r,type:"search",searchQueries:a,setSearchParams:c,filterKey:t,pageKey:o})},[z]);const L=h.useCallback(()=>{b(!0),requestAnimationFrame(()=>{var T;return(T=A.current)==null?void 0:T.focus()})},[]);ks(l,L);const x=()=>{s&&!k&&b(!1)},m=T=>{var B;s&&T.key==="Escape"&&!k&&(b(!1),(B=A.current)==null||B.blur())},I=()=>{g||C(!0)};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:L}),e.jsxs(f.Box,{onTransitionEnd:I,style:{position:"relative",width:g?Bs:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(hr.Input,{ref:A,size:"sm",fullWidth:!0,value:k,placeholder:n,leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:T=>D(T.target.value),onKeyDown:m,onBlur:x,tabIndex:g?0:-1}),g&&!k&&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(S.Text,{fontSize:"xs",color:"subtle",children:l})})]})]})},Il=({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(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{children:e.jsxs(f.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(S.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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(j.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,k=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:D=>{D.preventDefault(),a(p)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:k?"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:D=>{C&&(D.key==="ArrowUp"?(D.preventDefault(),g(p,-1)):D.key==="ArrowDown"&&(D.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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:b.title}),e.jsx(f.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(Tr.Toggle,{size:"sm",checked:b.visible,disabled:b.locked,onChange:()=>o(b.key),"aria-label":`Toggle ${b.title} column`})})]},b.key)})})]})})})]})},Ml=({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(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(j.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(W.MenuLists,{style:{width:"260px"},children:[e.jsx(W.MenuBody,{children:e.jsxs(f.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(S.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(S.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(c=>e.jsx(W.MenuItem,{startIcon:e.jsx(F.Icon,{name:"Bookmark"}),onClick:()=>t(c),endIcon:e.jsx(j.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(W.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(j.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!l.trim(),onClick:i,children:"Save"})]})})]})]})},ms=({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(Ur.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(S.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),p>0&&e.jsxs(S.Text,{fontSize:"sm",color:"subtle",children:["(",p,")"]})]}),e.jsx(j.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(S.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(ml,{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(S.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(f.Box,{direction:"column",children:o.map(C=>{const k=n.includes(C.key),D=!!C.locked;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:D?.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(S.Text,{fontSize:"sm",color:"primary",truncate:!0,children:C.label})]}),e.jsx(Tr.Toggle,{size:"sm",checked:k||D,disabled:D,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(j.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(j.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},Es=r=>`${r} Rows`,Fs=({perPageKey:r,pageKey:t,pageSizeOptions:o,defaultPerPage:n=10,showPageSize:l})=>{const{searchQueries:s,setSearchParams:i,searchParams:c}=_e(),a=c.get(r),d=a?Number(a):n,g=b=>{i({...s,[r]:b,[t]:"1"})};return l?e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(W.MenuLists,{children:e.jsxs(W.MenuBody,{style:{minWidth:200},children:[e.jsx(f.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(S.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),o.map(b=>e.jsx(W.MenuItem,{selected:b===d,endIcon:b===d?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>g(String(b)),children:Es(b)},b))]})})]}):null},Is=r=>{var we;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:k,pageKey:D,searchPlaceholder:z,searchShortcut:A,searchCollapsible:L,pagination:x,perPageKey:m,pageSizeOptions:I,defaultPerPage:T,showPagination:B,showResultCount:O,showPageSize:U,hasColumns:V,orderedColumns:H,allVisible:N,onToggleVisibility:G,onReorder:Y,onSetAllHidden:te,showSavedViews:K,savedViews:ee,onApplyView:_,onDeleteView:ge,onSaveView:fe,leadingActions:Fe,trailingActions:qe}=r,[Be,ve]=h.useState(!1),{searchQueries:Ce,setSearchParams:Ae}=_e(),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),He=(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)),ie=Ie=>{Ae({...Ce,[D]:String(Ie)})},de=O||B&&!!(x!=null&&x.totalPage),pe=()=>{b(),ve(!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(Fl,{searchKey:C,filterKey:k,pageKey:D,placeholder:z,shortcut:A,collapsible:L}),e.jsx(j.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),onClick:()=>ve(!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:[Fe,K&&e.jsx(Ml,{views:ee,onApply:_,onDelete:ge,onSave:fe}),V&&e.jsx(Il,{columns:H,allVisible:N,onToggle:G,onReorder:Y,onSetAllHidden:te}),e.jsx(Fs,{perPageKey:m,pageKey:D,pageSizeOptions:I,defaultPerPage:T,showPageSize:U}),qe]})]}),de&&e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[O?e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Ze}-${He} of ${((we=x==null?void 0:x.totalData)==null?void 0:we.toLocaleString())||0}`}):e.jsx(f.Box,{direction:"column"}),B&&!!(x!=null&&x.totalPage)&&e.jsx(zr.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:x!=null&&x.currentPage?Number(x.currentPage):1,totalPages:Number(x.totalPage),onPageChange:ie})]}),e.jsx(ms,{isOpen:Be,onClose:()=>ve(!1),configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:i,onReset:pe,getValue:a,setValue:d,clearValue:g,removeFilter:c})]})},Ms=({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:k="/",searchPosition:D="right",searchCollapsible:z=!0,pagination:A,columns:L=[],onColumnsChange:x,columnsState:m,scopeId:I,savedViews:T,persistLastState:B=!0,persistSearch:O=!0,storage:U=qt,onReset:V,leadingActions:H,trailingActions:N})=>{const G=I??(T==null?void 0:T.scopeId),{activeKeys:Y,configByKey:te,hasActiveFilter:K,toggleFilter:ee,removeFilter:_,getValue:ge,setValue:fe,clearValue:Fe,clearAll:qe}=_t({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:p}),Be=rs({columns:L,scopeId:G,storage:U,onColumnsChange:x,value:m}),ve=ts({scopeId:G,storage:U,snapshotKeys:[n,o,s],pageKey:l,getColumns:()=>Be.state,applyColumns:Be.applyState}),Ce=ls({scopeId:G,storage:U,snapshotKeys:[n,o,l],enabled:B,filterKey:o,searchKey:p,persistSearch:O}),Ae=ns({scopeId:G,storage:U,perPageKey:s,pageSizeOptions:i,enabled:B});is({enabled:B&&!!G,snapshotKeys:[n,o,l],perPageKey:s,readSnapshot:Ce.read,readPerPage:Ae.read});const Ze=c??i[0]??25,He=!!(T!=null&&T.enabled)&&ve.enabled,ie=()=>{qe(),Ce.clear(),V==null||V()},de=ke.useMediaQuery("md"),pe=b?e.jsx(Fl,{searchKey:p,filterKey:o,pageKey:l,placeholder:C,shortcut:k,collapsible:z}):null;return de?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(cs,{configs:t,activeKeys:Y,onToggle:ee,hasActiveFilter:K,onReset:ie}),D==="left"&&pe,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(ml,{activeKeys:Y,configByKey:te,getValue:ge,setValue:fe,clearValue:Fe,removeFilter:_}),K&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"sm",onClick:ie,children:"Reset"})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[H,e.jsx(Ss,{pagination:A,pageKey:l,perPageKey:s,pageSizeOptions:i,defaultPerPage:Ze,showPagination:a,showResultCount:d,showPageSize:g}),D==="right"&&pe,He&&e.jsx(Ml,{views:ve.views,onApply:ve.applyView,onDelete:ve.deleteView,onSave:ve.saveView}),L.length>0&&e.jsx(Il,{columns:Be.orderedColumns,allVisible:Be.allVisible,onToggle:Be.toggleVisibility,onReorder:Be.reorder,onSetAllHidden:Be.setAllHidden}),N]})]}):e.jsx(Is,{withPadding:r,configs:t,activeKeys:Y,configByKey:te,hasActiveFilter:K,toggleFilter:ee,removeFilter:_,getValue:ge,setValue:fe,clearValue:Fe,onReset:ie,searchable:b,searchKey:p,filterKey:o,pageKey:l,searchPlaceholder:C,searchShortcut:k,searchCollapsible:z,pagination:A,perPageKey:s,pageSizeOptions:i,defaultPerPage:Ze,showPagination:a,showResultCount:d,showPageSize:g,hasColumns:L.length>0,orderedColumns:Be.orderedColumns,allVisible:Be.allVisible,onToggleVisibility:Be.toggleVisibility,onReorder:Be.reorder,onSetAllHidden:Be.setAllHidden,showSavedViews:He,savedViews:ve.views,onApplyView:ve.applyView,onDeleteView:ve.deleteView,onSaveView:ve.saveView,leadingActions:H,trailingActions:N})},Ts=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},Ls=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},As=(r,t)=>{switch(r.type){case"dropdown":case"radio":return Ts(t);case"dropdown-multiple":case"checkbox-multiple":return Ls(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}},Tl=(r,t)=>{if(r==null||r==="")return t;const o=Number(r);return Number.isFinite(o)&&o>0?o:t},Os=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:k}=_t({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:i}),{searchParams:D}=_e(),z=D.toString();return h.useMemo(()=>{const L={},x={},m=Tl(D.get(l),c),I=Tl(D.get(s),a);L[(d==null?void 0:d.page)??"page"]=m,L[(d==null?void 0:d.perPage)??"perPage"]=I;const T=Rr(i,D,o)||"";T&&(L[(d==null?void 0:d.search)??"search"]=T);let B=!1;for(const O of b){const U=p[O];if(!U)continue;const V=k(U);x[O]=V;const H=g==null?void 0:g[O],N=H?H(V):As(U,V);if(N==null||Array.isArray(N)&&N.length===0)continue;const G=(d==null?void 0:d[O])??O;L[G]=N,B=!0}return{params:L,raw:x,hasActiveFilter:C||!!T||B}},[z,b.join("|"),o,n,l,s,i,c,a,d,g,p])},Ws=["dropdown","dropdown-multiple","checkbox-multiple","radio"],zs=({filterConfigs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l})=>{const{configByKey:s,getValue:i,setValue:c,removeFilter:a,clearAll:d,hasActiveFilter:g}=_t({configs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l}),b=(x,m)=>{var T;const I=x.options;return((T=I==null?void 0:I.find(B=>B.value===m))==null?void 0:T.label)??m},p=h.useCallback(x=>{const m=s[x];if(!m)return[];const I=i(m);return Array.isArray(I)?I.map(T=>String(T.value)):[]},[s,i]),C=h.useCallback((x,m)=>{const I=s[x];if(!I||!Ws.includes(I.type))return;const T=Array.isArray(m)?m:[m];if(T.length===0){a(x);return}c(I,T.map(B=>({label:b(I,B),value:B})))},[s,c,a]),k=h.useCallback((x,m)=>{const I=p(x);C(x,I.includes(m)?I.filter(T=>T!==m):[...I,m])},[p,C]),D=h.useCallback((x,m)=>p(x).includes(m),[p]),z=h.useCallback(x=>a(x),[a]),A=h.useCallback(x=>{const m=s[x];return m?i(m):void 0},[s,i]),L=h.useCallback((x,m)=>{const I=s[x];if(I){if(m==null){a(x);return}c(I,m)}},[s,c,a]);return{set:C,toggle:k,clear:z,clearAll:d,isActive:D,values:p,getRaw:A,setRaw:L,hasActiveFilter:g}},Xt="var(--sa-background-brand, #04254f)",Hs="var(--sa-text-brand, #031f43)",Ps={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"},Jt={padding:"4px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",fontSize:13,color:Hs},Ll=(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},Vs=({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:Ps}),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?Xt:"var(--sa-border-subtle, #0b120e24)"}`,background:g&&!l?Xt:"transparent"},children:g&&(l?e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:Xt}}):e.jsx(F.Icon,{name:"Check",size:"xs",style:{color:"#fff"}}))}),e.jsx(S.Text,{as:"span",style:{fontSize:14},children:d.label})]},d.value)}),c.length===0&&e.jsx(S.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:Jt,children:"Clear"})]})},js=({field:r,controls:t})=>{const o=t.getRaw(r.key);return e.jsx(f.Box,{style:{minWidth:240},children:e.jsx(pr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:o,onChange:n=>t.setRaw(r.key,n??null),withPadding:!1})})},Ns=({field:r,controls:t})=>{const o=t.getRaw(r.key),n=r.ops&&r.ops.length>0?r.ops:Cl,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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(xl,{op:i,ops:n,onChange:a})]}),e.jsx(wl,{value:o,op:i,mode:s,onChange:c}),Ll(r,t)&&e.jsx("button",{type:"button",onClick:()=>t.setRaw(r.key,null),style:Jt,children:"Clear"})]})},_s=({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(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:Jt,children:"Clear"})]})},qs=({field:r,controls:t})=>r.type==="text"?e.jsx(_s,{field:r,controls:t}):r.type==="date"?e.jsx(js,{field:r,controls:t}):r.type==="date-compact"?e.jsx(Ns,{field:r,controls:t}):e.jsx(Vs,{field:r,controls:t}),Zs=(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}=yl(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}},Al=({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})},Ol=({action:r,rightContent:t,leftContent:o,headerSlot:n,advanceFilter:l,showFilter:s=!0})=>{const i=ke.useMediaQuery("md"),c=s?e.jsx(fl,{...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(j.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()]})]})})},Gs=({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(Re.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Re.Body1,{children:r||0})]}),Wl=({pagination:r,pageKey:t="page",perPageKey:o="perPage",defaultPerPage:n=10,showPagination:l=!0,totalData:s})=>{const{searchQueries:i,setSearchParams:c,searchParams:a}=_e(),d=a.get(o),g=k=>{c({...i,[t]:String(k)})},b=k=>{c({...i,[o]:k,[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(S.Text,{children:"Rows Per Page: "}),e.jsx(Fr.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:k=>{b(k[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(S.Text,{children:`${p}-${C} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(zr.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(Gs,{totalData:s,withMarginBottom:!1,withMarginTop:!1})})},zl=({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(D=>D.label.toLowerCase().includes(c.toLowerCase())):r.options,[r.options,c]);h.useEffect(()=>{if(o&&s.current){const D=s.current.getBoundingClientRect(),z=280,A={top:D.bottom+8};r.position==="left"||D.left+z>window.innerWidth?A.right=window.innerWidth-D.right:A.left=D.left,g(A)}},[o,r.position]),h.useEffect(()=>{o&&i.current?setTimeout(()=>{var D;return(D=i.current)==null?void 0:D.focus()},50):a("")},[o]),h.useEffect(()=>{const D=z=>{l.current&&!l.current.contains(z.target)&&s.current&&!s.current.contains(z.target)&&n(!1)};return o&&document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[o]);const C=D=>{const z=b.includes(D)?b.filter(A=>A!==D):[...b,D];r.onFilterChange(z)},k=()=>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:D=>{var z;D.stopPropagation(),o||(z=r.onOpen)==null||z.call(r),n(A=>!A)},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(S.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(S.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:D=>{D.stopPropagation(),k()},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(F.Icon,{name:"Search",size:"sm"}),value:c,onChange:D=>a(D.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(S.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(D=>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(D.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:z=>{z.stopPropagation(),C(D.value)},onMouseEnter:z=>{b.includes(D.value)||(z.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),z.currentTarget.style.transform="translateX(2px)"},onMouseLeave:z=>{z.currentTarget.style.backgroundColor=b.includes(D.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",z.currentTarget.style.transform="translateX(0)"},children:[e.jsx(fr.Checkbox,{checked:b.includes(D.value),onChange:()=>{}}),e.jsx(S.Text,{fontSize:"sm",fontWeight:b.includes(D.value)?"medium":"normal",color:b.includes(D.value)?"primary":"gray-700",children:D.label})]},D.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(S.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(S.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",b.length>1?"s":""," selected"]})]})})]})]})},Qs=({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"})})]})},Us=({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"})]}),$t="var(--sa-background-primary, #ffffff)",Hl="var(--sa-background-primary-inverse, #f8f8f8)",Pl=({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:k=["detail","update","delete","custom"],customEmptyState:D,enableColumnResize:z=!1,defaultColumnWidths:A,onColumnWidthsChange:L,defaultMinColumnWidth:x=60,sort:m,defaultSort:I,onSortChange:T,showActionDivider:B=!1})=>{const O=m!==void 0,[U,V]=h.useState(I??null),H=O?m??null:U,N=P=>{if(P.sortKey)return P.sortKey;if(typeof P.accessor=="string")return P.accessor},G=P=>{const $=N(P);if(!$)return;let X;!H||H.key!==$?X={key:$,direction:"asc"}:H.direction==="asc"?X={key:$,direction:"desc"}:X=null,O||V(X),T==null||T(X)},te=[o,n,l].filter(P=>P!==void 0).length,K=!!C,ee=!!o||!!n||!!l||K,_="var(--sa-border-subtle, #0b120e24)",ge=`1px solid ${_}`,fe=`inset 1px 0 0 ${_}`,Fe=`inset -1px 0 0 ${_}`,qe=te===3?K?"178px":"140px":te===2?K?"140px":"102px":te===1?K?"112px":"74px":K?"74px":"",Be=(P,$)=>{if(!$)return P;if(typeof $=="function")return $(P);if(typeof $=="string")return P[$]},[ve,Ce]=h.useState(!1);h.useEffect(()=>{if(!(g!=null&&g.current))return;const P=g.current;Ce(P.scrollHeight>P.clientHeight)},[t,g]);const Ae=h.useRef(null),[Ze,He]=h.useState([]),[ie,de]=h.useState(()=>A??{}),pe=h.useRef(null);h.useLayoutEffect(()=>{if(!b||!Ae.current){He([]);return}const P=Array.from(Ae.current.querySelectorAll("thead tr th")),$=[];let X=0;P.forEach((he,me)=>{$[me]=X,me<b&&(X+=he.offsetWidth)}),He($)},[b,r,t,ie]);const we=P=>{p&&p(P<b?P:P+1)},Ie=(P,$)=>{const X=ie[P];if(X!==void 0){const he=`${X}px`;return{width:he,minWidth:he,maxWidth:he}}return $?{width:$}:{}},sr=P=>z&&(P.resizable??!0),ir=(P,$)=>{P.preventDefault(),P.stopPropagation();const X=P.currentTarget.closest("th");if(!X)return;const he=Math.round(X.getBoundingClientRect().width);pe.current={colIndex:$,startX:P.clientX,startWidth:he};const me=document.body.style.userSelect,xe=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Pe=Ye=>{var Ee;const Me=pe.current;if(!Me)return;const br=((Ee=r[Me.colIndex])==null?void 0:Ee.minWidth)??x,ur=Math.max(br,Me.startWidth+(Ye.clientX-Me.startX));de(ze=>ze[Me.colIndex]===ur?ze:{...ze,[Me.colIndex]:ur})},cr=()=>{document.removeEventListener("mousemove",Pe),document.removeEventListener("mouseup",cr),document.body.style.userSelect=me,document.body.style.cursor=xe,pe.current=null,L&&de(Ye=>(L(Ye),Ye))};document.addEventListener("mousemove",Pe),document.addEventListener("mouseup",cr)};return e.jsx("div",{ref:Ae,children:e.jsxs(Q.Table,{fullWidth:!0,children:[e.jsx(Q.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(Q.Tr,{children:[r.map((P,$)=>{var Sr,ar;const X=b>0&&$<b,he=Ze[$]??0,me=sr(P),Pe=$===r.length-1&&ee&&B,cr=N(P),Ye=!!P.sortable&&!!cr,Me=Ye&&(H==null?void 0:H.key)===cr?H.direction:null,br=P.title||((Sr=P.accessor)==null?void 0:Sr.toString())||"",ur=(ar=P.headerTooltip)!=null&&ar.showIcon?e.jsx(F.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:br}),ze=Ye?e.jsxs("button",{type:"button",onClick:()=>G(P),title:Me==="asc"?"Sorted ascending — click to sort descending":Me==="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,ur,e.jsx(Qs,{direction:Me})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Ee,ur]});return e.jsxs(Q.Th,{style:{position:"sticky",top:0,left:X?he:void 0,zIndex:X?4:2,paddingLeft:$===0?"12px":"",borderRight:d&&!Pe&&!X?ge:void 0,borderBottom:d?ge:void 0,boxShadow:d&&X?Fe:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left",...Ie($,P.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[P.headerTooltip?e.jsx(Le.Tooltip,{label:P.headerTooltip.content,position:"bottom",children:ze}):ze,P.filter&&e.jsx(zl,{filter:P.filter,columnTitle:P.title}),p&&e.jsx("button",{onClick:()=>we($),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(Us,{frozen:X})})]}),me&&e.jsx("div",{onMouseDown:vr=>ir(vr,$),onClick:vr=>vr.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-${$}`)}),ee?e.jsx(Q.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?ge:void 0,boxShadow:d&&B?fe:void 0}}):null]})}),e.jsx(Q.Tbody,{children:s?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:r.length+1,children:e.jsxs(f.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Ke.Skeleton,{variant:"list"}),e.jsx(Ke.Skeleton,{variant:"list"}),e.jsx(Ke.Skeleton,{variant:"list"}),e.jsx(Ke.Skeleton,{variant:"list"}),e.jsx(Ke.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&D?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:r.length+1,children:D})}):t==null?void 0:t.map((P,$)=>e.jsxs(Q.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:$===t.length-1&&ve?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:X=>{const he=X.currentTarget;he.style.backgroundColor=Hl,Array.from(he.querySelectorAll("td")).forEach(me=>{me.style.position==="sticky"&&(me.style.backgroundColor=Hl)})},onMouseLeave:X=>{const he=X.currentTarget;he.style.backgroundColor="",Array.from(he.querySelectorAll("td")).forEach(me=>{me.style.position==="sticky"&&(me.style.backgroundColor=$t)})},children:[r.map((X,he)=>{const me=X.render?X.render(P,$,t):Be(P,X.accessor),xe=b>0&&he<b,Pe=Ze[he]??0,cr=ie[he]!==void 0,Ye=xe&&he===b-1;return e.jsx(Q.Td,{style:{position:xe?"sticky":void 0,left:xe?Pe:void 0,zIndex:xe?1:void 0,backgroundColor:xe?$t:void 0,transition:xe?"background-color 0.3s ease":void 0,paddingLeft:he===0?"12px":"",whiteSpace:"nowrap",overflow:cr?"hidden":void 0,borderLeft:X.showBorderLeft?ge:void 0,borderRight:X.showBorderRight?ge:void 0,boxShadow:Ye?Fe:void 0,textAlign:X.textAlign==="text-right"?"right":X.textAlign==="text-center"?"center":"left",...Ie(he,X.width)},children:typeof me=="string"?e.jsx(S.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:X.textAlign==="text-right"?"right":X.textAlign==="text-center"?"center":"left"},children:me}):me},`row-${$}-col-${he}`)}),ee?e.jsx(Q.Td,{style:{width:qe,position:"sticky",right:0,zIndex:1,backgroundColor:$t,boxShadow:B?fe:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ae.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:k.map(X=>{const he=$===t.length-1?"top":"bottom";return X==="detail"&&o&&(a==null?void 0:a(P))!==!1?e.jsx(Le.Tooltip,{label:"Detail",position:he,children:e.jsx(j.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"):X==="update"&&n&&(c==null?void 0:c(P))!==!1?e.jsx(Le.Tooltip,{label:"Update",position:he,children:e.jsx(j.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"):X==="delete"&&l&&(i==null?void 0:i(P))!==!1?e.jsx(Le.Tooltip,{label:"Delete",position:he,children:e.jsx(j.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"):X==="custom"?e.jsx(h.Fragment,{children:C==null?void 0:C(P)},"custom"):null})})}):null]},`${P}${$}`))})]})})};let Vl=!1;const Ys=({wrapperProps:r,dataTableProps:t,headerProps:o,footerProps:n})=>{var b;process.env.NODE_ENV!=="production"&&!Vl&&(Vl=!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(Al,{...r,children:[c&&e.jsx(Ol,{...o}),e.jsx(f.Box,{direction:"column",ref:l,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(Pl,{...t,scrollParentRef:l,frozenCount:t!=null&&t.enableFreezeColumns?s:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?i:void 0}):null}),g&&e.jsx(Wl,{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 Xs(r){return h.memo(r)}const Js=Xs(Ys),jl="(any-pointer: coarse)",$s=r=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const t=window.matchMedia(jl);return t.addEventListener("change",r),()=>t.removeEventListener("change",r)},Ks=()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(jl).matches,Rs=()=>!1;function Nl(){return h.useSyncExternalStore($s,Ks,Rs)}const _l=200,tt="1px solid var(--sa-border-subtle, #0b120e24)",ei=({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}),ot=({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(S.Text,{as:"span",style:{color:s},children:t})]})},ri=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},ql=({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),k=h.useRef(null),[D,z]=h.useState({top:0,left:0}),A=h.useCallback(()=>{var H;const x=C.current;if(!x)return;const m=x.getBoundingClientRect(),I=x.closest(".sa-tl-scroll")??ri(x),T=I==null?void 0:I.getBoundingClientRect();if(T&&(m.left<T.left||m.left>T.right)){p(!1);return}const B=Math.min(window.innerWidth-8,T?T.right:window.innerWidth),O=((H=k.current)==null?void 0:H.offsetWidth)||_l,U=T?T.left:8,V=Math.max(U,Math.min(m.left,B-O));z({top:m.bottom+6,left:V})},[]);h.useEffect(()=>{if(!b)return;A();const x=()=>A();return window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}},[b,A]),h.useEffect(()=>{if(!b)return;const x=m=>{k.current&&!k.current.contains(m.target)&&C.current&&!C.current.contains(m.target)&&p(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[b]);const L=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(m=>!m)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:tt,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(ei,{sortDir:n,frozen:l,filterActive:g})}),b&&e.jsxs(f.Box,{ref:k,onClick:x=>x.stopPropagation(),style:{position:"fixed",top:`${D.top}px`,...D.left!==void 0?{left:`${D.left}px`}:{right:`${D.right}px`},minWidth:_l,backgroundColor:"var(--sa-background-primary, #ffffff)",border:tt,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(S.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:tt,margin:"4px 0"}})]}),t&&e.jsxs(e.Fragment,{children:[e.jsx(ot,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>L(()=>n==="asc"?i():s("asc"))}),e.jsx(ot,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>L(()=>n==="desc"?i():s("desc"))}),e.jsx("div",{style:{borderTop:tt,margin:"4px 0"}})]}),e.jsx(ot,{icon:"Pin1",label:l?"Unfreeze":"Freeze",active:l,onClick:()=>L(c)}),o&&e.jsx(ot,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>L(a)})]})]})},ti=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),oi={background:"var(--sa-background-warning-subtlest, #fef2e6)",color:"inherit",padding:0,borderRadius:"min(2px, var(--sa-radii-xs, 4px))"},Zl=({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(ti).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:{...oi,...o},children:a},d):e.jsx(h.Fragment,{children:a},d))})},Nr="1px solid var(--sa-border-subtle, #0b120e24)",li="var(--sa-text-subtle, #8c8f97)",Ar="var(--sa-background-neutral, #f0f1f2)",Gl="2px 0 4px -2px var(--sa-border-subtle, #0b120e24)",_r=40,Kt=5,ni=28,Rt=4,lt=16,eo="var(--sa-background-brand-subtlest)",nt={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Ql="sa-table-layout-styles",si=()=>{if(typeof document>"u"||document.getElementById(Ql))return;const r=document.createElement("style");r.id=Ql,r.textContent=`
|
|
1
|
+
(function(u,mr){typeof exports=="object"&&typeof module<"u"?mr(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"],mr):(u=typeof globalThis<"u"?globalThis:u||self,mr(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,mr,Qr,rr,f,Er,j,Dt,pr,Oe,Ur,Fr,Be,Ir,hr,W,zr,Hr,Q,vo,St,Mr,Co,Tr,Le,fr,kt,S,F,de,xo,wo,Do,So,ko,Ke,Bo,e,h,Yr,vn){"use strict";const Cn={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Bt=h.createContext(Cn),mt=()=>h.useContext(Bt),mo=r=>{const[t,o]=h.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:o}},Eo=h.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),Fo=({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(Eo.Provider,{value:i,children:r})},Io=()=>h.useContext(Eo),Xr=(r,t)=>{const o=t!==void 0?t:r;return o==null?null:typeof o=="string"||typeof o=="number"?{value:o}:o},Et=240,Ft=200,It=480,xn="sa-sidebar-width",Mt=(r,t,o)=>Math.min(Math.max(r,t),o),wn=(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)?Mt(s,o,n):t}catch{return t}},Mo=(r,t)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(r,String(t))}catch{}},To=h.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},width:Et,setWidth:()=>{},resetWidth:()=>{},minWidth:Ft,maxWidth:It,mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),Lo=({children:r,defaultCollapsed:t=!1,defaultWidth:o=Et,minWidth:n=Ft,maxWidth:l=It,widthStorageKey:s=xn})=>{const[i,c]=h.useState(t),[a,d]=h.useState(!1),[g,b]=h.useState(()=>wn(s,o,n,l)),p=h.useCallback(B=>{c(L=>typeof B=="function"?B(L):B)},[]),C=h.useCallback(()=>c(B=>!B),[]),k=h.useCallback(()=>c(!0),[]),D=h.useCallback(()=>c(!1),[]),z=h.useCallback(B=>{b(L=>{const U=typeof B=="function"?B(L):B,V=Mt(Math.round(U),n,l);return Mo(s,V),V})},[n,l,s]),O=h.useCallback(()=>{const B=Mt(o,n,l);Mo(s,B),b(B)},[o,n,l,s]),A=h.useCallback(B=>{d(L=>typeof B=="function"?B(L):B)},[]),x=h.useCallback(()=>d(!0),[]),m=h.useCallback(()=>d(!1),[]),I=h.useCallback(()=>d(B=>!B),[]),T=h.useMemo(()=>({collapsed:i,setCollapsed:p,toggle:C,collapse:k,expand:D,width:g,setWidth:z,resetWidth:O,minWidth:n,maxWidth:l,mobileOpen:a,setMobileOpen:A,openMobile:x,closeMobile:m,toggleMobile:I}),[i,p,C,k,D,g,z,O,n,l,a,A,x,m,I]);return e.jsx(To.Provider,{value:T,children:r})},Ao=()=>h.useContext(To),Oo=h.createContext(null),Wo=({adapter:r,children:t})=>e.jsx(Oo.Provider,{value:r,children:t}),tr=()=>{const r=h.useContext(Oo);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},zo=({router:r,routerAdapter:t,menus:o=[],menuBottom:n,logo:l,appName:s="Workspace",initialUserData:i,theme:c})=>{const a=mo({initialUserData:i}),{theme:d}=Mr.useTheme();return e.jsx(Wo,{adapter:t,children:e.jsx(Bt.Provider,{value:{logo:l,appName:s,menus:o,userData:a.userData,setUserData:a.setUserData,menuBottom:n},children:e.jsx(Fo,{children:e.jsx(Lo,{children:c?e.jsx(Mr.ThemeProvider,{value:c,children:r}):d?e.jsx(Mr.ThemeProvider,{value:d,children:r}):r})})})})},Dn=h.memo(zo);function Ho({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 Tt=h.createContext(null);function Po({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(Tt.Provider,{value:{prependNode:t,appendNode:n,replaceNode:s,setPrependNode:o,setAppendNode:l,setReplaceNode:i,replaceCount:c,registerReplace:d},children:r})}function Vo({children:r}){const t=h.useContext(Tt);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 Sn({children:r,mode:t="append"}){const o=h.useContext(Tt);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?Yr.createPortal(r,n):null}const Lt=h.createContext(null);function jo({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(Lt.Provider,{value:c,children:r})}function At({slotKey:r,fallback:t}){const o=h.useContext(Lt),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 kn({slotKey:r,children:t}){const o=h.useContext(Lt),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?Yr.createPortal(t,l):null}const Jr="moduleSwitcherGroupId",Ot="sa-module-switcher-change";function No(){if(typeof window>"u")return null;const r=window.localStorage.getItem(Jr);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function _o(r){typeof window>"u"||(r===null?window.localStorage.removeItem(Jr):window.localStorage.setItem(Jr,String(r)),window.dispatchEvent(new CustomEvent(Ot,{detail:r})))}function Bn(){_o(null)}function Wt(){const[r,t]=h.useState(()=>No());return h.useEffect(()=>{const n=()=>{t(No())},l=s=>{s.key===Jr&&n()};return window.addEventListener(Ot,n),window.addEventListener("storage",l),()=>{window.removeEventListener(Ot,n),window.removeEventListener("storage",l)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{_o(n),t(n)}}}const mn="4.5rem",En="var(--app-header-height, 4rem)",qo=r=>r?mn:En;function Zo({icon:r,label:t,tooltip:o=t,active:n=!1,badge:l,showLabel:s=!0,onClick:i}){const[c,a]=h.useState(!1);return e.jsx(Le.Tooltip,{fluid:!0,label:o,position:"right",children:e.jsxs(f.Box,{as:"button",onClick:i,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),"aria-label":o,"aria-current":n?"page":void 0,fullWidth:!0,direction:"column",align:"center",gap:"spacing-2",paddingBlock:"xs",style:{color:n?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)"},children:[e.jsxs(f.Box,{position:"relative",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",borderRadius:n?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:n?"white":c?"neutral":void 0,style:{borderColor:n?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsx(F.Icon,{name:r,size:"sm"}),l&&!s&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",style:{boxShadow:"0 0 0 1px var(--sa-background-primary, #ffffff)"},children:e.jsx(rr.BadgeDot,{tone:"error",variant:"solid",size:"xs"})}),l&&s&&e.jsx(f.Box,{position:"absolute",display:"inline-flex",style:{top:"-0.375rem",left:"1.5rem"},children:e.jsx(rr.Badge,{text:String(l.value),variant:l.variant??"info",size:"xs",border:!0})})]}),s&&e.jsx(S.Text,{as:"span",fontSize:"xs",fontWeight:n?"medium":"normal",textAlign:"center",truncate:!0,style:{display:"block",maxWidth:"100%",color:"inherit"},children:t})]})})}function Fn({items:r,bottomItems:t,activeKey:o,onSelect:n,onAction:l,logo:s,panelCollapsed:i,onExpandPanel:c,showLabels:a=!0}){const[d,g]=h.useState(!1),b=i&&d;return e.jsxs(f.Box,{as:"nav","aria-label":"Primary navigation",bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:"0",style:{width:qo(a),height:"100%"},children:[e.jsxs(f.Box,{onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!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:s,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",transition:"opacity 0.2s",opacity:b?0:1}}),i&&e.jsx(f.Box,{as:"button",onClick:c,"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:b?1:0,pointerEvents:b?"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(p=>e.jsx(Zo,{icon:p.icon,label:p.label,tooltip:p.tooltip,badge:p.badge,showLabel:a,active:p.key===o,onClick:()=>n(p.key)},p.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(p=>e.jsx(Zo,{icon:p.icon,label:p.label,tooltip:p.tooltip,badge:p.badge,showLabel:a,onClick:()=>l(p)},p.key))})]})}function In({items:r,activeKey:t,onSelect:o}){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",style:{overflowX:"auto",scrollbarWidth:"none"},children:r.map(n=>{const l=n.key===t;return e.jsxs(f.Box,{as:"button",role:"tab","aria-selected":l,onClick:()=>o(n.key),direction:"row",align:"center",gap:"spacing-4",paddingInline:"sm",height:"height-32",flexShrink:"0",borderRadius:l?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:l?"white":void 0,hover:l?void 0:{bg:"neutral"},style:{whiteSpace:"nowrap",color:l?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:l?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsx(F.Icon,{name:n.icon,size:"sm"}),e.jsx(S.Text,{as:"span",fontSize:"sm",fontWeight:l?"medium":"normal",style:{color:"inherit"},children:n.label})]},n.key)})})}const zt=(r,t)=>!r.groupIds||r.groupIds.includes(t.id)||t.parentGroupId!==void 0&&r.groupIds.includes(t.parentGroupId);let $r=0,Dr=!1,Go=new Set;const Qo=new Set;function Mn(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 Uo({text:r,textStyle:t,active:o=!1}){const{containerRef:n,textRef:l,truncated:s}=Mn(r,o),i=e.jsx(S.Text,{ref:l,as:"span",fontSize:"md",fontWeight:o?"medium":"normal",truncate:!0,style:{display:"block",...t},children:r});return e.jsx(f.Box,{ref:n,display:"block",style:{flex:1,minWidth:0},children:s?e.jsx(Le.Tooltip,{fluid:!0,label:r,position:"top",children:i}):i})}const Tn=200,Ht="var(--app-header-height, 4rem)",Yo="44px",Pt=`calc((${Ht} - 2rem) / 2)`,Xo=16;function Ln({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:k}){var bt,wr;const{useSearchParams:D,useNavigate:z,useLocation:O,Outlet:A}=tr(),[x]=D(),m=x.get("embed")==="true",I=mt(),{badges:T}=Io(),B=z(),L=O(),V=!Be.useMediaQuery("md"),[H,N]=h.useState(!1),{collapsed:G,setCollapsed:J,width:te,setWidth:K,resetWidth:ue,minWidth:Z,maxWidth:ee,mobileOpen:ie,setMobileOpen:De}=Ao(),[ze,me]=h.useState(!1),[ve,Ce]=h.useState(()=>new Set(Go)),[Ae,Ze]=h.useState(null),{selectedGroupId:Pe,setSelectedGroupId:ce}=Wt(),he=!!(k&&k.items.length>0),pe=G&&!V&&!he,we=G&&!V&&he;h.useEffect(()=>{Go=ve},[ve]);const Ie=h.useRef(null),sr=h.useRef(null),ir=h.useRef(null),[P,$]=h.useState(!1),[Y,fe]=h.useState(null),Ee=C&&!V&&!G,xe=E=>Math.min(Math.max(E,Z),ee),Ve=Y??te,cr=E=>{var Xe,_e,Je;if(!Ee)return;E.preventDefault();const q=E.clientX,X=((Xe=ir.current)==null?void 0:Xe.getBoundingClientRect().width)??te;(Je=(_e=E.currentTarget).setPointerCapture)==null||Je.call(_e,E.pointerId),$(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize";let ne=0,ye=X;const Te=Qe=>{ye=X+(Qe.clientX-q),ne||(ne=requestAnimationFrame(()=>{ne=0,fe(xe(ye))}))},ae=()=>{ne&&cancelAnimationFrame(ne),window.removeEventListener("pointermove",Te),window.removeEventListener("pointerup",ae),document.body.style.userSelect="",document.body.style.cursor="",fe(null),$(!1),ye<Tn?J(!0):K(xe(ye))};window.addEventListener("pointermove",Te),window.addEventListener("pointerup",ae)},Ye=E=>{Ee&&(E.key==="ArrowLeft"?(E.preventDefault(),K(q=>q-Xo)):E.key==="ArrowRight"?(E.preventDefault(),K(q=>q+Xo)):E.key==="Home"?(E.preventDefault(),K(Z)):E.key==="End"&&(E.preventDefault(),K(ee)))};h.useEffect(()=>{const E=Ie.current;if(!E)return;const q=()=>{Dr||($r=E.scrollTop)};return E.addEventListener("scroll",q),()=>E.removeEventListener("scroll",q)},[]);const Me=()=>{const E=Ie.current;E&&$r>0&&(Dr=!0,E.scrollTop=$r,requestAnimationFrame(()=>{Dr=!1}))};h.useLayoutEffect(()=>{Dr=!0,Me();const E=setTimeout(()=>{Dr=!1},300);return()=>clearTimeout(E)},[]),h.useLayoutEffect(()=>{I.menus.length>0&&($r>0?Me():requestAnimationFrame(()=>{var q;const E=(q=Ie.current)==null?void 0:q.querySelector("[data-menu-active='true']");E&&E.scrollIntoView({block:"center",behavior:"instant"})}))},[I.menus]),h.useEffect(()=>{Dr=!0,Me();const E=setTimeout(Me,0),q=setTimeout(Me,50),X=setTimeout(Me,100),ne=setTimeout(Me,200),ye=setTimeout(()=>{Dr=!1},300),Te=setTimeout(()=>{const ae=Ie.current,Xe=ae==null?void 0:ae.querySelector("[data-menu-active='true']");if(ae&&Xe){const _e=ae.getBoundingClientRect(),Je=Xe.getBoundingClientRect();Je.top>=_e.top&&Je.bottom<=_e.bottom||Xe.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(E),clearTimeout(q),clearTimeout(X),clearTimeout(ne),clearTimeout(ye),clearTimeout(Te)}},[L.pathname]),h.useEffect(()=>{sr.current&&(sr.current.scrollTop=0)},[L.pathname]),h.useEffect(()=>{V&&De(!1)},[L.pathname,V]),h.useEffect(()=>{V&&J(!0)},[V]),h.useEffect(()=>{const E=document.documentElement;return E.style.setProperty("--app-header-height",Yo),()=>{E.style.removeProperty("--app-header-height")}},[]);const br=()=>{N(!0)},ur=()=>{N(!1)},Fe=()=>{N(!1),l()},He=E=>{const q=E.slotKey?[]:[E.to];return E.children&&q.push(...E.children.map(X=>X.to)),q},Sr=[...I.menus.flatMap(E=>E.items.flatMap(He)),...((bt=I.menuBottom)==null?void 0:bt.flatMap(He))??[]],ar=E=>{if(!L.pathname.startsWith(E))return!1;const q=Sr.filter(X=>L.pathname.startsWith(X)).sort((X,ne)=>ne.length-X.length)[0];return E===q},vr=h.useRef(k);vr.current=k;const Cr=E=>{const q=vr.current;if(!q||q.items.length===0)return null;const X=q.defaultKey??q.items[0].key,ne=q.items.find(ae=>ae.key===E),ye=I.menus.find(ae=>ae.items.some(Xe=>He(Xe).some(ar)));if(!ye)return ne?ne.key:X;if(ne&&zt(ne,ye))return ne.key;const Te=q.items.find(ae=>ae.groupIds&&zt(ae,ye))??q.items.find(ae=>!ae.groupIds);return(Te==null?void 0:Te.key)??(ne==null?void 0:ne.key)??X},[xr,Ne]=h.useState(()=>Cr(null));h.useEffect(()=>{Ne(E=>Cr(E))},[L.pathname,I.menus]);const Ge=he?k.items.find(E=>E.key===xr)??k.items[0]:void 0,yt=E=>{Ne(E),we&&J(!1)},pt=E=>{E.onClick?E.onClick():E.to&&B(E.to)};h.useEffect(()=>{var q;const E=X=>{var ye;const ne=X.defaultExpanded&&!Qo.has(X.id);ne&&Qo.add(X.id),(ne||(ye=X.children)!=null&&ye.some(Te=>L.pathname.startsWith(Te.to)))&&Ce(Te=>{const ae=new Set(Te);return ae.add(X.id),ae})};I.menus.forEach(X=>{X.items.forEach(E)}),(q=I.menuBottom)==null||q.forEach(E)},[L.pathname,I.menus,I.menuBottom]);const so=E=>{Ce(q=>{const X=new Set(q);return X.has(E)?X.delete(E):X.add(E),X})};h.useEffect(()=>{I.menus.length!==0&&Pe!==null&&!I.menus.some(E=>E.id===Pe)&&ce(null)},[I.menus,Pe,ce]);const io=h.useMemo(()=>{if(Ge!=null&&Ge.groupIds)return I.menus.filter(ye=>zt(Ge,ye));const E=I.menus,q=he?null:Pe;if(q!==null)return E.filter(ye=>ye.id===q||ye.parentGroupId===q);const X=E.filter(ye=>ye.parentGroupId===void 0),ne=E.filter(ye=>ye.parentGroupId!==void 0).flatMap(ye=>ye.items);return ne.length===0?X:[...X,{id:18,name:"Pengaturan",items:ne,parentGroupId:void 0}]},[I.menus,Pe,Ge,he]);if(m)return e.jsx(f.Box,{as:"main",overflow:"overflow-y-auto",bg:"surface-inverse",style:{height:"100vh"},children:r||e.jsx(A,{})});const kr=E=>{const q=E.children&&E.children.length>0,X=!!E.slotKey,ne=q||X,ye=ve.has(E.id),Te=q?E.children.some(_e=>ar(_e.to)):X?!1:ar(E.to),ae=Xr(E.badge,T[E.id]),Xe=!!ae&&pe;return e.jsxs(f.Box,{display:"block","data-menu-active":Te||void 0,children:[e.jsxs(f.Box,{as:"button",onClick:_e=>{if(X&&pe)B(E.to);else if(ne)if(pe){const Je=_e.currentTarget.getBoundingClientRect();Ze({item:E,top:Je.top,left:Je.right+8})}else so(E.id);else B(E.to)},fullWidth:!0,direction:"row",align:"center",justify:pe?"center":void 0,gap:"sm",paddingInline:pe?void 0:"sm",paddingBlock:"xs",height:"height-32",borderRadius:Te?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:Te?"white":void 0,hover:Te?void 0:{bg:"neutral"},title:pe?E.title:void 0,style:{textAlign:"left",color:Te?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:Te?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsxs(f.Box,{position:"relative",display:"inline-flex",flexShrink:"0",style:{alignItems:"center"},children:[e.jsx(F.Icon,{name:E.icon,size:"sm",style:{flexShrink:0}}),Xe&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",style:{boxShadow:"0 0 0 1px var(--sa-background-primary, #ffffff)"},children:e.jsx(rr.BadgeDot,{tone:"error",variant:"solid",size:"xs"})})]}),!pe&&e.jsxs(e.Fragment,{children:[e.jsx(Uo,{text:E.title,active:Te,textStyle:{transition:"opacity 0.3s"}}),ae&&e.jsx(rr.Badge,{text:String(ae.value),variant:ae.variant??"info",size:"xs",border:!0}),ne&&e.jsx(F.Icon,{name:"ChevronDown",size:"sm",style:{flexShrink:0,transition:"transform 0.2s",transform:ye?"rotate(180deg)":"rotate(0deg)"}})]})]}),ne&&!pe&&(()=>{const _e=E.children??[],Je=X?-1:_e.findIndex(er=>ar(er.to)),Qe=_e.map(er=>{const Br=Xr(er.badge,T[er.id]),gr=ar(er.to);return e.jsxs(f.Box,{as:"button",onClick:()=>B(er.to),fullWidth:!0,direction:"row",align:"center",gap:"sm",paddingLeft:"sm",paddingRight:"sm",paddingBlock:"xs",height:"height-32",borderRadius:gr?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:gr?"white":void 0,hover:gr?void 0:{bg:"neutral"},style:{textAlign:"left",color:gr?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:gr?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsx(F.Icon,{name:er.icon,size:"sm",style:{flexShrink:0}}),e.jsx(Uo,{text:er.title,active:gr}),Br&&e.jsx(rr.Badge,{text:String(Br.value),variant:Br.variant??"info",size:"xs",border:!0})]},er.id)});return e.jsxs(f.Box,{position:"relative",overflow:"overflow-hidden",style:{marginLeft:"1rem",paddingLeft:"0.75rem",transition:"all 0.3s ease-in-out",maxHeight:ye?X?"none":`${_e.length*36}px`:"0px",opacity:ye?1:0,marginTop:ye?"0.25rem":"0px"},children:[e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",top:"top-0",fullHeight:!0,style:{width:"1.5px",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),Je>=0&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",height:"height-32",zIndex:"10",style:{top:`${Je*32}px`,width:"1.5px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none"}}),X?e.jsx(At,{slotKey:E.slotKey,fallback:Qe}):Qe]})})()]},E.id)};return e.jsx(jo,{children:e.jsxs(Po,{children:[e.jsxs(f.Box,{direction:"row",position:"relative",style:{height:"100vh","--app-header-height":Yo,"--app-sidebar-width":V?"0px":he?`calc(${qo(k.showLabels??!0)} + ${we?"0px":`${Ve}px`})`:G?Ht:`${Ve}px`,"--app-footer-zindex":V&&ie?"40":"998"},children:[V&&e.jsx(f.Box,{position:"fixed",zIndex:"40",bg:"black-alpha-a50",style:{inset:0,opacity:ie?.5:0,pointerEvents:ie?"auto":"none",transition:"opacity 0.3s"},onClick:()=>De(!1)}),he&&!V&&e.jsx(Fn,{items:k.items,bottomItems:k.bottomItems,activeKey:Ge.key,onSelect:yt,onAction:pt,logo:I.logo,panelCollapsed:we,onExpandPanel:()=>J(!1),showLabels:k.showLabels??!0}),e.jsxs(f.Box,{as:"aside",ref:ir,"aria-hidden":we||void 0,bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:V?void 0:"0",style:{width:V?"16.375rem":we?"0px":G?Ht:`${Ve}px`,...we&&{borderRightWidth:0,overflow:"hidden",visibility:"hidden"},position:V?"fixed":"relative",...V&&{inset:0,zIndex:50,transform:ie?"translateX(0)":"translateX(-100%)"},transition:P?"none":"all 0.3s ease-in-out",minWidth:0},children:[e.jsx(f.Box,{onMouseEnter:()=>me(!0),onMouseLeave:()=>me(!1),direction:"row",align:"center",justify:"space-between",paddingInline:pe?void 0:"lg",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",position:"relative",style:{height:"var(--app-header-height, 4rem)",...pe?{paddingInline:Pt}:null},children:(()=>{const E=he&&!V,q=Ge!=null&&Ge.groupIds?Ge.tooltip??Ge.label:I.appName,X=!V&&G&&!ie&&!he,ne=X&&ze;return e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flex:X?"1":void 0,justify:X?"center":void 0,style:{transition:"opacity 0.2s",opacity:ne?0:1,pointerEvents:ne?"none":"auto"},children:[!E&&e.jsx("img",{src:I.logo,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",flexShrink:0}}),(!G||ie)&&e.jsx(S.Text,{as:"span",fontSize:"md",fontWeight:"semibold",color:"primary",truncate:!0,style:{transition:"opacity 0.3s"},children:E?q:I.appName})]}),!V&&!G&&e.jsx(f.Box,{as:"button",onClick:()=>J(!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"})}),X&&e.jsx(f.Box,{as:"button",onClick:()=>J(!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:ne?1:0,pointerEvents:ne?"auto":"none",transition:"opacity 0.2s"},children:e.jsx(F.Icon,{name:"LayoutLeft",size:"sm"})}),V&&e.jsx(f.Box,{as:"button",onClick:()=>De(!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(Ho,{collapsed:V||he?!1:G,children:c}),he&&V&&e.jsx(In,{items:k.items,activeKey:Ge.key,onSelect:yt}),e.jsx(f.Box,{ref:Ie,flex:"1",overflow:"overflow-y-auto",paddingBlock:"lg",children:io.map(E=>e.jsxs(f.Box,{marginBottom:"lg",children:[pe?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(S.Text,{fontSize:"sm",fontWeight:"semibold",color:"subtlest",textTransform:"uppercase",truncate:!0,style:{letterSpacing:"0.06em",paddingLeft:"1.25rem",paddingRight:"0.75rem",paddingBottom:"0.25rem",transition:"opacity 0.3s"},children:E.name}),e.jsx(f.Box,{paddingInline:pe?void 0:"md",gap:"xs",style:pe?{paddingInline:Pt}:void 0,children:E.slotKey?e.jsx(At,{slotKey:E.slotKey,fallback:E.items.map(q=>kr(q))}):E.items.map(q=>kr(q))})]},E.id))}),I.menuBottom&&I.menuBottom.length>0&&e.jsx(f.Box,{borderWidth:"border-t",borderStyle:"border-solid-t",borderColor:"border-base",paddingBlock:"md",paddingInline:pe?void 0:"md",bg:"surface-inverse",gap:"xs",flexShrink:"0",style:pe?{paddingInline:Pt}:void 0,children:I.menuBottom.map(E=>kr(E))}),Ee&&e.jsx(f.Box,{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":te,"aria-valuemin":Z,"aria-valuemax":ee,tabIndex:0,onPointerDown:cr,onKeyDown:Ye,onDoubleClick:ue,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:P?"var(--sa-background-brand, #04254f)":"transparent",transition:"background 0.15s"},onMouseEnter:E=>{P||(E.currentTarget.style.background="var(--sa-border-bold, #0b120e40)")},onMouseLeave:E=>{P||(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:V?"lg":void 0,children:[V&&e.jsx(f.Box,{as:"button",onClick:()=>De(!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(Vo,{children:t})]}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"md",children:[a,e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",cursor:"pointer",children:[!V&&e.jsxs(f.Box,{display:"block",textAlign:"right",customMaxWidth:"12.5rem",children:[e.jsx(S.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(S.Text,{fontSize:"sm",color:"subtle",textAlign:"right",truncate:!0,children:n?"":(o==null?void 0:o.email)||"unknown"})]}),e.jsx(Qr.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(W.MenuLists,{width:280,style:{paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(W.MenuHeading,{children:e.jsxs(f.Box,{align:"center",textAlign:"center",paddingBlock:"sm",fullWidth:!0,children:[e.jsx(Qr.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(S.Text,{fontSize:"md",fontWeight:"semibold",color:"primary",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.name)||"unknown"}),e.jsx(S.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.email)||"unknown"}),d&&e.jsx(S.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:d})]})}),(g&&g.length>0||b)&&e.jsxs(W.MenuBody,{children:[g==null?void 0:g.map((E,q)=>e.jsx(W.MenuItem,{onClick:E.onClick,startIcon:e.jsx(F.Icon,{name:E.icon,size:"md"}),children:E.label},`${E.label}-${q}`)),b]}),p??e.jsx(W.MenuFooter,{children:e.jsx(W.MenuItem,{intent:"danger",onClick:br,startIcon:e.jsx(F.Icon,{name:"Logout",size:"md"}),children:"Logout"})})]})]})]})]}),e.jsx(f.Box,{as:"main",ref:sr,flex:"1",overflow:"overflow-y-auto",children:r||e.jsx(A,{})})]})]}),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:H,onHide:ur,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(j.Button,{secondary:!0,onClick:ur,children:"Cancel"})}),e.jsx(f.Box,{direction:"column",children:e.jsx(j.Button,{primary:!0,onClick:Fe,children:"Yes, Sure"})})]})})})]}),Ae&&e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{onClick:()=>Ze(null),position:"fixed",style:{inset:0,zIndex:60}}),e.jsxs(f.Box,{role:"dialog","aria-label":Ae.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:Ae.top,left:Ae.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem"},children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-500",textTransform:"uppercase",style:{padding:"0.25rem 0.5rem 0.5rem",letterSpacing:"0.05em"},children:Ae.item.title}),(wr=Ae.item.children)==null?void 0:wr.map(E=>{const q=ar(E.to),X=Xr(E.badge,T[E.id]);return e.jsxs(f.Box,{as:"button",onClick:()=>{B(E.to),Ze(null)},fullWidth:!0,direction:"row",align:"center",gap:"md",paddingBlock:"sm",paddingInline:"md",borderRadius:"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:q?"primary-inverse":void 0,hover:q?void 0:{bg:"primary-inverse"},style:{textAlign:"left",borderColor:"transparent",color:q?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)"},children:[E.icon&&e.jsx(F.Icon,{name:E.icon,size:"sm",style:{flexShrink:0}}),e.jsx(S.Text,{as:"span",fontSize:"md",fontWeight:q?"medium":"normal",whiteSpace:"nowrap",style:{flex:1},children:E.title}),X&&e.jsx(rr.Badge,{text:String(X.value),variant:X.variant??"info",size:"xs",border:!0})]},E.id)})]})]})]})})}const Pr=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})),Jo=({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(S.Text,{variant:"sub-h3",style:{color:i?b:d,transition:"color 0.15s ease"},children:r||"Back"})]})},An=({items:r,separator:t="/",iconName:o,iconColor:n,hoverIconColor:l})=>{const{Link:s}=tr(),[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(Pr,{onClick:g.onClick,children:p}):p;return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",children:[C,e.jsx(Er.Breadcrumb,{separator:t,size:"md",children:r.map((k,D)=>{const z=D===r.length-1;return k.to&&!z?e.jsx(Er.BreadcrumbItem,{children:e.jsx(s,{to:k.to,children:k.label})},D):e.jsx(Er.BreadcrumbItem,{currentPage:z,children:e.jsx(Er.BreadcrumbLink,{onClick:z?void 0:k.onClick,children:k.label})},D)})})]})},On=r=>{const{Link:t}=tr(),{items:o,separator:n,onClick:l,navigateTo:s,...i}=r;return o&&o.length>0?e.jsx(An,{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(Jo,{...i})})}):e.jsx(f.Box,{direction:"row",children:e.jsx(Pr,{onClick:l,children:e.jsx(Jo,{...i})})})},Vt=[{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 $o(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 Ko={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-text-primary, #292a2e)",lineHeight:"1.3",maxWidth:"80px"},Ro={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function el({isShow:r,onHide:t,menus:o,selectedGroupId:n,onSelect:l}){const[s,i]=h.useState(void 0),c=d=>{l(d),t()},a=Vt[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:Ro,children:[e.jsx("div",{style:$o(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:Ko,children:"Semua"})]}),o.map((d,g)=>{var D;const b=n===d.id,p=s===d.id,C=((D=d.items[0])==null?void 0:D.icon)??"Grid",k=Vt[(g+1)%Vt.length];return e.jsxs("button",{onClick:()=>c(d.id),onMouseEnter:()=>i(d.id),onMouseLeave:()=>i(void 0),style:Ro,children:[e.jsx("div",{style:$o(b,p,k),children:e.jsx("div",{style:{color:k.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:Ko,children:d.name})]},d.id)})]})})})}function Wn({onSelect:r,"aria-label":t="Pilih module"}={}){const o=mt(),{useNavigate:n}=tr(),l=n(),{selectedGroupId:s,setSelectedGroupId:i}=Wt(),[c,a]=h.useState(!1),d=g=>{var b;if(i(g),g!==null){const p=o.menus.find(k=>k.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(el,{isShow:c,onHide:()=>a(!1),menus:o.menus.filter(g=>g.parentGroupId===void 0),selectedGroupId:s,onSelect:d})]})}const zn=(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},Hn=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(S.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(S.Text,{color:"primary",fontWeight:"medium",children:r}):r,g=()=>typeof o=="string"||typeof o=="number"?e.jsx(S.Text,{fontWeight:"medium",color:"subtlest",children:o}):o;return e.jsxs(Q.Tr,{children:[e.jsx(Q.Td,{style:i,width:n,children:a()}),o?e.jsx(Q.Td,{style:c,width:24,children:g()}):null,e.jsx(Q.Td,{style:i,children:d()})]})}),Pn=h.memo(({fields:r,separator:t,labelWidth:o})=>e.jsx(Q.Table,{withColumnBorder:!1,withRowBorder:!1,children:r.map((n,l)=>e.jsx(Hn,{separator:t,labelWidth:o,lastIndex:l===r.length-1,...n},`field-group-field-${l}`))})),Vn=h.memo(({maxRow:r=0,maxColumn:t=2,separator:o=":",fields:n=[],labelWidth:l=150,bordered:s=!1})=>{const i=h.useMemo(()=>zn(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(Pn,{labelWidth:l,fields:d,separator:o})},g))})}),jn=({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(S.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"})]})},rl=({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:k})=>{const D=Be.useMediaQuery("md"),{Link:z,useNavigate:O}=tr(),A=O(),x=r==null?void 0:r.show,m=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}A(-1,{replace:!0})},I=()=>{if(!b)return null;if(h.isValidElement(b))return b;const H=b.filter(N=>N&&(N.title||N.icon));return H.length===0?null:D?e.jsx(f.Box,{direction:"row",gap:"md",children:H.map(({title:N,icon:G,buttonProps:J,onClick:te},K)=>e.jsx(j.Button,{iconLeft:G?e.jsx(F.Icon,{name:G,size:"md"}):void 0,onClick:te,...J,children:N},`action-${K}`))}):e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{minWidth:200},children:H.map(({title:N,icon:G,buttonProps:J,onClick:te},K)=>{const ue=(J==null?void 0:J.tone)==="error"||(J==null?void 0:J.danger)===!0;return e.jsx(W.MenuItem,{intent:ue?"danger":void 0,disabled:J==null?void 0:J.disabled,startIcon:G?e.jsx(F.Icon,{name:G}):void 0,onClick:te,children:N},`action-${K}`)})})})]})},T=()=>{const H=e.jsx(jn,{backButton:r});return r!=null&&r.navigateTo?e.jsx(f.Box,{direction:"row",children:e.jsx(z,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:H})}):e.jsx(f.Box,{direction:"row",children:e.jsx(Pr,{onClick:m,children:H})})},B=()=>{const H=!!t,N=Array.isArray(b)&&b.length>0,G=h.isValidElement(b)?!0:N;if(!H&&!G&&!x)return null;const te=D||!D&&N;return e.jsxs(f.Box,{direction:"column",gap:"xs",paddingBlock:(k==null?void 0:k.paddingBlock)??"sm",paddingInline:(k==null?void 0:k.paddingInline)??"md",...k,style:{...i?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...k==null?void 0:k.style},children:[x&&T(),(H||G)&&e.jsxs(f.Box,{direction:te?"row":"column",gap:"sm",justify:"space-between",align:te?"center":"flex-start",children:[H?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(S.Text,{variant:"h3",fontWeight:"semibold",children:t})]}),n&&e.jsx(rr.Badge,{border:!0,size:"lg",text:n,...p})]}):t:null,I()]})]})},L=()=>{if(!g||g.length===0)return null;const H=g.filter(J=>J.show!==!1);if(H.length===0)return null;let N=0,G=-1/0;return H.forEach((J,te)=>{const K=J.order??0;K>=G&&(G=K,N=te)}),H.map(({content:J,order:te,borderBottom:K=!0,keepBottomPadding:ue=!1,paddingInline:Z=!0,paddingBlock:ee=!0},ie)=>e.jsx(f.Box,{direction:"column",paddingTop:ee?"sm":"spacing-0",paddingBottom:ee&&(K||ue||ie===N)?"sm":"spacing-0",paddingInline:Z?"md":"spacing-0",style:{...K?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...te!==void 0?{order:te}:{}},children:J},`sub-header-${ie}`))},U=()=>{const H=s?B():null,N=L();return!H&&!N?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:N?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[H,N]})},V=()=>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:[U(),V()]})},Nn=r=>{const{useLocation:t}=tr(),o=t();return e.jsx(rl,{...r},o.pathname)},_n=r=>r.remountOnRouteChange?e.jsx(Nn,{...r}):e.jsx(rl,{...r}),qn=h.memo(_n),Zn={icon:"Cross",title:""},Gn=320,tl=16,ol=4,Qn=8,ll=h.forwardRef(({onHide:r,show:t,withBlur:o=!1,style:n,children:l,closeButton:s=Zn,paddingHorizontal:i=!0,width:c,minWidth:a,maxWidth:d,hideBackdrop:g=!1,title:b,headerAction:p,header:C=!0,widthPresets:k,resizable:D=!0,resizeMin:z=Gn,resizeMax:O,onWidthChange:A},x)=>{const I=!Be.useMediaQuery("md"),T=c??d??a??"357px",B=k??[],L=B.length>1,[U,V]=h.useState(()=>{const ce=B.indexOf(T);return ce>=0?ce:0}),[H,N]=h.useState(null),[G,J]=h.useState(!1),[te,K]=h.useState(!1),ue=h.useRef(null),Z=ce=>{ue.current=ce,typeof x=="function"?x(ce):x&&(x.current=ce)},ee=L?B[U]:T,ie=H!=null?`${H}px`:ee,De=D&&!I,ze=U===B.length-1,me=()=>{const ce=(U+1)%B.length;N(null),V(ce),A==null||A(B[ce])},ve=h.useCallback(ce=>{const he=O??window.innerWidth;return Math.min(Math.max(ce,z),he)},[z,O]),Ce=h.useRef(null),Ae=ce=>{if(!De)return;ce.preventDefault();const he=ce.currentTarget;he.setPointerCapture(ce.pointerId),J(!0);const pe=document.body.style.cursor,we=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let Ie=null;const sr=P=>{const $=ve(window.innerWidth-P.clientX);Ce.current=$,Ie==null&&(Ie=window.requestAnimationFrame(()=>{Ie=null,Ce.current!=null&&N(Ce.current)}))},ir=P=>{Ie!=null&&window.cancelAnimationFrame(Ie),Ce.current!=null&&N(Ce.current),he.releasePointerCapture(P.pointerId),he.removeEventListener("pointermove",sr),he.removeEventListener("pointerup",ir),he.removeEventListener("pointercancel",ir),document.body.style.cursor=pe,document.body.style.userSelect=we,J(!1),Ce.current!=null&&(A==null||A(`${Ce.current}px`))};he.addEventListener("pointermove",sr),he.addEventListener("pointerup",ir),he.addEventListener("pointercancel",ir)},Ze=ce=>{var Ie;if(!De||ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;ce.preventDefault();const he=ce.key==="ArrowLeft"?tl:-tl,pe=H??((Ie=ue.current)==null?void 0:Ie.offsetWidth)??z,we=ve(pe+he);N(we),A==null||A(`${we}px`)},Pe=()=>{De&&(N(null),A==null||A(ee))};return e.jsx(Ur.Drawer,{blur:o,isShow:t,position:"right",onHide:r,ref:Z,size:ie,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:Ae,onKeyDown:Ze,onDoubleClick:Pe,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:Qn,cursor:"col-resize",zIndex:1,background:G||te?`linear-gradient(to right, var(--sa-border-brand, var(--sa-border-subtle)) 0 ${ol}px, transparent ${ol}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(S.Text,{fontSize:"md",fontWeight:"bold",children:b}):b}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[p,L?e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:me,"aria-label":ze?"Kecilkan panel":"Lebarkan panel",iconRight:e.jsx(F.Icon,{name:ze?"ChevronRight":"ChevronLeft"})}):null,s?e.jsx(j.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})]})})}),jt=h.memo(({children:r,borderBottom:t=!0,padding:o=!0})=>{const n=Be.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})}),Nt=h.memo(({children:r,borderTop:t=!0,padding:o=!0})=>{const n=Be.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})}),Un=h.memo(({children:r,...t})=>e.jsx(f.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),Yn=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=Be.useMediaQuery("lg"),C=()=>o?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(S.Text,{fontWeight:"medium",children:t}),e.jsx(rr.Badges,{border:!0,text:o,variant:b})]}):e.jsx(S.Text,{fontWeight:"medium",children:t}),k=()=>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})]}),D=!!(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&&D?e.jsx(jt,{...d,children:k()}):null,e.jsx(Un,{...a,children:r}),s?e.jsx(Nt,{...g,children:s}):null]})}),Re={H1:r=>e.jsx(S.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(S.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(S.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(S.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(S.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(S.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(S.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(S.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(S.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(S.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(S.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(S.Text,{variant:"body-3",children:r.children,...r.props})},qe=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=tr(),[n,l]=r(),s=Ir.searchParamsToObject(n.toString()),i=t(),c=o(),a=i.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,k)=>n.has(C)&&n.get(C)===k,getQueryParam:C=>n.get(C),getRouteParam:C=>i[C],params:i,location:c,id:a,hasId:!!a}},nl=r=>JSON.stringify(r),sl=r=>JSON.stringify(r),il=r=>JSON.stringify(r),cl=r=>JSON.stringify(r),Xn=r=>r,Jn=r=>JSON.stringify(r),or=r=>{if(typeof r!="string"||r==="")return{};try{const t=JSON.parse(r);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}},lr=r=>{if(!(typeof r!="string"||r===""))try{return JSON.parse(r)}catch{return}},Vr=({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=Xn(r);break;case"dropdown":case"dropdown-multiple":d=nl(r);break;case"radio":d=sl(r);break;case"date-range":d=il(r);break;case"advanced-date-range":d=Jn(r);break;case"date":d=cl(r);break;default:d=r;break}if(typeof d<"u"){const g={...or(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(),k=new URLSearchParams(p).toString();if(C===k)return;l(p)}}},Kr=({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"?or(l):void 0,i=s?s[r]:void 0;return n==="label"&&i?(a=(c=lr(i))==null?void 0:c[0])==null?void 0:a.label:n==="value"&&i?(g=(d=lr(i))==null?void 0:d[0])==null?void 0:g.value:i},al=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{var c,a;const l=o.get(t)||void 0,s=l&&typeof l=="string"?or(l):void 0,i=s?s[r]:void 0;return n==="label"&&i?(c=lr(i))==null?void 0:c.map(d=>d.label):n==="value"&&i?(a=lr(i))==null?void 0:a.map(d=>d.value):n==="array"&&i?lr(i):i},$n=({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"?or(l):void 0,i=s?s[r]:void 0;return n==="id"&&i?(c=lr(i))==null?void 0:c.id:n==="label"&&i?(a=lr(i))==null?void 0:a.label:n==="value"&&i?(d=lr(i))==null?void 0:d.value:i},Rr=(r,t,o)=>{const n=t.get(o||"filter")||void 0,l=n&&typeof n=="string"?or(n):void 0;return l?l[r]:void 0},Kn=({name:r,filterKey:t="filter",searchParams:o})=>{var i,c;const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?or(n):void 0,s=l?l[r]:void 0;return{start:s?(i=lr(s))==null?void 0:i.from:void 0,end:s?(c=lr(s))==null?void 0:c.to:void 0}},dl=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?or(n):void 0,s=l?l[r]:void 0;return s?lr(s):void 0},Rn=(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},hl=({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:k=!0}=p;return k&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}case"dropdown":{const{show:k=!0}=p;return k&&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:k=!0}=p;return k&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}default:return null}};return e.jsx(ll,{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))]})})},fl=({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:k="Work Order",withTitleLabels:D=!1})=>{const O=(p==null?void 0:p.isShowLabel)??!0,[A,x]=h.useState(!1),[m,I]=h.useState(0),T=()=>{I(Z=>Z+1)},{searchParams:B,setSearchParams:L,getQueryParam:U}=qe(),V=Ir.searchParamsToObject(B.toString()),H=Rr(r,B,c)||"",[N,G]=h.useState(H),J=U(c),K=!!(J&&!(()=>{if(J)try{const Z=JSON.parse(J);return Object.keys(Z).length===1&&Z[r]===""}catch(Z){console.error("Filter parameter is not a valid JSON:",Z)}return!1})()),ue=Be.useMediaQuery("md");return h.useEffect(()=>{G(H)},[H]),h.useEffect(()=>{if(N===H)return;const Z=window.setTimeout(()=>{Vr({value:N,name:r,type:"search",searchQueries:V,setSearchParams:L,filterKey:c,pageKey:a})},350);return()=>{window.clearTimeout(Z)}},[N,H,r,V,L,c,a]),e.jsxs(de.Flex,{gap:"md",style:{flexDirection:ue&&C==="left"?"row":ue&&C==="right"?"row-reverse":"column"},align:"flex-end",children:[K&&e.jsx(f.Box,{direction:"column",justify:"flex-end",children:e.jsx(j.Button,{onClick:()=>{const Z=new URLSearchParams(B);Z.delete(c),L(Z),G(""),T(),g&&g()},variant:"outline",tone:"neutral",children:e.jsx(S.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),l==null?void 0:l.map(({minWidth:Z,content:ee,title:ie,onClickContainer:De},ze)=>e.jsxs(f.Box,{direction:"column",gap:"sm",onClick:De,style:{minWidth:Z},children:[ie&&e.jsx(Re.SubH3,{children:ie}),ee]},`extended-filter-${ze}-${m}`)),!!(b!=null&&b.length)&&e.jsx(j.Button,{primary:K,secondary:!K,iconLeft:e.jsx(F.Icon,{size:"sm",name:(p==null?void 0:p.icon)||"FilterHorizontal",style:{color:J?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!ue,onClick:()=>x(!0),children:O?"Filter":void 0}),i&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[D&&e.jsx(Re.SubH3,{children:"Status"}),e.jsx(Fr.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Kr({get:"value",name:t,searchParams:B,filterKey:c})?[{label:Kr({get:"value",name:t,searchParams:B,filterKey:c})==="active"?"Active":"InActive",value:Kr({get:"value",name:t,searchParams:B,filterKey:c})}]:[],onChange:Z=>Vr({value:Z,name:t,type:"dropdown",searchQueries:V,setSearchParams:L,filterKey:c}),placeholder:D?"All":"All Status"},m)]}),s&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{width:d&&ue?d:ue?"310px":""},children:[D&&e.jsxs(Re.SubH3,{children:["Search for ",k]}),e.jsx(hr.Input,{placeholder:o,leftIcon:e.jsx(F.Icon,{name:"Search",width:20,height:20}),onChange:Z=>G(Z.target.value),value:N,fullWidth:!0},m+1+c)]}),e.jsx(hl,{isOpen:A,onClose:()=>x(!1),filterKey:c,filters:b,pageKey:a})]})},es=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r==="text"?"search":r;function _t({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(m=>[m.key,m])),[r]),d=h.useMemo(()=>{const m=(s.get(o)||"").split(",").map(T=>T.trim()).filter(Boolean),I=Object.keys(or(s.get(t))).filter(T=>T!==l);return r.map(T=>T.key).filter(T=>{const B=a[T];return(B==null?void 0:B.locked)||m.includes(T)||I.includes(T)})},[s,o,t,l,r,a]),g=h.useCallback(m=>or(m[t]),[t]),b=h.useCallback(m=>{const I={...c};m.length?I[o]=m.join(","):delete I[o],i(I)},[c,o,i]),p=h.useCallback(m=>{d.includes(m)||b([...d,m])},[d,b]),C=h.useCallback(m=>{var L;if((L=a[m])!=null&&L.locked)return;const I={...c},T=d.filter(U=>U!==m);T.length?I[o]=T.join(","):delete I[o];const B=g(I);m in B&&(delete B[m],Object.keys(B).length?I[t]=JSON.stringify(B):delete I[t]),delete I[n],i(I)},[c,d,o,t,n,g,i,a]),k=h.useCallback(m=>d.includes(m)?C(m):p(m),[d,p,C]),D=h.useCallback(m=>{switch(m.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return al({name:m.key,get:"array",searchParams:s,filterKey:t})||[];case"date":{const I=dl({name:m.key,searchParams:s,filterKey:t});return I?new Date(I):void 0}case"date-compact":{const T=g(Object.fromEntries(s.entries()))[m.key];return T&&typeof T=="object"?T:void 0}case"text":{const T=g(Object.fromEntries(s.entries()))[m.key];return typeof T=="string"?T:void 0}default:return}},[s,t,g]),z=h.useCallback((m,I)=>{if(m.type==="date-compact"||m.type==="text"){const T={...c},B=g(T);I==null||I===""?delete B[m.key]:B[m.key]=I,Object.keys(B).length?T[t]=JSON.stringify(B):delete T[t],delete T[n],i(T);return}Vr({value:I,name:m.key,type:es(m.type),searchQueries:c,setSearchParams:i,filterKey:t,pageKey:n})},[c,i,t,n,g]),O=h.useCallback(m=>{const I={...c},T=g(I);m in T&&(delete T[m],Object.keys(T).length?I[t]=JSON.stringify(T):delete I[t]),delete I[n],i(I)},[c,t,n,g,i]),A=h.useCallback(()=>{const m={...c};delete m[t],delete m[o],delete m[n],i(m)},[c,t,o,n,i]),x=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:x,addFilter:p,removeFilter:C,toggleFilter:k,getValue:D,setValue:z,clearValue:O,clearAll:A}}const qt={get(r){return Hr.storage.get(r)??null},set(r,t){Hr.storage.save(r,t)},remove(r){Hr.storage.delete(r)}},Lr={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}`},et=(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 rs({columns:r,scopeId:t,storage:o,onColumnsChange:n,value:l}){const s=h.useMemo(()=>({order:r.map(B=>B.key),hidden:[]}),[r]),i=t?Lr.columns(t):void 0,c=(B,L)=>et({order:B.order??L,hidden:B.hidden??[]},r),[a,d]=h.useState(()=>{if(l&&(l.order||l.hidden))return c(l,r.map(B=>B.key));if(i){const B=o.get(i);if(B&&Array.isArray(B.order))return et(B,r)}return s}),g=r.map(B=>B.key).join("|");h.useEffect(()=>d(B=>et(B,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 B=b.current,L=c(l,B.order);L.order.join("|")===B.order.join("|")&&L.hidden.join("|")===B.hidden.join("|")||(d(L),i&&o.set(i,L))},[p,g]);const k=h.useRef(!1);h.useEffect(()=>{k.current||(k.current=!0,n==null||n(a))},[]);const D=h.useCallback(B=>{d(B),i&&o.set(i,B),n==null||n(B)},[i,o,n]),z=h.useMemo(()=>{const B=new Map(r.map(L=>[L.key,L]));return a.order.filter(L=>B.has(L)).map(L=>({...B.get(L),visible:!a.hidden.includes(L)}))},[a,r]),O=h.useCallback(B=>{const L=a.hidden.includes(B)?a.hidden.filter(U=>U!==B):[...a.hidden,B];D({...a,hidden:L})},[a,D]),A=h.useCallback((B,L)=>{if(B===L)return;const U=[...a.order],[V]=U.splice(B,1);U.splice(L,0,V),D({...a,order:U})},[a,D]),x=h.useCallback(B=>{D({...a,hidden:B?r.filter(L=>!L.locked).map(L=>L.key):[]})},[a,r,D]),m=h.useCallback(()=>D(s),[D,s]),I=h.useCallback(B=>D(et(B,r)),[D,r]),T=a.hidden.length===0;return{state:a,orderedColumns:z,allVisible:T,toggleVisibility:O,reorder:A,setAllHidden:x,reset:m,applyState:I}}function ts({scopeId:r,storage:t,snapshotKeys:o,pageKey:n="page",getColumns:l,applyColumns:s}){const{searchParams:i,setSearchParams:c}=qe(),a=r?Lr.savedViews(r):void 0,[d,g]=h.useState(()=>a?t.get(a)||[]:[]),b=h.useCallback(D=>{g(D),a&&t.set(a,D)},[a]),p=h.useCallback(D=>{const z=D.trim();if(!z)return;const O={};o.forEach(x=>{const m=i.get(x);m!=null&&(O[x]=m)});const A={id:`${Date.now()}`,name:z,query:O,columns:l==null?void 0:l(),createdAt:Date.now()};b([...d,A])},[o,i,l,b,d]),C=h.useCallback(D=>b(d.filter(z=>z.id!==D)),[b,d]),k=h.useCallback(D=>{const z=Object.fromEntries(i.entries());o.forEach(O=>delete z[O]),Object.assign(z,D.query),delete z[n],c(z),D.columns&&(s==null||s(D.columns))},[i,o,n,c,s]);return{enabled:!!a,views:d,saveView:p,deleteView:C,applyView:k}}function os(r,t){const o=or(r);return delete o[t],Object.keys(o).length>0?JSON.stringify(o):void 0}function ul(r,t,o){const n=r[t];if(n==null)return;const l=os(n,o);l===void 0?delete r[t]:r[t]=l}function ls({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?Lr.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(k=>{const D=c.get(k);D!=null&&(C[k]=D)}),i||ul(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 k=C[l];return k!=null&&Object.keys(or(k)).length===0&&delete C[l],i||ul(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 ns({scopeId:r,storage:t,perPageKey:o,pageSizeOptions:n,enabled:l=!0}){const{searchParams:s}=qe(),i=r&&l?Lr.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 Zt={},Gt=!1,Qt=null;const ss=(r,t)=>{Object.assign(Zt,r),Qt=t,!Gt&&(Gt=!0,queueMicrotask(()=>{const o=Zt,n=Qt;Zt={},Gt=!1,Qt=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 is({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&&ss(d,i)},[c.pathname,r])}const cs=({configs:r,activeKeys:t,onToggle:o,hasActiveFilter:n,onReset:l})=>r.length?e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{minWidth:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&l&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"xs",onClick:l,children:"Reset"})]}),children:r.map(s=>e.jsx(W.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,jr=({onClear:r,onRemove:t})=>e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(F.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(W.MenuLists,{children:e.jsxs(W.MenuBody,{style:{width:180},children:[e.jsx(W.MenuItem,{startIcon:e.jsx(F.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(W.MenuItem,{intent:"danger",startIcon:e.jsx(F.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),as=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},gl=(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},yl=r=>{const t=as(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:gl(t,-o,r.period),to:t}:{from:t,to:gl(t,o,r.period)}},pl=24,bl=r=>r.length>pl?`${r.slice(0,pl)}...`:r,vl=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Ut=(r,t="days")=>t==="months"?r.toLocaleDateString(void 0,{month:"short",year:"numeric"}):t==="years"?String(r.getFullYear()):vl(r),rt={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"},Cl=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],Yt={past:"Past",next:"Next",this:"This"},ds=["day","week","month","year"],hs=["past","next","this"],fs=r=>r.field.type==="date-compact"?e.jsx(ys,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(us,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),us=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=t?vl(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:bl(s)})]}):r.label;return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.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(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(jr,{onClear:n,onRemove:l})]}),children:e.jsx(pr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():o(a),withPadding:!1})})})]})},gs=(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?`${rt[r.op]} ${Ut(new Date(r.date),t)}`:null;case"is-between":return r.from&&r.to?`${Ut(new Date(r.from),t)} - ${Ut(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`${Yt[o.direction]} ${n} ${l}`}case"is-empty":case"is-not-empty":return rt[r.op];default:return null}},ys=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.ops&&r.ops.length>0?r.ops:Cl,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?gs(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:bl(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(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.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(W.MenuLists,{children:[e.jsx(W.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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(xl,{op:a,ops:s,onChange:p})]}),e.jsx(jr,{onClear:n,onRemove:l})]}),children:e.jsx(wl,{value:t,op:a,mode:c,onChange:o})}),a==="is-relative-to-today"&&e.jsx(W.MenuFooter,{children:e.jsx(S.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},xl=({op:r,ops:t,onChange:o})=>e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:rt[r]})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:200},children:t.map(n=>e.jsx(W.MenuItem,{selected:r===n,onClick:()=>o(n),endIcon:r===n?e.jsx(F.Icon,{name:"Check"}):void 0,children:rt[n]},n))})})]}),wl=({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(S.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(pr.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(ps,{value:r==null?void 0:r.relative,onChange:l=>n({op:t,relative:l})}):e.jsx(pr.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}`)},ps=({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=yl({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(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:Yt[o]})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:140},children:hs.map(c=>e.jsx(W.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:Yt[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(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:140},children:ds.map(c=>e.jsx(W.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(pr.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:i,onChange:()=>{},withPadding:!1},"relative-preview")]})},Dl=18,bs=r=>r.length>Dl?`${r.slice(0,Dl)}...`:r,vs=({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 O=a.trim().toLowerCase();return O?g.filter(A=>A.label.toLowerCase().includes(O)):g})(),C=O=>t.some(A=>A.value===O.value),k=O=>{if(!s){o([{label:O.label,value:O.value}]),d("");return}o(C(O)?t.filter(A=>A.value!==O.value):[...t,{label:O.label,value:O.value}])},D=O=>{var A;d(O),(A=r.onSearch)==null||A.call(r,O)},z=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?bs(t[0].label):`${i} Selected`})]});return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.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:z})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(jr,{onClear:n,onRemove:l})]}),children:e.jsxs(f.Box,{direction:"column",gap:"sm",children:[c&&e.jsx(Fr.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:s,searchAble:!0,searchValue:a,onSearch:D,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(S.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(S.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(O=>e.jsx(W.MenuItem,{closeOnSelect:!s,selected:C(O),startIcon:O.avatar,endIcon:C(O)?e.jsx(F.Icon,{name:"Check"}):void 0,description:O.description,onClick:()=>k(O),children:O.label},O.value))})]})})})]})},Sl=18,Cs=r=>r.length>Sl?`${r.slice(0,Sl)}...`:r,kl=({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"})}),xs=({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(S.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(S.Text,{as:"span",children:i===1?Cs(t[0].label):`${i} Selected`})]});return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.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(W.MenuLists,{children:e.jsxs(W.MenuBody,{style:{width:240},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(jr,{onClear:n,onRemove:l})]}),children:[e.jsx(W.MenuItem,{closeOnSelect:!1,selected:c,onClick:g,startIcon:e.jsx(kl,{checked:c||a,indeterminate:a}),children:"Select All"}),r.options.map(p=>e.jsx(W.MenuItem,{closeOnSelect:!1,selected:s.has(p.value),onClick:()=>d(p),startIcon:e.jsx(kl,{checked:s.has(p.value)}),children:p.label},p.value))]})})]})},Bl=18,ws=r=>r.length>Bl?`${r.slice(0,Bl)}...`:r,Ds=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const[s,i]=h.useState(t??""),c=Be.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:ws(t)})]}):r.label;return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.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(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(jr,{onClear:n,onRemove:l})]}),children:e.jsx(hr.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)})})})]})},ml=({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(Ds,{field:c,value:a||"",onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i):c.type==="checkbox-multiple"?e.jsx(xs,{field:c,value:a||[],onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i):e.jsx(vs,{field:c,value:a||[],onChange:g=>n(c,g),onClear:()=>l(i),onRemove:d},i)})}),El=r=>`${r} Rows`,Ss=({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 O;const{searchQueries:a,setSearchParams:d,searchParams:g}=qe(),b=g.get(o),p=b?Number(b):l,C=A=>{d({...a,[t]:String(A)})},k=A=>{d({...a,[o]:A,[t]:"1"})},D=(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),z=(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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${D}-${z} of ${((O=r==null?void 0:r.totalData)==null?void 0:O.toLocaleString())||0}`}),i&&e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:El(p)})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{children:n.map(A=>e.jsx(W.MenuItem,{selected:A===p,onClick:()=>k(String(A)),children:El(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(zr.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 ks(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 Bs=240,Fl=({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=Rr(r,i,t)||"",[g,b]=h.useState(!s||!!d),[p,C]=h.useState(s&&!d),[k,D]=h.useState(d),z=Be.useDebounce(k,350),O=h.useRef(null);h.useEffect(()=>{D(d),d&&b(!0)},[d]),h.useEffect(()=>{g&&C(!1)},[g]),h.useEffect(()=>{z!==d&&Vr({value:z,name:r,type:"search",searchQueries:a,setSearchParams:c,filterKey:t,pageKey:o})},[z]);const A=h.useCallback(()=>{b(!0),requestAnimationFrame(()=>{var T;return(T=O.current)==null?void 0:T.focus()})},[]);ks(l,A);const x=()=>{s&&!k&&b(!1)},m=T=>{var B;s&&T.key==="Escape"&&!k&&(b(!1),(B=O.current)==null||B.blur())},I=()=>{g||C(!0)};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:A}),e.jsxs(f.Box,{onTransitionEnd:I,style:{position:"relative",width:g?Bs:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(hr.Input,{ref:O,size:"sm",fullWidth:!0,value:k,placeholder:n,leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:T=>D(T.target.value),onKeyDown:m,onBlur:x,tabIndex:g?0:-1}),g&&!k&&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(S.Text,{fontSize:"xs",color:"subtle",children:l})})]})]})},Il=({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(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{children:e.jsxs(f.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(S.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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(j.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,k=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:D=>{D.preventDefault(),a(p)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:k?"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:D=>{C&&(D.key==="ArrowUp"?(D.preventDefault(),g(p,-1)):D.key==="ArrowDown"&&(D.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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:b.title}),e.jsx(f.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(Tr.Toggle,{size:"sm",checked:b.visible,disabled:b.locked,onChange:()=>o(b.key),"aria-label":`Toggle ${b.title} column`})})]},b.key)})})]})})})]})},Ml=({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(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(j.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(W.MenuLists,{style:{width:"260px"},children:[e.jsx(W.MenuBody,{children:e.jsxs(f.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(S.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(S.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(c=>e.jsx(W.MenuItem,{startIcon:e.jsx(F.Icon,{name:"Bookmark"}),onClick:()=>t(c),endIcon:e.jsx(j.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(W.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(j.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!l.trim(),onClick:i,children:"Save"})]})})]})]})},ms=({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(Ur.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(S.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),p>0&&e.jsxs(S.Text,{fontSize:"sm",color:"subtle",children:["(",p,")"]})]}),e.jsx(j.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(S.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(ml,{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(S.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(f.Box,{direction:"column",children:o.map(C=>{const k=n.includes(C.key),D=!!C.locked;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:D?.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(S.Text,{fontSize:"sm",color:"primary",truncate:!0,children:C.label})]}),e.jsx(Tr.Toggle,{size:"sm",checked:k||D,disabled:D,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(j.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(j.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},Es=r=>`${r} Rows`,Fs=({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(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(W.MenuLists,{children:e.jsxs(W.MenuBody,{style:{minWidth:200},children:[e.jsx(f.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(S.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),o.map(b=>e.jsx(W.MenuItem,{selected:b===d,endIcon:b===d?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>g(String(b)),children:Es(b)},b))]})})]}):null},Is=r=>{var we;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:k,pageKey:D,searchPlaceholder:z,searchShortcut:O,searchCollapsible:A,pagination:x,perPageKey:m,pageSizeOptions:I,defaultPerPage:T,showPagination:B,showResultCount:L,showPageSize:U,hasColumns:V,orderedColumns:H,allVisible:N,onToggleVisibility:G,onReorder:J,onSetAllHidden:te,showSavedViews:K,savedViews:ue,onApplyView:Z,onDeleteView:ee,onSaveView:ie,leadingActions:De,trailingActions:ze}=r,[me,ve]=h.useState(!1),{searchQueries:Ce,setSearchParams:Ae}=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),Pe=(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)),ce=Ie=>{Ae({...Ce,[D]:String(Ie)})},he=L||B&&!!(x!=null&&x.totalPage),pe=()=>{b(),ve(!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(Fl,{searchKey:C,filterKey:k,pageKey:D,placeholder:z,shortcut:O,collapsible:A}),e.jsx(j.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),onClick:()=>ve(!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(Ml,{views:ue,onApply:Z,onDelete:ee,onSave:ie}),V&&e.jsx(Il,{columns:H,allVisible:N,onToggle:G,onReorder:J,onSetAllHidden:te}),e.jsx(Fs,{perPageKey:m,pageKey:D,pageSizeOptions:I,defaultPerPage:T,showPageSize:U}),ze]})]}),he&&e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[L?e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Ze}-${Pe} of ${((we=x==null?void 0:x.totalData)==null?void 0:we.toLocaleString())||0}`}):e.jsx(f.Box,{direction:"column"}),B&&!!(x!=null&&x.totalPage)&&e.jsx(zr.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:x!=null&&x.currentPage?Number(x.currentPage):1,totalPages:Number(x.totalPage),onPageChange:ce})]}),e.jsx(ms,{isOpen:me,onClose:()=>ve(!1),configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:i,onReset:pe,getValue:a,setValue:d,clearValue:g,removeFilter:c})]})},Ms=({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:k="/",searchPosition:D="right",searchCollapsible:z=!0,pagination:O,columns:A=[],onColumnsChange:x,columnsState:m,scopeId:I,savedViews:T,persistLastState:B=!0,persistSearch:L=!0,storage:U=qt,onReset:V,leadingActions:H,trailingActions:N})=>{const G=I??(T==null?void 0:T.scopeId),{activeKeys:J,configByKey:te,hasActiveFilter:K,toggleFilter:ue,removeFilter:Z,getValue:ee,setValue:ie,clearValue:De,clearAll:ze}=_t({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:p}),me=rs({columns:A,scopeId:G,storage:U,onColumnsChange:x,value:m}),ve=ts({scopeId:G,storage:U,snapshotKeys:[n,o,s],pageKey:l,getColumns:()=>me.state,applyColumns:me.applyState}),Ce=ls({scopeId:G,storage:U,snapshotKeys:[n,o,l],enabled:B,filterKey:o,searchKey:p,persistSearch:L}),Ae=ns({scopeId:G,storage:U,perPageKey:s,pageSizeOptions:i,enabled:B});is({enabled:B&&!!G,snapshotKeys:[n,o,l],perPageKey:s,readSnapshot:Ce.read,readPerPage:Ae.read});const Ze=c??i[0]??25,Pe=!!(T!=null&&T.enabled)&&ve.enabled,ce=()=>{ze(),Ce.clear(),V==null||V()},he=Be.useMediaQuery("md"),pe=b?e.jsx(Fl,{searchKey:p,filterKey:o,pageKey:l,placeholder:C,shortcut:k,collapsible:z}):null;return he?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(cs,{configs:t,activeKeys:J,onToggle:ue,hasActiveFilter:K,onReset:ce}),D==="left"&&pe,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(ml,{activeKeys:J,configByKey:te,getValue:ee,setValue:ie,clearValue:De,removeFilter:Z}),K&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"sm",onClick:ce,children:"Reset"})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[H,e.jsx(Ss,{pagination:O,pageKey:l,perPageKey:s,pageSizeOptions:i,defaultPerPage:Ze,showPagination:a,showResultCount:d,showPageSize:g}),D==="right"&&pe,Pe&&e.jsx(Ml,{views:ve.views,onApply:ve.applyView,onDelete:ve.deleteView,onSave:ve.saveView}),A.length>0&&e.jsx(Il,{columns:me.orderedColumns,allVisible:me.allVisible,onToggle:me.toggleVisibility,onReorder:me.reorder,onSetAllHidden:me.setAllHidden}),N]})]}):e.jsx(Is,{withPadding:r,configs:t,activeKeys:J,configByKey:te,hasActiveFilter:K,toggleFilter:ue,removeFilter:Z,getValue:ee,setValue:ie,clearValue:De,onReset:ce,searchable:b,searchKey:p,filterKey:o,pageKey:l,searchPlaceholder:C,searchShortcut:k,searchCollapsible:z,pagination:O,perPageKey:s,pageSizeOptions:i,defaultPerPage:Ze,showPagination:a,showResultCount:d,showPageSize:g,hasColumns:A.length>0,orderedColumns:me.orderedColumns,allVisible:me.allVisible,onToggleVisibility:me.toggleVisibility,onReorder:me.reorder,onSetAllHidden:me.setAllHidden,showSavedViews:Pe,savedViews:ve.views,onApplyView:ve.applyView,onDeleteView:ve.deleteView,onSaveView:ve.saveView,leadingActions:H,trailingActions:N})},Ts=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},Ls=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},As=(r,t)=>{switch(r.type){case"dropdown":case"radio":return Ts(t);case"dropdown-multiple":case"checkbox-multiple":return Ls(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}},Tl=(r,t)=>{if(r==null||r==="")return t;const o=Number(r);return Number.isFinite(o)&&o>0?o:t},Os=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:k}=_t({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:i}),{searchParams:D}=qe(),z=D.toString();return h.useMemo(()=>{const A={},x={},m=Tl(D.get(l),c),I=Tl(D.get(s),a);A[(d==null?void 0:d.page)??"page"]=m,A[(d==null?void 0:d.perPage)??"perPage"]=I;const T=Rr(i,D,o)||"";T&&(A[(d==null?void 0:d.search)??"search"]=T);let B=!1;for(const L of b){const U=p[L];if(!U)continue;const V=k(U);x[L]=V;const H=g==null?void 0:g[L],N=H?H(V):As(U,V);if(N==null||Array.isArray(N)&&N.length===0)continue;const G=(d==null?void 0:d[L])??L;A[G]=N,B=!0}return{params:A,raw:x,hasActiveFilter:C||!!T||B}},[z,b.join("|"),o,n,l,s,i,c,a,d,g,p])},Ws=["dropdown","dropdown-multiple","checkbox-multiple","radio"],zs=({filterConfigs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l})=>{const{configByKey:s,getValue:i,setValue:c,removeFilter:a,clearAll:d,hasActiveFilter:g}=_t({configs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l}),b=(x,m)=>{var T;const I=x.options;return((T=I==null?void 0:I.find(B=>B.value===m))==null?void 0:T.label)??m},p=h.useCallback(x=>{const m=s[x];if(!m)return[];const I=i(m);return Array.isArray(I)?I.map(T=>String(T.value)):[]},[s,i]),C=h.useCallback((x,m)=>{const I=s[x];if(!I||!Ws.includes(I.type))return;const T=Array.isArray(m)?m:[m];if(T.length===0){a(x);return}c(I,T.map(B=>({label:b(I,B),value:B})))},[s,c,a]),k=h.useCallback((x,m)=>{const I=p(x);C(x,I.includes(m)?I.filter(T=>T!==m):[...I,m])},[p,C]),D=h.useCallback((x,m)=>p(x).includes(m),[p]),z=h.useCallback(x=>a(x),[a]),O=h.useCallback(x=>{const m=s[x];return m?i(m):void 0},[s,i]),A=h.useCallback((x,m)=>{const I=s[x];if(I){if(m==null){a(x);return}c(I,m)}},[s,c,a]);return{set:C,toggle:k,clear:z,clearAll:d,isActive:D,values:p,getRaw:O,setRaw:A,hasActiveFilter:g}},Xt="var(--sa-background-brand, #04254f)",Hs="var(--sa-text-brand, #031f43)",Ps={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"},Jt={padding:"4px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",fontSize:13,color:Hs},Ll=(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},Vs=({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:Ps}),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?Xt:"var(--sa-border-subtle, #0b120e24)"}`,background:g&&!l?Xt:"transparent"},children:g&&(l?e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:Xt}}):e.jsx(F.Icon,{name:"Check",size:"xs",style:{color:"#fff"}}))}),e.jsx(S.Text,{as:"span",style:{fontSize:14},children:d.label})]},d.value)}),c.length===0&&e.jsx(S.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:Jt,children:"Clear"})]})},js=({field:r,controls:t})=>{const o=t.getRaw(r.key);return e.jsx(f.Box,{style:{minWidth:240},children:e.jsx(pr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:o,onChange:n=>t.setRaw(r.key,n??null),withPadding:!1})})},Ns=({field:r,controls:t})=>{const o=t.getRaw(r.key),n=r.ops&&r.ops.length>0?r.ops:Cl,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(S.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(xl,{op:i,ops:n,onChange:a})]}),e.jsx(wl,{value:o,op:i,mode:s,onChange:c}),Ll(r,t)&&e.jsx("button",{type:"button",onClick:()=>t.setRaw(r.key,null),style:Jt,children:"Clear"})]})},_s=({field:r,controls:t})=>{const o=t.getRaw(r.key)??"",[n,l]=h.useState(o),s=Be.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(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:Jt,children:"Clear"})]})},qs=({field:r,controls:t})=>r.type==="text"?e.jsx(_s,{field:r,controls:t}):r.type==="date"?e.jsx(js,{field:r,controls:t}):r.type==="date-compact"?e.jsx(Ns,{field:r,controls:t}):e.jsx(Vs,{field:r,controls:t}),Zs=(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}=yl(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}},Al=({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})},Ol=({action:r,rightContent:t,leftContent:o,headerSlot:n,advanceFilter:l,showFilter:s=!0})=>{const i=Be.useMediaQuery("md"),c=s?e.jsx(fl,{...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(j.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()]})]})})},Gs=({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(Re.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Re.Body1,{children:r||0})]}),Wl=({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=k=>{c({...i,[t]:String(k)})},b=k=>{c({...i,[o]:k,[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(S.Text,{children:"Rows Per Page: "}),e.jsx(Fr.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:k=>{b(k[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(S.Text,{children:`${p}-${C} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(zr.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(Gs,{totalData:s,withMarginBottom:!1,withMarginTop:!1})})},zl=({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(D=>D.label.toLowerCase().includes(c.toLowerCase())):r.options,[r.options,c]);h.useEffect(()=>{if(o&&s.current){const D=s.current.getBoundingClientRect(),z=280,O={top:D.bottom+8};r.position==="left"||D.left+z>window.innerWidth?O.right=window.innerWidth-D.right:O.left=D.left,g(O)}},[o,r.position]),h.useEffect(()=>{o&&i.current?setTimeout(()=>{var D;return(D=i.current)==null?void 0:D.focus()},50):a("")},[o]),h.useEffect(()=>{const D=z=>{l.current&&!l.current.contains(z.target)&&s.current&&!s.current.contains(z.target)&&n(!1)};return o&&document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[o]);const C=D=>{const z=b.includes(D)?b.filter(O=>O!==D):[...b,D];r.onFilterChange(z)},k=()=>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:D=>{var z;D.stopPropagation(),o||(z=r.onOpen)==null||z.call(r),n(O=>!O)},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(S.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(S.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:D=>{D.stopPropagation(),k()},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(F.Icon,{name:"Search",size:"sm"}),value:c,onChange:D=>a(D.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(S.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(D=>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(D.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:z=>{z.stopPropagation(),C(D.value)},onMouseEnter:z=>{b.includes(D.value)||(z.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),z.currentTarget.style.transform="translateX(2px)"},onMouseLeave:z=>{z.currentTarget.style.backgroundColor=b.includes(D.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",z.currentTarget.style.transform="translateX(0)"},children:[e.jsx(fr.Checkbox,{checked:b.includes(D.value),onChange:()=>{}}),e.jsx(S.Text,{fontSize:"sm",fontWeight:b.includes(D.value)?"medium":"normal",color:b.includes(D.value)?"primary":"gray-700",children:D.label})]},D.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(S.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(S.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",b.length>1?"s":""," selected"]})]})})]})]})},Qs=({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"})})]})},Us=({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"})]}),$t="var(--sa-background-primary, #ffffff)",Hl="var(--sa-background-primary-inverse, #f8f8f8)",Pl=({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:k=["detail","update","delete","custom"],customEmptyState:D,enableColumnResize:z=!1,defaultColumnWidths:O,onColumnWidthsChange:A,defaultMinColumnWidth:x=60,sort:m,defaultSort:I,onSortChange:T,showActionDivider:B=!1})=>{const L=m!==void 0,[U,V]=h.useState(I??null),H=L?m??null:U,N=P=>{if(P.sortKey)return P.sortKey;if(typeof P.accessor=="string")return P.accessor},G=P=>{const $=N(P);if(!$)return;let Y;!H||H.key!==$?Y={key:$,direction:"asc"}:H.direction==="asc"?Y={key:$,direction:"desc"}:Y=null,L||V(Y),T==null||T(Y)},te=[o,n,l].filter(P=>P!==void 0).length,K=!!C,ue=!!o||!!n||!!l||K,Z="var(--sa-border-subtle, #0b120e24)",ee=`1px solid ${Z}`,ie=`inset 1px 0 0 ${Z}`,De=`inset -1px 0 0 ${Z}`,ze=te===3?K?"178px":"140px":te===2?K?"140px":"102px":te===1?K?"112px":"74px":K?"74px":"",me=(P,$)=>{if(!$)return P;if(typeof $=="function")return $(P);if(typeof $=="string")return P[$]},[ve,Ce]=h.useState(!1);h.useEffect(()=>{if(!(g!=null&&g.current))return;const P=g.current;Ce(P.scrollHeight>P.clientHeight)},[t,g]);const Ae=h.useRef(null),[Ze,Pe]=h.useState([]),[ce,he]=h.useState(()=>O??{}),pe=h.useRef(null);h.useLayoutEffect(()=>{if(!b||!Ae.current){Pe([]);return}const P=Array.from(Ae.current.querySelectorAll("thead tr th")),$=[];let Y=0;P.forEach((fe,Ee)=>{$[Ee]=Y,Ee<b&&(Y+=fe.offsetWidth)}),Pe($)},[b,r,t,ce]);const we=P=>{p&&p(P<b?P:P+1)},Ie=(P,$)=>{const Y=ce[P];if(Y!==void 0){const fe=`${Y}px`;return{width:fe,minWidth:fe,maxWidth:fe}}return $?{width:$}:{}},sr=P=>z&&(P.resizable??!0),ir=(P,$)=>{P.preventDefault(),P.stopPropagation();const Y=P.currentTarget.closest("th");if(!Y)return;const fe=Math.round(Y.getBoundingClientRect().width);pe.current={colIndex:$,startX:P.clientX,startWidth:fe};const Ee=document.body.style.userSelect,xe=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Ve=Ye=>{var Fe;const Me=pe.current;if(!Me)return;const br=((Fe=r[Me.colIndex])==null?void 0:Fe.minWidth)??x,ur=Math.max(br,Me.startWidth+(Ye.clientX-Me.startX));he(He=>He[Me.colIndex]===ur?He:{...He,[Me.colIndex]:ur})},cr=()=>{document.removeEventListener("mousemove",Ve),document.removeEventListener("mouseup",cr),document.body.style.userSelect=Ee,document.body.style.cursor=xe,pe.current=null,A&&he(Ye=>(A(Ye),Ye))};document.addEventListener("mousemove",Ve),document.addEventListener("mouseup",cr)};return e.jsx("div",{ref:Ae,children:e.jsxs(Q.Table,{fullWidth:!0,children:[e.jsx(Q.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(Q.Tr,{children:[r.map((P,$)=>{var Sr,ar;const Y=b>0&&$<b,fe=Ze[$]??0,Ee=sr(P),Ve=$===r.length-1&&ue&&B,cr=N(P),Ye=!!P.sortable&&!!cr,Me=Ye&&(H==null?void 0:H.key)===cr?H.direction:null,br=P.title||((Sr=P.accessor)==null?void 0:Sr.toString())||"",ur=(ar=P.headerTooltip)!=null&&ar.showIcon?e.jsx(F.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Fe=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:br}),He=Ye?e.jsxs("button",{type:"button",onClick:()=>G(P),title:Me==="asc"?"Sorted ascending — click to sort descending":Me==="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:[Fe,ur,e.jsx(Qs,{direction:Me})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Fe,ur]});return e.jsxs(Q.Th,{style:{position:"sticky",top:0,left:Y?fe:void 0,zIndex:Y?4:2,paddingLeft:$===0?"12px":"",borderRight:d&&!Ve&&!Y?ee:void 0,borderBottom:d?ee: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",...Ie($,P.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[P.headerTooltip?e.jsx(Le.Tooltip,{label:P.headerTooltip.content,position:"bottom",children:He}):He,P.filter&&e.jsx(zl,{filter:P.filter,columnTitle:P.title}),p&&e.jsx("button",{onClick:()=>we($),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(Us,{frozen:Y})})]}),Ee&&e.jsx("div",{onMouseDown:vr=>ir(vr,$),onClick:vr=>vr.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-${$}`)}),ue?e.jsx(Q.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?ee:void 0,boxShadow:d&&B?ie:void 0}}):null]})}),e.jsx(Q.Tbody,{children:s?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:r.length+1,children:e.jsxs(f.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Ke.Skeleton,{variant:"list"}),e.jsx(Ke.Skeleton,{variant:"list"}),e.jsx(Ke.Skeleton,{variant:"list"}),e.jsx(Ke.Skeleton,{variant:"list"}),e.jsx(Ke.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&D?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:r.length+1,children:D})}):t==null?void 0:t.map((P,$)=>e.jsxs(Q.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:$===t.length-1&&ve?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:Y=>{const fe=Y.currentTarget;fe.style.backgroundColor=Hl,Array.from(fe.querySelectorAll("td")).forEach(Ee=>{Ee.style.position==="sticky"&&(Ee.style.backgroundColor=Hl)})},onMouseLeave:Y=>{const fe=Y.currentTarget;fe.style.backgroundColor="",Array.from(fe.querySelectorAll("td")).forEach(Ee=>{Ee.style.position==="sticky"&&(Ee.style.backgroundColor=$t)})},children:[r.map((Y,fe)=>{const Ee=Y.render?Y.render(P,$,t):me(P,Y.accessor),xe=b>0&&fe<b,Ve=Ze[fe]??0,cr=ce[fe]!==void 0,Ye=xe&&fe===b-1;return e.jsx(Q.Td,{style:{position:xe?"sticky":void 0,left:xe?Ve:void 0,zIndex:xe?1:void 0,backgroundColor:xe?$t:void 0,transition:xe?"background-color 0.3s ease":void 0,paddingLeft:fe===0?"12px":"",whiteSpace:"nowrap",overflow:cr?"hidden":void 0,borderLeft:Y.showBorderLeft?ee:void 0,borderRight:Y.showBorderRight?ee:void 0,boxShadow:Ye?De:void 0,textAlign:Y.textAlign==="text-right"?"right":Y.textAlign==="text-center"?"center":"left",...Ie(fe,Y.width)},children:typeof Ee=="string"?e.jsx(S.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Y.textAlign==="text-right"?"right":Y.textAlign==="text-center"?"center":"left"},children:Ee}):Ee},`row-${$}-col-${fe}`)}),ue?e.jsx(Q.Td,{style:{width:ze,position:"sticky",right:0,zIndex:1,backgroundColor:$t,boxShadow:B?ie:void 0,transition:"background-color 0.3s ease"},children:e.jsx(de.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:k.map(Y=>{const fe=$===t.length-1?"top":"bottom";return Y==="detail"&&o&&(a==null?void 0:a(P))!==!1?e.jsx(Le.Tooltip,{label:"Detail",position:fe,children:e.jsx(j.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(Le.Tooltip,{label:"Update",position:fe,children:e.jsx(j.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(Le.Tooltip,{label:"Delete",position:fe,children:e.jsx(j.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 Vl=!1;const Ys=({wrapperProps:r,dataTableProps:t,headerProps:o,footerProps:n})=>{var b;process.env.NODE_ENV!=="production"&&!Vl&&(Vl=!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(Al,{...r,children:[c&&e.jsx(Ol,{...o}),e.jsx(f.Box,{direction:"column",ref:l,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(Pl,{...t,scrollParentRef:l,frozenCount:t!=null&&t.enableFreezeColumns?s:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?i:void 0}):null}),g&&e.jsx(Wl,{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 Xs(r){return h.memo(r)}const Js=Xs(Ys),jl="(any-pointer: coarse)",$s=r=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const t=window.matchMedia(jl);return t.addEventListener("change",r),()=>t.removeEventListener("change",r)},Ks=()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(jl).matches,Rs=()=>!1;function Nl(){return h.useSyncExternalStore($s,Ks,Rs)}const _l=200,tt="1px solid var(--sa-border-subtle, #0b120e24)",ei=({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}),ot=({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(S.Text,{as:"span",style:{color:s},children:t})]})},ri=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},ql=({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),k=h.useRef(null),[D,z]=h.useState({top:0,left:0}),O=h.useCallback(()=>{var H;const x=C.current;if(!x)return;const m=x.getBoundingClientRect(),I=x.closest(".sa-tl-scroll")??ri(x),T=I==null?void 0:I.getBoundingClientRect();if(T&&(m.left<T.left||m.left>T.right)){p(!1);return}const B=Math.min(window.innerWidth-8,T?T.right:window.innerWidth),L=((H=k.current)==null?void 0:H.offsetWidth)||_l,U=T?T.left:8,V=Math.max(U,Math.min(m.left,B-L));z({top:m.bottom+6,left:V})},[]);h.useEffect(()=>{if(!b)return;O();const x=()=>O();return window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}},[b,O]),h.useEffect(()=>{if(!b)return;const x=m=>{k.current&&!k.current.contains(m.target)&&C.current&&!C.current.contains(m.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(m=>!m)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:tt,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(ei,{sortDir:n,frozen:l,filterActive:g})}),b&&e.jsxs(f.Box,{ref:k,onClick:x=>x.stopPropagation(),style:{position:"fixed",top:`${D.top}px`,...D.left!==void 0?{left:`${D.left}px`}:{right:`${D.right}px`},minWidth:_l,backgroundColor:"var(--sa-background-primary, #ffffff)",border:tt,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(S.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:tt,margin:"4px 0"}})]}),t&&e.jsxs(e.Fragment,{children:[e.jsx(ot,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>A(()=>n==="asc"?i():s("asc"))}),e.jsx(ot,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>A(()=>n==="desc"?i():s("desc"))}),e.jsx("div",{style:{borderTop:tt,margin:"4px 0"}})]}),e.jsx(ot,{icon:"Pin1",label:l?"Unfreeze":"Freeze",active:l,onClick:()=>A(c)}),o&&e.jsx(ot,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>A(a)})]})]})},ti=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),oi={background:"var(--sa-background-warning-subtlest, #fef2e6)",color:"inherit",padding:0,borderRadius:"min(2px, var(--sa-radii-xs, 4px))"},Zl=({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(ti).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:{...oi,...o},children:a},d):e.jsx(h.Fragment,{children:a},d))})},Nr="1px solid var(--sa-border-subtle, #0b120e24)",li="var(--sa-text-subtle, #8c8f97)",Ar="var(--sa-background-neutral, #f0f1f2)",Gl="2px 0 4px -2px var(--sa-border-subtle, #0b120e24)",_r=40,Kt=5,ni=28,Rt=4,lt=16,eo="var(--sa-background-brand-subtlest)",nt={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Ql="sa-table-layout-styles",si=()=>{if(typeof document>"u"||document.getElementById(Ql))return;const r=document.createElement("style");r.id=Ql,r.textContent=`
|
|
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,7 +49,7 @@
|
|
|
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)},qr=r=>r==="right"?"right":r==="center"?"center":"left",ii=/^(#|rgb|hsl|var\()/,st=r=>r?ii.test(r)?r:`var(--sa-background-${r})`:void 0,ci=(r,t)=>{if(t)return r[t]},ai=(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)),di=({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:k,height:D,mobileLayout:z="cards",mobileBreakpoint:A="md",groupSeparator:L,summary:x,footer:m,stickyFooter:I=!1,emptyState:T,loading:B=!1,loadingRows:O=8,rowActions:U,rowActionsMode:V="auto",selectable:H=!1,selectedKeys:N,defaultSelectedKeys:G,onSelectionChange:Y,isRowSelectable:te})=>{si();const ee=!ke.useMediaQuery(A)&&z!=="scroll",_=!!(U!=null&&U.length),ge=Nl(),fe=_&&(V==="column"||V==="auto"&&ge),Fe=Math.min((U==null?void 0:U.length)??0,Kt+1),qe=Fe>Kt?1:Fe,Be=lt*2+qe*ni+Math.max(0,qe-1)*Rt,ve=fe?Be:1,[Ce,Ae]=h.useState(null);h.useEffect(()=>{if(!Ce)return;const v=()=>Ae(null),w=setTimeout(()=>document.addEventListener("click",v),0);return()=>{clearTimeout(w),document.removeEventListener("click",v)}},[Ce]);const[Ze,He]=h.useState(()=>new Set),ie=a!==void 0,[de,pe]=h.useState({}),we=a??de,Ie=v=>{d==null||d(v),ie||pe(v)},sr=p!==void 0,[ir,P]=h.useState(C??null),$=sr?p??null:ir,X=!k,he=v=>{k==null||k(v),sr||P(v)},{headerGroups:me,leafColumns:xe,hasGroups:Pe}=h.useMemo(()=>{var le;const v=new Set(we.hidden??[]),w=(oe,De)=>oe.key??(typeof oe.accessor=="string"?oe.accessor:`col-${De}`),M=r.map((oe,De)=>{var $e;if(($e=oe.children)!=null&&$e.length){const Gr=oe.children.map((dr,Wr)=>({col:dr,key:w(dr,`${De}-${Wr}`)})).filter(dr=>!v.has(dr.key));return{col:oe,key:oe.key??`group-${De}`,isGroup:!0,leaves:Gr}}const Se={col:oe,key:w(oe,`${De}`)};return{col:oe,key:Se.key,isGroup:!1,leaves:v.has(Se.key)?[]:[Se]}}).filter(oe=>oe.leaves.length>0),q=M.some(oe=>oe.isGroup);let re=M.flatMap(oe=>oe.leaves);if(!q&&((le=we.order)!=null&&le.length)){const oe=new Map(we.order.map((De,Se)=>[De,Se]));re=[...re].sort((De,Se)=>(oe.get(De.key)??1/0)-(oe.get(Se.key)??1/0))}return{headerGroups:M,leafColumns:re,hasGroups:q}},[r,we]),cr=h.useMemo(()=>new Map(xe.map((v,w)=>[v.key,w])),[xe]),Ye=!Pe&&xe.some(v=>(v.col.headerColSpan??1)>1),Me=xe.map(v=>v.key).join("|"),br=(v,w)=>{const M=v.sortKey??(typeof v.accessor=="string"?v.accessor:void 0);return M?w[M]:void 0},ur=v=>v.sortable??(!!v.sortKey||typeof v.accessor=="string"),Ee=h.useMemo(()=>{if(!X||!$)return t;const v=xe.find(M=>M.key===$.key);if(!v)return t;const w=$.direction==="asc"?1:-1;return[...t].sort((M,q)=>ai(br(v.col,M),br(v.col,q))*w)},[t,X,$,xe]),ze=!Pe&&!Ye,Sr=!!c&&ze,[ar,vr]=Q.useColumnWidths(c??""),Cr=Sr?ar:void 0,xr=h.useRef(null),[je,Ge]=h.useState();h.useLayoutEffect(()=>{Ge(void 0)},[Me]),h.useLayoutEffect(()=>{if(!ze||je||!xr.current)return;const v=xr.current.querySelectorAll("th.sa-tl-leaf");Ge(Array.from(v).map(w=>w.offsetWidth))},[je,ze]);const[yt,pt]=h.useState(),[so,io]=h.useState(0);h.useLayoutEffect(()=>{if(!Pe||!xr.current)return;const v=xr.current.querySelector(":scope > tr");v&&io(v.offsetHeight)},[Pe,Me]);const kr=(v,w)=>{if((Cr==null?void 0:Cr[w])!=null)return Cr[w];if(v.width!=null)return v.width;if((je==null?void 0:je[w])!=null)return je[w]},bt=(v,w)=>typeof v.width=="number"?v.width:je==null?void 0:je[w],wr=we.frozenKey&&!Pe&&!Ye?xe.findIndex(v=>v.key===we.frozenKey):-1,E=v=>v<=wr,Z=H?_r:0,J=v=>{const w=yt??je;if(!w)return Z;let M=Z;for(let q=0;q<v;q++)M+=w[q]??0;return M};h.useLayoutEffect(()=>{const v=xr.current;if(!v||wr<0){pt(void 0);return}let w=0;const M=()=>{w=0;const re=v.querySelectorAll("th.sa-tl-leaf"),le=Array.from(re).map(oe=>oe.getBoundingClientRect().width);pt(oe=>oe&&oe.length===le.length&&oe.every((De,Se)=>Math.abs(De-le[Se])<.5)?oe:le)},q=new ResizeObserver(()=>{w||(w=requestAnimationFrame(M))});return q.observe(v),v.querySelectorAll("th.sa-tl-leaf").forEach(re=>q.observe(re)),M(),()=>{w&&cancelAnimationFrame(w),q.disconnect()}},[Me,wr,H,je,Cr]);const ne=h.useRef(null),[ye,Te]=h.useState("100vh");h.useLayoutEffect(()=>{if(D!==void 0)return;const v=()=>{if(ne.current){const w=ne.current.getBoundingClientRect().top;Te(`calc(100vh - ${w}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[D]);const ce=(v,w)=>o?o(v,w):w,Xe=N!==void 0,[Ne,Je]=h.useState(()=>new Set(G??[])),Qe=h.useMemo(()=>Xe?new Set(N):Ne,[Xe,N,Ne]);h.useEffect(()=>{H&&!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).")},[H,!o]);const er=v=>{if(Xe||Je(v),Y){const w=Ee.filter((M,q)=>v.has(ce(M,q)));Y(Array.from(v),w)}},Br=(v,w)=>H&&(te?te(v,w):!0),gr=v=>{const w=new Set(Qe);w.has(v)?w.delete(v):w.add(v),er(w)},Or=h.useMemo(()=>H?Ee.map((v,w)=>({row:v,i:w,key:ce(v,w)})).filter(({row:v,i:w})=>te?te(v,w):!0).map(({key:v})=>v):[],[H,Ee,te,o]),an=Or.filter(v=>Qe.has(v)),co=Or.length>0&&an.length===Or.length,dn=an.length>0&&!co,qc=()=>{const v=new Set(Qe);co?Or.forEach(w=>v.delete(w)):Or.forEach(w=>v.add(w)),er(v)},ao=(v,w,M)=>{const q=v.render?v.render(w,M,Ee):ci(w,v.accessor);if(b&&!v.render&&typeof q=="string"){const re=v.key??(typeof v.accessor=="string"?v.accessor:void 0),le=re?b[re]:void 0;if(le)return e.jsx(Zl,{text:q,query:le})}return q},ho=xe.length+(H?1:0)+(_?1:0),hn=["80%","55%","70%","45%","90%","60%"],Zc=(v,w)=>hn[(v*7+w*3)%hn.length],Gc=(v,w)=>e.jsx(Ke.Skeleton,{height:14,width:Zc(v,w),borderRadius:"rounded-sm"}),Qc=Array.from({length:O},(v,w)=>e.jsxs(Q.Tr,{children:[H&&e.jsx(Q.Td,{style:{width:_r,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(Ke.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),xe.map(({col:M,key:q},re)=>e.jsx(Q.Td,{style:{textAlign:qr(M.align)},children:Gc(w,re)},`sa-tl-sk-${w}-${q}`)),_&&e.jsx(Q.Td,{style:{width:ve,padding:0,border:"none"}})]},`sa-tl-sk-${w}`)),Uc=(v,w)=>{w||Ie({...we,hidden:[...we.hidden??[],v]})},Yc=v=>Ie({...we,frozenKey:we.frozenKey===v?void 0:v}),vt=v=>(U??[]).filter(w=>{var M;return!((M=w.hidden)!=null&&M.call(w,v))}),fn=fe?{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:Rt,paddingLeft:lt,paddingRight:lt,height:"100%"}:{position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:Rt,paddingRight:lt,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},Ct=(v,w,M,q)=>{var $e;const re=($e=v.disabled)==null?void 0:$e.call(v,w),le=(q==null?void 0:q.showLabel)??v.showLabel,oe=(q==null?void 0:q.size)??"xs",De=e.jsx(j.Button,{size:oe,variant:v.variant??"tertiary",tone:v.tone??"neutral",disabled:re,onClick:()=>v.onClick(w,M),iconLeft:v.icon?e.jsx(F.Icon,{name:v.icon,size:"sm"}):void 0,children:le&&v.label}),Se=v.tooltip;return Se?e.jsx(Le.Tooltip,{label:Se,position:"top-end",children:De}):De},Xc=(v,w)=>{const M=vt(v);if(!M.length)return null;if(M.length>Kt){const re=ce(v,w),le=(Ce==null?void 0:Ce.rowKey)===re;return e.jsx("div",{className:"sa-tl-row-actions","data-mode":fe?"column":"overlay",style:fn,onClick:oe=>oe.stopPropagation(),children:e.jsx(Le.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(j.Button,{size:"xs",variant:"tertiary",onClick:oe=>{const De=oe.currentTarget.getBoundingClientRect();Ae(le?null:{rowKey:re,top:De.bottom+4,right:window.innerWidth-De.right})},children:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions","data-mode":fe?"column":"overlay",style:fn,children:M.map(re=>e.jsx(h.Fragment,{children:Ct(re,v,w)},re.key))})},Jc=(v,w)=>{const M=vt(v);return M.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:Nr},children:M.map(q=>e.jsx(h.Fragment,{children:Ct(q,v,w,{showLabel:!0,size:"sm"})},q.key))}):null},$c=(v,w)=>{const M=vt(v);return M.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:M.map(q=>e.jsx(h.Fragment,{children:Ct(q,v,w,{showLabel:!1})},q.key))}):null},fo=(v,w)=>{var Wr;const{col:M,key:q}=v,re=cr.get(q)??0,le=E(re),oe=le&&re===wr,De=($==null?void 0:$.key)===q?$.direction:null,Se=g&&!M.disableMenu?e.jsx(ql,{active:!!De||le||!!M.filterActive,canSort:ur(M),canHide:!M.locked,sortDir:De,frozen:le,onSort:wt=>he({key:q,direction:wt}),onClearSort:()=>he(null),onToggleFreeze:()=>Yc(q),onHide:()=>Uc(q,M.locked),filterSlot:(Wr=M.renderFilter)==null?void 0:Wr.call(M),filterActive:M.filterActive}):null,$e=M.align==="right",Gr=M.align==="right"?"flex-end":M.align==="center"?"center":"flex-start",dr=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Gr,overflow:"hidden"},children:[M.icon&&e.jsx(F.Icon,{name:M.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:nt,children:M.title})]});return e.jsx(Q.Th,{className:`sa-tl-leaf${le?" sa-tl-frozen":""}`,rowSpan:w==null?void 0:w.rowSpan,colSpan:w==null?void 0:w.colSpan,minWidth:M.minWidth,numeric:M.numeric,resizable:ze?M.resizable:!1,defaultWidth:bt(M,re),style:{textAlign:qr(M.align),width:kr(M,re),position:"sticky",top:(w==null?void 0:w.top)??0,left:le?J(re):void 0,zIndex:le?3:2,backgroundColor:Ar,boxShadow:oe?Gl:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:$e?e.jsxs(e.Fragment,{children:[Se,dr]}):e.jsxs(e.Fragment,{children:[dr,Se]})})},`th-${q}`)},Kc=()=>{const v=[];for(let w=0;w<xe.length;){const M=xe[w],q=M.col.headerColSpan??1,re=Math.max(1,Math.min(q,xe.length-w));v.push(fo(M,re>1?{colSpan:re}:void 0)),w+=re}return v},un=v=>e.jsx(Q.Th,{rowSpan:v==null?void 0:v.rowSpan,style:{width:_r,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:Ar,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:e.jsx(fr.Checkbox,{size:"sm",variant:dn?"indeterminate":"select",checked:co||dn,disabled:Or.length===0,onChange:qc,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),Rc=(v,w,M)=>{const q=ce(v,w);return e.jsx(Q.Td,{className:"sa-tl-frozen",style:{width:_r,padding:0,position:"sticky",left:0,zIndex:2,...M?{"--sa-tl-bg":M}:{}},children:Br(v,w)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:re=>re.stopPropagation(),children:e.jsx(fr.Checkbox,{size:"sm",checked:Qe.has(q),onChange:()=>gr(q),"aria-label":"Pilih baris"})})},`tl-select-${w}`)},uo=xe.filter(v=>!v.col.hideOnMobile),go=uo.find(v=>v.col.primary)??uo[0],ea=uo.filter(v=>v!==go),ra=v=>He(w=>{const M=new Set(w);return M.has(v)?M.delete(v):M.add(v),M}),gn=(v,w)=>ea.map(({col:M,key:q})=>{const re=ao(M,v,w),le={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right",...M.numeric?{fontVariantNumeric:"tabular-nums"}:{}},oe=typeof re=="string"||typeof re=="number"?e.jsx(S.Text,{style:le,children:re}):e.jsx("div",{style:le,children:re});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof M.title=="string"?e.jsx(S.Text,{color:"subtle",fontWeight:"medium",style:{color:li,flexShrink:0},children:M.title}):e.jsx("div",{style:{flexShrink:0},children:M.title}),oe]},q)}),yo=(v,w)=>{const M=go?ao(go.col,v,w):null;return typeof M=="string"||typeof M=="number"?e.jsx(S.Text,{as:"span",style:nt,children:M}):e.jsx("span",{style:nt,children:M})},ta=e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:O},(v,w)=>e.jsxs(f.Box,{style:{border:Nr,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ke.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(Ke.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(Ke.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${w}`))}),yn=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}),oa=B?ta:Ee.length===0?yn:z==="expand"?e.jsx(f.Box,{style:{display:"flex",flexDirection:"column"},children:Ee.map((v,w)=>{const M=ce(v,w),q=Ze.has(M),le=H&&Qe.has(M)?eo:st(n==null?void 0:n(v,w));return e.jsxs("div",{style:{borderBottom:Nr,backgroundColor:le},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[Br(v,w)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(fr.Checkbox,{size:"sm",checked:Qe.has(M),onChange:()=>gr(M),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>ra(M),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:[yo(v,w),e.jsx(F.Icon,{name:q?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),_&&$c(v,w)]}),q&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:gn(v,w)})]},M)})}):e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Ee.map((v,w)=>{const M=ce(v,w),q=H&&Qe.has(M);return e.jsxs(f.Box,{style:{border:Nr,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:q?eo:st(n==null?void 0:n(v,w))},children:[Br(v,w)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(fr.Checkbox,{size:"sm",checked:Qe.has(M),onChange:()=>gr(M),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:yo(v,w)})]}):yo(v,w),gn(v,w),_&&Jc(v,w)]},M)})}),la=s&&ze&&je!==void 0,pn=i==="fixed"&&!s&&(ze?je!==void 0:!0),na=pn&&!ze,xt=m&&m.length>0?m.map((v,w)=>e.jsx(Q.Tr,{children:v.cells.map((M,q)=>e.jsx(Q.Td,{colSpan:M.colSpan,rowSpan:M.rowSpan,numeric:M.numeric,style:{textAlign:qr(M.align)},children:M.content},`tl-foot-${w}-${q}`))},`tl-foot-${w}`)):null,sa=e.jsxs(Q.Table,{className:"sa-table-layout",fullWidth:!0,size:l,resizable:la,style:pn?{tableLayout:"fixed"}:void 0,onWidthsChange:Sr?vr:void 0,children:[na&&e.jsxs("colgroup",{children:[H&&e.jsx("col",{style:{width:_r}}),xe.map(({col:v,key:w},M)=>e.jsx("col",{style:{width:kr(v,M)}},`col-${w}`)),_&&e.jsx("col",{style:{width:ve}})]}),e.jsx(Q.Thead,{ref:xr,children:Pe?e.jsxs(e.Fragment,{children:[e.jsxs(Q.Tr,{children:[H&&un({rowSpan:2}),me.map(v=>v.isGroup?e.jsx(Q.Th,{colSpan:v.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:Ar},children:e.jsx("span",{style:nt,children:v.col.title})},`grp-${v.key}`):fo(v.leaves[0],{rowSpan:2})),_&&e.jsx(Q.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:ve,padding:0,border:"none",backgroundColor:Ar}})]}),e.jsx(Q.Tr,{children:me.flatMap(v=>v.isGroup?v.leaves.map(w=>fo(w,{top:so})):[])})]}):e.jsxs(Q.Tr,{children:[H&&un(),Kc(),_&&e.jsx(Q.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:ve,padding:0,border:"none",backgroundColor:Ar}})]})}),e.jsx(Q.Tbody,{children:B?Qc:Ee.length===0?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:ho,children:yn})}):e.jsxs(e.Fragment,{children:[Ee.map((v,w)=>{const M=L==null?void 0:L(v,w,w>0?Ee[w-1]:void 0),re=H&&Qe.has(ce(v,w))?eo:st(n==null?void 0:n(v,w));return e.jsxs(h.Fragment,{children:[M!=null&&M!==!1&&e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:ho,style:{backgroundColor:Ar},children:M})}),e.jsxs(Q.Tr,{children:[H&&Rc(v,w,re),xe.map(({col:le,key:oe},De)=>{var bn;const Se=(bn=le.cellProps)==null?void 0:bn.call(le,v,w,Ee);if(Se!=null&&Se.hidden)return null;const $e=E(De),Gr=$e&&De===wr,dr=ao(le,v,w),Wr=typeof le.bg=="function"?le.bg(v,w,Ee):le.bg,wt=st(Wr)??re;return e.jsx(Q.Td,{className:$e?"sa-tl-frozen":void 0,colSpan:Se==null?void 0:Se.colSpan,rowSpan:Se==null?void 0:Se.rowSpan,numeric:le.numeric,style:{textAlign:qr(le.align),width:kr(le,De),minWidth:le.minWidth,position:$e?"sticky":void 0,left:$e?J(De):void 0,zIndex:$e?1:void 0,boxShadow:Gr?Gl:void 0,...wt?{"--sa-tl-bg":wt}:{}},children:typeof dr=="string"?e.jsx(S.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:qr(le.align)},children:dr}):dr},`tl-cell-${w}-${oe}`)}),_&&e.jsx(Q.Td,{className:fe?"sa-tl-frozen":void 0,style:{position:"sticky",right:0,width:ve,padding:0,overflow:fe?void 0:"visible",zIndex:2,border:"none"},children:Xc(v,w)})]})]},ce(v,w))}),x!=null&&e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:ho,children:x})})]})}),xt&&e.jsx(Q.Tfoot,{className:I?"sa-tl-sticky-foot":void 0,children:xt})]}),po=Ce?Ee.findIndex((v,w)=>ce(v,w)===Ce.rowKey):-1,bo=po>=0?Ee[po]:null;return e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{ref:ne,className:"sa-tl-scroll",fullWidth:!0,style:{overflow:"auto",height:D??ye},children:ee?e.jsxs(e.Fragment,{children:[oa,xt&&!B&&Ee.length>0&&e.jsx(f.Box,{style:{borderTop:Nr},children:e.jsx(Q.Table,{fullWidth:!0,size:l,className:"sa-table-layout",children:e.jsx(Q.Tbody,{children:xt})})})]}):sa}),Ce&&bo&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:Ce.top,right:Ce.right},onClick:v=>v.stopPropagation(),children:vt(bo).map(v=>e.jsx("div",{style:{padding:"2px 4px"},children:Ct(v,bo,po,{showLabel:!0,size:"sm"})},v.key))})]})},ro=r=>r==="asc"||r==="desc",hi=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:o="sortOrder",pageKey:n="page",defaultSort:l=null,paramKeys:s,scopeId:i,storage:c=qt}=r,{searchParams:a,setSearchParams:d,searchQueries:g}=_e(),b=a.toString(),p=i?Lr.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)||!ro(x.direction)||d({...Object.fromEntries(a.entries()),[t]:x.key,[o]:x.direction},{replace:!0})},[]);const k=h.useMemo(()=>{const x=a.get(t),m=a.get(o);return x&&ro(m)?{key:x,direction:m}:l},[b,t,o,l]);h.useEffect(()=>{if(!p)return;const x=a.get(t),m=a.get(o);x&&ro(m)?c.set(p,{key:x,direction:m}):c.remove(p)},[b,p,t,o,c]);const D=(s==null?void 0:s.sortBy)??"sortBy",z=(s==null?void 0:s.sortOrder)??"sortOrder",A=h.useMemo(()=>k?{[D]:k.key,[z]:k.direction}:{},[k,D,z]),L=h.useCallback(x=>{const m={...g};x?(m[t]=x.key,m[o]=x.direction):(delete m[t],delete m[o]),delete m[n],d(m)},[g,t,o,n,d]);return{sort:k,setSort:L,params:A}},it=({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(S.Text,{...r,fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),yr=r=>e.jsx(S.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(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(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ae.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(Le.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(ue,{condition:!!l.description,children:e.jsx(S.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(yr,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},ui=({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(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ae.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(Le.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(ue,{condition:!!l.description,children:e.jsx(S.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(Fr.Dropdown,{size:r,...l.inputProps,error:!!l.errorMessage})}),!s&&l.errorMessage&&e.jsx(yr,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},gi=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",yi=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 ${gi(r.errorMessage,r.status)}`},children:[e.jsx(F.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ae.Flex,{direction:"row",gap:"xs",children:[e.jsx(S.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(S.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(S.Text,{fontSize:"sm",color:"gray-500",children:(c=r.fileSupports)==null?void 0:c.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function pi(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const Ul=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},bi=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 vi(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 Ci=r=>{const t=r.split(" ");let o=t[0].charAt(0);return t.length>1&&(o+=""+t[1].charAt(0)),o.toUpperCase()};function xi(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 wi="sa-admin",nr=r=>`var(--${wi}-${r})`,Di={base:{borderColor:nr("base-border-color"),textColor:nr("base-text-color"),iconColor:nr("base-icon-color"),placeholderColor:nr("base-placeholder-color")},document:{bgColor:nr("document-bg-color")},sidebar:{bgColor:nr("sidebar-bg-color"),borderColor:nr("sidebar-border-color"),maxWidth:nr("sidebar-max-width"),width:nr("sidebar-width"),collapseWidth:nr("sidebar-collapse-width"),collapseV2Width:nr("sidebar-v2-collapse-width")}},Si=24*60*60*1e3,ki=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))},Bi=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,mi=/--+/,Ei=/-$/;function Fi(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function Ii(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function Mi(r){return/^[A-Za-z\s]+$/.test(r)}const Ti=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()},Li=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()},Ai=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()},Oi=r=>Bi.test(r);function Wi(r){return!(mi.test(r)||Ei.test(r))}const zi=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()},Hi=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 Pi(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 Vi(r){const t=r.split("/");return t[t.length-1]}const ji=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(ae.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(ae.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(S.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?Vi(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(S.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(S.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(ae.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",children:Pi(((o=r.fileSelected)==null?void 0:o.size.toString())||"100000")}),e.jsx(F.Icon,{name:"Dot",size:"xs"}),e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:Ul(new Date)})]})]})]}),e.jsx(j.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(F.Icon,{name:"Trash1"})})]})},Yl=({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(ae.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(S.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(S.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(S.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.helperText}),o.errorText&&r==="error"&&e.jsx(S.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorText}),o.errorMessage&&!o.errorText&&e.jsx(S.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 k;return o.handleOnChangeFile(((k=C.target.files)==null?void 0:k.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(ji,{fileSelected:o.fileSelected,defaultFile:o.defaultFile,handleOnDeleteFile:o.handleOnDeleteFile,handleOnClickFile:l}),!o.fileSelected&&!o.defaultFile&&e.jsx(yi,{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(ae.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ae.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[c,a]}),e.jsxs(ae.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[b,d]})]}):e.jsxs(ae.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[c,a,b,d]})},Ni=({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(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ae.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(Le.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(ue,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsx(Yl,{...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(yr,{message:l.errorMessage})]})]})},_i=({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(Re.Body3,{props:{color:"gray-500"},children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ae.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(Le.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(ue,{condition:!!s.description,children:e.jsx(S.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(it,{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(yr,{message:s.errorMessage})]})},qi=({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(S.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(it,{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(kt.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(S.Text,{color:"gray-500",style:{marginLeft:28},children:b}),d]})})}),n.errorMessage&&e.jsx(yr,{message:n.errorMessage})]})},Zi=({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(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ae.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(Le.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(ue,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsx(St.Textarea,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(yr,{message:l.errorMessage})]})]})},Gi=({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(S.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:l,children:[e.jsxs(ae.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(Le.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(ue,{condition:!!s.titleDescription,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})})]})}),e.jsx(Tr.Toggle,{checked:s.checked,onChange:s.onChange,label:s.label,description:s.description}),s.errorMessage&&e.jsx(yr,{message:s.errorMessage})]})},Qi=({variant:r="primary",size:t="md",...o})=>{const n=Mr.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(Re.Body2,{props:{style:i},children:o.title});case"sm":case"md":return e.jsx(Re.SubH3,{props:{style:i},children:o.title});case"lg":return e.jsx(Re.SubH2,{props:{style:i},children:o.title});default:return o.title}};return e.jsx(j.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()})},Ui=r=>e.jsx(Re.H5,{props:{...r},children:r.title}),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",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(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ae.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(Le.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(ue,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ae.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(pr.StarasiaDate,{size:r,...l.inputProps,status:l.errorMessage?"error":void 0})}),!s&&l.errorMessage&&e.jsx(yr,{message:l.errorMessage})]})]})};async function Xi(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 Xl={"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},Jl=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),[k,D]=h.useState(null),[z,A]=h.useState(!1),[L,x]=h.useState({x:0,y:0}),[m,I]=h.useState(1),[T,B]=h.useState(null);h.useEffect(()=>{t===null&&l(null)},[t]);const O=h.useCallback((ee,_)=>{B(_)},[]),U=ee=>{var fe;const _=(fe=ee.target.files)==null?void 0:fe[0];if(!_)return;const ge=new FileReader;ge.onload=()=>{D(ge.result),A(!0)},ge.readAsDataURL(_)},V=async()=>{if(!(!k||!T))try{const ee=await Xi(k,T);if(a&&ee.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(ee);const _=URL.createObjectURL(ee);l(_,ee),A(!1)}catch{d==null||d("Gagal memproses gambar")}},H=h.useRef(null),N=()=>{H.current&&H.current.click()};h.useImperativeHandle(g,()=>({openFileDialog:()=>{var ee;(ee=H.current)==null||ee.click()}}));const G=parseInt(s,10),Y=Xl[i];let te,K;return Y>=1?(K=G,te=G*Y):(te=G,K=G/Y),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%":`${te}px`,height:c!=null&&c.fullWidth?"auto":`${K}px`,aspectRatio:Y,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:N,children:[e.jsx("input",{ref:H,type:"file",accept:"image/*",onChange:U,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(ue,{condition:s.toNumber()>80,children:e.jsx(S.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"})}),z&&Yr.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:()=>A(!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, ${te*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:ee=>ee.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:k&&e.jsx(vn,{image:k,crop:L,zoom:m,aspect:i?Xl[i]:void 0,onCropChange:x,onZoomChange:I,onCropComplete:O,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(j.Button,{size:"sm",secondary:!0,onClick:()=>A(!1),children:"Cancel"}),e.jsx(j.Button,{size:"sm",primary:!0,onClick:V,children:"Crop"})]})]})}),document.body)]})}),Ji=({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(S.Text,{fontSize:r,color:"gray-500",children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ae.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(Le.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(ue,{condition:!!s.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsxs(ae.Flex,{direction:"column",gap:"xs",children:[e.jsx(Jl,{...s.inputProps}),!i&&s.errorMessage&&e.jsx(yr,{message:s.errorMessage})]})]})},$i=({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(S.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ae.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(Le.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(ue,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),l.inputProps.extended&&l.inputProps.extended]})},Ki=({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(Tr.Toggle,{disabled:s,checked:a,onChange:d,label:a?"Active":"Inactive"})})},Ri={InputText:fi,InputDropdown:ui,InputSingleFile:Ni,CheckBoxOptions:_i,RadioOptions:qi,InputTextArea:Zi,ToggleForm:Gi,ActionButton:Qi,FormTitle:Ui,InputDate:Yi,InputImgFile:Ji,Custom:$i},$l=({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(j.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)"}})})})})},Ue="sa-sidepanel-item",Kl="sa-sidepanel-item-styles",ec=`
|
|
52
|
+
`,document.head.appendChild(r)},qr=r=>r==="right"?"right":r==="center"?"center":"left",ii=/^(#|rgb|hsl|var\()/,st=r=>r?ii.test(r)?r:`var(--sa-background-${r})`:void 0,ci=(r,t)=>{if(t)return r[t]},ai=(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)),di=({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:k,height:D,mobileLayout:z="cards",mobileBreakpoint:O="md",groupSeparator:A,summary:x,footer:m,stickyFooter:I=!1,emptyState:T,loading:B=!1,loadingRows:L=8,rowActions:U,rowActionsMode:V="auto",selectable:H=!1,selectedKeys:N,defaultSelectedKeys:G,onSelectionChange:J,isRowSelectable:te})=>{si();const ue=!Be.useMediaQuery(O)&&z!=="scroll",Z=!!(U!=null&&U.length),ee=Nl(),ie=Z&&(V==="column"||V==="auto"&&ee),De=Math.min((U==null?void 0:U.length)??0,Kt+1),ze=De>Kt?1:De,me=lt*2+ze*ni+Math.max(0,ze-1)*Rt,ve=ie?me:1,[Ce,Ae]=h.useState(null);h.useEffect(()=>{if(!Ce)return;const v=()=>Ae(null),w=setTimeout(()=>document.addEventListener("click",v),0);return()=>{clearTimeout(w),document.removeEventListener("click",v)}},[Ce]);const[Ze,Pe]=h.useState(()=>new Set),ce=a!==void 0,[he,pe]=h.useState({}),we=a??he,Ie=v=>{d==null||d(v),ce||pe(v)},sr=p!==void 0,[ir,P]=h.useState(C??null),$=sr?p??null:ir,Y=!k,fe=v=>{k==null||k(v),sr||P(v)},{headerGroups:Ee,leafColumns:xe,hasGroups:Ve}=h.useMemo(()=>{var le;const v=new Set(we.hidden??[]),w=(oe,Se)=>oe.key??(typeof oe.accessor=="string"?oe.accessor:`col-${Se}`),M=r.map((oe,Se)=>{var $e;if(($e=oe.children)!=null&&$e.length){const Gr=oe.children.map((dr,Wr)=>({col:dr,key:w(dr,`${Se}-${Wr}`)})).filter(dr=>!v.has(dr.key));return{col:oe,key:oe.key??`group-${Se}`,isGroup:!0,leaves:Gr}}const ke={col:oe,key:w(oe,`${Se}`)};return{col:oe,key:ke.key,isGroup:!1,leaves:v.has(ke.key)?[]:[ke]}}).filter(oe=>oe.leaves.length>0),_=M.some(oe=>oe.isGroup);let re=M.flatMap(oe=>oe.leaves);if(!_&&((le=we.order)!=null&&le.length)){const oe=new Map(we.order.map((Se,ke)=>[Se,ke]));re=[...re].sort((Se,ke)=>(oe.get(Se.key)??1/0)-(oe.get(ke.key)??1/0))}return{headerGroups:M,leafColumns:re,hasGroups:_}},[r,we]),cr=h.useMemo(()=>new Map(xe.map((v,w)=>[v.key,w])),[xe]),Ye=!Ve&&xe.some(v=>(v.col.headerColSpan??1)>1),Me=xe.map(v=>v.key).join("|"),br=(v,w)=>{const M=v.sortKey??(typeof v.accessor=="string"?v.accessor:void 0);return M?w[M]:void 0},ur=v=>v.sortable??(!!v.sortKey||typeof v.accessor=="string"),Fe=h.useMemo(()=>{if(!Y||!$)return t;const v=xe.find(M=>M.key===$.key);if(!v)return t;const w=$.direction==="asc"?1:-1;return[...t].sort((M,_)=>ai(br(v.col,M),br(v.col,_))*w)},[t,Y,$,xe]),He=!Ve&&!Ye,Sr=!!c&&He,[ar,vr]=Q.useColumnWidths(c??""),Cr=Sr?ar:void 0,xr=h.useRef(null),[Ne,Ge]=h.useState();h.useLayoutEffect(()=>{Ge(void 0)},[Me]),h.useLayoutEffect(()=>{if(!He||Ne||!xr.current)return;const v=xr.current.querySelectorAll("th.sa-tl-leaf");Ge(Array.from(v).map(w=>w.offsetWidth))},[Ne,He]);const[yt,pt]=h.useState(),[so,io]=h.useState(0);h.useLayoutEffect(()=>{if(!Ve||!xr.current)return;const v=xr.current.querySelector(":scope > tr");v&&io(v.offsetHeight)},[Ve,Me]);const kr=(v,w)=>{if((Cr==null?void 0:Cr[w])!=null)return Cr[w];if(v.width!=null)return v.width;if((Ne==null?void 0:Ne[w])!=null)return Ne[w]},bt=(v,w)=>typeof v.width=="number"?v.width:Ne==null?void 0:Ne[w],wr=we.frozenKey&&!Ve&&!Ye?xe.findIndex(v=>v.key===we.frozenKey):-1,E=v=>v<=wr,q=H?_r:0,X=v=>{const w=yt??Ne;if(!w)return q;let M=q;for(let _=0;_<v;_++)M+=w[_]??0;return M};h.useLayoutEffect(()=>{const v=xr.current;if(!v||wr<0){pt(void 0);return}let w=0;const M=()=>{w=0;const re=v.querySelectorAll("th.sa-tl-leaf"),le=Array.from(re).map(oe=>oe.getBoundingClientRect().width);pt(oe=>oe&&oe.length===le.length&&oe.every((Se,ke)=>Math.abs(Se-le[ke])<.5)?oe:le)},_=new ResizeObserver(()=>{w||(w=requestAnimationFrame(M))});return _.observe(v),v.querySelectorAll("th.sa-tl-leaf").forEach(re=>_.observe(re)),M(),()=>{w&&cancelAnimationFrame(w),_.disconnect()}},[Me,wr,H,Ne,Cr]);const ne=h.useRef(null),[ye,Te]=h.useState("100vh");h.useLayoutEffect(()=>{if(D!==void 0)return;const v=()=>{if(ne.current){const w=ne.current.getBoundingClientRect().top;Te(`calc(100vh - ${w}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[D]);const ae=(v,w)=>o?o(v,w):w,Xe=N!==void 0,[_e,Je]=h.useState(()=>new Set(G??[])),Qe=h.useMemo(()=>Xe?new Set(N):_e,[Xe,N,_e]);h.useEffect(()=>{H&&!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).")},[H,!o]);const er=v=>{if(Xe||Je(v),J){const w=Fe.filter((M,_)=>v.has(ae(M,_)));J(Array.from(v),w)}},Br=(v,w)=>H&&(te?te(v,w):!0),gr=v=>{const w=new Set(Qe);w.has(v)?w.delete(v):w.add(v),er(w)},Or=h.useMemo(()=>H?Fe.map((v,w)=>({row:v,i:w,key:ae(v,w)})).filter(({row:v,i:w})=>te?te(v,w):!0).map(({key:v})=>v):[],[H,Fe,te,o]),an=Or.filter(v=>Qe.has(v)),co=Or.length>0&&an.length===Or.length,dn=an.length>0&&!co,qc=()=>{const v=new Set(Qe);co?Or.forEach(w=>v.delete(w)):Or.forEach(w=>v.add(w)),er(v)},ao=(v,w,M)=>{const _=v.render?v.render(w,M,Fe):ci(w,v.accessor);if(b&&!v.render&&typeof _=="string"){const re=v.key??(typeof v.accessor=="string"?v.accessor:void 0),le=re?b[re]:void 0;if(le)return e.jsx(Zl,{text:_,query:le})}return _},ho=xe.length+(H?1:0)+(Z?1:0),hn=["80%","55%","70%","45%","90%","60%"],Zc=(v,w)=>hn[(v*7+w*3)%hn.length],Gc=(v,w)=>e.jsx(Ke.Skeleton,{height:14,width:Zc(v,w),borderRadius:"rounded-sm"}),Qc=Array.from({length:L},(v,w)=>e.jsxs(Q.Tr,{children:[H&&e.jsx(Q.Td,{style:{width:_r,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(Ke.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),xe.map(({col:M,key:_},re)=>e.jsx(Q.Td,{style:{textAlign:qr(M.align)},children:Gc(w,re)},`sa-tl-sk-${w}-${_}`)),Z&&e.jsx(Q.Td,{style:{width:ve,padding:0,border:"none"}})]},`sa-tl-sk-${w}`)),Uc=(v,w)=>{w||Ie({...we,hidden:[...we.hidden??[],v]})},Yc=v=>Ie({...we,frozenKey:we.frozenKey===v?void 0:v}),vt=v=>(U??[]).filter(w=>{var M;return!((M=w.hidden)!=null&&M.call(w,v))}),fn=ie?{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:Rt,paddingLeft:lt,paddingRight:lt,height:"100%"}:{position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:Rt,paddingRight:lt,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},Ct=(v,w,M,_)=>{var $e;const re=($e=v.disabled)==null?void 0:$e.call(v,w),le=(_==null?void 0:_.showLabel)??v.showLabel,oe=(_==null?void 0:_.size)??"xs",Se=e.jsx(j.Button,{size:oe,variant:v.variant??"tertiary",tone:v.tone??"neutral",disabled:re,onClick:()=>v.onClick(w,M),iconLeft:v.icon?e.jsx(F.Icon,{name:v.icon,size:"sm"}):void 0,children:le&&v.label}),ke=v.tooltip;return ke?e.jsx(Le.Tooltip,{label:ke,position:"top-end",children:Se}):Se},Xc=(v,w)=>{const M=vt(v);if(!M.length)return null;if(M.length>Kt){const re=ae(v,w),le=(Ce==null?void 0:Ce.rowKey)===re;return e.jsx("div",{className:"sa-tl-row-actions","data-mode":ie?"column":"overlay",style:fn,onClick:oe=>oe.stopPropagation(),children:e.jsx(Le.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(j.Button,{size:"xs",variant:"tertiary",onClick:oe=>{const Se=oe.currentTarget.getBoundingClientRect();Ae(le?null:{rowKey:re,top:Se.bottom+4,right:window.innerWidth-Se.right})},children:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions","data-mode":ie?"column":"overlay",style:fn,children:M.map(re=>e.jsx(h.Fragment,{children:Ct(re,v,w)},re.key))})},Jc=(v,w)=>{const M=vt(v);return M.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:Nr},children:M.map(_=>e.jsx(h.Fragment,{children:Ct(_,v,w,{showLabel:!0,size:"sm"})},_.key))}):null},$c=(v,w)=>{const M=vt(v);return M.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:M.map(_=>e.jsx(h.Fragment,{children:Ct(_,v,w,{showLabel:!1})},_.key))}):null},fo=(v,w)=>{var Wr;const{col:M,key:_}=v,re=cr.get(_)??0,le=E(re),oe=le&&re===wr,Se=($==null?void 0:$.key)===_?$.direction:null,ke=g&&!M.disableMenu?e.jsx(ql,{active:!!Se||le||!!M.filterActive,canSort:ur(M),canHide:!M.locked,sortDir:Se,frozen:le,onSort:wt=>fe({key:_,direction:wt}),onClearSort:()=>fe(null),onToggleFreeze:()=>Yc(_),onHide:()=>Uc(_,M.locked),filterSlot:(Wr=M.renderFilter)==null?void 0:Wr.call(M),filterActive:M.filterActive}):null,$e=M.align==="right",Gr=M.align==="right"?"flex-end":M.align==="center"?"center":"flex-start",dr=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Gr,overflow:"hidden"},children:[M.icon&&e.jsx(F.Icon,{name:M.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:nt,children:M.title})]});return e.jsx(Q.Th,{className:`sa-tl-leaf${le?" sa-tl-frozen":""}`,rowSpan:w==null?void 0:w.rowSpan,colSpan:w==null?void 0:w.colSpan,minWidth:M.minWidth,numeric:M.numeric,resizable:He?M.resizable:!1,defaultWidth:bt(M,re),style:{textAlign:qr(M.align),width:kr(M,re),position:"sticky",top:(w==null?void 0:w.top)??0,left:le?X(re):void 0,zIndex:le?3:2,backgroundColor:Ar,boxShadow:oe?Gl:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:$e?e.jsxs(e.Fragment,{children:[ke,dr]}):e.jsxs(e.Fragment,{children:[dr,ke]})})},`th-${_}`)},Kc=()=>{const v=[];for(let w=0;w<xe.length;){const M=xe[w],_=M.col.headerColSpan??1,re=Math.max(1,Math.min(_,xe.length-w));v.push(fo(M,re>1?{colSpan:re}:void 0)),w+=re}return v},un=v=>e.jsx(Q.Th,{rowSpan:v==null?void 0:v.rowSpan,style:{width:_r,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:Ar,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:e.jsx(fr.Checkbox,{size:"sm",variant:dn?"indeterminate":"select",checked:co||dn,disabled:Or.length===0,onChange:qc,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),Rc=(v,w,M)=>{const _=ae(v,w);return e.jsx(Q.Td,{className:"sa-tl-frozen",style:{width:_r,padding:0,position:"sticky",left:0,zIndex:2,...M?{"--sa-tl-bg":M}:{}},children:Br(v,w)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:re=>re.stopPropagation(),children:e.jsx(fr.Checkbox,{size:"sm",checked:Qe.has(_),onChange:()=>gr(_),"aria-label":"Pilih baris"})})},`tl-select-${w}`)},uo=xe.filter(v=>!v.col.hideOnMobile),go=uo.find(v=>v.col.primary)??uo[0],ea=uo.filter(v=>v!==go),ra=v=>Pe(w=>{const M=new Set(w);return M.has(v)?M.delete(v):M.add(v),M}),gn=(v,w)=>ea.map(({col:M,key:_})=>{const re=ao(M,v,w),le={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right",...M.numeric?{fontVariantNumeric:"tabular-nums"}:{}},oe=typeof re=="string"||typeof re=="number"?e.jsx(S.Text,{style:le,children:re}):e.jsx("div",{style:le,children:re});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof M.title=="string"?e.jsx(S.Text,{color:"subtle",fontWeight:"medium",style:{color:li,flexShrink:0},children:M.title}):e.jsx("div",{style:{flexShrink:0},children:M.title}),oe]},_)}),yo=(v,w)=>{const M=go?ao(go.col,v,w):null;return typeof M=="string"||typeof M=="number"?e.jsx(S.Text,{as:"span",style:nt,children:M}):e.jsx("span",{style:nt,children:M})},ta=e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:L},(v,w)=>e.jsxs(f.Box,{style:{border:Nr,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Ke.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(Ke.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(Ke.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${w}`))}),yn=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}),oa=B?ta:Fe.length===0?yn:z==="expand"?e.jsx(f.Box,{style:{display:"flex",flexDirection:"column"},children:Fe.map((v,w)=>{const M=ae(v,w),_=Ze.has(M),le=H&&Qe.has(M)?eo:st(n==null?void 0:n(v,w));return e.jsxs("div",{style:{borderBottom:Nr,backgroundColor:le},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[Br(v,w)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(fr.Checkbox,{size:"sm",checked:Qe.has(M),onChange:()=>gr(M),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>ra(M),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:[yo(v,w),e.jsx(F.Icon,{name:_?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),Z&&$c(v,w)]}),_&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:gn(v,w)})]},M)})}):e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Fe.map((v,w)=>{const M=ae(v,w),_=H&&Qe.has(M);return e.jsxs(f.Box,{style:{border:Nr,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:_?eo:st(n==null?void 0:n(v,w))},children:[Br(v,w)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(fr.Checkbox,{size:"sm",checked:Qe.has(M),onChange:()=>gr(M),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:yo(v,w)})]}):yo(v,w),gn(v,w),Z&&Jc(v,w)]},M)})}),la=s&&He&&Ne!==void 0,pn=i==="fixed"&&!s&&(He?Ne!==void 0:!0),na=pn&&!He,xt=m&&m.length>0?m.map((v,w)=>e.jsx(Q.Tr,{children:v.cells.map((M,_)=>e.jsx(Q.Td,{colSpan:M.colSpan,rowSpan:M.rowSpan,numeric:M.numeric,style:{textAlign:qr(M.align)},children:M.content},`tl-foot-${w}-${_}`))},`tl-foot-${w}`)):null,sa=e.jsxs(Q.Table,{className:"sa-table-layout",fullWidth:!0,size:l,resizable:la,style:pn?{tableLayout:"fixed"}:void 0,onWidthsChange:Sr?vr:void 0,children:[na&&e.jsxs("colgroup",{children:[H&&e.jsx("col",{style:{width:_r}}),xe.map(({col:v,key:w},M)=>e.jsx("col",{style:{width:kr(v,M)}},`col-${w}`)),Z&&e.jsx("col",{style:{width:ve}})]}),e.jsx(Q.Thead,{ref:xr,children:Ve?e.jsxs(e.Fragment,{children:[e.jsxs(Q.Tr,{children:[H&&un({rowSpan:2}),Ee.map(v=>v.isGroup?e.jsx(Q.Th,{colSpan:v.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:Ar},children:e.jsx("span",{style:nt,children:v.col.title})},`grp-${v.key}`):fo(v.leaves[0],{rowSpan:2})),Z&&e.jsx(Q.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:ve,padding:0,border:"none",backgroundColor:Ar}})]}),e.jsx(Q.Tr,{children:Ee.flatMap(v=>v.isGroup?v.leaves.map(w=>fo(w,{top:so})):[])})]}):e.jsxs(Q.Tr,{children:[H&&un(),Kc(),Z&&e.jsx(Q.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:ve,padding:0,border:"none",backgroundColor:Ar}})]})}),e.jsx(Q.Tbody,{children:B?Qc:Fe.length===0?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:ho,children:yn})}):e.jsxs(e.Fragment,{children:[Fe.map((v,w)=>{const M=A==null?void 0:A(v,w,w>0?Fe[w-1]:void 0),re=H&&Qe.has(ae(v,w))?eo:st(n==null?void 0:n(v,w));return e.jsxs(h.Fragment,{children:[M!=null&&M!==!1&&e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:ho,style:{backgroundColor:Ar},children:M})}),e.jsxs(Q.Tr,{children:[H&&Rc(v,w,re),xe.map(({col:le,key:oe},Se)=>{var bn;const ke=(bn=le.cellProps)==null?void 0:bn.call(le,v,w,Fe);if(ke!=null&&ke.hidden)return null;const $e=E(Se),Gr=$e&&Se===wr,dr=ao(le,v,w),Wr=typeof le.bg=="function"?le.bg(v,w,Fe):le.bg,wt=st(Wr)??re;return e.jsx(Q.Td,{className:$e?"sa-tl-frozen":void 0,colSpan:ke==null?void 0:ke.colSpan,rowSpan:ke==null?void 0:ke.rowSpan,numeric:le.numeric,style:{textAlign:qr(le.align),width:kr(le,Se),minWidth:le.minWidth,position:$e?"sticky":void 0,left:$e?X(Se):void 0,zIndex:$e?1:void 0,boxShadow:Gr?Gl:void 0,...wt?{"--sa-tl-bg":wt}:{}},children:typeof dr=="string"?e.jsx(S.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:qr(le.align)},children:dr}):dr},`tl-cell-${w}-${oe}`)}),Z&&e.jsx(Q.Td,{className:ie?"sa-tl-frozen":void 0,style:{position:"sticky",right:0,width:ve,padding:0,overflow:ie?void 0:"visible",zIndex:2,border:"none"},children:Xc(v,w)})]})]},ae(v,w))}),x!=null&&e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:ho,children:x})})]})}),xt&&e.jsx(Q.Tfoot,{className:I?"sa-tl-sticky-foot":void 0,children:xt})]}),po=Ce?Fe.findIndex((v,w)=>ae(v,w)===Ce.rowKey):-1,bo=po>=0?Fe[po]:null;return e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{ref:ne,className:"sa-tl-scroll",fullWidth:!0,style:{overflow:"auto",height:D??ye},children:ue?e.jsxs(e.Fragment,{children:[oa,xt&&!B&&Fe.length>0&&e.jsx(f.Box,{style:{borderTop:Nr},children:e.jsx(Q.Table,{fullWidth:!0,size:l,className:"sa-table-layout",children:e.jsx(Q.Tbody,{children:xt})})})]}):sa}),Ce&&bo&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:Ce.top,right:Ce.right},onClick:v=>v.stopPropagation(),children:vt(bo).map(v=>e.jsx("div",{style:{padding:"2px 4px"},children:Ct(v,bo,po,{showLabel:!0,size:"sm"})},v.key))})]})},ro=r=>r==="asc"||r==="desc",hi=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:o="sortOrder",pageKey:n="page",defaultSort:l=null,paramKeys:s,scopeId:i,storage:c=qt}=r,{searchParams:a,setSearchParams:d,searchQueries:g}=qe(),b=a.toString(),p=i?Lr.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)||!ro(x.direction)||d({...Object.fromEntries(a.entries()),[t]:x.key,[o]:x.direction},{replace:!0})},[]);const k=h.useMemo(()=>{const x=a.get(t),m=a.get(o);return x&&ro(m)?{key:x,direction:m}:l},[b,t,o,l]);h.useEffect(()=>{if(!p)return;const x=a.get(t),m=a.get(o);x&&ro(m)?c.set(p,{key:x,direction:m}):c.remove(p)},[b,p,t,o,c]);const D=(s==null?void 0:s.sortBy)??"sortBy",z=(s==null?void 0:s.sortOrder)??"sortOrder",O=h.useMemo(()=>k?{[D]:k.key,[z]:k.direction}:{},[k,D,z]),A=h.useCallback(x=>{const m={...g};x?(m[t]=x.key,m[o]=x.direction):(delete m[t],delete m[o]),delete m[n],d(m)},[g,t,o,n,d]);return{sort:k,setSort:A,params:O}},it=({of:r,render:t})=>h.Children.toArray(r==null?void 0:r.map((o,n,l)=>t(o,n,l))),ge=({condition:r,fallback:t,children:o,loading:n,isLoading:l})=>e.jsx(e.Fragment,{children:l?n:r?o:t}),be=r=>e.jsx(S.Text,{...r,fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),yr=r=>e.jsx(S.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(ge,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(S.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(ge,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Le.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(ge,{condition:!!l.description,children:e.jsx(S.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(yr,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},ui=({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(ge,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(S.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(ge,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Le.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(ge,{condition:!!l.description,children:e.jsx(S.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(Fr.Dropdown,{size:r,...l.inputProps,error:!!l.errorMessage})}),!s&&l.errorMessage&&e.jsx(yr,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},gi=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",yi=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 ${gi(r.errorMessage,r.status)}`},children:[e.jsx(F.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(S.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(S.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(S.Text,{fontSize:"sm",color:"gray-500",children:(c=r.fileSupports)==null?void 0:c.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function pi(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const Ul=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},bi=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 vi(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 Ci=r=>{const t=r.split(" ");let o=t[0].charAt(0);return t.length>1&&(o+=""+t[1].charAt(0)),o.toUpperCase()};function xi(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 wi="sa-admin",nr=r=>`var(--${wi}-${r})`,Di={base:{borderColor:nr("base-border-color"),textColor:nr("base-text-color"),iconColor:nr("base-icon-color"),placeholderColor:nr("base-placeholder-color")},document:{bgColor:nr("document-bg-color")},sidebar:{bgColor:nr("sidebar-bg-color"),borderColor:nr("sidebar-border-color"),maxWidth:nr("sidebar-max-width"),width:nr("sidebar-width"),collapseWidth:nr("sidebar-collapse-width"),collapseV2Width:nr("sidebar-v2-collapse-width")}},Si=24*60*60*1e3,ki=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))},Bi=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,mi=/--+/,Ei=/-$/;function Fi(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function Ii(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function Mi(r){return/^[A-Za-z\s]+$/.test(r)}const Ti=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()},Li=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()},Ai=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()},Oi=r=>Bi.test(r);function Wi(r){return!(mi.test(r)||Ei.test(r))}const zi=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()},Hi=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 Pi(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 Vi(r){const t=r.split("/");return t[t.length-1]}const ji=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(F.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(S.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?Vi(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(S.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(S.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(S.Text,{fontSize:"sm",fontWeight:"medium",children:Pi(((o=r.fileSelected)==null?void 0:o.size.toString())||"100000")}),e.jsx(F.Icon,{name:"Dot",size:"xs"}),e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:Ul(new Date)})]})]})]}),e.jsx(j.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(F.Icon,{name:"Trash1"})})]})},Yl=({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=Be.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(S.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(S.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(S.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.helperText}),o.errorText&&r==="error"&&e.jsx(S.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorText}),o.errorMessage&&!o.errorText&&e.jsx(S.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 k;return o.handleOnChangeFile(((k=C.target.files)==null?void 0:k.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(ji,{fileSelected:o.fileSelected,defaultFile:o.defaultFile,handleOnDeleteFile:o.handleOnDeleteFile,handleOnClickFile:l}),!o.fileSelected&&!o.defaultFile&&e.jsx(yi,{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]})},Ni=({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(ge,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(S.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(ge,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Le.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(ge,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(de.Flex,{direction:"column",gap:"xs",children:[e.jsx(Yl,{...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(yr,{message:l.errorMessage})]})]})},_i=({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(ge,{condition:!!l,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(be,{children:s.title}),e.jsx(Re.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(ge,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Le.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(ge,{condition:!!s.description,children:e.jsx(S.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(it,{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(yr,{message:s.errorMessage})]})},qi=({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(ge,{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(ge,{condition:!!n.description,children:e.jsx(S.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(it,{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(kt.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(S.Text,{color:"gray-500",style:{marginLeft:28},children:b}),d]})})}),n.errorMessage&&e.jsx(yr,{message:n.errorMessage})]})},Zi=({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(ge,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(S.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(ge,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Le.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(ge,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(de.Flex,{direction:"column",gap:"xs",children:[e.jsx(St.Textarea,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(yr,{message:l.errorMessage})]})]})},Gi=({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(ge,{condition:n,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:l,children:[e.jsx(be,{children:s.title}),e.jsx(S.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(ge,{condition:!!((c=s.tooltip)!=null&&c.label),children:e.jsx(Le.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(ge,{condition:!!s.titleDescription,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})})]})}),e.jsx(Tr.Toggle,{checked:s.checked,onChange:s.onChange,label:s.label,description:s.description}),s.errorMessage&&e.jsx(yr,{message:s.errorMessage})]})},Qi=({variant:r="primary",size:t="md",...o})=>{const n=Mr.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(Re.Body2,{props:{style:i},children:o.title});case"sm":case"md":return e.jsx(Re.SubH3,{props:{style:i},children:o.title});case"lg":return e.jsx(Re.SubH2,{props:{style:i},children:o.title});default:return o.title}};return e.jsx(j.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()})},Ui=r=>e.jsx(Re.H5,{props:{...r},children:r.title}),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",onClick:l.onClickContainer,children:[l.title&&e.jsx(ge,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(S.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(ge,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(Le.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(ge,{condition:!!l.description,children:e.jsx(S.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(pr.StarasiaDate,{size:r,...l.inputProps,status:l.errorMessage?"error":void 0})}),!s&&l.errorMessage&&e.jsx(yr,{message:l.errorMessage})]})]})};async function Xi(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 Xl={"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},Jl=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=Be.useMediaQuery("md"),[p,C]=h.useState(!1),[k,D]=h.useState(null),[z,O]=h.useState(!1),[A,x]=h.useState({x:0,y:0}),[m,I]=h.useState(1),[T,B]=h.useState(null),[L,U]=h.useState(!1);h.useEffect(()=>{t===null&&l(null)},[t]);const V=h.useCallback((ee,ie)=>{B(ie)},[]),H=ee=>{var ze;const ie=(ze=ee.target.files)==null?void 0:ze[0];if(!ie)return;const De=new FileReader;De.onload=()=>{D(De.result),O(!0)},De.readAsDataURL(ie)},N=async()=>{if(!(!k||!T||L)){U(!0);try{const ee=await Xi(k,T);if(a&&ee.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(ee);const ie=URL.createObjectURL(ee);l(ie,ee),O(!1)}catch{d==null||d("Gagal memproses gambar")}finally{U(!1)}}},G=h.useRef(null),J=()=>{G.current&&G.current.click()};h.useImperativeHandle(g,()=>({openFileDialog:()=>{var ee;(ee=G.current)==null||ee.click()}}));const te=parseInt(s,10),K=Xl[i];let ue,Z;return K>=1?(Z=te,ue=te*K):(ue=te,Z=te/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%":`${ue}px`,height:c!=null&&c.fullWidth?"auto":`${Z}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:J,children:[e.jsx("input",{ref:G,type:"file",accept:"image/*",onChange:H,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(ge,{condition:s.toNumber()>80,children:e.jsx(S.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"})}),z&&Yr.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:()=>{L||O(!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, ${ue*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:ee=>ee.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:k&&e.jsx(vn,{image:k,crop:A,zoom:m,aspect:i?Xl[i]:void 0,onCropChange:x,onZoomChange:I,onCropComplete:V,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(j.Button,{size:"sm",secondary:!0,disabled:L,onClick:()=>O(!1),children:"Cancel"}),e.jsx(j.Button,{size:"sm",primary:!0,isLoading:L,onClick:N,children:"Crop"})]})]})}),document.body)]})}),Ji=({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(ge,{condition:!!l,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(be,{children:s.title}),e.jsx(S.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(ge,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Le.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(ge,{condition:!!s.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsxs(de.Flex,{direction:"column",gap:"xs",children:[e.jsx(Jl,{...s.inputProps}),!i&&s.errorMessage&&e.jsx(yr,{message:s.errorMessage})]})]})},$i=({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(ge,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(be,{children:l.title}),e.jsx(S.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(ge,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(Le.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(ge,{condition:!!l.description,children:e.jsx(S.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),l.inputProps.extended&&l.inputProps.extended]})},Ki=({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(Tr.Toggle,{disabled:s,checked:a,onChange:d,label:a?"Active":"Inactive"})})},Ri={InputText:fi,InputDropdown:ui,InputSingleFile:Ni,CheckBoxOptions:_i,RadioOptions:qi,InputTextArea:Zi,ToggleForm:Gi,ActionButton:Qi,FormTitle:Ui,InputDate:Yi,InputImgFile:Ji,Custom:$i},$l=({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(j.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)"}})})})})},Ue="sa-sidepanel-item",Kl="sa-sidepanel-item-styles",ec=`
|
|
53
53
|
.${Ue} {
|
|
54
54
|
display: block;
|
|
55
55
|
box-sizing: border-box;
|
|
@@ -100,4 +100,4 @@
|
|
|
100
100
|
cursor: not-allowed;
|
|
101
101
|
opacity: 0.55;
|
|
102
102
|
}
|
|
103
|
-
`;function rc(){if(typeof document>"u"||document.getElementById(Kl))return;const r=document.createElement("style");r.id=Kl,r.textContent=ec,document.head.appendChild(r)}const tc=({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(rc,[]),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(ae.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[n?e.jsx(S.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(S.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:s}):null,i?e.jsx(S.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:i}):null]})})),to=18,oc=40,Rl="280ms cubic-bezier(0.4, 0, 0.2, 1)",en="var(--sa-border-subtle, #0b120e24)",lc=`1px solid ${en}`,rn="var(--sa-background-primary, #ffffff)",nc=({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:k,className:D,pageLayout:z,overlay:A="mobile",wrapperProps:L,contentProps:x})=>{const m=ke.useMediaQuery("md"),I=o!==void 0,[T,B]=h.useState(n),O=I?o:T,U=()=>{const ge=!O;I||B(ge),l==null||l(ge)},V=i==="left",H=typeof c=="number"?`${c}px`:c,N=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${H})`,G=p??{collapse:"Collapse panel",expand:"Expand panel"},Y=g==="center"?{top:"50%",transform:"translateY(-50%)"}:g==="bottom"?{bottom:b}:{top:b},te=O?V?"ChevronRight":"ChevronLeft":V?"ChevronLeft":"ChevronRight",K=z!==void 0&&(A==="mobile"?!m:A),ee=K?{position:"absolute",top:0,bottom:0,width:s,transform:`translateX(${O?V?"-100%":"100%":"0"})`,transition:`transform ${Rl}`,zIndex:50,...V?{left:0}:{right:0},...C}:{position:"sticky",top:H,alignSelf:"flex-start",width:O?0:s,flexShrink:0,height:N,transition:`width ${Rl}`,...C},_=e.jsxs(f.Box,{className:D,style:ee,children:[e.jsx(f.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:O?void 0:V?"border-solid-r":"border-solid-l",borderWidth:O?void 0:V?"border-r":"border-l",style:{backgroundColor:rn,borderColor:en},children:e.jsxs(f.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:s,customMinWidth:s,style:V?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,...k},children:r})]})}),d&&e.jsx(Pr,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:U,"aria-label":O?G.expand:G.collapse,"aria-expanded":!O,"aria-pressed":O,customWidth:to,customHeight:oc,style:{...Y,backgroundColor:rn,border:lc,zIndex:5,...V?{right:-to,borderLeft:"none",borderRadius:"0 var(--sa-radii-md, 8px) var(--sa-radii-md, 8px) 0"}:{left:-to,borderRight:"none",borderRadius:"var(--sa-radii-md, 8px) 0 0 var(--sa-radii-md, 8px)"}},children:e.jsx(F.Icon,{name:te,size:"sm"})})]});return z===void 0?_:e.jsxs(f.Box,{direction:"row",position:"relative",...L,style:{height:`calc(100vh - ${H})`,overflow:"hidden",...(L==null?void 0:L.style)??{}},children:[!K&&V?_: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:z}),!K&&!V?_:null,K&&e.jsxs(e.Fragment,{children:[!O&&e.jsx("div",{onClick:U,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),_]})]})},oo="--app-aside-width",sc=r=>typeof r=="number"?`${r}px`:r,ic=({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(oo,l?sc(s):"0px"),()=>i.style.removeProperty(oo)},[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})]})},lo="--sa-floating-footer-height",cc=r=>typeof r=="number"?`${r}px`:r,ac=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:o,respectAside:n=!1,offsetRight:l,containerProps:s})=>{const i=h.useRef(null),c=l!=null?cc(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(lo,`${b}px`)};d();const g=new ResizeObserver(d);return i.current&&g.observe(i.current),()=>{g.disconnect(),a.style.removeProperty(lo)}},[]),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($l,{...o,customBottom:(o==null?void 0:o.customBottom)||"5.7rem"}),r]})})},dc=({fields:r})=>e.jsx(f.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(it,{of:r,render:(t,o)=>e.jsx(hc,{...t},o)})}),hc=({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(S.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(S.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(S.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 uc=({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(j.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:o,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{secondary:!0,iconLeft:s,onClick:o,children:l?e.jsx(S.Text,{fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(j.Button,{secondary:!0,onClick:o,children:a||r})});case"success":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{success:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{success:!0,onClick:o,children:a||r})});default:return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.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(Re.Body1,{props:{align:"center",textAlign:"center"},children:p>2?null:b},p))}),i?g():null]})},R={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function gc({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:R.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:R.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:R.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:R.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:R.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:R.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:R.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:R.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:R.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:R.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:R.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:R.cFFFFFF,stroke:R.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:R.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:R.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:R.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:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:R.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:R.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:R.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:R.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:R.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:R.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:R.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:R.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:R.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:R.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:R.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:R.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:R.c001A72})]})})}function yc({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(gc,{width:t?600:300}),e.jsx(S.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(S.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const se={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 pc({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:se.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:se.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:se.cEFF3F8,stroke:se.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:se.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:se.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:se.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:se.c956847,stroke:se.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:se.c956847,stroke:se.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:se.cC8CEF4,stroke:se.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:se.cC8CEF4,stroke:se.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:se.cC8CEF4,stroke:se.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:se.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:se.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:se.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:se.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:se.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:se.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:se.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:se.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:se.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:se.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:se.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:se.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:se.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function bc({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(pc,{width:t?600:300}),e.jsx(S.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(j.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 vc({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 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",overflow:"overflow-hidden",children:[e.jsx(vc,{width:t?600:300}),e.jsx(S.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(S.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const xc=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(S.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Oe.DialogBody,{children:typeof r.description=="string"?e.jsx(S.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(j.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(j.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},wc=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:k={borderBottom:!0},footerProps:D={borderTop:!0},variantTag:z="info"})=>{const A=h.useRef(null),[L,x]=h.useState("100vh");h.useEffect(()=>{const B=()=>{if(A.current){const O=A.current.getBoundingClientRect().top;x(`calc(100vh - ${O}px)`)}};return B(),window.addEventListener("resize",B),()=>window.removeEventListener("resize",B)},[]);const m=()=>d?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(S.Text,{fontWeight:"medium",children:a}),e.jsx(rr.Badges,{border:!0,text:d,variant:z})]}):e.jsx(S.Text,{fontWeight:"medium",children:a}),I=()=>i||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:a?m():null}),e.jsx(f.Box,{direction:"column",...b,children:g??null})]}),T=!!(i||a||g);return e.jsxs(f.Box,{ref:A,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:L,...(p==null?void 0:p.style)??{}},children:[i!==null&&T?e.jsx(jt,{...k,children:I()}):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(Nt,{...D,children:c}):null]})}),Dc=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(j.Button,{...l.includes(c.value)?{primary:!0}:{secondary:!0},onClick:()=>i(c),children:c.label},a))})});function ct(r){return null}ct.displayName="LayoutDialog.Header";function at(r){return null}at.displayName="LayoutDialog.Body";function dt(r){return null}dt.displayName="LayoutDialog.Aside";function ht(r){return null}ht.displayName="LayoutDialog.Footer";const Ve={"lyd-root":"_lyd-root_8mm4b_1","lyd-backdrop":"_lyd-backdrop_8mm4b_38","lyd-panel":"_lyd-panel_8mm4b_47","lyd-modal":"_lyd-modal_8mm4b_58","lyd-fullscreen":"_lyd-fullscreen_8mm4b_72","lyd-sidebar":"_lyd-sidebar_8mm4b_80","lyd-header":"_lyd-header_8mm4b_110","lyd-header-content":"_lyd-header-content_8mm4b_121","lyd-header-actions":"_lyd-header-actions_8mm4b_129","lyd-main":"_lyd-main_8mm4b_136","lyd-body":"_lyd-body_8mm4b_143","lyd-aside":"_lyd-aside_8mm4b_149","lyd-footer":"_lyd-footer_8mm4b_165","lyd-vm-group":"_lyd-vm-group_8mm4b_178","lyd-vm-btn":"_lyd-vm-btn_8mm4b_186","lyd-close-btn":"_lyd-close-btn_8mm4b_209"},Sc=[{mode:"sidebar",label:"Sidebar",renderIcon:()=>e.jsx(Bc,{})},{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 kc({value:r,onChange:t}){return e.jsx("div",{className:Ve["lyd-vm-group"],role:"group","aria-label":"View mode",children:Sc.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 Bc(){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 no={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function mc(r){return r?r in no?no[r]:r:no.xl}function ft(r,t){let o=null;return h.Children.forEach(r,n=>{h.isValidElement(n)&&n.type===t&&(o=n.props.children??null)}),o}function Ec(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,[k,D]=h.useState(l),z=n??k,L=ke.useMediaQuery("md")?z:"fullscreen",x=h.useCallback(G=>{n===void 0&&D(G),s==null||s(G)},[n,s]),m=h.useRef(null);h.useEffect(()=>{if(!(!t||!p))return m.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=m.current??""}},[t,p]);const I=h.useRef(o);I.current=o,h.useEffect(()=>{if(t)return Oe.registerOverlay({onEscape:g?void 0:()=>I.current()})},[t,g]);const T=h.useMemo(()=>ft(C,ct),[C]),B=h.useMemo(()=>ft(C,at),[C]),O=h.useMemo(()=>ft(C,dt),[C]),U=h.useMemo(()=>ft(C,ht),[C]);if(!t)return null;const V=[Ve["lyd-panel"],L==="modal"&&Ve["lyd-modal"],L==="fullscreen"&&Ve["lyd-fullscreen"],L==="sidebar"&&Ve["lyd-sidebar"]].filter(Boolean).join(" "),H={"--lyd-max-w":mc(a),...d!==void 0&&{"--lyd-aside-w":d}},N=()=>{b||o()};return typeof document>"u"?null:Yr.createPortal(e.jsxs("div",{className:Ve["lyd-root"],style:H,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:Ve["lyd-backdrop"],onClick:N,"aria-hidden":"true"}),e.jsxs("div",{className:V,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(kc,{value:z,onChange:x}),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:B}),O&&e.jsx("aside",{className:Ve["lyd-aside"],children:O})]}),U&&e.jsx("div",{className:Ve["lyd-footer"],children:U})]})]}),document.body)}const Zr=Ec;Zr.Header=ct,Zr.Body=at,Zr.Aside=dt,Zr.Footer=ht;function Fc({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 Ic=/\.(jpe?g|png|gif|webp|bmp|svg|avif)(\?|#|$)/i,Mc=/\.pdf(\?|#|$)/i,Tc=/\.(mp4|webm|ogv|mov|m4v)(\?|#|$)/i,Lc=/\.(mp3|wav|ogg|m4a|aac|flac)(\?|#|$)/i;function Ac(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(Ic)?"image":o==="application/pdf"||n(Mc)?"pdf":o.startsWith("video/")||n(Tc)?"video":o.startsWith("audio/")||n(Lc)?"audio":"other"}const tn={display:"block",maxWidth:"100%",maxHeight:"70vh",margin:"0 auto",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)"},Oc={width:"100%",height:"75vh",border:"none",borderRadius:"var(--sa-radii-sm, 6px)"};function Wc({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:tn});case"pdf":return e.jsx("iframe",{src:l,title:s,style:Oc});case"video":return e.jsx("video",{src:l,controls:!0,style:{...tn,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(S.Text,{fontSize:"sm",color:"gray-500",children:n}),e.jsx(j.Button,{type:"button",variant:"link",iconLeft:e.jsx(F.Icon,{name:"SquareArrowExpand"}),onClick:()=>window.open(l,"_blank","noopener"),children:o})]})}}const zc=({attachment:r,onClose:t,onDownload:o,isDownloading:n,kind:l,maxWidth:s,labels:i})=>{if(!r)return null;const c=Ac(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(S.Text,{fontWeight:"semibold",truncate:!0,children:r.fileName}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[o?e.jsx(j.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(j.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(Wc,{kind:c,attachment:r,openLabel:d.openInNewTab,unsupportedLabel:d.unsupported})})]})},on="var(--sa-border-subtle, #e5e7eb)",ut=()=>e.jsx(f.Box,{style:{width:1,height:22,backgroundColor:on}}),Hc=r=>typeof r=="number"?`${r}px`:r;function ln({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:Hc(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 ${on}`,boxShadow:"var(--sa-shadow-xl, 0 10px 25px -5px rgb(0 0 0/0.15))",...a},children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",whiteSpace:"nowrap",style:{paddingInline:6},children:g}),e.jsx(ut,{}),t,n&&e.jsxs(e.Fragment,{children:[e.jsx(ut,{}),e.jsx(Le.Tooltip,{label:l,position:"top",children:e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Cross",size:"xs"}),"aria-label":l,onClick:n,disabled:s})})]})]})})}ln.Divider=ut;const gt=r=>{const{variant:t="outlined",overflow:o="hidden",style:n,children:l,...s}=r;return e.jsx(Dt.Card,{variant:t,overflow:o,style:{display:"flex",flexDirection:"column",...n},...s,children:l})},Pc=r=>r==null?void 0:typeof r=="number"?`${r}px`:r,nn=({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:Pc(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]}),sn=({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(ae.Flex,{direction:"row",align:"center",gap:"sm",children:[r,e.jsxs(f.Box,{flex:"1",style:{minWidth:0},children:[t!=null&&e.jsx(S.Text,{fontWeight:"semibold",truncate:!0,children:t}),o!=null&&e.jsx(S.Text,{fontSize:"sm",color:"subtlest",truncate:!0,children:o})]}),n!=null&&e.jsx(f.Box,{style:{flexShrink:0},children:n})]})}),cn=({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(ae.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})]})});gt.Media=nn,gt.Header=sn,gt.Footer=cn;const Vc=r=>{const{defaultTab:t=0,paramKey:o="tab"}=r||{},{useSearchParams:n}=tr(),[l,s]=n(),i=Ir.searchParamsToObject(l.toString());return{activeTab:i[o]?parseInt(i[o]):t,handleTabChange:d=>{s({...i,[o]:d.toString()})},searchQueries:i}};function jc({appName:r,menuConfig:t,formatTitle:o}){const{useLocation:n}=tr(),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 Nc=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=tr(),[n,l]=r(),s=Ir.searchParamsToObject(n.toString()),i=t(),c=o(),a=i.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,k)=>n.has(C)&&n.get(C)===k,getQueryParam:C=>n.get(C),getRouteParam:C=>i[C],params:i,location:c,id:a,hasId:!!a}};function _c(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=oo,u.AdvanceFilterBar=fl,u.App=Dn,u.AppComponent=zo,u.AppContext=Bt,u.AppLayout=Ln,u.AsideBar=ic,u.AttachmentPreview=zc,u.BackButton=On,u.ColumnFilterDropdown=zl,u.ColumnHeaderFilter=qs,u.ColumnMenu=ql,u.ConfirmationDialog=xc,u.DataTable=Pl,u.DecisionWrapper=ue,u.EachUtils=it,u.EmptyStatePage=uc,u.EntityCard=gt,u.EntityCardFooter=cn,u.EntityCardHeader=sn,u.EntityCardMedia=nn,u.FLOATING_FOOTER_HEIGHT_VAR=lo,u.FilterBar=Ms,u.FilterDrawer=hl,u.FloatingFooter=ac,u.ForbiddenPage=bc,u.Form=Ri,u.FullSection=wc,u.HeaderLeftSlot=Sn,u.HeaderLeftSlotOutlet=Vo,u.HeaderLeftSlotProvider=Po,u.Highlight=Zl,u.HorizontalField=Vn,u.ImagePreview=Fc,u.InputFile=Yl,u.InputImage=Jl,u.LayoutDialog=Zr,u.LayoutDialogAside=dt,u.LayoutDialogBody=at,u.LayoutDialogFooter=ht,u.LayoutDialogHeader=ct,u.ModuleSwitcher=Wn,u.ModuleSwitcherModal=el,u.NotFoundPage=yc,u.PageLayout=qn,u.Pressable=Pr,u.RightDrawer=ll,u.SIDEBAR_DEFAULT_WIDTH=Et,u.SIDEBAR_MAX_WIDTH=It,u.SIDEBAR_MIN_WIDTH=Ft,u.ScrollToTopButton=$l,u.Section=Yn,u.SectionFooter=Nt,u.SectionHeader=jt,u.SelectButton=Dc,u.SelectionActionBar=ln,u.SelectionActionBarDivider=ut,u.ServerErrorPage=Cc,u.SidePanel=nc,u.SidePanelItem=tc,u.SidebarBadgesProvider=Fo,u.SidebarGroupSlot=kn,u.SidebarGroupSlotOutlet=At,u.SidebarGroupSlotProvider=jo,u.SidebarHeaderSlot=Ho,u.SidebarProvider=Lo,u.StarasiaRouterProvider=Wo,u.TableFooter=Wl,u.TableHeader=Ol,u.TableLayout=di,u.TableSection=Js,u.TableWrapper=Al,u.ToggleStatus=Ki,u.Typography=Re,u.VerticalField=dc,u.clearModuleSelection=Bn,u.createInitialFromUserName=pi,u.cssVars=Di,u.expandDateCompact=Zs,u.formHasChanged=Fi,u.formatDate=xi,u.formatDateToIndonesian=Ul,u.formatRupiah=vi,u.getDateFilterValue=dl,u.getDateRangeFilterValue=Kn,u.getInitials=Ci,u.getValueDropdownMultipleFilter=al,u.getValueRadioFilter=$n,u.getValueSearch=Rr,u.getValuesFilter=Kr,u.handleChangeFilter=Vr,u.handleOnScroll=Hi,u.isColumnFilterActive=Ll,u.isEmail=Oi,u.isFilterActive=Rn,u.isOnlyLettersAndSpaces=Mi,u.isPhoneNumber=Ii,u.isSlug=Wi,u.localStorageAdapter=qt,u.oneDayInMs=Si,u.parseIndonesianDateToDate=bi,u.preventNonCoordinateInput=zi,u.preventNonNumberAndDecimalInput=Ai,u.preventNonNumberInput=Ti,u.preventNumberInput=Li,u.resolveDateRangeValueToString=il,u.resolveDateValueToString=cl,u.resolveDropdownValueToString=nl,u.resolveRadioValueToString=sl,u.resolveSidebarBadge=Xr,u.storageKeys=Lr,u.textWidth=ki,u.useApp=mt,u.useAppState=mo,u.useAuthRole=_c,u.useCoarsePointer=Nl,u.useDynamicTitle=jc,u.useFilterBarApiParams=Os,u.useFilterBarControls=zs,u.useModuleSelection=Wt,u.useRouteInfo=_e,u.useRouteParams=Nc,u.useRouterAdapter=tr,u.useSidebar=Ao,u.useSidebarBadges=Io,u.useTabState=Vc,u.useTableSortApiParams=hi,Object.keys(mr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>mr[r]})}),Object.keys(Qr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Qr[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(f).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>f[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(j).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>j[r]})}),Object.keys(Dt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Dt[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(Oe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Oe[r]})}),Object.keys(Ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ur[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(ke).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ke[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(hr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>hr[r]})}),Object.keys(W).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>W[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(Hr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Hr[r]})}),Object.keys(Q).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Q[r]})}),Object.keys(vo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>vo[r]})}),Object.keys(St).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>St[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(Co).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Co[r]})}),Object.keys(Tr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Tr[r]})}),Object.keys(Le).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Le[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(kt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>kt[r]})}),Object.keys(S).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>S[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(ae).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ae[r]})}),Object.keys(xo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>xo[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(Do).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Do[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(ko).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ko[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(Bo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Bo[r]})}),Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
103
|
+
`;function rc(){if(typeof document>"u"||document.getElementById(Kl))return;const r=document.createElement("style");r.id=Kl,r.textContent=ec,document.head.appendChild(r)}const tc=({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(rc,[]),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(S.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(S.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:s}):null,i?e.jsx(S.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:i}):null]})})),to=18,oc=40,Rl="280ms cubic-bezier(0.4, 0, 0.2, 1)",en="var(--sa-border-subtle, #0b120e24)",lc=`1px solid ${en}`,rn="var(--sa-background-primary, #ffffff)",nc=({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:k,className:D,pageLayout:z,overlay:O="mobile",wrapperProps:A,contentProps:x})=>{const m=Be.useMediaQuery("md"),I=o!==void 0,[T,B]=h.useState(n),L=I?o:T,U=()=>{const ee=!L;I||B(ee),l==null||l(ee)},V=i==="left",H=typeof c=="number"?`${c}px`:c,N=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${H})`,G=p??{collapse:"Collapse panel",expand:"Expand panel"},J=g==="center"?{top:"50%",transform:"translateY(-50%)"}:g==="bottom"?{bottom:b}:{top:b},te=L?V?"ChevronRight":"ChevronLeft":V?"ChevronLeft":"ChevronRight",K=z!==void 0&&(O==="mobile"?!m:O),ue=K?{position:"absolute",top:0,bottom:0,width:s,transform:`translateX(${L?V?"-100%":"100%":"0"})`,transition:`transform ${Rl}`,zIndex:50,...V?{left:0}:{right:0},...C}:{position:"sticky",top:H,alignSelf:"flex-start",width:L?0:s,flexShrink:0,height:N,transition:`width ${Rl}`,...C},Z=e.jsxs(f.Box,{className:D,style:ue,children:[e.jsx(f.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:L?void 0:V?"border-solid-r":"border-solid-l",borderWidth:L?void 0:V?"border-r":"border-l",style:{backgroundColor:rn,borderColor:en},children:e.jsxs(f.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:s,customMinWidth:s,style:V?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,...k},children:r})]})}),d&&e.jsx(Pr,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:U,"aria-label":L?G.expand:G.collapse,"aria-expanded":!L,"aria-pressed":L,customWidth:to,customHeight:oc,style:{...J,backgroundColor:rn,border:lc,zIndex:5,...V?{right:-to,borderLeft:"none",borderRadius:"0 var(--sa-radii-md, 8px) var(--sa-radii-md, 8px) 0"}:{left:-to,borderRight:"none",borderRadius:"var(--sa-radii-md, 8px) 0 0 var(--sa-radii-md, 8px)"}},children:e.jsx(F.Icon,{name:te,size:"sm"})})]});return z===void 0?Z:e.jsxs(f.Box,{direction:"row",position:"relative",...A,style:{height:`calc(100vh - ${H})`,overflow:"hidden",...(A==null?void 0:A.style)??{}},children:[!K&&V?Z: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:z}),!K&&!V?Z:null,K&&e.jsxs(e.Fragment,{children:[!L&&e.jsx("div",{onClick:U,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),Z]})]})},oo="--app-aside-width",sc=r=>typeof r=="number"?`${r}px`:r,ic=({pageLayout:r,children:t,wrapperProps:o,containerProps:n})=>{const l=Be.useMediaQuery("md"),s=(n==null?void 0:n.customWidth)??264;return h.useLayoutEffect(()=>{const i=document.documentElement;return i.style.setProperty(oo,l?sc(s):"0px"),()=>i.style.removeProperty(oo)},[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})]})},lo="--sa-floating-footer-height",cc=r=>typeof r=="number"?`${r}px`:r,ac=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:o,respectAside:n=!1,offsetRight:l,containerProps:s})=>{const i=h.useRef(null),c=l!=null?cc(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(lo,`${b}px`)};d();const g=new ResizeObserver(d);return i.current&&g.observe(i.current),()=>{g.disconnect(),a.style.removeProperty(lo)}},[]),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($l,{...o,customBottom:(o==null?void 0:o.customBottom)||"5.7rem"}),r]})})},dc=({fields:r})=>e.jsx(f.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(it,{of:r,render:(t,o)=>e.jsx(hc,{...t},o)})}),hc=({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(S.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(S.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(S.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 uc=({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(j.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:o,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{secondary:!0,iconLeft:s,onClick:o,children:l?e.jsx(S.Text,{fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(j.Button,{secondary:!0,onClick:o,children:a||r})});case"success":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{success:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{success:!0,onClick:o,children:a||r})});default:return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.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(Re.Body1,{props:{align:"center",textAlign:"center"},children:p>2?null:b},p))}),i?g():null]})},R={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function gc({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:R.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:R.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:R.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:R.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:R.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:R.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:R.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:R.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:R.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:R.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:R.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:R.cFFFFFF,stroke:R.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:R.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:R.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:R.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:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:R.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:R.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:R.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:R.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:R.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:R.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:R.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:R.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:R.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:R.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:R.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:R.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:R.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:R.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:R.c001A72})]})})}function yc({onClick:r}){const t=Be.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(gc,{width:t?600:300}),e.jsx(S.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(S.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const se={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 pc({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:se.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:se.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:se.cEFF3F8,stroke:se.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:se.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:se.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:se.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:se.c956847,stroke:se.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:se.c956847,stroke:se.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:se.cC8CEF4,stroke:se.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:se.cC8CEF4,stroke:se.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:se.cC8CEF4,stroke:se.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:se.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:se.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:se.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:se.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:se.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:se.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:se.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:se.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:se.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:se.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:se.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:se.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:se.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function bc({onClick:r}){const t=Be.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(pc,{width:t?600:300}),e.jsx(S.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(j.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 vc({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 Cc({onClick:r}){const t=Be.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(vc,{width:t?600:300}),e.jsx(S.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(S.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const xc=r=>{var o,n,l,s,i;const t=Be.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(S.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Oe.DialogBody,{children:typeof r.description=="string"?e.jsx(S.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(j.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(j.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},wc=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:k={borderBottom:!0},footerProps:D={borderTop:!0},variantTag:z="info"})=>{const O=h.useRef(null),[A,x]=h.useState("100vh");h.useEffect(()=>{const B=()=>{if(O.current){const L=O.current.getBoundingClientRect().top;x(`calc(100vh - ${L}px)`)}};return B(),window.addEventListener("resize",B),()=>window.removeEventListener("resize",B)},[]);const m=()=>d?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(S.Text,{fontWeight:"medium",children:a}),e.jsx(rr.Badges,{border:!0,text:d,variant:z})]}):e.jsx(S.Text,{fontWeight:"medium",children:a}),I=()=>i||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:a?m():null}),e.jsx(f.Box,{direction:"column",...b,children:g??null})]}),T=!!(i||a||g);return e.jsxs(f.Box,{ref:O,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&&T?e.jsx(jt,{...k,children:I()}):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(Nt,{...D,children:c}):null]})}),Dc=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(j.Button,{...l.includes(c.value)?{primary:!0}:{secondary:!0},onClick:()=>i(c),children:c.label},a))})});function ct(r){return null}ct.displayName="LayoutDialog.Header";function at(r){return null}at.displayName="LayoutDialog.Body";function dt(r){return null}dt.displayName="LayoutDialog.Aside";function ht(r){return null}ht.displayName="LayoutDialog.Footer";const je={"lyd-root":"_lyd-root_8mm4b_1","lyd-backdrop":"_lyd-backdrop_8mm4b_38","lyd-panel":"_lyd-panel_8mm4b_47","lyd-modal":"_lyd-modal_8mm4b_58","lyd-fullscreen":"_lyd-fullscreen_8mm4b_72","lyd-sidebar":"_lyd-sidebar_8mm4b_80","lyd-header":"_lyd-header_8mm4b_110","lyd-header-content":"_lyd-header-content_8mm4b_121","lyd-header-actions":"_lyd-header-actions_8mm4b_129","lyd-main":"_lyd-main_8mm4b_136","lyd-body":"_lyd-body_8mm4b_143","lyd-aside":"_lyd-aside_8mm4b_149","lyd-footer":"_lyd-footer_8mm4b_165","lyd-vm-group":"_lyd-vm-group_8mm4b_178","lyd-vm-btn":"_lyd-vm-btn_8mm4b_186","lyd-close-btn":"_lyd-close-btn_8mm4b_209"},Sc=[{mode:"sidebar",label:"Sidebar",renderIcon:()=>e.jsx(Bc,{})},{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 kc({value:r,onChange:t}){return e.jsx("div",{className:je["lyd-vm-group"],role:"group","aria-label":"View mode",children:Sc.map(o=>e.jsx("button",{type:"button",className:je["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 Bc(){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 no={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function mc(r){return r?r in no?no[r]:r:no.xl}function ft(r,t){let o=null;return h.Children.forEach(r,n=>{h.isValidElement(n)&&n.type===t&&(o=n.props.children??null)}),o}function Ec(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,[k,D]=h.useState(l),z=n??k,A=Be.useMediaQuery("md")?z:"fullscreen",x=h.useCallback(G=>{n===void 0&&D(G),s==null||s(G)},[n,s]),m=h.useRef(null);h.useEffect(()=>{if(!(!t||!p))return m.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=m.current??""}},[t,p]);const I=h.useRef(o);I.current=o,h.useEffect(()=>{if(t)return Oe.registerOverlay({onEscape:g?void 0:()=>I.current()})},[t,g]);const T=h.useMemo(()=>ft(C,ct),[C]),B=h.useMemo(()=>ft(C,at),[C]),L=h.useMemo(()=>ft(C,dt),[C]),U=h.useMemo(()=>ft(C,ht),[C]);if(!t)return null;const V=[je["lyd-panel"],A==="modal"&&je["lyd-modal"],A==="fullscreen"&&je["lyd-fullscreen"],A==="sidebar"&&je["lyd-sidebar"]].filter(Boolean).join(" "),H={"--lyd-max-w":mc(a),...d!==void 0&&{"--lyd-aside-w":d}},N=()=>{b||o()};return typeof document>"u"?null:Yr.createPortal(e.jsxs("div",{className:je["lyd-root"],style:H,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:je["lyd-backdrop"],onClick:N,"aria-hidden":"true"}),e.jsxs("div",{className:V,children:[e.jsxs("div",{className:je["lyd-header"],children:[e.jsx("div",{className:je["lyd-header-content"],children:T}),e.jsxs("div",{className:je["lyd-header-actions"],children:[i&&e.jsx(kc,{value:z,onChange:x}),c&&e.jsx("button",{type:"button",className:je["lyd-close-btn"],onClick:o,"aria-label":"Close dialog",children:e.jsx(F.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:je["lyd-main"],children:[e.jsx("div",{className:je["lyd-body"],children:B}),L&&e.jsx("aside",{className:je["lyd-aside"],children:L})]}),U&&e.jsx("div",{className:je["lyd-footer"],children:U})]})]}),document.body)}const Zr=Ec;Zr.Header=ct,Zr.Body=at,Zr.Aside=dt,Zr.Footer=ht;function Fc({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 Ic=/\.(jpe?g|png|gif|webp|bmp|svg|avif)(\?|#|$)/i,Mc=/\.pdf(\?|#|$)/i,Tc=/\.(mp4|webm|ogv|mov|m4v)(\?|#|$)/i,Lc=/\.(mp3|wav|ogg|m4a|aac|flac)(\?|#|$)/i;function Ac(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(Ic)?"image":o==="application/pdf"||n(Mc)?"pdf":o.startsWith("video/")||n(Tc)?"video":o.startsWith("audio/")||n(Lc)?"audio":"other"}const tn={display:"block",maxWidth:"100%",maxHeight:"70vh",margin:"0 auto",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)"},Oc={width:"100%",height:"75vh",border:"none",borderRadius:"var(--sa-radii-sm, 6px)"};function Wc({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:tn});case"pdf":return e.jsx("iframe",{src:l,title:s,style:Oc});case"video":return e.jsx("video",{src:l,controls:!0,style:{...tn,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(S.Text,{fontSize:"sm",color:"gray-500",children:n}),e.jsx(j.Button,{type:"button",variant:"link",iconLeft:e.jsx(F.Icon,{name:"SquareArrowExpand"}),onClick:()=>window.open(l,"_blank","noopener"),children:o})]})}}const zc=({attachment:r,onClose:t,onDownload:o,isDownloading:n,kind:l,maxWidth:s,labels:i})=>{if(!r)return null;const c=Ac(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(S.Text,{fontWeight:"semibold",truncate:!0,children:r.fileName}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[o?e.jsx(j.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(j.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(Wc,{kind:c,attachment:r,openLabel:d.openInNewTab,unsupportedLabel:d.unsupported})})]})},on="var(--sa-border-subtle, #e5e7eb)",ut=()=>e.jsx(f.Box,{style:{width:1,height:22,backgroundColor:on}}),Hc=r=>typeof r=="number"?`${r}px`:r;function ln({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:Hc(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 ${on}`,boxShadow:"var(--sa-shadow-xl, 0 10px 25px -5px rgb(0 0 0/0.15))",...a},children:[e.jsx(S.Text,{fontSize:"sm",fontWeight:"medium",whiteSpace:"nowrap",style:{paddingInline:6},children:g}),e.jsx(ut,{}),t,n&&e.jsxs(e.Fragment,{children:[e.jsx(ut,{}),e.jsx(Le.Tooltip,{label:l,position:"top",children:e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Cross",size:"xs"}),"aria-label":l,onClick:n,disabled:s})})]})]})})}ln.Divider=ut;const gt=r=>{const{variant:t="outlined",overflow:o="hidden",style:n,children:l,...s}=r;return e.jsx(Dt.Card,{variant:t,overflow:o,style:{display:"flex",flexDirection:"column",...n},...s,children:l})},Pc=r=>r==null?void 0:typeof r=="number"?`${r}px`:r,nn=({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:Pc(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]}),sn=({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(S.Text,{fontWeight:"semibold",truncate:!0,children:t}),o!=null&&e.jsx(S.Text,{fontSize:"sm",color:"subtlest",truncate:!0,children:o})]}),n!=null&&e.jsx(f.Box,{style:{flexShrink:0},children:n})]})}),cn=({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})]})});gt.Media=nn,gt.Header=sn,gt.Footer=cn;const Vc=r=>{const{defaultTab:t=0,paramKey:o="tab"}=r||{},{useSearchParams:n}=tr(),[l,s]=n(),i=Ir.searchParamsToObject(l.toString());return{activeTab:i[o]?parseInt(i[o]):t,handleTabChange:d=>{s({...i,[o]:d.toString()})},searchQueries:i}};function jc({appName:r,menuConfig:t,formatTitle:o}){const{useLocation:n}=tr(),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 Nc=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=tr(),[n,l]=r(),s=Ir.searchParamsToObject(n.toString()),i=t(),c=o(),a=i.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,k)=>n.has(C)&&n.get(C)===k,getQueryParam:C=>n.get(C),getRouteParam:C=>i[C],params:i,location:c,id:a,hasId:!!a}};function _c(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=oo,u.AdvanceFilterBar=fl,u.App=Dn,u.AppComponent=zo,u.AppContext=Bt,u.AppLayout=Ln,u.AsideBar=ic,u.AttachmentPreview=zc,u.BackButton=On,u.ColumnFilterDropdown=zl,u.ColumnHeaderFilter=qs,u.ColumnMenu=ql,u.ConfirmationDialog=xc,u.DataTable=Pl,u.DecisionWrapper=ge,u.EachUtils=it,u.EmptyStatePage=uc,u.EntityCard=gt,u.EntityCardFooter=cn,u.EntityCardHeader=sn,u.EntityCardMedia=nn,u.FLOATING_FOOTER_HEIGHT_VAR=lo,u.FilterBar=Ms,u.FilterDrawer=hl,u.FloatingFooter=ac,u.ForbiddenPage=bc,u.Form=Ri,u.FullSection=wc,u.HeaderLeftSlot=Sn,u.HeaderLeftSlotOutlet=Vo,u.HeaderLeftSlotProvider=Po,u.Highlight=Zl,u.HorizontalField=Vn,u.ImagePreview=Fc,u.InputFile=Yl,u.InputImage=Jl,u.LayoutDialog=Zr,u.LayoutDialogAside=dt,u.LayoutDialogBody=at,u.LayoutDialogFooter=ht,u.LayoutDialogHeader=ct,u.ModuleSwitcher=Wn,u.ModuleSwitcherModal=el,u.NotFoundPage=yc,u.PageLayout=qn,u.Pressable=Pr,u.RightDrawer=ll,u.SIDEBAR_DEFAULT_WIDTH=Et,u.SIDEBAR_MAX_WIDTH=It,u.SIDEBAR_MIN_WIDTH=Ft,u.ScrollToTopButton=$l,u.Section=Yn,u.SectionFooter=Nt,u.SectionHeader=jt,u.SelectButton=Dc,u.SelectionActionBar=ln,u.SelectionActionBarDivider=ut,u.ServerErrorPage=Cc,u.SidePanel=nc,u.SidePanelItem=tc,u.SidebarBadgesProvider=Fo,u.SidebarGroupSlot=kn,u.SidebarGroupSlotOutlet=At,u.SidebarGroupSlotProvider=jo,u.SidebarHeaderSlot=Ho,u.SidebarProvider=Lo,u.StarasiaRouterProvider=Wo,u.TableFooter=Wl,u.TableHeader=Ol,u.TableLayout=di,u.TableSection=Js,u.TableWrapper=Al,u.ToggleStatus=Ki,u.Typography=Re,u.VerticalField=dc,u.clearModuleSelection=Bn,u.createInitialFromUserName=pi,u.cssVars=Di,u.expandDateCompact=Zs,u.formHasChanged=Fi,u.formatDate=xi,u.formatDateToIndonesian=Ul,u.formatRupiah=vi,u.getDateFilterValue=dl,u.getDateRangeFilterValue=Kn,u.getInitials=Ci,u.getValueDropdownMultipleFilter=al,u.getValueRadioFilter=$n,u.getValueSearch=Rr,u.getValuesFilter=Kr,u.handleChangeFilter=Vr,u.handleOnScroll=Hi,u.isColumnFilterActive=Ll,u.isEmail=Oi,u.isFilterActive=Rn,u.isOnlyLettersAndSpaces=Mi,u.isPhoneNumber=Ii,u.isSlug=Wi,u.localStorageAdapter=qt,u.oneDayInMs=Si,u.parseIndonesianDateToDate=bi,u.preventNonCoordinateInput=zi,u.preventNonNumberAndDecimalInput=Ai,u.preventNonNumberInput=Ti,u.preventNumberInput=Li,u.resolveDateRangeValueToString=il,u.resolveDateValueToString=cl,u.resolveDropdownValueToString=nl,u.resolveRadioValueToString=sl,u.resolveSidebarBadge=Xr,u.storageKeys=Lr,u.textWidth=ki,u.useApp=mt,u.useAppState=mo,u.useAuthRole=_c,u.useCoarsePointer=Nl,u.useDynamicTitle=jc,u.useFilterBarApiParams=Os,u.useFilterBarControls=zs,u.useModuleSelection=Wt,u.useRouteInfo=qe,u.useRouteParams=Nc,u.useRouterAdapter=tr,u.useSidebar=Ao,u.useSidebarBadges=Io,u.useTabState=Vc,u.useTableSortApiParams=hi,Object.keys(mr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>mr[r]})}),Object.keys(Qr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Qr[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(f).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>f[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(j).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>j[r]})}),Object.keys(Dt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Dt[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(Oe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Oe[r]})}),Object.keys(Ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Ur[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(Be).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Be[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(hr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>hr[r]})}),Object.keys(W).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>W[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(Hr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Hr[r]})}),Object.keys(Q).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Q[r]})}),Object.keys(vo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>vo[r]})}),Object.keys(St).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>St[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(Co).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Co[r]})}),Object.keys(Tr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Tr[r]})}),Object.keys(Le).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Le[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(kt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>kt[r]})}),Object.keys(S).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>S[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(de).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>de[r]})}),Object.keys(xo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>xo[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(Do).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Do[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(ko).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ko[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(Bo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Bo[r]})}),Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|