@starasia/admin 11.2.0 → 11.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/PageLayout/index.d.ts +26 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +1655 -1640
- package/dist/index.umd.js +3 -3
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(g,tr){typeof exports=="object"&&typeof module<"u"?tr(exports,require("@starasia/alert"),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/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"],tr):(g=typeof globalThis<"u"?globalThis:g||self,tr(g["@starasia/admin"]={},g.alert,g.badges,g.box,g.breadcrumb,g.button,g.card,g.date,g.dialog,g.drawer,g.dropdown,g.hooks,g.http,g.input,g.menu,g.pagination,g.storage,g.table,g.tabs,g.textarea,g.theme,g.toast,g.toggle,g.tooltip,g.checkbox,g.radio,g.text,g.icon,g.flex,g.grid,g.progress,g.stepper,g.accordion,g.storyRecord,g.skeleton,g.progressStepper,g.jsxRuntime,g.React,g.ReactDOM,g.ReactEasyCrop))})(this,function(g,tr,Ye,y,or,N,It,er,Ae,kr,lr,Ce,nr,Xe,W,gr,ur,q,Ot,Ur,cr,Wt,sr,me,Ze,Jr,k,T,le,At,zt,Ht,Vt,Pt,ze,jt,e,h,Yr,bl){"use strict";const Cl={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Xr=h.createContext(Cl),$r=()=>h.useContext(Xr),Nt=r=>{const[t,o]=h.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:o}},_t=h.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),qt=({children:r})=>{const[t,o]=h.useState({}),n=h.useCallback(i=>{o(a=>typeof i=="function"?i(a):i)},[]),l=h.useCallback((i,a)=>{o(d=>{const p=typeof a=="function"?a(d[i]):a;return{...d,[i]:p}})},[]),c=h.useCallback(i=>{o(a=>{if(!(i in a))return a;const d={...a};return delete d[i],d})},[]),s=h.useMemo(()=>({badges:t,setBadge:l,setBadges:n,clearBadge:c}),[t,l,n,c]);return e.jsx(_t.Provider,{value:s,children:r})},Zt=()=>h.useContext(_t),Br=(r,t)=>{const o=t!==void 0?t:r;return o==null?null:typeof o=="string"||typeof o=="number"?{value:o}:o},Gt=h.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),Qt=({children:r,defaultCollapsed:t=!1})=>{const[o,n]=h.useState(t),[l,c]=h.useState(!1),s=h.useCallback(x=>{n(L=>typeof x=="function"?x(L):x)},[]),i=h.useCallback(()=>n(x=>!x),[]),a=h.useCallback(()=>n(!0),[]),d=h.useCallback(()=>n(!1),[]),p=h.useCallback(x=>{c(L=>typeof x=="function"?x(L):x)},[]),b=h.useCallback(()=>c(!0),[]),u=h.useCallback(()=>c(!1),[]),v=h.useCallback(()=>c(x=>!x),[]),B=h.useMemo(()=>({collapsed:o,setCollapsed:s,toggle:i,collapse:a,expand:d,mobileOpen:l,setMobileOpen:p,openMobile:b,closeMobile:u,toggleMobile:v}),[o,s,i,a,d,l,p,b,u,v]);return e.jsx(Gt.Provider,{value:B,children:r})},Ut=()=>h.useContext(Gt),Jt=h.createContext(null),Yt=({adapter:r,children:t})=>e.jsx(Jt.Provider,{value:r,children:t}),Ge=()=>{const r=h.useContext(Jt);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},Xt=({router:r,routerAdapter:t,menus:o=[],menuBottom:n,logo:l,appName:c="Workspace",initialUserData:s,theme:i})=>{const a=Nt({initialUserData:s}),{theme:d}=cr.useTheme();return e.jsx(Yt,{adapter:t,children:e.jsx(Xr.Provider,{value:{logo:l,appName:c,menus:o,userData:a.userData,setUserData:a.setUserData,menuBottom:n},children:e.jsx(qt,{children:e.jsx(Qt,{children:i?e.jsx(cr.ThemeProvider,{value:i,children:r}):d?e.jsx(cr.ThemeProvider,{value:d,children:r}):r})})})})},vl=h.memo(Xt);function $t({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:"4rem",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:"0.5rem",paddingRight:"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 Kr=h.createContext(null);function Kt({children:r}){const[t,o]=h.useState(null),[n,l]=h.useState(null),[c,s]=h.useState(null),[i,a]=h.useState(0),d=h.useCallback(()=>(a(p=>p+1),()=>a(p=>p-1)),[]);return e.jsx(Kr.Provider,{value:{prependNode:t,appendNode:n,replaceNode:c,setPrependNode:o,setAppendNode:l,setReplaceNode:s,replaceCount:i,registerReplace:d},children:r})}function Rt({children:r}){const t=h.useContext(Kr);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 xl({children:r,mode:t="append"}){const o=h.useContext(Kr);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 Rr=h.createContext(null);function eo({children:r}){const[t,o]=h.useState({}),[n,l]=h.useState({}),c=h.useCallback((a,d)=>{o(p=>p[a]===d?p:{...p,[a]:d})},[]),s=h.useCallback(a=>(l(d=>({...d,[a]:(d[a]??0)+1})),()=>l(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),i=h.useMemo(()=>({outletNodes:t,setOutletNode:c,slotCounts:n,registerSlot:s}),[t,c,n,s]);return e.jsx(Rr.Provider,{value:i,children:r})}function ro({slotKey:r,fallback:t}){const o=h.useContext(Rr),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 c=h.useCallback(s=>{var i;return(i=l.current)==null?void 0:i.call(l,r,s)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:c,style:{display:"contents"}}):t})}function wl({slotKey:r,children:t}){const o=h.useContext(Rr),n=h.useRef(o==null?void 0:o.registerSlot);if(n.current=o==null?void 0:o.registerSlot,h.useEffect(()=>{var c;return(c=n.current)==null?void 0:c.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 mr="moduleSwitcherGroupId",et="sa-module-switcher-change";function to(){if(typeof window>"u")return null;const r=window.localStorage.getItem(mr);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function oo(r){typeof window>"u"||(r===null?window.localStorage.removeItem(mr):window.localStorage.setItem(mr,String(r)),window.dispatchEvent(new CustomEvent(et,{detail:r})))}function Dl(){oo(null)}function rt(){const[r,t]=h.useState(()=>to());return h.useEffect(()=>{const n=()=>{t(to())},l=c=>{c.key===mr&&n()};return window.addEventListener(et,n),window.addEventListener("storage",l),()=>{window.removeEventListener(et,n),window.removeEventListener("storage",l)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{oo(n),t(n)}}}let Fr=0,rr=!1,lo=new Set;const no=()=>e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"1.667",y:"1.667",width:"12.667",height:"12.667",rx:"2"}),e.jsx("line",{x1:"6",y1:"1.667",x2:"6",y2:"14.333"})]}),co={width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",fontSize:"0.875rem",color:"var(--sa-text-subtle, #8c8f97)",background:"transparent",border:"none",borderRadius:"0.375rem",cursor:"pointer",textAlign:"left"};function Sl({children:r,headerLeftSlot:t,profile:o,isLoadingProfile:n,onLogout:l,isLoggingOut:c,loadingComponent:s,sidebarHeaderContent:i,headerActions:a,profileRole:d,profileMenuButtons:p,profileMenuItems:b,logoutButton:u}){var dr,j;const{useSearchParams:v,useNavigate:B,useLocation:x,Outlet:L}=Ge(),[F]=v(),A=F.get("embed")==="true",D=$r(),{badges:m}=Zt(),H=B(),z=x(),E=!Ce.useMediaQuery("md"),[Z,$]=h.useState(!1),{collapsed:P,setCollapsed:_,mobileOpen:U,setMobileOpen:K}=Ut(),[te,Y]=h.useState(!1),[Q,J]=h.useState(()=>new Set(lo)),[ce,pe]=h.useState(null),{selectedGroupId:Be,setSelectedGroupId:fe}=rt();h.useEffect(()=>{lo=Q},[Q]);const ge=h.useRef(null),ve=h.useRef(null);h.useEffect(()=>{const S=ge.current;if(!S)return;const O=()=>{rr||(Fr=S.scrollTop)};return S.addEventListener("scroll",O),()=>S.removeEventListener("scroll",O)},[]);const Ee=()=>{const S=ge.current;S&&Fr>0&&(rr=!0,S.scrollTop=Fr,requestAnimationFrame(()=>{rr=!1}))};h.useLayoutEffect(()=>{rr=!0,Ee();const S=setTimeout(()=>{rr=!1},300);return()=>clearTimeout(S)},[]),h.useLayoutEffect(()=>{D.menus.length>0&&(Fr>0?Ee():requestAnimationFrame(()=>{var O;const S=(O=ge.current)==null?void 0:O.querySelector("[data-menu-active='true']");S&&S.scrollIntoView({block:"center",behavior:"instant"})}))},[D.menus]),h.useEffect(()=>{rr=!0,Ee();const S=setTimeout(Ee,0),O=setTimeout(Ee,50),V=setTimeout(Ee,100),G=setTimeout(Ee,200),de=setTimeout(()=>{rr=!1},300),Me=setTimeout(()=>{const he=ge.current,oe=he==null?void 0:he.querySelector("[data-menu-active='true']");if(he&&oe){const be=he.getBoundingClientRect(),Le=oe.getBoundingClientRect();Le.top>=be.top&&Le.bottom<=be.bottom||oe.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(S),clearTimeout(O),clearTimeout(V),clearTimeout(G),clearTimeout(de),clearTimeout(Me)}},[z.pathname]),h.useEffect(()=>{ve.current&&(ve.current.scrollTop=0)},[z.pathname]),h.useEffect(()=>{E&&K(!1)},[z.pathname,E]),h.useEffect(()=>{E&&_(!0)},[E]);const Oe=()=>{$(!0)},Ve=()=>{$(!1)},Pe=()=>{$(!1),l()},Se=S=>{const O=[S.to];return S.children&&O.push(...S.children.map(V=>V.to)),O},je=[...D.menus.flatMap(S=>S.items.flatMap(Se)),...((dr=D.menuBottom)==null?void 0:dr.flatMap(Se))??[]],xe=S=>{if(!z.pathname.startsWith(S))return!1;const O=je.filter(V=>z.pathname.startsWith(V)).sort((V,G)=>G.length-V.length)[0];return S===O};h.useEffect(()=>{var O;const S=V=>{var G;(G=V.children)!=null&&G.some(de=>z.pathname.startsWith(de.to))&&J(de=>{const Me=new Set(de);return Me.add(V.id),Me})};D.menus.forEach(V=>{V.items.forEach(S)}),(O=D.menuBottom)==null||O.forEach(S)},[z.pathname,D.menus,D.menuBottom]);const $e=S=>{J(O=>{const V=new Set(O);return V.has(S)?V.delete(S):V.add(S),V})};h.useEffect(()=>{D.menus.length!==0&&Be!==null&&!D.menus.some(S=>S.id===Be)&&fe(null)},[D.menus,Be,fe]);const we=h.useMemo(()=>{if(Be!==null)return D.menus.filter(V=>V.id===Be||V.parentGroupId===Be);const S=D.menus.filter(V=>V.parentGroupId===void 0),O=D.menus.filter(V=>V.parentGroupId!==void 0).flatMap(V=>V.items);return O.length===0?S:[...S,{id:18,name:"Pengaturan",items:O,parentGroupId:void 0}]},[D.menus,Be]);if(A)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:r||e.jsx(L,{})});const Ne=S=>{const O=S.children&&S.children.length>0,V=Q.has(S.id),G=O?S.children.some(he=>xe(he.to)):xe(S.to),de=Br(S.badge,m[S.id]),Me=!!de&&P&&!E;return e.jsxs("div",{"data-menu-active":G||void 0,children:[e.jsxs("button",{onClick:he=>{if(O)if(P&&!E){const oe=he.currentTarget.getBoundingClientRect();pe({item:S,top:oe.top,left:oe.right+8})}else $e(S.id);else H(S.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:P&&!E?"center":void 0,gap:"0.5rem",paddingLeft:P&&!E?"0":"0.5rem",paddingRight:P&&!E?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:G?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:G?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:G?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:P&&!E?S.title:void 0,onMouseEnter:he=>{G||(he.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:he=>{G||(he.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(T.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),Me&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"-2px",right:"-2px",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-error-500, #ff4d6d)",border:"1px solid var(--sa-background-primary, #ffffff)"}})]}),(!P||E)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",transition:"opacity 0.3s",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:S.title}),de&&e.jsx(Ye.Badges,{text:String(de.value),variant:de.variant??"info",size:"xs",border:!0}),O&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:V?"rotate(180deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),O&&(!P||E)&&(()=>{const he=S.children.findIndex(oe=>xe(oe.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:V?`${S.children.length*36}px`:"0px",opacity:V?1:0,marginTop:V?"0.25rem":"0px"},children:[e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"1.5px",height:"100%",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),he>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${he*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),S.children.map(oe=>{const be=Br(oe.badge,m[oe.id]);return e.jsxs("button",{onClick:()=>H(oe.to),style:{width:"100%",display:"flex",alignItems:"center",gap:"0.5rem",paddingLeft:"0.75rem",paddingRight:"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:xe(oe.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:xe(oe.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:xe(oe.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:xe(oe.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:Le=>{xe(oe.to)||(Le.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:Le=>{xe(oe.to)||(Le.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(T.Icon,{name:oe.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:oe.title}),be&&e.jsx(Ye.Badges,{text:String(be.value),variant:be.variant??"info",size:"xs",border:!0})]},oe.id)})]})})()]},S.id)};return e.jsx(eo,{children:e.jsxs(Kt,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":E?"0px":P?"4.375rem":"16.375rem","--app-footer-zindex":E&&U?"40":"998"},children:[E&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:U?.5:0,pointerEvents:U?"auto":"none",transition:"opacity 0.3s"},onClick:()=>K(!1)}),e.jsxs("aside",{style:{width:E?"16.375rem":P?"4.375rem":"16.375rem",position:E?"fixed":"relative",...E&&{inset:0,zIndex:50,transform:U?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:"all 0.3s ease-in-out",flexShrink:E?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>Y(!0),onMouseLeave:()=>Y(!1),style:{height:"4rem",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",position:"relative"},children:(()=>{const S=!E&&P&&!U,O=S&&te;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:S?1:void 0,justifyContent:S?"center":void 0,transition:"opacity 0.2s",opacity:O?0:1,pointerEvents:O?"none":"auto"},children:[e.jsx("img",{src:D.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!P||U)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:D.appName})]}),!E&&!P&&e.jsx("button",{type:"button",onClick:()=>_(!0),"aria-label":"Collapse sidebar",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1rem",height:"1rem",padding:0,background:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer",flexShrink:0},children:e.jsx(no,{})}),S&&e.jsx("button",{type:"button",onClick:()=>_(!1),"aria-label":"Expand sidebar",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",padding:0,background:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-sm, 0.375rem)",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer",opacity:O?1:0,pointerEvents:O?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(no,{})})}),E&&e.jsx("button",{onClick:()=>K(!1),"aria-label":"Close menu",style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.25rem",height:"1.25rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})()}),i&&e.jsx($t,{collapsed:E?!1:P,children:i}),e.jsx("div",{ref:ge,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:we.map(S=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!P||E?S.name&&e.jsx("div",{style:{paddingLeft:"1.5rem",paddingRight:"1rem",paddingTop:"0rem",paddingBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"400",color:"var(--sa-text-subtlest, #6b6e76)",transition:"opacity 0.3s",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:S.name}):S.name&&e.jsx("div",{"aria-label":S.name,style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"0.75rem",paddingBottom:"0.75rem"},children:e.jsx("span",{style:{display:"block",width:"1rem",height:"2px",borderRadius:"1px",backgroundColor:S.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx("div",{style:{paddingLeft:"1rem",paddingRight:"1rem",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)"},children:S.slotKey?e.jsx(ro,{slotKey:S.slotKey,fallback:S.items.map(O=>Ne(O))}):S.items.map(O=>Ne(O))})]},S.id))}),D.menuBottom&&D.menuBottom.length>0&&e.jsx("div",{style:{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",paddingTop:"0.75rem",paddingBottom:"0.75rem",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)",flexShrink:0},children:D.menuBottom.map(S=>Ne(S))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{height:"4rem",backgroundColor:"var(--sa-background-primary, #ffffff)",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:E?"1rem":void 0},children:[E&&e.jsx("button",{onClick:()=>K(!0),style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.5rem",height:"1.5rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),e.jsx(Rt,{children:t})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsxs("div",{style:{textAlign:"right",maxWidth:"12.5rem"},children:[e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:500,color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"Loading...":(o==null?void 0:o.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"":(o==null?void 0:o.email)||"unknown"})]}),e.jsx("div",{style:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"0.875rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",flexShrink:0,backgroundColor:"var(--sa-background-brand, #04254f)"},children:((o==null?void 0:o.name)||"U")[0].toUpperCase()}),e.jsx(T.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(W.MenuLists,{style:{width:"280px",paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(W.MenuHeading,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",paddingBlock:"0.5rem"},children:[e.jsx("div",{style:{width:"4rem",height:"4rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"1.25rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",marginBottom:"0.75rem",backgroundColor:"var(--sa-background-brand, #04254f)"},children:((o==null?void 0:o.name)||"U")[0].toUpperCase()}),e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:600,color:"var(--sa-text-primary, #292a2e)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(o==null?void 0:o.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(o==null?void 0:o.email)||"unknown"}),d&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d})]})}),(p&&p.length>0||b)&&e.jsxs(W.MenuBody,{children:[p==null?void 0:p.map((S,O)=>e.jsx(W.MenuButton,{children:e.jsxs("button",{type:"button",onClick:S.onClick,style:co,onMouseEnter:V=>{V.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:V=>{V.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(T.Icon,{name:S.icon,size:"md"}),e.jsx("span",{children:S.label})]})},`${S.label}-${O}`)),b]}),u??e.jsx(W.MenuFooter,{children:e.jsx(W.MenuButton,{children:e.jsxs("button",{type:"button",onClick:Oe,style:{...co,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(T.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:ve,style:{flex:1,overflowY:"auto"},children:r||e.jsx(L,{})})]})]}),c&&s&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--sa-color-black-alpha-a70, #181a19b8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:s}),e.jsxs(Ae.Dialog,{isShow:Z,onHide:Ve,children:[e.jsx(Ae.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Ae.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Ae.DialogFooter,{children:e.jsx(y.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(le.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(y.Box,{direction:"column",children:e.jsx(N.Button,{secondary:!0,onClick:Ve,children:"Cancel"})}),e.jsx(y.Box,{direction:"column",children:e.jsx(N.Button,{primary:!0,onClick:Pe,children:"Yes, Sure"})})]})})})]}),ce&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>pe(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":ce.item.title,style:{position:"fixed",top:ce.top,left:ce.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem",backgroundColor:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-md, 0.5rem)",boxShadow:"var(--sa-shadow-lg, 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a)",padding:"0.5rem",display:"flex",flexDirection:"column",gap:"0.125rem"},children:[e.jsx("div",{style:{fontSize:"0.75rem",fontWeight:600,color:"var(--sa-color-gray-500, #8c8f97)",padding:"0.25rem 0.5rem 0.5rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:ce.item.title}),(j=ce.item.children)==null?void 0:j.map(S=>{const O=xe(S.to),V=Br(S.badge,m[S.id]);return e.jsxs("button",{onClick:()=>{H(S.to),pe(null)},style:{width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.5rem 0.75rem",borderRadius:"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:O?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:O?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:G=>{O||(G.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:G=>{O||(G.currentTarget.style.backgroundColor="transparent")},children:[S.icon&&e.jsx(T.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:S.title}),V&&e.jsx(Ye.Badges,{text:String(V.value),variant:V.variant??"info",size:"xs",border:!0})]},S.id)})]})]})]})})}const yr=h.forwardRef(({children:r,...t},o)=>e.jsx(y.Box,{ref:o,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),so=({title:r,iconName:t,textColor:o,iconColor:n,hoverTextColor:l,hoverIconColor:c})=>{const[s,i]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=o??"var(--sa-text-subtle, #8c8f97)",p=c??"var(--sa-text-subtle, #8c8f97)",b=l??"var(--sa-text-primary, #292a2e)";return e.jsxs(y.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{cursor:"pointer"},children:[e.jsx(T.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:s?p:a,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:s?b:d,transition:"color 0.15s ease"},children:r||"Back"})]})},kl=({items:r,separator:t="/",iconName:o,iconColor:n,hoverIconColor:l})=>{const{Link:c}=Ge(),[s,i]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=l??"var(--sa-text-subtle, #8c8f97)",p=r.length>1?r[0]:void 0,b=!!(p!=null&&p.to||p!=null&&p.onClick),u=e.jsx(T.Icon,{name:o||"ChevronLeft",size:"xs",onMouseEnter:b?()=>i(!0):void 0,onMouseLeave:b?()=>i(!1):void 0,style:{color:b&&s?d:a,transition:"color 0.15s ease",cursor:b?"pointer":void 0}}),v=p!=null&&p.to?e.jsx(c,{to:p.to,replace:!0,style:{textDecoration:"none"},children:u}):p!=null&&p.onClick?e.jsx(yr,{onClick:p.onClick,children:u}):u;return e.jsxs(y.Box,{direction:"row",gap:"xs",align:"center",children:[v,e.jsx(or.Breadcrumb,{separator:t,size:"md",children:r.map((B,x)=>{const L=x===r.length-1;return B.to&&!L?e.jsx(or.BreadcrumbItem,{children:e.jsx(c,{to:B.to,children:B.label})},x):e.jsx(or.BreadcrumbItem,{currentPage:L,children:e.jsx(or.BreadcrumbLink,{onClick:L?void 0:B.onClick,children:B.label})},x)})})]})},Bl=r=>{const{Link:t}=Ge(),{items:o,separator:n,onClick:l,navigateTo:c,...s}=r;return o&&o.length>0?e.jsx(kl,{items:o,separator:n,iconName:s.iconName,iconColor:s.iconColor,hoverIconColor:s.hoverIconColor}):c?e.jsx(y.Box,{direction:"row",children:e.jsx(t,{to:c,replace:!0,style:{textDecoration:"none"},children:e.jsx(so,{...s})})}):e.jsx(y.Box,{direction:"row",children:e.jsx(yr,{onClick:l,children:e.jsx(so,{...s})})})},tt=[{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 io(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 ao={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},ho={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function fo({isShow:r,onHide:t,menus:o,selectedGroupId:n,onSelect:l}){const[c,s]=h.useState(void 0),i=d=>{l(d),t()},a=tt[0];return e.jsx(Ae.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Ae.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>i(null),onMouseEnter:()=>s("all"),onMouseLeave:()=>s(void 0),style:ho,children:[e.jsx("div",{style:io(n===null,c==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(T.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:ao,children:"Semua"})]}),o.map((d,p)=>{var x;const b=n===d.id,u=c===d.id,v=((x=d.items[0])==null?void 0:x.icon)??"Grid",B=tt[(p+1)%tt.length];return e.jsxs("button",{onClick:()=>i(d.id),onMouseEnter:()=>s(d.id),onMouseLeave:()=>s(void 0),style:ho,children:[e.jsx("div",{style:io(b,u,B),children:e.jsx("div",{style:{color:B.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(T.Icon,{name:v,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:ao,children:d.name})]},d.id)})]})})})}function ml({onSelect:r,"aria-label":t="Pilih module"}={}){const o=$r(),{useNavigate:n}=Ge(),l=n(),{selectedGroupId:c,setSelectedGroupId:s}=rt(),[i,a]=h.useState(!1),d=p=>{var b;if(s(p),p!==null){const u=o.menus.find(B=>B.id===p),v=(b=u==null?void 0:u.items[0])==null?void 0:b.to;v&&l(v)}r==null||r(p)};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:p=>{p.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent"},children:e.jsx(T.Icon,{name:"GridApplication",size:"sm"})}),c!==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(fo,{isShow:i,onHide:()=>a(!1),menus:o.menus.filter(p=>p.parentGroupId===void 0),selectedGroupId:c,onSelect:d})]})}const Fl=(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},El=h.memo(({value:r,label:t,separator:o,labelWidth:n,lastIndex:l,labelAlign:c="top"})=>{const s=h.useMemo(()=>({padding:0,paddingBottom:l?0:12,verticalAlign:c}),[l,c]),i=h.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:l?0:12,verticalAlign:c}),[l,c]),a=()=>typeof t=="string"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(k.Text,{color:"primary",fontWeight:"medium",children:r}):r,p=()=>typeof o=="string"||typeof o=="number"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:o}):o;return e.jsxs(q.Tr,{children:[e.jsx(q.Td,{style:s,width:n,children:a()}),o?e.jsx(q.Td,{style:i,width:24,children:p()}):null,e.jsx(q.Td,{style:s,children:d()})]})}),Ml=h.memo(({fields:r,separator:t,labelWidth:o})=>e.jsx(q.Table,{withColumnBorder:!1,withRowBorder:!1,children:r.map((n,l)=>e.jsx(El,{separator:t,labelWidth:o,lastIndex:l===r.length-1,...n},`field-group-field-${l}`))})),Ll=h.memo(({maxRow:r=0,maxColumn:t=2,separator:o=":",fields:n=[],labelWidth:l=150,bordered:c=!1})=>{const s=h.useMemo(()=>Fl(n,r),[n,r]),i=s.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(y.Box,{gap:i?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:i?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:c?"border":void 0,borderStyle:c?"border-solid":void 0,borderColor:c?"border-subtle":void 0,children:s.map((d,p)=>e.jsx(y.Box,{direction:"column",flex:i?void 0:"1",width:i?a():void 0,marginBottom:i?"lg":void 0,children:e.jsx(Ml,{labelWidth:l,fields:d,separator:o})},p))})}),Tl=({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)",c=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",s=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(y.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{cursor:"pointer"},children:[e.jsx(T.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?c:n,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:t?s:l,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},Il=({backButton:r,title:t,titleIcon:o,titleTag:n,children:l,header:c=!0,headerBorder:s=!1,disableAnimation:i=!1,subHeaders:a,action:d,titleTagProps:p,containerProps:b,headerProps:u})=>{const v=Ce.useMediaQuery("md"),{Link:B,useNavigate:x,useLocation:L}=Ge(),F=x(),A=L(),D=r==null?void 0:r.show,m=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}F(-1,{replace:!0})},H=()=>{if(!d)return null;if(h.isValidElement(d))return d;const P=d.filter(_=>_&&(_.title||_.icon));return P.length===0?null:v?e.jsx(y.Box,{direction:"row",gap:"md",children:P.map(({title:_,icon:U,buttonProps:K,onClick:te},Y)=>e.jsx(N.Button,{iconLeft:U?e.jsx(T.Icon,{name:U,size:"md"}):void 0,onClick:te,...K,children:_},`action-${Y}`))}):e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(T.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{minWidth:200},children:P.map(({title:_,icon:U,buttonProps:K,onClick:te},Y)=>{const Q=(K==null?void 0:K.tone)==="error"||(K==null?void 0:K.danger)===!0;return e.jsx(W.MenuItem,{intent:Q?"danger":void 0,disabled:K==null?void 0:K.disabled,startIcon:U?e.jsx(T.Icon,{name:U}):void 0,onClick:te,children:_},`action-${Y}`)})})})]})},z=()=>{const P=e.jsx(Tl,{backButton:r});return r!=null&&r.navigateTo?e.jsx(y.Box,{direction:"row",children:e.jsx(B,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:P})}):e.jsx(y.Box,{direction:"row",children:e.jsx(yr,{onClick:m,children:P})})},I=()=>{const P=!!t,_=Array.isArray(d)&&d.length>0,U=h.isValidElement(d)?!0:_;if(!P&&!U&&!D)return null;const te=v||!v&&_;return e.jsxs(y.Box,{direction:"column",gap:"xs",paddingBlock:(u==null?void 0:u.paddingBlock)??"sm",paddingInline:(u==null?void 0:u.paddingInline)??"md",...u,style:{...s?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...u==null?void 0:u.style},children:[D&&z(),(P||U)&&e.jsxs(y.Box,{direction:te?"row":"column",gap:"sm",justify:"space-between",align:te?"center":"flex-start",children:[P?typeof t=="string"?e.jsxs(y.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(y.Box,{direction:"row",gap:"sm",align:"center",children:[o&&e.jsx(T.Icon,{name:o,size:"md",color:"primary"}),e.jsx(k.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:t})]}),n&&e.jsx(Ye.Badge,{border:!0,size:"lg",text:n,...p})]}):t:null,H()]})]})},E=()=>{if(!a||a.length===0)return null;const P=a.filter(K=>K.show!==!1);if(P.length===0)return null;let _=0,U=-1/0;return P.forEach((K,te)=>{const Y=K.order??0;Y>=U&&(U=Y,_=te)}),P.map(({content:K,order:te,borderBottom:Y=!0,keepBottomPadding:Q=!1,paddingInline:J=!0,paddingBlock:ce=!0},pe)=>e.jsx(y.Box,{direction:"column",paddingTop:ce?"sm":"spacing-0",paddingBottom:ce&&(Y||Q||pe===_)?"sm":"spacing-0",paddingInline:J?"md":"spacing-0",style:{...Y?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...te!==void 0?{order:te}:{}},children:K},`sub-header-${pe}`))},Z=()=>{const P=c?I():null,_=E();return!P&&!_?null:e.jsxs(y.Box,{direction:"column",style:{marginBottom:_?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[P,_]})},$=()=>l;return e.jsxs(y.Box,{direction:"column",as:"main",...b,style:{...(b==null?void 0:b.style)??{},...i?{}:{animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"}},children:[Z(),$()]},A.pathname)},Ol=h.memo(Il),Wl={icon:"Cross",title:""},Al="calc(100vw - 16px)",go=r=>r==null?void 0:`min(${typeof r=="number"?`${r}px`:r}, ${Al})`,uo=h.forwardRef(({onHide:r,show:t,withBlur:o=!1,style:n,children:l,closeButton:c=Wl,width:s,minWidth:i="357px",maxWidth:a="357px"},d)=>{const p=go(s??i),b=go(s??a);return e.jsx(kr.Drawer,{blur:o,isShow:t,position:"right",onHide:r,ref:d,style:{minWidth:p,maxWidth:b,...n},children:e.jsxs(y.Box,{direction:"column",padding:"lg",children:[c?e.jsxs(y.Box,{direction:"row",align:"center",gap:"sm",onClick:r,marginBottom:"lg",cursor:"pointer",children:[e.jsx(T.Icon,{name:c.icon,size:"md",color:"subtle",cursor:"pointer"}),c.title?e.jsx(k.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:c.title}):null]}):null,l]})})}),ot=h.memo(({children:r,borderBottom:t=!0,padding:o=!0})=>{const n=Ce.useMediaQuery("lg");return e.jsx(y.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})}),lt=h.memo(({children:r,borderTop:t=!0,padding:o=!0})=>{const n=Ce.useMediaQuery("lg");return e.jsx(y.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})}),zl=h.memo(({children:r,...t})=>e.jsx(y.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),Hl=h.memo(({children:r,title:t,titleTag:o,action:n,header:l,footer:c,actionContainer:s,containerProps:i,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:p={borderTop:!0},variantTag:b="info"})=>{const u=Ce.useMediaQuery("lg"),v=()=>o?e.jsxs(y.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:t}),e.jsx(Ye.Badges,{border:!0,text:o,variant:b})]}):e.jsx(k.Text,{fontWeight:"medium",children:t}),B=()=>l||e.jsxs(y.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(y.Box,{direction:"column",children:t?v():null}),e.jsx(y.Box,{direction:"column",style:u?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...s,children:n??null})]}),x=!!(l||t||n);return e.jsxs(y.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...i,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(i==null?void 0:i.style)??{}},children:[l!==null&&x?e.jsx(ot,{...d,children:B()}):null,e.jsx(zl,{...a,children:r}),c?e.jsx(lt,{...p,children:c}):null]})}),He={H1:r=>e.jsx(k.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(k.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(k.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(k.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(k.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(k.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(k.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(k.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(k.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(k.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(k.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(k.Text,{variant:"body-3",children:r.children,...r.props})},Te=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=Ge(),[n,l]=r(),c=nr.searchParamsToObject(n.toString()),s=t(),i=o(),a=s.id;return{setSearchParams:l,searchParams:n,searchQueries:c,isHasQuery:(v,B)=>n.has(v)&&n.get(v)===B,getQueryParam:v=>n.get(v),getRouteParam:v=>s[v],params:s,location:i,id:a,hasId:!!a}},yo=r=>JSON.stringify(r),po=r=>JSON.stringify(r),bo=r=>JSON.stringify(r),Co=r=>JSON.stringify(r),Vl=r=>r,Pl=r=>JSON.stringify(r),pr=({value:r,name:t,type:o,withSearchParam:n=!0,setSearchParams:l,searchQueries:c,dropdownSearchKey:s,filterKey:i="filter",pageKey:a="page"})=>{if(n){let d;switch(o){case"search":d=Vl(r);break;case"dropdown":case"dropdown-multiple":d=yo(r);break;case"radio":d=po(r);break;case"date-range":d=bo(r);break;case"advanced-date-range":d=Pl(r);break;case"date":d=Co(r);break;default:d=r;break}if(typeof d<"u"){const b={...c[i]&&typeof c[i]=="string"?JSON.parse(c[i]):void 0,[t]:d},u={...c};s&&typeof s=="string"&&delete u[s],delete u[a];const v={...u,[i]:JSON.stringify(b)},B=new URLSearchParams(c).toString(),x=new URLSearchParams(v).toString();if(B===x)return;l(v)}}},Er=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,c=l&&typeof l=="string"?JSON.parse(l):void 0,s=c?c[r]:void 0;return n==="label"&&s?JSON.parse(s)[0].label:n==="value"&&s?JSON.parse(s)[0].value:s},vo=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,c=l&&typeof l=="string"?JSON.parse(l):void 0,s=c?c[r]:void 0;return n==="label"&&s?JSON.parse(s).map(i=>i.label):n==="value"&&s?JSON.parse(s).map(i=>i.value):n==="array"&&s?JSON.parse(s):s},jl=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,c=l&&typeof l=="string"?JSON.parse(l):void 0,s=c?c[r]:void 0;return n==="id"&&s?JSON.parse(s).id:n==="label"&&s?JSON.parse(s).label:n==="value"&&s?JSON.parse(s).value:s},Mr=(r,t,o)=>{const n=t.get(o||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0;return l?l[r]:void 0},Nl=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,c=l?l[r]:void 0;return{start:c?JSON.parse(c).from:void 0,end:c?JSON.parse(c).to:void 0}},xo=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,c=l?l[r]:void 0;return c?JSON.parse(c):void 0},_l=(r,{filterKey:t="filter",perPageKey:o="perPage",pageKey:n="page"})=>{const l=r.get(t)||void 0,c=r.get(o)||void 0,s=r.get(n)||void 0;return!!l||!!c||!!s},wo=({isOpen:r,onClose:t,filterKey:o,pageKey:n,filters:l})=>{const{searchParams:c,setSearchParams:s,searchQueries:i}=Te(),[a,d]=h.useState({}),p=()=>{c.delete(o||"filter"),s(c)},b=(u,v)=>{switch(u.type){case"radio":{const{show:B=!0}=u;return B&&e.jsx(y.Box,{direction:"column",children:e.jsx(y.Box,{direction:"column",children:u.title})},v)}case"dropdown":{const{show:B=!0}=u;return B&&e.jsx(y.Box,{direction:"column",children:e.jsx(y.Box,{direction:"column",children:u.title})},v)}case"date-range":return e.jsx(y.Box,{direction:"column",children:e.jsx(y.Box,{direction:"column",children:u.title})},v);case"date":return e.jsx(y.Box,{direction:"column",children:e.jsx(y.Box,{direction:"column",children:u.title})},v);case"dropdown-multiple":{const{show:B=!0}=u;return B&&e.jsx(y.Box,{direction:"column",children:e.jsx(y.Box,{direction:"column",children:u.title})},v)}default:return null}};return e.jsx(uo,{onHide:t,show:r||!1,children:e.jsxs(y.Box,{direction:"column",gap:"md",children:[e.jsxs(le.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(y.Box,{direction:"column",children:"Filter"}),e.jsx(y.Box,{direction:"column",style:{cursor:"pointer"},onClick:p,children:"Reset"})]}),l==null?void 0:l.map((u,v)=>b(u,v))]})})},Do=({searchKey:r="q",statusKey:t="status",searchPlaceholder:o="Search",searchHighlightPlaceholder:n,extendedFilter:l,showSearchFilter:c=!0,showStatusFilter:s=!0,filterKey:i="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:p,filterConfigs:b,buttonToggleProps:u,position:v="right",titleSearchLabel:B="Work Order",withTitleLabels:x=!1})=>{const F=(u==null?void 0:u.isShowLabel)??!0,[A,D]=h.useState(!1),[m,H]=h.useState(0),z=()=>{H(J=>J+1)},{searchParams:I,setSearchParams:E,getQueryParam:Z}=Te(),$=nr.searchParamsToObject(I.toString()),P=Mr(r,I,i)||"",[_,U]=h.useState(P),K=Z(i),Y=!!(K&&!(()=>{if(K)try{const J=JSON.parse(K);return Object.keys(J).length===1&&J[r]===""}catch(J){console.error("Filter parameter is not a valid JSON:",J)}return!1})()),Q=Ce.useMediaQuery("md");return h.useEffect(()=>{U(P)},[P]),h.useEffect(()=>{if(_===P)return;const J=window.setTimeout(()=>{pr({value:_,name:r,type:"search",searchQueries:$,setSearchParams:E,filterKey:i,pageKey:a})},350);return()=>{window.clearTimeout(J)}},[_,P,r,$,E,i,a]),e.jsxs(le.Flex,{gap:"md",style:{flexDirection:Q&&v==="left"?"row":Q&&v==="right"?"row-reverse":"column"},align:"flex-end",children:[Y&&e.jsx(y.Box,{direction:"column",justify:"flex-end",children:e.jsx(N.Button,{onClick:()=>{const J=new URLSearchParams(I);J.delete(i),E(J),U(""),z(),p&&p()},variant:"outline",tone:"neutral",children:e.jsx(k.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),l==null?void 0:l.map(({minWidth:J,content:ce,title:pe,onClickContainer:Be},fe)=>e.jsxs(y.Box,{direction:"column",gap:"sm",onClick:Be,style:{minWidth:J},children:[pe&&e.jsx(He.SubH3,{children:pe}),ce]},`extended-filter-${fe}-${m}`)),!!(b!=null&&b.length)&&e.jsx(N.Button,{primary:Y,secondary:!Y,iconLeft:e.jsx(T.Icon,{size:"sm",name:(u==null?void 0:u.icon)||"FilterHorizontal",style:{color:K?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!Q,onClick:()=>D(!0),children:F?"Filter":void 0}),s&&e.jsxs(y.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[x&&e.jsx(He.SubH3,{children:"Status"}),e.jsx(lr.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Er({get:"value",name:t,searchParams:I,filterKey:i})?[{label:Er({get:"value",name:t,searchParams:I,filterKey:i})==="active"?"Active":"InActive",value:Er({get:"value",name:t,searchParams:I,filterKey:i})}]:[],onChange:J=>pr({value:J,name:t,type:"dropdown",searchQueries:$,setSearchParams:E,filterKey:i}),placeholder:x?"All":"All Status"},m)]}),c&&e.jsxs(y.Box,{direction:"column",gap:"sm",style:{width:d&&Q?d:Q?"310px":""},children:[x&&e.jsxs(He.SubH3,{children:["Search for ",B]}),e.jsx(Xe.Input,{placeholder:o,leftIcon:e.jsx(T.Icon,{name:"Search",width:20,height:20}),onChange:J=>U(J.target.value),value:_,fullWidth:!0},m+1+i)]}),e.jsx(wo,{isOpen:A,onClose:()=>D(!1),filterKey:i,filters:b,pageKey:a})]})},ql=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r;function nt({configs:r,filterKey:t="filter",activeFilterKey:o="filters",pageKey:n="page",searchKey:l="q"}){const{searchParams:c,setSearchParams:s,searchQueries:i}=Te(),a=h.useMemo(()=>Object.fromEntries(r.map(m=>[m.key,m])),[r]),d=h.useMemo(()=>{const m=(c.get(o)||"").split(",").map(z=>z.trim()).filter(Boolean);let H=[];try{const z=c.get(t);z&&(H=Object.keys(JSON.parse(z)).filter(I=>I!==l))}catch{}return r.map(z=>z.key).filter(z=>{const I=a[z];return(I==null?void 0:I.locked)||m.includes(z)||H.includes(z)})},[c,o,t,l,r,a]),p=h.useCallback(m=>{try{return m[t]?JSON.parse(m[t]):{}}catch{return{}}},[t]),b=h.useCallback(m=>{const H={...i};m.length?H[o]=m.join(","):delete H[o],s(H)},[i,o,s]),u=h.useCallback(m=>{d.includes(m)||b([...d,m])},[d,b]),v=h.useCallback(m=>{var E;if((E=a[m])!=null&&E.locked)return;const H={...i},z=d.filter(Z=>Z!==m);z.length?H[o]=z.join(","):delete H[o];const I=p(H);m in I&&(delete I[m],Object.keys(I).length?H[t]=JSON.stringify(I):delete H[t]),delete H[n],s(H)},[i,d,o,t,n,p,s,a]),B=h.useCallback(m=>d.includes(m)?v(m):u(m),[d,u,v]),x=h.useCallback(m=>{switch(m.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return vo({name:m.key,get:"array",searchParams:c,filterKey:t})||[];case"date":{const H=xo({name:m.key,searchParams:c,filterKey:t});return H?new Date(H):void 0}case"date-compact":{const z=p(Object.fromEntries(c.entries()))[m.key];return z&&typeof z=="object"?z:void 0}default:return}},[c,t,p]),L=h.useCallback((m,H)=>{if(m.type==="date-compact"){const z={...i},I=p(z);H==null?delete I[m.key]:I[m.key]=H,Object.keys(I).length?z[t]=JSON.stringify(I):delete z[t],delete z[n],s(z);return}pr({value:H,name:m.key,type:ql(m.type),searchQueries:i,setSearchParams:s,filterKey:t,pageKey:n})},[i,s,t,n,p]),F=h.useCallback(m=>{const H={...i},z=p(H);m in z&&(delete z[m],Object.keys(z).length?H[t]=JSON.stringify(z):delete H[t]),delete H[n],s(H)},[i,t,n,p,s]),A=h.useCallback(()=>{const m={...i};delete m[t],delete m[o],delete m[n],s(m)},[i,t,o,n,s]),D=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:D,addFilter:u,removeFilter:v,toggleFilter:B,getValue:x,setValue:L,clearValue:F,clearAll:A}}const ct={get(r){return ur.storage.get(r)??null},set(r,t){ur.storage.save(r,t)},remove(r){ur.storage.delete(r)}},ir={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}`},Lr=(r,t)=>{const o=new Set(t.map(c=>c.key)),n=r.order.filter(c=>o.has(c));for(const c of t)n.includes(c.key)||n.push(c.key);const l=r.hidden.filter(c=>o.has(c));return{order:n,hidden:l}};function Zl({columns:r,scopeId:t,storage:o,onColumnsChange:n,value:l}){const c=h.useMemo(()=>({order:r.map(I=>I.key),hidden:[]}),[r]),s=t?ir.columns(t):void 0,i=(I,E)=>Lr({order:I.order??E,hidden:I.hidden??[]},r),[a,d]=h.useState(()=>{if(l&&(l.order||l.hidden))return i(l,r.map(I=>I.key));if(s){const I=o.get(s);if(I&&Array.isArray(I.order))return Lr(I,r)}return c}),p=r.map(I=>I.key).join("|");h.useEffect(()=>d(I=>Lr(I,r)),[p]);const b=h.useRef(a);b.current=a;const u=l?`${(l.order??[]).join("|")}~${(l.hidden??[]).join("|")}`:null,v=h.useRef(u);h.useEffect(()=>{if(u==null||v.current===u)return;v.current=u;const I=b.current,E=i(l,I.order);E.order.join("|")===I.order.join("|")&&E.hidden.join("|")===I.hidden.join("|")||(d(E),s&&o.set(s,E))},[u,p]);const B=h.useRef(!1);h.useEffect(()=>{B.current||(B.current=!0,n==null||n(a))},[]);const x=h.useCallback(I=>{d(I),s&&o.set(s,I),n==null||n(I)},[s,o,n]),L=h.useMemo(()=>{const I=new Map(r.map(E=>[E.key,E]));return a.order.filter(E=>I.has(E)).map(E=>({...I.get(E),visible:!a.hidden.includes(E)}))},[a,r]),F=h.useCallback(I=>{const E=a.hidden.includes(I)?a.hidden.filter(Z=>Z!==I):[...a.hidden,I];x({...a,hidden:E})},[a,x]),A=h.useCallback((I,E)=>{if(I===E)return;const Z=[...a.order],[$]=Z.splice(I,1);Z.splice(E,0,$),x({...a,order:Z})},[a,x]),D=h.useCallback(I=>{x({...a,hidden:I?r.filter(E=>!E.locked).map(E=>E.key):[]})},[a,r,x]),m=h.useCallback(()=>x(c),[x,c]),H=h.useCallback(I=>x(Lr(I,r)),[x,r]),z=a.hidden.length===0;return{state:a,orderedColumns:L,allVisible:z,toggleVisibility:F,reorder:A,setAllHidden:D,reset:m,applyState:H}}function Gl({scopeId:r,storage:t,snapshotKeys:o,pageKey:n="page",getColumns:l,applyColumns:c}){const{searchParams:s,setSearchParams:i}=Te(),a=r?ir.savedViews(r):void 0,[d,p]=h.useState(()=>a?t.get(a)||[]:[]),b=h.useCallback(x=>{p(x),a&&t.set(a,x)},[a]),u=h.useCallback(x=>{const L=x.trim();if(!L)return;const F={};o.forEach(D=>{const m=s.get(D);m!=null&&(F[D]=m)});const A={id:`${Date.now()}`,name:L,query:F,columns:l==null?void 0:l(),createdAt:Date.now()};b([...d,A])},[o,s,l,b,d]),v=h.useCallback(x=>b(d.filter(L=>L.id!==x)),[b,d]),B=h.useCallback(x=>{const L=Object.fromEntries(s.entries());o.forEach(F=>delete L[F]),Object.assign(L,x.query),delete L[n],i(L),x.columns&&(c==null||c(x.columns))},[s,o,n,i,c]);return{enabled:!!a,views:d,saveView:u,deleteView:v,applyView:B}}function Ql(r,t){let o;try{o=JSON.parse(r)}catch{return r}return!o||typeof o!="object"?r:(delete o[t],Object.keys(o).length>0?JSON.stringify(o):void 0)}function So(r,t,o){const n=r[t];if(n==null)return;const l=Ql(n,o);l===void 0?delete r[t]:r[t]=l}function Ul({scopeId:r,storage:t,snapshotKeys:o,enabled:n=!0,filterKey:l="filter",searchKey:c="q",persistSearch:s=!0}){const{searchParams:i}=Te(),a=r&&n?ir.lastState(r):void 0,d=h.useRef(a),p=h.useRef(!1);h.useEffect(()=>{if(!a){d.current=a;return}if(d.current!==a){d.current=a,p.current=!1;return}const v={};if(o.forEach(B=>{const x=i.get(B);x!=null&&(v[B]=x)}),s||So(v,l,c),Object.keys(v).length===0){p.current&&t.remove(a);return}p.current=!0,t.set(a,v)},[i,a,o,t,s,l,c]);const b=h.useCallback(()=>{if(!a)return null;const v=t.get(a);return!v||Object.keys(v).length===0||!s&&(So(v,l,c),Object.keys(v).length===0)?null:v},[a,t,s,l,c]),u=h.useCallback(()=>{a&&t.remove(a)},[a,t]);return{enabled:!!a,read:b,clear:u}}function Jl({scopeId:r,storage:t,perPageKey:o,pageSizeOptions:n,enabled:l=!0}){const{searchParams:c}=Te(),s=r&&l?ir.perPage(r):void 0,i=c.toString(),a=h.useRef(s);h.useEffect(()=>{if(!s){a.current=s;return}if(a.current!==s){a.current=s;return}const b=c.get(o);if(!b)return;const u=Number(b);!Number.isFinite(u)||u<=0||t.set(s,u)},[i,s,o,t]);const d=h.useCallback(()=>{if(!s)return null;const b=t.get(s);if(b==null)return null;const u=Number(b);return!Number.isFinite(u)||u<=0||n&&!n.includes(u)?null:String(u)},[s,t,n]),p=h.useCallback(()=>{s&&t.remove(s)},[s,t]);return{enabled:!!s,read:d,clear:p}}let st={},it=!1,at=null;const Yl=(r,t)=>{Object.assign(st,r),at=t,!it&&(it=!0,queueMicrotask(()=>{const o=st,n=at;st={},it=!1,at=null,!(!n||Object.keys(o).length===0)&&n(l=>{const c=new URLSearchParams(l);return Object.entries(o).forEach(([s,i])=>c.set(s,i)),c})}))};function Xl({enabled:r,snapshotKeys:t,perPageKey:o,readSnapshot:n,readPerPage:l}){const{searchParams:c,setSearchParams:s,location:i}=Te(),a=h.useRef(null);h.useEffect(()=>{if(!r||a.current===i.pathname)return;a.current=i.pathname;const d={};if(!c.has(o)){const p=l();p&&(d[o]=p)}if(!t.some(p=>c.has(p))){const p=n();p&&Object.assign(d,p)}Object.keys(d).length!==0&&Yl(d,s)},[i.pathname,r])}const $l=({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(N.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{minWidth:260},title:e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&l&&e.jsx(N.Button,{variant:"link",tone:"brand",size:"xs",onClick:l,children:"Reset"})]}),children:r.map(c=>e.jsx(W.MenuItem,{selected:c.locked||t.includes(c.key),disabled:c.locked,closeOnSelect:!1,startIcon:c.icon??void 0,onClick:()=>{c.locked||o(c.key)},children:c.label},c.key))})})]}):null,Tr=({onClear:r,onRemove:t})=>e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(T.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(T.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(W.MenuItem,{intent:"danger",startIcon:e.jsx(T.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),Kl=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},ko=(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},Bo=r=>{const t=Kl(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:ko(t,-o,r.period),to:t}:{from:t,to:ko(t,o,r.period)}},mo=24,Fo=r=>r.length>mo?`${r.slice(0,mo)}...`:r,Ir=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Or={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"},Rl=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],dt={past:"Past",next:"Next",this:"This"},en=["day","week","month","year"],rn=["past","next","this"],tn=r=>r.field.type==="date-compact"?e.jsx(nn,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(on,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),on=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const c=t?Ir(new Date(t)):null,s=!!c,i=s?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Fo(c)})]}):r.label;return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s?e.jsx(T.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:i})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:260},title:e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:e.jsx(er.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():o(a),withPadding:!1})})})]})},ln=r=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${Or[r.op]} ${Ir(new Date(r.date))}`:null;case"is-between":return r.from&&r.to?`${Ir(new Date(r.from))} - ${Ir(new Date(r.to))}`:null;case"is-relative-to-today":{const t=r.relative;if(!t)return null;if(t.direction==="this")return`This ${t.period}`;const o=t.count??1,n=o===1?t.period:`${t.period}s`;return`${dt[t.direction]} ${o} ${n}`}case"is-empty":case"is-not-empty":return Or[r.op];default:return null}},nn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const c=r.ops&&r.ops.length>0?r.ops:Rl,s=r.defaultOp&&c.includes(r.defaultOp)?r.defaultOp:c[0],i=(t==null?void 0:t.op)??s,a=t?ln(t):null,d=!!a,p=d?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Fo(a)})]}):r.label,b=u=>{if(u!==i){if(u==="is-empty"||u==="is-not-empty"){o({op:u});return}if(u==="is-relative-to-today"){o({op:u,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(u==="is-between"){o({op:u,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}o({op:u,date:t==null?void 0:t.date})}};return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:d?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:d?e.jsx(T.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:p})}),e.jsxs(W.MenuLists,{children:[e.jsx(W.MenuBody,{style:{width:320},title:e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(cn,{op:i,ops:c,onChange:b})]}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:e.jsx(sn,{value:t,op:i,onChange:o})}),i==="is-relative-to-today"&&e.jsx(W.MenuFooter,{children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},cn=({op:r,ops:t,onChange:o})=>e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:Or[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(T.Icon,{name:"Check"}):void 0,children:Or[n]},n))})})]}),sn=({value:r,op:t,onChange:o})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(y.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const n=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(er.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:n,onChange:l=>{if(l==null){o({op:t});return}if(typeof l=="object"&&l!==null&&"from"in l&&"to"in l){let{from:c,to:s}=l;if(!c&&s&&(c=s,s=null),!c&&!s){o({op:t});return}o({op:t,from:c?c.toISOString():void 0,to:s?s.toISOString():void 0})}},withPadding:!1},"range")}return t==="is-relative-to-today"?e.jsx(an,{value:r==null?void 0:r.relative,onChange:n=>o({op:t,relative:n})}):e.jsx(er.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:r!=null&&r.date?new Date(r.date):void 0,onChange:n=>{if(n==null){o({op:t});return}n instanceof Date&&o({op:t,date:n.toISOString()})},withPadding:!1},"single")},an=({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",c=o!=="this",s=Bo({direction:o,count:n,period:l});return e.jsxs(y.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(y.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(N.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:dt[o]})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:140},children:rn.map(i=>e.jsx(W.MenuItem,{selected:o===i,endIcon:o===i?e.jsx(T.Icon,{name:"Check"}):void 0,onClick:()=>t(i==="this"?{direction:i,period:l}:{direction:i,count:n,period:l}),children:dt[i]},i))})})]}),c&&e.jsx(Xe.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:i=>{const a=Number(i.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(N.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:140},children:en.map(i=>e.jsx(W.MenuItem,{selected:l===i,endIcon:l===i?e.jsx(T.Icon,{name:"Check"}):void 0,onClick:()=>t(o==="this"?{direction:o,period:i}:{direction:o,count:n,period:i}),children:i},i))})})]})]}),e.jsx(er.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:s,onChange:()=>{},withPadding:!1},"relative-preview")]})},Eo=18,dn=r=>r.length>Eo?`${r.slice(0,Eo)}...`:r,hn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const c=r.type==="dropdown-multiple",s=t.length,i=r.searchable!==!1,[a,d]=h.useState(""),p=r.options,b=typeof r.onSearch=="function",u=(()=>{if(b)return p;const F=a.trim().toLowerCase();return F?p.filter(A=>A.label.toLowerCase().includes(F)):p})(),v=F=>t.some(A=>A.value===F.value),B=F=>{if(!c){o([{label:F.label,value:F.value}]),d("");return}o(v(F)?t.filter(A=>A.value!==F.value):[...t,{label:F.label,value:F.value}])},x=F=>{var A;d(F),(A=r.onSearch)==null||A.call(r,F)},L=s===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:s===1?dn(t[0].label):`${s} Selected`})]});return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:s>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s>0?e.jsx(T.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:L})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:260},title:e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:e.jsxs(y.Box,{direction:"column",gap:"sm",children:[i&&e.jsx(lr.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:c,searchAble:!0,searchValue:a,onSearch:x,value:t,onChange:o,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(y.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(y.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):u.length===0?e.jsx(y.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):u.map(F=>e.jsx(W.MenuItem,{closeOnSelect:!c,selected:v(F),startIcon:F.avatar,endIcon:v(F)?e.jsx(T.Icon,{name:"Check"}):void 0,description:F.description,onClick:()=>B(F),children:F.label},F.value))})]})})})]})},Mo=18,fn=r=>r.length>Mo?`${r.slice(0,Mo)}...`:r,Lo=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(Ze.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),gn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const c=new Set(t.map(u=>u.value)),s=t.length,i=r.options.length>0&&r.options.every(u=>c.has(u.value)),a=s>0&&!i,d=u=>{o(c.has(u.value)?t.filter(v=>v.value!==u.value):[...t,{label:u.label,value:u.value}])},p=()=>{o(i?[]:r.options.map(u=>({label:u.label,value:u.value})))},b=s===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(k.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(k.Text,{as:"span",children:s===1?fn(t[0].label):`${s} Selected`})]});return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:s>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s>0?e.jsx(T.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsx(W.MenuLists,{children:e.jsxs(W.MenuBody,{style:{width:240},title:e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:[e.jsx(W.MenuItem,{closeOnSelect:!1,selected:i,onClick:p,startIcon:e.jsx(Lo,{checked:i||a,indeterminate:a}),children:"Select All"}),r.options.map(u=>e.jsx(W.MenuItem,{closeOnSelect:!1,selected:c.has(u.value),onClick:()=>d(u),startIcon:e.jsx(Lo,{checked:c.has(u.value)}),children:u.label},u.value))]})})]})},To=({activeKeys:r,configByKey:t,getValue:o,setValue:n,clearValue:l,removeFilter:c})=>e.jsx(e.Fragment,{children:r.map(s=>{const i=t[s];if(!i)return null;const a=o(i),d=i.locked?void 0:()=>c(s);return i.type==="date"||i.type==="date-compact"?e.jsx(tn,{field:i,value:a,onChange:p=>n(i,p),onClear:()=>l(s),onRemove:d},s):i.type==="checkbox-multiple"?e.jsx(gn,{field:i,value:a||[],onChange:p=>n(i,p),onClear:()=>l(s),onRemove:d},s):e.jsx(hn,{field:i,value:a||[],onChange:p=>n(i,p),onClear:()=>l(s),onRemove:d},s)})}),Io=r=>`${r} Rows`,un=({pagination:r,pageKey:t="page",perPageKey:o="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:l=10,showResultCount:c=!0,showPageSize:s=!0,showPagination:i=!0})=>{var F;const{searchQueries:a,setSearchParams:d,searchParams:p}=Te(),b=p.get(o),u=b?Number(b):l,v=A=>{d({...a,[t]:String(A)})},B=A=>{d({...a,[o]:A,[t]:"1"})},x=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:0),L=(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:[c&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${x}-${L} of ${((F=r==null?void 0:r.totalData)==null?void 0:F.toLocaleString())||0}`}),s&&e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Io(u)})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{children:n.map(A=>e.jsx(W.MenuItem,{selected:A===u,onClick:()=>B(String(A)),children:Io(A)},A))})})]}),i&&((r==null?void 0:r.totalPage)??0)>1&&e.jsx(y.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(gr.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:v})})]})};function yn(r,t,o=!0){h.useEffect(()=>{if(!o)return;const n=l=>{var i;if(l.metaKey||l.ctrlKey||l.altKey||l.key!==r)return;const c=l.target,s=(i=c==null?void 0:c.tagName)==null?void 0:i.toLowerCase();s==="input"||s==="textarea"||c!=null&&c.isContentEditable||(l.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,o])}const pn=240,Oo=({searchKey:r="q",filterKey:t="filter",pageKey:o="page",placeholder:n="Search",shortcut:l="/",collapsible:c=!0})=>{const{searchParams:s,setSearchParams:i,searchQueries:a}=Te(),d=Mr(r,s,t)||"",[p,b]=h.useState(!c||!!d),[u,v]=h.useState(c&&!d),[B,x]=h.useState(d),L=Ce.useDebounce(B,350),F=h.useRef(null);h.useEffect(()=>{x(d),d&&b(!0)},[d]),h.useEffect(()=>{p&&v(!1)},[p]),h.useEffect(()=>{L!==d&&pr({value:L,name:r,type:"search",searchQueries:a,setSearchParams:i,filterKey:t,pageKey:o})},[L]);const A=h.useCallback(()=>{b(!0),requestAnimationFrame(()=>{var z;return(z=F.current)==null?void 0:z.focus()})},[]);yn(l,A);const D=()=>{c&&!B&&b(!1)},m=z=>{var I;c&&z.key==="Escape"&&!B&&(b(!1),(I=F.current)==null||I.blur())},H=()=>{p||v(!0)};return e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[u&&e.jsx(N.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:A}),e.jsxs(y.Box,{onTransitionEnd:H,style:{position:"relative",width:p?pn:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(Xe.Input,{ref:F,size:"sm",fullWidth:!0,value:B,placeholder:n,leftIcon:e.jsx(T.Icon,{name:"Search",width:16,height:16}),onChange:z=>x(z.target.value),onKeyDown:m,onBlur:D,tabIndex:p?0:-1}),p&&!B&&e.jsx(y.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-surface-hover, #f1f2f4)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(k.Text,{fontSize:"xs",color:"subtle",children:l})})]})]})},Wo=({columns:r,allVisible:t,onToggle:o,onReorder:n,onSetAllHidden:l})=>{const[c,s]=h.useState(null),[i,a]=h.useState(null),d=()=>{c!==null&&i!==null&&c!==i&&n(c,i),s(null),a(null)},p=(b,u)=>{const v=b+u;v<0||v>=r.length||n(b,v)};return e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{children:e.jsxs(y.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(N.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>l(t),children:t?"Hide All":"Show All"})]}),e.jsx(y.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((b,u)=>{const v=!b.locked,B=i===u&&c!==null&&c!==u;return e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:v,onDragStart:()=>v&&s(u),onDragOver:x=>{x.preventDefault(),a(u)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:B?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(y.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:v?0:-1,"aria-label":`Reorder ${b.title}`,"aria-disabled":!v||void 0,color:"icon-subtlest",onKeyDown:x=>{v&&(x.key==="ArrowUp"?(x.preventDefault(),p(u,-1)):x.key==="ArrowDown"&&(x.preventDefault(),p(u,1)))},style:{display:"inline-flex",cursor:v?"grab":"default",opacity:v?1:.4},children:e.jsx(T.Icon,{name:"DragVertical",width:16,height:16})}),b.icon&&e.jsx(y.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:b.icon}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:b.title}),e.jsx(y.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(sr.Toggle,{size:"sm",checked:b.visible,disabled:b.locked,onChange:()=>o(b.key),"aria-label":`Toggle ${b.title} column`})})]},b.key)})})]})})})]})},Ao=({views:r,onApply:t,onDelete:o,onSave:n})=>{const[l,c]=h.useState(""),s=()=>{const i=l.trim();i&&(n(i),c(""))};return e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(T.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(W.MenuLists,{style:{width:"260px"},children:[e.jsx(W.MenuBody,{children:e.jsxs(y.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(y.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(y.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(k.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(i=>e.jsx(W.MenuItem,{startIcon:e.jsx(T.Icon,{name:"Bookmark"}),onClick:()=>t(i),endIcon:e.jsx(N.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Trash2"}),"aria-label":`Delete ${i.name}`,onClick:a=>{a.stopPropagation(),o(i.id)}}),children:i.name},i.id))})]})}),e.jsx(W.MenuFooter,{children:e.jsxs(y.Box,{direction:"row",gap:"xs",children:[e.jsx(y.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(Xe.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:l,onChange:i=>c(i.target.value),onKeyDown:i=>{i.key==="Enter"&&s()}})}),e.jsx(N.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!l.trim(),onClick:s,children:"Save"})]})})]})]})},bn=({isOpen:r,onClose:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:c,onToggle:s,onReset:i,getValue:a,setValue:d,clearValue:p,removeFilter:b})=>{const u=n.length;return e.jsx(kr.Drawer,{position:"bottom",isShow:r,onHide:t,children:e.jsxs(y.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(y.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(y.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),u>0&&e.jsxs(k.Text,{fontSize:"sm",color:"subtle",children:["(",u,")"]})]}),e.jsx(N.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(y.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[u>0&&e.jsxs(y.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(y.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(To,{activeKeys:n,configByKey:l,getValue:a,setValue:d,clearValue:p,removeFilter:b})})]}),o.length>0&&e.jsxs(y.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(y.Box,{direction:"column",children:o.map(v=>{const B=n.includes(v.key),x=!!v.locked;return e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:x?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[v.icon&&e.jsx(y.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:v.icon}),e.jsx(k.Text,{fontSize:"sm",color:"primary",truncate:!0,children:v.label})]}),e.jsx(sr.Toggle,{size:"sm",checked:B||x,disabled:x,onChange:()=>s(v.key),"aria-label":`Toggle ${v.label}`})]},v.key)})})]})]}),e.jsxs(y.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(y.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(N.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!c,onClick:i,children:"Reset"})}),e.jsx(y.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(N.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},Cn=r=>`${r} Rows`,vn=({perPageKey:r,pageKey:t,pageSizeOptions:o,defaultPerPage:n=10,showPageSize:l})=>{const{searchQueries:c,setSearchParams:s,searchParams:i}=Te(),a=i.get(r),d=a?Number(a):n,p=b=>{s({...c,[r]:b,[t]:"1"})};return l?e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(W.MenuLists,{children:e.jsxs(W.MenuBody,{style:{minWidth:200},children:[e.jsx(y.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),o.map(b=>e.jsx(W.MenuItem,{selected:b===d,endIcon:b===d?e.jsx(T.Icon,{name:"Check"}):void 0,onClick:()=>p(String(b)),children:Cn(b)},b))]})})]}):null},xn=r=>{var xe;const{withPadding:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:c,toggleFilter:s,removeFilter:i,getValue:a,setValue:d,clearValue:p,onReset:b,searchable:u,searchKey:v,filterKey:B,pageKey:x,searchPlaceholder:L,searchShortcut:F,searchCollapsible:A,pagination:D,perPageKey:m,pageSizeOptions:H,defaultPerPage:z,showPagination:I,showResultCount:E,showPageSize:Z,hasColumns:$,orderedColumns:P,allVisible:_,onToggleVisibility:U,onReorder:K,onSetAllHidden:te,showSavedViews:Y,savedViews:Q,onApplyView:J,onDeleteView:ce,onSaveView:pe,leadingActions:Be}=r,[fe,ge]=h.useState(!1),{searchQueries:ve,setSearchParams:Ee}=Te(),Oe=(D==null?void 0:D.rangeStart)??(((D==null?void 0:D.currentPage)||0)>1?(((D==null?void 0:D.currentPage)||0)-1)*((D==null?void 0:D.perPage)||0)+1:1),Ve=(D==null?void 0:D.rangeEnd)??((D==null?void 0:D.totalCurrentPage)!==(D==null?void 0:D.perPage)?D==null?void 0:D.totalData:((D==null?void 0:D.currentPage)||1)*((D==null?void 0:D.totalCurrentPage)||0)),Pe=$e=>{Ee({...ve,[x]:String($e)})},Se=E||I&&!!(D!=null&&D.totalPage),je=()=>{b(),ge(!1)};return e.jsxs(y.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(y.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[u&&e.jsx(Oo,{searchKey:v,filterKey:B,pageKey:x,placeholder:L,shortcut:F,collapsible:A}),e.jsx(N.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"FilterHorizontal"}),onClick:()=>ge(!0),"aria-label":"Open filters",children:c?`Filter: ${n.length}`:null}),e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[Be,Y&&e.jsx(Ao,{views:Q,onApply:J,onDelete:ce,onSave:pe}),$&&e.jsx(Wo,{columns:P,allVisible:_,onToggle:U,onReorder:K,onSetAllHidden:te}),e.jsx(vn,{perPageKey:m,pageKey:x,pageSizeOptions:H,defaultPerPage:z,showPageSize:Z})]})]}),Se&&e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[E?e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Oe}-${Ve} of ${((xe=D==null?void 0:D.totalData)==null?void 0:xe.toLocaleString())||0}`}):e.jsx(y.Box,{direction:"column"}),I&&!!(D!=null&&D.totalPage)&&e.jsx(gr.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:D!=null&&D.currentPage?Number(D.currentPage):1,totalPages:Number(D.totalPage),onPageChange:Pe})]}),e.jsx(bn,{isOpen:fe,onClose:()=>ge(!1),configs:o,activeKeys:n,configByKey:l,hasActiveFilter:c,onToggle:s,onReset:je,getValue:a,setValue:d,clearValue:p,removeFilter:i})]})},wn=({withPadding:r=!1,filterConfigs:t=[],filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:c="perPage",pageSizeOptions:s=[25,50,100],defaultPerPage:i,showPagination:a=!0,showResultCount:d=!0,showPageSize:p=!0,searchable:b=!1,searchKey:u="q",searchPlaceholder:v="Search",searchShortcut:B="/",searchPosition:x="right",searchCollapsible:L=!0,pagination:F,columns:A=[],onColumnsChange:D,columnsState:m,scopeId:H,savedViews:z,persistLastState:I=!0,persistSearch:E=!0,storage:Z=ct,onReset:$,leadingActions:P})=>{const _=H??(z==null?void 0:z.scopeId),{activeKeys:U,configByKey:K,hasActiveFilter:te,toggleFilter:Y,removeFilter:Q,getValue:J,setValue:ce,clearValue:pe,clearAll:Be}=nt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:u}),fe=Zl({columns:A,scopeId:_,storage:Z,onColumnsChange:D,value:m}),ge=Gl({scopeId:_,storage:Z,snapshotKeys:[n,o,c],pageKey:l,getColumns:()=>fe.state,applyColumns:fe.applyState}),ve=Ul({scopeId:_,storage:Z,snapshotKeys:[n,o,l],enabled:I,filterKey:o,searchKey:u,persistSearch:E}),Ee=Jl({scopeId:_,storage:Z,perPageKey:c,pageSizeOptions:s,enabled:I});Xl({enabled:I&&!!_,snapshotKeys:[n,o,l],perPageKey:c,readSnapshot:ve.read,readPerPage:Ee.read});const Oe=i??s[0]??25,Ve=!!(z!=null&&z.enabled)&&ge.enabled,Pe=()=>{Be(),ve.clear(),$==null||$()},Se=Ce.useMediaQuery("md"),je=b?e.jsx(Oo,{searchKey:u,filterKey:o,pageKey:l,placeholder:v,shortcut:B,collapsible:L}):null;return Se?e.jsxs(y.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(y.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx($l,{configs:t,activeKeys:U,onToggle:Y,hasActiveFilter:te,onReset:Pe}),x==="left"&&je,e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(To,{activeKeys:U,configByKey:K,getValue:J,setValue:ce,clearValue:pe,removeFilter:Q}),te&&e.jsx(N.Button,{variant:"link",tone:"brand",size:"sm",onClick:Pe,children:"Reset"})]})]}),e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[P,e.jsx(un,{pagination:F,pageKey:l,perPageKey:c,pageSizeOptions:s,defaultPerPage:Oe,showPagination:a,showResultCount:d,showPageSize:p}),x==="right"&&je,Ve&&e.jsx(Ao,{views:ge.views,onApply:ge.applyView,onDelete:ge.deleteView,onSave:ge.saveView}),A.length>0&&e.jsx(Wo,{columns:fe.orderedColumns,allVisible:fe.allVisible,onToggle:fe.toggleVisibility,onReorder:fe.reorder,onSetAllHidden:fe.setAllHidden})]})]}):e.jsx(xn,{withPadding:r,configs:t,activeKeys:U,configByKey:K,hasActiveFilter:te,toggleFilter:Y,removeFilter:Q,getValue:J,setValue:ce,clearValue:pe,onReset:Pe,searchable:b,searchKey:u,filterKey:o,pageKey:l,searchPlaceholder:v,searchShortcut:B,searchCollapsible:L,pagination:F,perPageKey:c,pageSizeOptions:s,defaultPerPage:Oe,showPagination:a,showResultCount:d,showPageSize:p,hasColumns:A.length>0,orderedColumns:fe.orderedColumns,allVisible:fe.allVisible,onToggleVisibility:fe.toggleVisibility,onReorder:fe.reorder,onSetAllHidden:fe.setAllHidden,showSavedViews:Ve,savedViews:ge.views,onApplyView:ge.applyView,onDeleteView:ge.deleteView,onSaveView:ge.saveView,leadingActions:P})},Dn=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},Sn=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},kn=(r,t)=>{switch(r.type){case"dropdown":case"radio":return Dn(t);case"dropdown-multiple":case"checkbox-multiple":return Sn(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;default:return}},zo=(r,t)=>{if(r==null||r==="")return t;const o=Number(r);return Number.isFinite(o)&&o>0?o:t},Bn=r=>{const{filterConfigs:t,filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:c="perPage",searchKey:s="q",defaultPage:i=1,defaultPerPage:a=10,paramKeys:d,serialize:p}=r,{activeKeys:b,configByKey:u,hasActiveFilter:v,getValue:B}=nt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:s}),{searchParams:x}=Te(),L=x.toString();return h.useMemo(()=>{const A={},D={},m=zo(x.get(l),i),H=zo(x.get(c),a);A[(d==null?void 0:d.page)??"page"]=m,A[(d==null?void 0:d.perPage)??"perPage"]=H;const z=Mr(s,x,o)||"";z&&(A[(d==null?void 0:d.search)??"search"]=z);let I=!1;for(const E of b){const Z=u[E];if(!Z)continue;const $=B(Z);D[E]=$;const P=p==null?void 0:p[E],_=P?P($):kn(Z,$);if(_==null||Array.isArray(_)&&_.length===0)continue;const U=(d==null?void 0:d[E])??E;A[U]=_,I=!0}return{params:A,raw:D,hasActiveFilter:v||!!z||I}},[L,b.join("|"),o,n,l,c,s,i,a,d,p,u])},mn=["dropdown","dropdown-multiple","checkbox-multiple","radio"],Fn=({filterConfigs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l})=>{const{configByKey:c,getValue:s,setValue:i,removeFilter:a,clearAll:d,hasActiveFilter:p}=nt({configs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l}),b=(F,A)=>{var m;const D=F.options;return((m=D==null?void 0:D.find(H=>H.value===A))==null?void 0:m.label)??A},u=h.useCallback(F=>{const A=c[F];if(!A)return[];const D=s(A);return Array.isArray(D)?D.map(m=>String(m.value)):[]},[c,s]),v=h.useCallback((F,A)=>{const D=c[F];if(!D||!mn.includes(D.type))return;const m=Array.isArray(A)?A:[A];if(m.length===0){a(F);return}i(D,m.map(H=>({label:b(D,H),value:H})))},[c,i,a]),B=h.useCallback((F,A)=>{const D=u(F);v(F,D.includes(A)?D.filter(m=>m!==A):[...D,A])},[u,v]),x=h.useCallback((F,A)=>u(F).includes(A),[u]),L=h.useCallback(F=>a(F),[a]);return{set:v,toggle:B,clear:L,clearAll:d,isActive:x,values:u,hasActiveFilter:p}},En=(r,t)=>{if(!r)return{};const{fromKey:o,toKey:n,opKey:l}=t,c={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(c[o]=new Date(r.date).toISOString()),l&&(c[l]=r.op),c;case"is-between":return r.from&&(c[o]=new Date(r.from).toISOString()),r.to&&(c[n]=new Date(r.to).toISOString()),c;case"is-relative-to-today":{if(!r.relative)return c;const{from:s,to:i}=Bo(r.relative);return c[o]=s.toISOString(),c[n]=i.toISOString(),c}case"is-empty":case"is-not-empty":return l&&(c[l]=r.op==="is-empty"?"empty":"not-empty"),c;default:return c}},Ho=({children:r,borderRadius:t,height:o})=>{const n=h.useRef(null),[l,c]=h.useState("100vh");return h.useEffect(()=>{if(o)return;const s=()=>{if(n.current){const i=n.current.getBoundingClientRect().top;c(`calc(100vh - ${i}px)`)}};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[o]),e.jsx(y.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})},Vo=({action:r,rightContent:t,leftContent:o,headerSlot:n,advanceFilter:l,showFilter:c=!0})=>{const s=Ce.useMediaQuery("md"),i=c?e.jsx(Do,{...l}):null,a=()=>r?h.isValidElement(r)?r:e.jsx(y.Box,{style:{display:"flex",flexDirection:s?"row":"column",gap:"8px",width:s?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:d,icon:p,buttonProps:b,onClick:u},v)=>!d&&!p?null:e.jsx(N.Button,{fullWidth:!s,iconLeft:p?e.jsx(T.Icon,{name:p}):void 0,onClick:u,...b,children:d},`action-${v}`))}):null;return e.jsx(y.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:s?"row":"column-reverse",gap:"16px"},children:n?n({filter:i}):e.jsxs(e.Fragment,{children:[e.jsxs(y.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[i,o]}),e.jsxs(y.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},Mn=({totalData:r,withMarginBottom:t=!0,withMarginTop:o=!0})=>e.jsxs(y.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:o?"16px":void 0},children:[e.jsxs(He.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(He.Body1,{children:r||0})]}),Po=({pagination:r,pageKey:t="page",perPageKey:o="perPage",defaultPerPage:n=10,showPagination:l=!0,totalData:c})=>{const{searchQueries:s,setSearchParams:i,searchParams:a}=Te(),d=a.get(o),p=B=>{i({...s,[t]:String(B)})},b=B=>{i({...s,[o]:B,[t]:"1"})},u=(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),v=(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(y.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(y.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(k.Text,{children:"Rows Per Page: "}),e.jsx(lr.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:B=>{b(B[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(k.Text,{children:`${u}-${v} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(gr.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:p})]}):e.jsx(Mn,{totalData:c,withMarginBottom:!1,withMarginTop:!1})})},jo=({filter:r,columnTitle:t})=>{const[o,n]=h.useState(!1),l=h.useRef(null),c=h.useRef(null),s=h.useRef(null),[i,a]=h.useState(""),[d,p]=h.useState({top:0,left:0}),b=r.selectedValues,u=h.useMemo(()=>i?r.options.filter(x=>x.label.toLowerCase().includes(i.toLowerCase())):r.options,[r.options,i]);h.useEffect(()=>{if(o&&c.current){const x=c.current.getBoundingClientRect(),L=280,F={top:x.bottom+8};r.position==="left"||x.left+L>window.innerWidth?F.right=window.innerWidth-x.right:F.left=x.left,p(F)}},[o,r.position]),h.useEffect(()=>{o&&s.current?setTimeout(()=>{var x;return(x=s.current)==null?void 0:x.focus()},50):a("")},[o]),h.useEffect(()=>{const x=L=>{l.current&&!l.current.contains(L.target)&&c.current&&!c.current.contains(L.target)&&n(!1)};return o&&document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]);const v=x=>{const L=b.includes(x)?b.filter(F=>F!==x):[...b,x];r.onFilterChange(L)},B=()=>r.onFilterChange([]);return e.jsxs(y.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(y.Box,{ref:c,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:x=>{var L;x.stopPropagation(),o||(L=r.onOpen)==null||L.call(r),n(F=>!F)},children:e.jsx(T.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(y.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:"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(y.Box,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(k.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),b.length>0&&e.jsx(y.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(k.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:x=>{x.stopPropagation(),B()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(y.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(Xe.Input,{ref:s,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(T.Icon,{name:"Search",size:"sm"}),value:i,onChange:x=>a(x.target.value),style:{fontSize:"14px"}})}),e.jsx(y.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:r.isLoadingOptions?e.jsxs(y.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(T.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):u.length>0?e.jsx(y.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:u.map(x=>e.jsxs(y.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:b.includes(x.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:L=>{L.stopPropagation(),v(x.value)},onMouseEnter:L=>{b.includes(x.value)||(L.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),L.currentTarget.style.transform="translateX(2px)"},onMouseLeave:L=>{L.currentTarget.style.backgroundColor=b.includes(x.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",L.currentTarget.style.transform="translateX(0)"},children:[e.jsx(Ze.Checkbox,{checked:b.includes(x.value),onChange:()=>{}}),e.jsx(k.Text,{fontSize:"sm",fontWeight:b.includes(x.value)?"medium":"normal",color:b.includes(x.value)?"primary":"gray-700",children:x.label})]},x.value))}):e.jsxs(y.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(T.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),b.length>0&&e.jsx(y.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(y.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(y.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:b.length}),e.jsxs(k.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",b.length>1?"s":""," selected"]})]})})]})]})},Ln=({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,c=r==="asc"?1:.45,s=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:c,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:s},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},Tn=({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"})]}),ht="var(--sa-background-primary, #ffffff)",No="var(--sa-background-primary-inverse, #f8f8f8)",_o=({columns:r,records:t,handleDetail:o,handleUpdate:n,handleDelete:l,isLoading:c,visibleHandleDelete:s,visibleHandleUpdate:i,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:p,frozenCount:b=0,onFrozenCountChange:u,customActions:v,actionsOrder:B=["detail","update","delete","custom"],customEmptyState:x,enableColumnResize:L=!1,defaultColumnWidths:F,onColumnWidthsChange:A,defaultMinColumnWidth:D=60,sort:m,defaultSort:H,onSortChange:z,showActionDivider:I=!1})=>{const E=m!==void 0,[Z,$]=h.useState(H??null),P=E?m??null:Z,_=j=>{if(j.sortKey)return j.sortKey;if(typeof j.accessor=="string")return j.accessor},U=j=>{const S=_(j);if(!S)return;let O;!P||P.key!==S?O={key:S,direction:"asc"}:P.direction==="asc"?O={key:S,direction:"desc"}:O=null,E||$(O),z==null||z(O)},te=[o,n,l].filter(j=>j!==void 0).length,Y=!!v,Q=!!o||!!n||!!l||Y,J="var(--sa-border-subtle, #0b120e24)",ce=`1px solid ${J}`,pe=`inset 1px 0 0 ${J}`,Be=`inset -1px 0 0 ${J}`,fe=te===3?Y?"178px":"140px":te===2?Y?"140px":"102px":te===1?Y?"112px":"74px":Y?"74px":"",ge=(j,S)=>{if(!S)return j;if(typeof S=="function")return S(j);if(typeof S=="string")return j[S]},[ve,Ee]=h.useState(!1);h.useEffect(()=>{if(!(p!=null&&p.current))return;const j=p.current;Ee(j.scrollHeight>j.clientHeight)},[t,p]);const Oe=h.useRef(null),[Ve,Pe]=h.useState([]),[Se,je]=h.useState(()=>F??{}),xe=h.useRef(null);h.useLayoutEffect(()=>{if(!b||!Oe.current){Pe([]);return}const j=Array.from(Oe.current.querySelectorAll("thead tr th")),S=[];let O=0;j.forEach((V,G)=>{S[G]=O,G<b&&(O+=V.offsetWidth)}),Pe(S)},[b,r,t,Se]);const $e=j=>{u&&u(j<b?j:j+1)},we=(j,S)=>{const O=Se[j];if(O!==void 0){const V=`${O}px`;return{width:V,minWidth:V,maxWidth:V}}return S?{width:S}:{}},Ne=j=>L&&(j.resizable??!0),dr=(j,S)=>{j.preventDefault(),j.stopPropagation();const O=j.currentTarget.closest("th");if(!O)return;const V=Math.round(O.getBoundingClientRect().width);xe.current={colIndex:S,startX:j.clientX,startWidth:V};const G=document.body.style.userSelect,de=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Me=oe=>{var Ke;const be=xe.current;if(!be)return;const Le=((Ke=r[be.colIndex])==null?void 0:Ke.minWidth)??D,De=Math.max(Le,be.startWidth+(oe.clientX-be.startX));je(Re=>Re[be.colIndex]===De?Re:{...Re,[be.colIndex]:De})},he=()=>{document.removeEventListener("mousemove",Me),document.removeEventListener("mouseup",he),document.body.style.userSelect=G,document.body.style.cursor=de,xe.current=null,A&&je(oe=>(A(oe),oe))};document.addEventListener("mousemove",Me),document.addEventListener("mouseup",he)};return e.jsx("div",{ref:Oe,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((j,S)=>{var qr,hr;const O=b>0&&S<b,V=Ve[S]??0,G=Ne(j),Me=S===r.length-1&&Q&&I,he=_(j),oe=!!j.sortable&&!!he,be=oe&&(P==null?void 0:P.key)===he?P.direction:null,Le=j.title||((qr=j.accessor)==null?void 0:qr.toString())||"",De=(hr=j.headerTooltip)!=null&&hr.showIcon?e.jsx(T.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Ke=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Le}),Re=oe?e.jsxs("button",{type:"button",onClick:()=>U(j),title:be==="asc"?"Sorted ascending — click to sort descending":be==="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:j.textAlign==="text-right"?"right":j.textAlign==="text-center"?"center":"left"},children:[Ke,De,e.jsx(Ln,{direction:be})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Ke,De]});return e.jsxs(q.Th,{style:{position:"sticky",top:0,left:O?V:void 0,zIndex:O?4:2,paddingLeft:S===0?"12px":"",borderRight:d&&!Me&&!O?ce:void 0,borderBottom:d?ce:void 0,boxShadow:d&&O?Be:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:j.textAlign==="text-right"?"right":j.textAlign==="text-center"?"center":"left",...we(S,j.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[j.headerTooltip?e.jsx(me.Tooltip,{label:j.headerTooltip.content,position:"bottom",children:Re}):Re,j.filter&&e.jsx(jo,{filter:j.filter,columnTitle:j.title}),u&&e.jsx("button",{onClick:()=>$e(S),title:O?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:O?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:O?1:.45,transition:"opacity 0.15s"},children:e.jsx(Tn,{frozen:O})})]}),G&&e.jsx("div",{onMouseDown:wr=>dr(wr,S),onClick:wr=>wr.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-${S}`)}),Q?e.jsx(q.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?ce:void 0,boxShadow:d&&I?pe:void 0}}):null]})}),e.jsx(q.Tbody,{children:c?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:r.length+1,children:e.jsxs(y.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&x?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:r.length+1,children:x})}):t==null?void 0:t.map((j,S)=>e.jsxs(q.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:S===t.length-1&&ve?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:O=>{const V=O.currentTarget;V.style.backgroundColor=No,Array.from(V.querySelectorAll("td")).forEach(G=>{G.style.position==="sticky"&&(G.style.backgroundColor=No)})},onMouseLeave:O=>{const V=O.currentTarget;V.style.backgroundColor="",Array.from(V.querySelectorAll("td")).forEach(G=>{G.style.position==="sticky"&&(G.style.backgroundColor=ht)})},children:[r.map((O,V)=>{const G=O.render?O.render(j,S,t):ge(j,O.accessor),de=b>0&&V<b,Me=Ve[V]??0,he=Se[V]!==void 0,oe=de&&V===b-1;return e.jsx(q.Td,{style:{position:de?"sticky":void 0,left:de?Me:void 0,zIndex:de?1:void 0,backgroundColor:de?ht:void 0,transition:de?"background-color 0.3s ease":void 0,paddingLeft:V===0?"12px":"",whiteSpace:"nowrap",overflow:he?"hidden":void 0,borderLeft:O.showBorderLeft?ce:void 0,borderRight:O.showBorderRight?ce:void 0,boxShadow:oe?Be:void 0,textAlign:O.textAlign==="text-right"?"right":O.textAlign==="text-center"?"center":"left",...we(V,O.width)},children:typeof G=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:O.textAlign==="text-right"?"right":O.textAlign==="text-center"?"center":"left"},children:G}):G},`row-${S}-col-${V}`)}),Q?e.jsx(q.Td,{style:{width:fe,position:"sticky",right:0,zIndex:1,backgroundColor:ht,boxShadow:I?pe:void 0,transition:"background-color 0.3s ease"},children:e.jsx(le.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:B.map(O=>{const V=S===t.length-1?"top":"bottom";return O==="detail"&&o&&(a==null?void 0:a(j))!==!1?e.jsx(me.Tooltip,{label:"Detail",position:V,children:e.jsx(N.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(j.id,j),iconLeft:e.jsx(T.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):O==="update"&&n&&(i==null?void 0:i(j))!==!1?e.jsx(me.Tooltip,{label:"Update",position:V,children:e.jsx(N.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(j),iconLeft:e.jsx(T.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):O==="delete"&&l&&(s==null?void 0:s(j))!==!1?e.jsx(me.Tooltip,{label:"Delete",position:V,children:e.jsx(N.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(j.id,j),iconLeft:e.jsx(T.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):O==="custom"?e.jsx(h.Fragment,{children:v==null?void 0:v(j)},"custom"):null})})}):null]},`${j}${S}`))})]})})},In=({wrapperProps:r,dataTableProps:t,headerProps:o,footerProps:n})=>{var b;const l=h.useRef(null),[c,s]=h.useState((t==null?void 0:t.defaultFrozenCount)??0),i=(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 p=(n==null?void 0:n.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(Ho,{...r,children:[i&&e.jsx(Vo,{...o}),e.jsx(y.Box,{direction:"column",ref:l,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(_o,{...t,scrollParentRef:l,frozenCount:t!=null&&t.enableFreezeColumns?c:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?s:void 0}):null}),p&&e.jsx(Po,{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 On(r){return h.memo(r)}const Wn=On(In),qo=200,ft="1px solid var(--sa-border-subtle, #0b120e24)",An=({sortDir:r,frozen:t})=>r==="asc"?e.jsx(T.Icon,{name:"ChevronSmallUp"}):r==="desc"?e.jsx(T.Icon,{name:"ChevronSmallDown"}):t?e.jsx(T.Icon,{name:"LockOn",size:"xs"}):e.jsx(T.Icon,{name:"Filter",size:"xs"}),Wr=({icon:r,label:t,active:o,danger:n,onClick:l})=>{const c=n?"var(--sa-color-error-600, #c9184a)":"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:c,textAlign:"left"},onMouseEnter:s=>{o||(s.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:s=>{s.currentTarget.style.background=o?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(T.Icon,{name:r,size:"sm",style:{color:c,flexShrink:0}}),e.jsx(k.Text,{as:"span",style:{color:c},children:t})]})},Zo=({active:r,canSort:t,canHide:o,sortDir:n,frozen:l,onSort:c,onClearSort:s,onToggleFreeze:i,onHide:a})=>{const[d,p]=h.useState(!1),b=h.useRef(null),u=h.useRef(null),[v,B]=h.useState({top:0,left:0});h.useEffect(()=>{if(d&&b.current){const L=b.current.getBoundingClientRect(),F=L.left+qo>window.innerWidth;B({top:L.bottom+6,...F?{right:window.innerWidth-L.right}:{left:L.left}})}},[d]),h.useEffect(()=>{if(!d)return;const L=F=>{u.current&&!u.current.contains(F.target)&&b.current&&!b.current.contains(F.target)&&p(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[d]);const x=L=>{L(),p(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:b,type:"button",className:"sa-tl-menu-trigger","data-active":r||d?"true":"false",onClick:L=>{L.stopPropagation(),p(F=>!F)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:ft,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(An,{sortDir:n,frozen:l})}),d&&e.jsxs(y.Box,{ref:u,onClick:L=>L.stopPropagation(),style:{position:"fixed",top:`${v.top}px`,...v.left!==void 0?{left:`${v.left}px`}:{right:`${v.right}px`},minWidth:qo,backgroundColor:"var(--sa-background-primary, #ffffff)",border:ft,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"0 6px 24px rgba(0,0,0,0.12)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[t&&e.jsxs(e.Fragment,{children:[e.jsx(Wr,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>x(()=>n==="asc"?s():c("asc"))}),e.jsx(Wr,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>x(()=>n==="desc"?s():c("desc"))}),e.jsx("div",{style:{borderTop:ft,margin:"4px 0"}})]}),e.jsx(Wr,{icon:"Pin1",label:l?"Unfreeze":"Freeze",active:l,onClick:()=>x(i)}),o&&e.jsx(Wr,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>x(a)})]})]})},br="1px solid var(--sa-border-subtle, #0b120e24)",zn="var(--sa-text-subtle, #8c8f97)",ar="var(--sa-background-neutral, #f0f1f2)",Go="2px 0 4px -2px rgba(0,0,0,0.15)",Cr=40,gt="var(--sa-background-brand-subtlest)",Ar={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Qo="sa-table-layout-styles",Hn=()=>{if(typeof document>"u"||document.getElementById(Qo))return;const r=document.createElement("style");r.id=Qo,r.textContent=`
|
|
1
|
+
(function(g,tr){typeof exports=="object"&&typeof module<"u"?tr(exports,require("@starasia/alert"),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/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"],tr):(g=typeof globalThis<"u"?globalThis:g||self,tr(g["@starasia/admin"]={},g.alert,g.badges,g.box,g.breadcrumb,g.button,g.card,g.date,g.dialog,g.drawer,g.dropdown,g.hooks,g.http,g.input,g.menu,g.pagination,g.storage,g.table,g.tabs,g.textarea,g.theme,g.toast,g.toggle,g.tooltip,g.checkbox,g.radio,g.text,g.icon,g.flex,g.grid,g.progress,g.stepper,g.accordion,g.storyRecord,g.skeleton,g.progressStepper,g.jsxRuntime,g.React,g.ReactDOM,g.ReactEasyCrop))})(this,function(g,tr,Ye,u,or,N,It,er,Ae,kr,lr,be,nr,Xe,W,gr,ur,Q,Ot,Ur,cr,Wt,sr,me,Ze,Jr,k,T,ne,At,zt,Ht,Vt,Pt,ze,jt,e,h,Yr,bl){"use strict";const Cl={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Xr=h.createContext(Cl),$r=()=>h.useContext(Xr),Nt=r=>{const[t,o]=h.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:o}},_t=h.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),qt=({children:r})=>{const[t,o]=h.useState({}),n=h.useCallback(i=>{o(a=>typeof i=="function"?i(a):i)},[]),l=h.useCallback((i,a)=>{o(d=>{const y=typeof a=="function"?a(d[i]):a;return{...d,[i]:y}})},[]),c=h.useCallback(i=>{o(a=>{if(!(i in a))return a;const d={...a};return delete d[i],d})},[]),s=h.useMemo(()=>({badges:t,setBadge:l,setBadges:n,clearBadge:c}),[t,l,n,c]);return e.jsx(_t.Provider,{value:s,children:r})},Zt=()=>h.useContext(_t),Br=(r,t)=>{const o=t!==void 0?t:r;return o==null?null:typeof o=="string"||typeof o=="number"?{value:o}:o},Gt=h.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),Qt=({children:r,defaultCollapsed:t=!1})=>{const[o,n]=h.useState(t),[l,c]=h.useState(!1),s=h.useCallback(x=>{n(L=>typeof x=="function"?x(L):x)},[]),i=h.useCallback(()=>n(x=>!x),[]),a=h.useCallback(()=>n(!0),[]),d=h.useCallback(()=>n(!1),[]),y=h.useCallback(x=>{c(L=>typeof x=="function"?x(L):x)},[]),b=h.useCallback(()=>c(!0),[]),p=h.useCallback(()=>c(!1),[]),v=h.useCallback(()=>c(x=>!x),[]),B=h.useMemo(()=>({collapsed:o,setCollapsed:s,toggle:i,collapse:a,expand:d,mobileOpen:l,setMobileOpen:y,openMobile:b,closeMobile:p,toggleMobile:v}),[o,s,i,a,d,l,y,b,p,v]);return e.jsx(Gt.Provider,{value:B,children:r})},Ut=()=>h.useContext(Gt),Jt=h.createContext(null),Yt=({adapter:r,children:t})=>e.jsx(Jt.Provider,{value:r,children:t}),Ge=()=>{const r=h.useContext(Jt);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},Xt=({router:r,routerAdapter:t,menus:o=[],menuBottom:n,logo:l,appName:c="Workspace",initialUserData:s,theme:i})=>{const a=Nt({initialUserData:s}),{theme:d}=cr.useTheme();return e.jsx(Yt,{adapter:t,children:e.jsx(Xr.Provider,{value:{logo:l,appName:c,menus:o,userData:a.userData,setUserData:a.setUserData,menuBottom:n},children:e.jsx(qt,{children:e.jsx(Qt,{children:i?e.jsx(cr.ThemeProvider,{value:i,children:r}):d?e.jsx(cr.ThemeProvider,{value:d,children:r}):r})})})})},vl=h.memo(Xt);function $t({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:"4rem",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:"0.5rem",paddingRight:"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 Kr=h.createContext(null);function Kt({children:r}){const[t,o]=h.useState(null),[n,l]=h.useState(null),[c,s]=h.useState(null),[i,a]=h.useState(0),d=h.useCallback(()=>(a(y=>y+1),()=>a(y=>y-1)),[]);return e.jsx(Kr.Provider,{value:{prependNode:t,appendNode:n,replaceNode:c,setPrependNode:o,setAppendNode:l,setReplaceNode:s,replaceCount:i,registerReplace:d},children:r})}function Rt({children:r}){const t=h.useContext(Kr);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 xl({children:r,mode:t="append"}){const o=h.useContext(Kr);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 Rr=h.createContext(null);function eo({children:r}){const[t,o]=h.useState({}),[n,l]=h.useState({}),c=h.useCallback((a,d)=>{o(y=>y[a]===d?y:{...y,[a]:d})},[]),s=h.useCallback(a=>(l(d=>({...d,[a]:(d[a]??0)+1})),()=>l(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),i=h.useMemo(()=>({outletNodes:t,setOutletNode:c,slotCounts:n,registerSlot:s}),[t,c,n,s]);return e.jsx(Rr.Provider,{value:i,children:r})}function ro({slotKey:r,fallback:t}){const o=h.useContext(Rr),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 c=h.useCallback(s=>{var i;return(i=l.current)==null?void 0:i.call(l,r,s)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:c,style:{display:"contents"}}):t})}function wl({slotKey:r,children:t}){const o=h.useContext(Rr),n=h.useRef(o==null?void 0:o.registerSlot);if(n.current=o==null?void 0:o.registerSlot,h.useEffect(()=>{var c;return(c=n.current)==null?void 0:c.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 mr="moduleSwitcherGroupId",et="sa-module-switcher-change";function to(){if(typeof window>"u")return null;const r=window.localStorage.getItem(mr);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function oo(r){typeof window>"u"||(r===null?window.localStorage.removeItem(mr):window.localStorage.setItem(mr,String(r)),window.dispatchEvent(new CustomEvent(et,{detail:r})))}function Dl(){oo(null)}function rt(){const[r,t]=h.useState(()=>to());return h.useEffect(()=>{const n=()=>{t(to())},l=c=>{c.key===mr&&n()};return window.addEventListener(et,n),window.addEventListener("storage",l),()=>{window.removeEventListener(et,n),window.removeEventListener("storage",l)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{oo(n),t(n)}}}let Fr=0,rr=!1,lo=new Set;const no=()=>e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"1.667",y:"1.667",width:"12.667",height:"12.667",rx:"2"}),e.jsx("line",{x1:"6",y1:"1.667",x2:"6",y2:"14.333"})]}),co={width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",fontSize:"0.875rem",color:"var(--sa-text-subtle, #8c8f97)",background:"transparent",border:"none",borderRadius:"0.375rem",cursor:"pointer",textAlign:"left"};function Sl({children:r,headerLeftSlot:t,profile:o,isLoadingProfile:n,onLogout:l,isLoggingOut:c,loadingComponent:s,sidebarHeaderContent:i,headerActions:a,profileRole:d,profileMenuButtons:y,profileMenuItems:b,logoutButton:p}){var dr,P;const{useSearchParams:v,useNavigate:B,useLocation:x,Outlet:L}=Ge(),[F]=v(),A=F.get("embed")==="true",D=$r(),{badges:m}=Zt(),H=B(),z=x(),E=!be.useMediaQuery("md"),[U,X]=h.useState(!1),{collapsed:G,setCollapsed:R,mobileOpen:_,setMobileOpen:K}=Ut(),[te,q]=h.useState(!1),[j,Z]=h.useState(()=>new Set(lo)),[le,Ce]=h.useState(null),{selectedGroupId:ve,setSelectedGroupId:he}=rt();h.useEffect(()=>{lo=j},[j]);const ge=h.useRef(null),xe=h.useRef(null);h.useEffect(()=>{const S=ge.current;if(!S)return;const O=()=>{rr||(Fr=S.scrollTop)};return S.addEventListener("scroll",O),()=>S.removeEventListener("scroll",O)},[]);const Ee=()=>{const S=ge.current;S&&Fr>0&&(rr=!0,S.scrollTop=Fr,requestAnimationFrame(()=>{rr=!1}))};h.useLayoutEffect(()=>{rr=!0,Ee();const S=setTimeout(()=>{rr=!1},300);return()=>clearTimeout(S)},[]),h.useLayoutEffect(()=>{D.menus.length>0&&(Fr>0?Ee():requestAnimationFrame(()=>{var O;const S=(O=ge.current)==null?void 0:O.querySelector("[data-menu-active='true']");S&&S.scrollIntoView({block:"center",behavior:"instant"})}))},[D.menus]),h.useEffect(()=>{rr=!0,Ee();const S=setTimeout(Ee,0),O=setTimeout(Ee,50),V=setTimeout(Ee,100),J=setTimeout(Ee,200),de=setTimeout(()=>{rr=!1},300),Me=setTimeout(()=>{const fe=ge.current,oe=fe==null?void 0:fe.querySelector("[data-menu-active='true']");if(fe&&oe){const pe=fe.getBoundingClientRect(),Le=oe.getBoundingClientRect();Le.top>=pe.top&&Le.bottom<=pe.bottom||oe.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(S),clearTimeout(O),clearTimeout(V),clearTimeout(J),clearTimeout(de),clearTimeout(Me)}},[z.pathname]),h.useEffect(()=>{xe.current&&(xe.current.scrollTop=0)},[z.pathname]),h.useEffect(()=>{E&&K(!1)},[z.pathname,E]),h.useEffect(()=>{E&&R(!0)},[E]);const Oe=()=>{X(!0)},Ve=()=>{X(!1)},Pe=()=>{X(!1),l()},ke=S=>{const O=[S.to];return S.children&&O.push(...S.children.map(V=>V.to)),O},je=[...D.menus.flatMap(S=>S.items.flatMap(ke)),...((dr=D.menuBottom)==null?void 0:dr.flatMap(ke))??[]],we=S=>{if(!z.pathname.startsWith(S))return!1;const O=je.filter(V=>z.pathname.startsWith(V)).sort((V,J)=>J.length-V.length)[0];return S===O};h.useEffect(()=>{var O;const S=V=>{var J;(J=V.children)!=null&&J.some(de=>z.pathname.startsWith(de.to))&&Z(de=>{const Me=new Set(de);return Me.add(V.id),Me})};D.menus.forEach(V=>{V.items.forEach(S)}),(O=D.menuBottom)==null||O.forEach(S)},[z.pathname,D.menus,D.menuBottom]);const $e=S=>{Z(O=>{const V=new Set(O);return V.has(S)?V.delete(S):V.add(S),V})};h.useEffect(()=>{D.menus.length!==0&&ve!==null&&!D.menus.some(S=>S.id===ve)&&he(null)},[D.menus,ve,he]);const De=h.useMemo(()=>{if(ve!==null)return D.menus.filter(V=>V.id===ve||V.parentGroupId===ve);const S=D.menus.filter(V=>V.parentGroupId===void 0),O=D.menus.filter(V=>V.parentGroupId!==void 0).flatMap(V=>V.items);return O.length===0?S:[...S,{id:18,name:"Pengaturan",items:O,parentGroupId:void 0}]},[D.menus,ve]);if(A)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:r||e.jsx(L,{})});const Ne=S=>{const O=S.children&&S.children.length>0,V=j.has(S.id),J=O?S.children.some(fe=>we(fe.to)):we(S.to),de=Br(S.badge,m[S.id]),Me=!!de&&G&&!E;return e.jsxs("div",{"data-menu-active":J||void 0,children:[e.jsxs("button",{onClick:fe=>{if(O)if(G&&!E){const oe=fe.currentTarget.getBoundingClientRect();Ce({item:S,top:oe.top,left:oe.right+8})}else $e(S.id);else H(S.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:G&&!E?"center":void 0,gap:"0.5rem",paddingLeft:G&&!E?"0":"0.5rem",paddingRight:G&&!E?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:J?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:J?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:J?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:G&&!E?S.title:void 0,onMouseEnter:fe=>{J||(fe.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:fe=>{J||(fe.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(T.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),Me&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"-2px",right:"-2px",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-error-500, #ff4d6d)",border:"1px solid var(--sa-background-primary, #ffffff)"}})]}),(!G||E)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",transition:"opacity 0.3s",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:S.title}),de&&e.jsx(Ye.Badges,{text:String(de.value),variant:de.variant??"info",size:"xs",border:!0}),O&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:V?"rotate(180deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),O&&(!G||E)&&(()=>{const fe=S.children.findIndex(oe=>we(oe.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:V?`${S.children.length*36}px`:"0px",opacity:V?1:0,marginTop:V?"0.25rem":"0px"},children:[e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"1.5px",height:"100%",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),fe>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${fe*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),S.children.map(oe=>{const pe=Br(oe.badge,m[oe.id]);return e.jsxs("button",{onClick:()=>H(oe.to),style:{width:"100%",display:"flex",alignItems:"center",gap:"0.5rem",paddingLeft:"0.75rem",paddingRight:"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:we(oe.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:we(oe.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:we(oe.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:we(oe.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:Le=>{we(oe.to)||(Le.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:Le=>{we(oe.to)||(Le.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(T.Icon,{name:oe.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:oe.title}),pe&&e.jsx(Ye.Badges,{text:String(pe.value),variant:pe.variant??"info",size:"xs",border:!0})]},oe.id)})]})})()]},S.id)};return e.jsx(eo,{children:e.jsxs(Kt,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":E?"0px":G?"4.375rem":"16.375rem","--app-footer-zindex":E&&_?"40":"998"},children:[E&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:_?.5:0,pointerEvents:_?"auto":"none",transition:"opacity 0.3s"},onClick:()=>K(!1)}),e.jsxs("aside",{style:{width:E?"16.375rem":G?"4.375rem":"16.375rem",position:E?"fixed":"relative",...E&&{inset:0,zIndex:50,transform:_?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:"all 0.3s ease-in-out",flexShrink:E?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>q(!0),onMouseLeave:()=>q(!1),style:{height:"4rem",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",position:"relative"},children:(()=>{const S=!E&&G&&!_,O=S&&te;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:S?1:void 0,justifyContent:S?"center":void 0,transition:"opacity 0.2s",opacity:O?0:1,pointerEvents:O?"none":"auto"},children:[e.jsx("img",{src:D.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!G||_)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:D.appName})]}),!E&&!G&&e.jsx("button",{type:"button",onClick:()=>R(!0),"aria-label":"Collapse sidebar",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1rem",height:"1rem",padding:0,background:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer",flexShrink:0},children:e.jsx(no,{})}),S&&e.jsx("button",{type:"button",onClick:()=>R(!1),"aria-label":"Expand sidebar",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",padding:0,background:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-sm, 0.375rem)",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer",opacity:O?1:0,pointerEvents:O?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(no,{})})}),E&&e.jsx("button",{onClick:()=>K(!1),"aria-label":"Close menu",style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.25rem",height:"1.25rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})()}),i&&e.jsx($t,{collapsed:E?!1:G,children:i}),e.jsx("div",{ref:ge,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:De.map(S=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!G||E?S.name&&e.jsx("div",{style:{paddingLeft:"1.5rem",paddingRight:"1rem",paddingTop:"0rem",paddingBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"400",color:"var(--sa-text-subtlest, #6b6e76)",transition:"opacity 0.3s",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:S.name}):S.name&&e.jsx("div",{"aria-label":S.name,style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"0.75rem",paddingBottom:"0.75rem"},children:e.jsx("span",{style:{display:"block",width:"1rem",height:"2px",borderRadius:"1px",backgroundColor:S.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx("div",{style:{paddingLeft:"1rem",paddingRight:"1rem",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)"},children:S.slotKey?e.jsx(ro,{slotKey:S.slotKey,fallback:S.items.map(O=>Ne(O))}):S.items.map(O=>Ne(O))})]},S.id))}),D.menuBottom&&D.menuBottom.length>0&&e.jsx("div",{style:{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",paddingTop:"0.75rem",paddingBottom:"0.75rem",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)",flexShrink:0},children:D.menuBottom.map(S=>Ne(S))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{height:"4rem",backgroundColor:"var(--sa-background-primary, #ffffff)",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:E?"1rem":void 0},children:[E&&e.jsx("button",{onClick:()=>K(!0),style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.5rem",height:"1.5rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),e.jsx(Rt,{children:t})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsxs("div",{style:{textAlign:"right",maxWidth:"12.5rem"},children:[e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:500,color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"Loading...":(o==null?void 0:o.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"":(o==null?void 0:o.email)||"unknown"})]}),e.jsx("div",{style:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"0.875rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",flexShrink:0,backgroundColor:"var(--sa-background-brand, #04254f)"},children:((o==null?void 0:o.name)||"U")[0].toUpperCase()}),e.jsx(T.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(W.MenuLists,{style:{width:"280px",paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(W.MenuHeading,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",paddingBlock:"0.5rem"},children:[e.jsx("div",{style:{width:"4rem",height:"4rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"1.25rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",marginBottom:"0.75rem",backgroundColor:"var(--sa-background-brand, #04254f)"},children:((o==null?void 0:o.name)||"U")[0].toUpperCase()}),e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:600,color:"var(--sa-text-primary, #292a2e)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(o==null?void 0:o.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(o==null?void 0:o.email)||"unknown"}),d&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d})]})}),(y&&y.length>0||b)&&e.jsxs(W.MenuBody,{children:[y==null?void 0:y.map((S,O)=>e.jsx(W.MenuButton,{children:e.jsxs("button",{type:"button",onClick:S.onClick,style:co,onMouseEnter:V=>{V.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:V=>{V.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(T.Icon,{name:S.icon,size:"md"}),e.jsx("span",{children:S.label})]})},`${S.label}-${O}`)),b]}),p??e.jsx(W.MenuFooter,{children:e.jsx(W.MenuButton,{children:e.jsxs("button",{type:"button",onClick:Oe,style:{...co,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(T.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:xe,style:{flex:1,overflowY:"auto"},children:r||e.jsx(L,{})})]})]}),c&&s&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--sa-color-black-alpha-a70, #181a19b8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:s}),e.jsxs(Ae.Dialog,{isShow:U,onHide:Ve,children:[e.jsx(Ae.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Ae.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Ae.DialogFooter,{children:e.jsx(u.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(ne.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(u.Box,{direction:"column",children:e.jsx(N.Button,{secondary:!0,onClick:Ve,children:"Cancel"})}),e.jsx(u.Box,{direction:"column",children:e.jsx(N.Button,{primary:!0,onClick:Pe,children:"Yes, Sure"})})]})})})]}),le&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>Ce(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":le.item.title,style:{position:"fixed",top:le.top,left:le.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem",backgroundColor:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-md, 0.5rem)",boxShadow:"var(--sa-shadow-lg, 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a)",padding:"0.5rem",display:"flex",flexDirection:"column",gap:"0.125rem"},children:[e.jsx("div",{style:{fontSize:"0.75rem",fontWeight:600,color:"var(--sa-color-gray-500, #8c8f97)",padding:"0.25rem 0.5rem 0.5rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:le.item.title}),(P=le.item.children)==null?void 0:P.map(S=>{const O=we(S.to),V=Br(S.badge,m[S.id]);return e.jsxs("button",{onClick:()=>{H(S.to),Ce(null)},style:{width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.5rem 0.75rem",borderRadius:"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:O?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:O?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:J=>{O||(J.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:J=>{O||(J.currentTarget.style.backgroundColor="transparent")},children:[S.icon&&e.jsx(T.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:S.title}),V&&e.jsx(Ye.Badges,{text:String(V.value),variant:V.variant??"info",size:"xs",border:!0})]},S.id)})]})]})]})})}const yr=h.forwardRef(({children:r,...t},o)=>e.jsx(u.Box,{ref:o,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),so=({title:r,iconName:t,textColor:o,iconColor:n,hoverTextColor:l,hoverIconColor:c})=>{const[s,i]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=o??"var(--sa-text-subtle, #8c8f97)",y=c??"var(--sa-text-subtle, #8c8f97)",b=l??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{cursor:"pointer"},children:[e.jsx(T.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:s?y:a,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:s?b:d,transition:"color 0.15s ease"},children:r||"Back"})]})},kl=({items:r,separator:t="/",iconName:o,iconColor:n,hoverIconColor:l})=>{const{Link:c}=Ge(),[s,i]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=l??"var(--sa-text-subtle, #8c8f97)",y=r.length>1?r[0]:void 0,b=!!(y!=null&&y.to||y!=null&&y.onClick),p=e.jsx(T.Icon,{name:o||"ChevronLeft",size:"xs",onMouseEnter:b?()=>i(!0):void 0,onMouseLeave:b?()=>i(!1):void 0,style:{color:b&&s?d:a,transition:"color 0.15s ease",cursor:b?"pointer":void 0}}),v=y!=null&&y.to?e.jsx(c,{to:y.to,replace:!0,style:{textDecoration:"none"},children:p}):y!=null&&y.onClick?e.jsx(yr,{onClick:y.onClick,children:p}):p;return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",children:[v,e.jsx(or.Breadcrumb,{separator:t,size:"md",children:r.map((B,x)=>{const L=x===r.length-1;return B.to&&!L?e.jsx(or.BreadcrumbItem,{children:e.jsx(c,{to:B.to,children:B.label})},x):e.jsx(or.BreadcrumbItem,{currentPage:L,children:e.jsx(or.BreadcrumbLink,{onClick:L?void 0:B.onClick,children:B.label})},x)})})]})},Bl=r=>{const{Link:t}=Ge(),{items:o,separator:n,onClick:l,navigateTo:c,...s}=r;return o&&o.length>0?e.jsx(kl,{items:o,separator:n,iconName:s.iconName,iconColor:s.iconColor,hoverIconColor:s.hoverIconColor}):c?e.jsx(u.Box,{direction:"row",children:e.jsx(t,{to:c,replace:!0,style:{textDecoration:"none"},children:e.jsx(so,{...s})})}):e.jsx(u.Box,{direction:"row",children:e.jsx(yr,{onClick:l,children:e.jsx(so,{...s})})})},tt=[{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 io(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 ao={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},ho={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function fo({isShow:r,onHide:t,menus:o,selectedGroupId:n,onSelect:l}){const[c,s]=h.useState(void 0),i=d=>{l(d),t()},a=tt[0];return e.jsx(Ae.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Ae.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>i(null),onMouseEnter:()=>s("all"),onMouseLeave:()=>s(void 0),style:ho,children:[e.jsx("div",{style:io(n===null,c==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(T.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:ao,children:"Semua"})]}),o.map((d,y)=>{var x;const b=n===d.id,p=c===d.id,v=((x=d.items[0])==null?void 0:x.icon)??"Grid",B=tt[(y+1)%tt.length];return e.jsxs("button",{onClick:()=>i(d.id),onMouseEnter:()=>s(d.id),onMouseLeave:()=>s(void 0),style:ho,children:[e.jsx("div",{style:io(b,p,B),children:e.jsx("div",{style:{color:B.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(T.Icon,{name:v,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:ao,children:d.name})]},d.id)})]})})})}function ml({onSelect:r,"aria-label":t="Pilih module"}={}){const o=$r(),{useNavigate:n}=Ge(),l=n(),{selectedGroupId:c,setSelectedGroupId:s}=rt(),[i,a]=h.useState(!1),d=y=>{var b;if(s(y),y!==null){const p=o.menus.find(B=>B.id===y),v=(b=p==null?void 0:p.items[0])==null?void 0:b.to;v&&l(v)}r==null||r(y)};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:y=>{y.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent"},children:e.jsx(T.Icon,{name:"GridApplication",size:"sm"})}),c!==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(fo,{isShow:i,onHide:()=>a(!1),menus:o.menus.filter(y=>y.parentGroupId===void 0),selectedGroupId:c,onSelect:d})]})}const Fl=(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},El=h.memo(({value:r,label:t,separator:o,labelWidth:n,lastIndex:l,labelAlign:c="top"})=>{const s=h.useMemo(()=>({padding:0,paddingBottom:l?0:12,verticalAlign:c}),[l,c]),i=h.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:l?0:12,verticalAlign:c}),[l,c]),a=()=>typeof t=="string"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(k.Text,{color:"primary",fontWeight:"medium",children:r}):r,y=()=>typeof o=="string"||typeof o=="number"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:o}):o;return e.jsxs(Q.Tr,{children:[e.jsx(Q.Td,{style:s,width:n,children:a()}),o?e.jsx(Q.Td,{style:i,width:24,children:y()}):null,e.jsx(Q.Td,{style:s,children:d()})]})}),Ml=h.memo(({fields:r,separator:t,labelWidth:o})=>e.jsx(Q.Table,{withColumnBorder:!1,withRowBorder:!1,children:r.map((n,l)=>e.jsx(El,{separator:t,labelWidth:o,lastIndex:l===r.length-1,...n},`field-group-field-${l}`))})),Ll=h.memo(({maxRow:r=0,maxColumn:t=2,separator:o=":",fields:n=[],labelWidth:l=150,bordered:c=!1})=>{const s=h.useMemo(()=>Fl(n,r),[n,r]),i=s.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(u.Box,{gap:i?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:i?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:c?"border":void 0,borderStyle:c?"border-solid":void 0,borderColor:c?"border-subtle":void 0,children:s.map((d,y)=>e.jsx(u.Box,{direction:"column",flex:i?void 0:"1",width:i?a():void 0,marginBottom:i?"lg":void 0,children:e.jsx(Ml,{labelWidth:l,fields:d,separator:o})},y))})}),Tl=({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)",c=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",s=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{cursor:"pointer"},children:[e.jsx(T.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?c:n,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:t?s:l,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},Il=({backButton:r,title:t,titleIcon:o,titleTag:n,children:l,header:c=!0,headerBorder:s=!1,disableAnimation:i=!1,scrollable:a=!1,stickyHeader:d=!1,subHeaders:y,action:b,titleTagProps:p,containerProps:v,headerProps:B})=>{const x=be.useMediaQuery("md"),{Link:L,useNavigate:F,useLocation:A}=Ge(),D=F(),m=A(),H=r==null?void 0:r.show,z=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}D(-1,{replace:!0})},I=()=>{if(!b)return null;if(h.isValidElement(b))return b;const _=b.filter(K=>K&&(K.title||K.icon));return _.length===0?null:x?e.jsx(u.Box,{direction:"row",gap:"md",children:_.map(({title:K,icon:te,buttonProps:q,onClick:j},Z)=>e.jsx(N.Button,{iconLeft:te?e.jsx(T.Icon,{name:te,size:"md"}):void 0,onClick:j,...q,children:K},`action-${Z}`))}):e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(T.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{minWidth:200},children:_.map(({title:K,icon:te,buttonProps:q,onClick:j},Z)=>{const le=(q==null?void 0:q.tone)==="error"||(q==null?void 0:q.danger)===!0;return e.jsx(W.MenuItem,{intent:le?"danger":void 0,disabled:q==null?void 0:q.disabled,startIcon:te?e.jsx(T.Icon,{name:te}):void 0,onClick:j,children:K},`action-${Z}`)})})})]})},E=()=>{const _=e.jsx(Tl,{backButton:r});return r!=null&&r.navigateTo?e.jsx(u.Box,{direction:"row",children:e.jsx(L,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:_})}):e.jsx(u.Box,{direction:"row",children:e.jsx(yr,{onClick:z,children:_})})},U=()=>{const _=!!t,K=Array.isArray(b)&&b.length>0,te=h.isValidElement(b)?!0:K;if(!_&&!te&&!H)return null;const j=x||!x&&K;return e.jsxs(u.Box,{direction:"column",gap:"xs",paddingBlock:(B==null?void 0:B.paddingBlock)??"sm",paddingInline:(B==null?void 0:B.paddingInline)??"md",...B,style:{...s?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...B==null?void 0:B.style},children:[H&&E(),(_||te)&&e.jsxs(u.Box,{direction:j?"row":"column",gap:"sm",justify:"space-between",align:j?"center":"flex-start",children:[_?typeof t=="string"?e.jsxs(u.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[o&&e.jsx(T.Icon,{name:o,size:"md",color:"primary"}),e.jsx(k.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:t})]}),n&&e.jsx(Ye.Badge,{border:!0,size:"lg",text:n,...p})]}):t:null,I()]})]})},X=()=>{if(!y||y.length===0)return null;const _=y.filter(q=>q.show!==!1);if(_.length===0)return null;let K=0,te=-1/0;return _.forEach((q,j)=>{const Z=q.order??0;Z>=te&&(te=Z,K=j)}),_.map(({content:q,order:j,borderBottom:Z=!0,keepBottomPadding:le=!1,paddingInline:Ce=!0,paddingBlock:ve=!0},he)=>e.jsx(u.Box,{direction:"column",paddingTop:ve?"sm":"spacing-0",paddingBottom:ve&&(Z||le||he===K)?"sm":"spacing-0",paddingInline:Ce?"md":"spacing-0",style:{...Z?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...j!==void 0?{order:j}:{}},children:q},`sub-header-${he}`))},G=()=>{const _=c?U():null,K=X();return!_&&!K?null:e.jsxs(u.Box,{direction:"column",style:{...a&&d?{position:"sticky",top:0,zIndex:2,background:"var(--sa-background-primary, #ffffff)"}:{},marginBottom:K?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[_,K]})},R=()=>l;return e.jsxs(u.Box,{direction:"column",as:"main",...v,style:{...a?{height:"100%",minHeight:0,overflow:"auto"}:{},...(v==null?void 0:v.style)??{},...i?{}:{animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"}},children:[G(),R()]},m.pathname)},Ol=h.memo(Il),Wl={icon:"Cross",title:""},Al="calc(100vw - 16px)",go=r=>r==null?void 0:`min(${typeof r=="number"?`${r}px`:r}, ${Al})`,uo=h.forwardRef(({onHide:r,show:t,withBlur:o=!1,style:n,children:l,closeButton:c=Wl,width:s,minWidth:i="357px",maxWidth:a="357px"},d)=>{const y=go(s??i),b=go(s??a);return e.jsx(kr.Drawer,{blur:o,isShow:t,position:"right",onHide:r,ref:d,style:{minWidth:y,maxWidth:b,...n},children:e.jsxs(u.Box,{direction:"column",padding:"lg",children:[c?e.jsxs(u.Box,{direction:"row",align:"center",gap:"sm",onClick:r,marginBottom:"lg",cursor:"pointer",children:[e.jsx(T.Icon,{name:c.icon,size:"md",color:"subtle",cursor:"pointer"}),c.title?e.jsx(k.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:c.title}):null]}):null,l]})})}),ot=h.memo(({children:r,borderBottom:t=!0,padding:o=!0})=>{const n=be.useMediaQuery("lg");return e.jsx(u.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})}),lt=h.memo(({children:r,borderTop:t=!0,padding:o=!0})=>{const n=be.useMediaQuery("lg");return e.jsx(u.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})}),zl=h.memo(({children:r,...t})=>e.jsx(u.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),Hl=h.memo(({children:r,title:t,titleTag:o,action:n,header:l,footer:c,actionContainer:s,containerProps:i,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:y={borderTop:!0},variantTag:b="info"})=>{const p=be.useMediaQuery("lg"),v=()=>o?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:t}),e.jsx(Ye.Badges,{border:!0,text:o,variant:b})]}):e.jsx(k.Text,{fontWeight:"medium",children:t}),B=()=>l||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:t?v():null}),e.jsx(u.Box,{direction:"column",style:p?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...s,children:n??null})]}),x=!!(l||t||n);return e.jsxs(u.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...i,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(i==null?void 0:i.style)??{}},children:[l!==null&&x?e.jsx(ot,{...d,children:B()}):null,e.jsx(zl,{...a,children:r}),c?e.jsx(lt,{...y,children:c}):null]})}),He={H1:r=>e.jsx(k.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(k.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(k.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(k.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(k.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(k.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(k.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(k.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(k.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(k.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(k.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(k.Text,{variant:"body-3",children:r.children,...r.props})},Te=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=Ge(),[n,l]=r(),c=nr.searchParamsToObject(n.toString()),s=t(),i=o(),a=s.id;return{setSearchParams:l,searchParams:n,searchQueries:c,isHasQuery:(v,B)=>n.has(v)&&n.get(v)===B,getQueryParam:v=>n.get(v),getRouteParam:v=>s[v],params:s,location:i,id:a,hasId:!!a}},yo=r=>JSON.stringify(r),po=r=>JSON.stringify(r),bo=r=>JSON.stringify(r),Co=r=>JSON.stringify(r),Vl=r=>r,Pl=r=>JSON.stringify(r),pr=({value:r,name:t,type:o,withSearchParam:n=!0,setSearchParams:l,searchQueries:c,dropdownSearchKey:s,filterKey:i="filter",pageKey:a="page"})=>{if(n){let d;switch(o){case"search":d=Vl(r);break;case"dropdown":case"dropdown-multiple":d=yo(r);break;case"radio":d=po(r);break;case"date-range":d=bo(r);break;case"advanced-date-range":d=Pl(r);break;case"date":d=Co(r);break;default:d=r;break}if(typeof d<"u"){const b={...c[i]&&typeof c[i]=="string"?JSON.parse(c[i]):void 0,[t]:d},p={...c};s&&typeof s=="string"&&delete p[s],delete p[a];const v={...p,[i]:JSON.stringify(b)},B=new URLSearchParams(c).toString(),x=new URLSearchParams(v).toString();if(B===x)return;l(v)}}},Er=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,c=l&&typeof l=="string"?JSON.parse(l):void 0,s=c?c[r]:void 0;return n==="label"&&s?JSON.parse(s)[0].label:n==="value"&&s?JSON.parse(s)[0].value:s},vo=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,c=l&&typeof l=="string"?JSON.parse(l):void 0,s=c?c[r]:void 0;return n==="label"&&s?JSON.parse(s).map(i=>i.label):n==="value"&&s?JSON.parse(s).map(i=>i.value):n==="array"&&s?JSON.parse(s):s},jl=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,c=l&&typeof l=="string"?JSON.parse(l):void 0,s=c?c[r]:void 0;return n==="id"&&s?JSON.parse(s).id:n==="label"&&s?JSON.parse(s).label:n==="value"&&s?JSON.parse(s).value:s},Mr=(r,t,o)=>{const n=t.get(o||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0;return l?l[r]:void 0},Nl=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,c=l?l[r]:void 0;return{start:c?JSON.parse(c).from:void 0,end:c?JSON.parse(c).to:void 0}},xo=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,c=l?l[r]:void 0;return c?JSON.parse(c):void 0},_l=(r,{filterKey:t="filter",perPageKey:o="perPage",pageKey:n="page"})=>{const l=r.get(t)||void 0,c=r.get(o)||void 0,s=r.get(n)||void 0;return!!l||!!c||!!s},wo=({isOpen:r,onClose:t,filterKey:o,pageKey:n,filters:l})=>{const{searchParams:c,setSearchParams:s,searchQueries:i}=Te(),[a,d]=h.useState({}),y=()=>{c.delete(o||"filter"),s(c)},b=(p,v)=>{switch(p.type){case"radio":{const{show:B=!0}=p;return B&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},v)}case"dropdown":{const{show:B=!0}=p;return B&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},v)}case"date-range":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},v);case"date":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},v);case"dropdown-multiple":{const{show:B=!0}=p;return B&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},v)}default:return null}};return e.jsx(uo,{onHide:t,show:r||!1,children:e.jsxs(u.Box,{direction:"column",gap:"md",children:[e.jsxs(ne.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(u.Box,{direction:"column",children:"Filter"}),e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},onClick:y,children:"Reset"})]}),l==null?void 0:l.map((p,v)=>b(p,v))]})})},Do=({searchKey:r="q",statusKey:t="status",searchPlaceholder:o="Search",searchHighlightPlaceholder:n,extendedFilter:l,showSearchFilter:c=!0,showStatusFilter:s=!0,filterKey:i="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:y,filterConfigs:b,buttonToggleProps:p,position:v="right",titleSearchLabel:B="Work Order",withTitleLabels:x=!1})=>{const F=(p==null?void 0:p.isShowLabel)??!0,[A,D]=h.useState(!1),[m,H]=h.useState(0),z=()=>{H(Z=>Z+1)},{searchParams:I,setSearchParams:E,getQueryParam:U}=Te(),X=nr.searchParamsToObject(I.toString()),G=Mr(r,I,i)||"",[R,_]=h.useState(G),K=U(i),q=!!(K&&!(()=>{if(K)try{const Z=JSON.parse(K);return Object.keys(Z).length===1&&Z[r]===""}catch(Z){console.error("Filter parameter is not a valid JSON:",Z)}return!1})()),j=be.useMediaQuery("md");return h.useEffect(()=>{_(G)},[G]),h.useEffect(()=>{if(R===G)return;const Z=window.setTimeout(()=>{pr({value:R,name:r,type:"search",searchQueries:X,setSearchParams:E,filterKey:i,pageKey:a})},350);return()=>{window.clearTimeout(Z)}},[R,G,r,X,E,i,a]),e.jsxs(ne.Flex,{gap:"md",style:{flexDirection:j&&v==="left"?"row":j&&v==="right"?"row-reverse":"column"},align:"flex-end",children:[q&&e.jsx(u.Box,{direction:"column",justify:"flex-end",children:e.jsx(N.Button,{onClick:()=>{const Z=new URLSearchParams(I);Z.delete(i),E(Z),_(""),z(),y&&y()},variant:"outline",tone:"neutral",children:e.jsx(k.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),l==null?void 0:l.map(({minWidth:Z,content:le,title:Ce,onClickContainer:ve},he)=>e.jsxs(u.Box,{direction:"column",gap:"sm",onClick:ve,style:{minWidth:Z},children:[Ce&&e.jsx(He.SubH3,{children:Ce}),le]},`extended-filter-${he}-${m}`)),!!(b!=null&&b.length)&&e.jsx(N.Button,{primary:q,secondary:!q,iconLeft:e.jsx(T.Icon,{size:"sm",name:(p==null?void 0:p.icon)||"FilterHorizontal",style:{color:K?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!j,onClick:()=>D(!0),children:F?"Filter":void 0}),s&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[x&&e.jsx(He.SubH3,{children:"Status"}),e.jsx(lr.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Er({get:"value",name:t,searchParams:I,filterKey:i})?[{label:Er({get:"value",name:t,searchParams:I,filterKey:i})==="active"?"Active":"InActive",value:Er({get:"value",name:t,searchParams:I,filterKey:i})}]:[],onChange:Z=>pr({value:Z,name:t,type:"dropdown",searchQueries:X,setSearchParams:E,filterKey:i}),placeholder:x?"All":"All Status"},m)]}),c&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{width:d&&j?d:j?"310px":""},children:[x&&e.jsxs(He.SubH3,{children:["Search for ",B]}),e.jsx(Xe.Input,{placeholder:o,leftIcon:e.jsx(T.Icon,{name:"Search",width:20,height:20}),onChange:Z=>_(Z.target.value),value:R,fullWidth:!0},m+1+i)]}),e.jsx(wo,{isOpen:A,onClose:()=>D(!1),filterKey:i,filters:b,pageKey:a})]})},ql=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r;function nt({configs:r,filterKey:t="filter",activeFilterKey:o="filters",pageKey:n="page",searchKey:l="q"}){const{searchParams:c,setSearchParams:s,searchQueries:i}=Te(),a=h.useMemo(()=>Object.fromEntries(r.map(m=>[m.key,m])),[r]),d=h.useMemo(()=>{const m=(c.get(o)||"").split(",").map(z=>z.trim()).filter(Boolean);let H=[];try{const z=c.get(t);z&&(H=Object.keys(JSON.parse(z)).filter(I=>I!==l))}catch{}return r.map(z=>z.key).filter(z=>{const I=a[z];return(I==null?void 0:I.locked)||m.includes(z)||H.includes(z)})},[c,o,t,l,r,a]),y=h.useCallback(m=>{try{return m[t]?JSON.parse(m[t]):{}}catch{return{}}},[t]),b=h.useCallback(m=>{const H={...i};m.length?H[o]=m.join(","):delete H[o],s(H)},[i,o,s]),p=h.useCallback(m=>{d.includes(m)||b([...d,m])},[d,b]),v=h.useCallback(m=>{var E;if((E=a[m])!=null&&E.locked)return;const H={...i},z=d.filter(U=>U!==m);z.length?H[o]=z.join(","):delete H[o];const I=y(H);m in I&&(delete I[m],Object.keys(I).length?H[t]=JSON.stringify(I):delete H[t]),delete H[n],s(H)},[i,d,o,t,n,y,s,a]),B=h.useCallback(m=>d.includes(m)?v(m):p(m),[d,p,v]),x=h.useCallback(m=>{switch(m.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return vo({name:m.key,get:"array",searchParams:c,filterKey:t})||[];case"date":{const H=xo({name:m.key,searchParams:c,filterKey:t});return H?new Date(H):void 0}case"date-compact":{const z=y(Object.fromEntries(c.entries()))[m.key];return z&&typeof z=="object"?z:void 0}default:return}},[c,t,y]),L=h.useCallback((m,H)=>{if(m.type==="date-compact"){const z={...i},I=y(z);H==null?delete I[m.key]:I[m.key]=H,Object.keys(I).length?z[t]=JSON.stringify(I):delete z[t],delete z[n],s(z);return}pr({value:H,name:m.key,type:ql(m.type),searchQueries:i,setSearchParams:s,filterKey:t,pageKey:n})},[i,s,t,n,y]),F=h.useCallback(m=>{const H={...i},z=y(H);m in z&&(delete z[m],Object.keys(z).length?H[t]=JSON.stringify(z):delete H[t]),delete H[n],s(H)},[i,t,n,y,s]),A=h.useCallback(()=>{const m={...i};delete m[t],delete m[o],delete m[n],s(m)},[i,t,o,n,s]),D=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:D,addFilter:p,removeFilter:v,toggleFilter:B,getValue:x,setValue:L,clearValue:F,clearAll:A}}const ct={get(r){return ur.storage.get(r)??null},set(r,t){ur.storage.save(r,t)},remove(r){ur.storage.delete(r)}},ir={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}`},Lr=(r,t)=>{const o=new Set(t.map(c=>c.key)),n=r.order.filter(c=>o.has(c));for(const c of t)n.includes(c.key)||n.push(c.key);const l=r.hidden.filter(c=>o.has(c));return{order:n,hidden:l}};function Zl({columns:r,scopeId:t,storage:o,onColumnsChange:n,value:l}){const c=h.useMemo(()=>({order:r.map(I=>I.key),hidden:[]}),[r]),s=t?ir.columns(t):void 0,i=(I,E)=>Lr({order:I.order??E,hidden:I.hidden??[]},r),[a,d]=h.useState(()=>{if(l&&(l.order||l.hidden))return i(l,r.map(I=>I.key));if(s){const I=o.get(s);if(I&&Array.isArray(I.order))return Lr(I,r)}return c}),y=r.map(I=>I.key).join("|");h.useEffect(()=>d(I=>Lr(I,r)),[y]);const b=h.useRef(a);b.current=a;const p=l?`${(l.order??[]).join("|")}~${(l.hidden??[]).join("|")}`:null,v=h.useRef(p);h.useEffect(()=>{if(p==null||v.current===p)return;v.current=p;const I=b.current,E=i(l,I.order);E.order.join("|")===I.order.join("|")&&E.hidden.join("|")===I.hidden.join("|")||(d(E),s&&o.set(s,E))},[p,y]);const B=h.useRef(!1);h.useEffect(()=>{B.current||(B.current=!0,n==null||n(a))},[]);const x=h.useCallback(I=>{d(I),s&&o.set(s,I),n==null||n(I)},[s,o,n]),L=h.useMemo(()=>{const I=new Map(r.map(E=>[E.key,E]));return a.order.filter(E=>I.has(E)).map(E=>({...I.get(E),visible:!a.hidden.includes(E)}))},[a,r]),F=h.useCallback(I=>{const E=a.hidden.includes(I)?a.hidden.filter(U=>U!==I):[...a.hidden,I];x({...a,hidden:E})},[a,x]),A=h.useCallback((I,E)=>{if(I===E)return;const U=[...a.order],[X]=U.splice(I,1);U.splice(E,0,X),x({...a,order:U})},[a,x]),D=h.useCallback(I=>{x({...a,hidden:I?r.filter(E=>!E.locked).map(E=>E.key):[]})},[a,r,x]),m=h.useCallback(()=>x(c),[x,c]),H=h.useCallback(I=>x(Lr(I,r)),[x,r]),z=a.hidden.length===0;return{state:a,orderedColumns:L,allVisible:z,toggleVisibility:F,reorder:A,setAllHidden:D,reset:m,applyState:H}}function Gl({scopeId:r,storage:t,snapshotKeys:o,pageKey:n="page",getColumns:l,applyColumns:c}){const{searchParams:s,setSearchParams:i}=Te(),a=r?ir.savedViews(r):void 0,[d,y]=h.useState(()=>a?t.get(a)||[]:[]),b=h.useCallback(x=>{y(x),a&&t.set(a,x)},[a]),p=h.useCallback(x=>{const L=x.trim();if(!L)return;const F={};o.forEach(D=>{const m=s.get(D);m!=null&&(F[D]=m)});const A={id:`${Date.now()}`,name:L,query:F,columns:l==null?void 0:l(),createdAt:Date.now()};b([...d,A])},[o,s,l,b,d]),v=h.useCallback(x=>b(d.filter(L=>L.id!==x)),[b,d]),B=h.useCallback(x=>{const L=Object.fromEntries(s.entries());o.forEach(F=>delete L[F]),Object.assign(L,x.query),delete L[n],i(L),x.columns&&(c==null||c(x.columns))},[s,o,n,i,c]);return{enabled:!!a,views:d,saveView:p,deleteView:v,applyView:B}}function Ql(r,t){let o;try{o=JSON.parse(r)}catch{return r}return!o||typeof o!="object"?r:(delete o[t],Object.keys(o).length>0?JSON.stringify(o):void 0)}function So(r,t,o){const n=r[t];if(n==null)return;const l=Ql(n,o);l===void 0?delete r[t]:r[t]=l}function Ul({scopeId:r,storage:t,snapshotKeys:o,enabled:n=!0,filterKey:l="filter",searchKey:c="q",persistSearch:s=!0}){const{searchParams:i}=Te(),a=r&&n?ir.lastState(r):void 0,d=h.useRef(a),y=h.useRef(!1);h.useEffect(()=>{if(!a){d.current=a;return}if(d.current!==a){d.current=a,y.current=!1;return}const v={};if(o.forEach(B=>{const x=i.get(B);x!=null&&(v[B]=x)}),s||So(v,l,c),Object.keys(v).length===0){y.current&&t.remove(a);return}y.current=!0,t.set(a,v)},[i,a,o,t,s,l,c]);const b=h.useCallback(()=>{if(!a)return null;const v=t.get(a);return!v||Object.keys(v).length===0||!s&&(So(v,l,c),Object.keys(v).length===0)?null:v},[a,t,s,l,c]),p=h.useCallback(()=>{a&&t.remove(a)},[a,t]);return{enabled:!!a,read:b,clear:p}}function Jl({scopeId:r,storage:t,perPageKey:o,pageSizeOptions:n,enabled:l=!0}){const{searchParams:c}=Te(),s=r&&l?ir.perPage(r):void 0,i=c.toString(),a=h.useRef(s);h.useEffect(()=>{if(!s){a.current=s;return}if(a.current!==s){a.current=s;return}const b=c.get(o);if(!b)return;const p=Number(b);!Number.isFinite(p)||p<=0||t.set(s,p)},[i,s,o,t]);const d=h.useCallback(()=>{if(!s)return null;const b=t.get(s);if(b==null)return null;const p=Number(b);return!Number.isFinite(p)||p<=0||n&&!n.includes(p)?null:String(p)},[s,t,n]),y=h.useCallback(()=>{s&&t.remove(s)},[s,t]);return{enabled:!!s,read:d,clear:y}}let st={},it=!1,at=null;const Yl=(r,t)=>{Object.assign(st,r),at=t,!it&&(it=!0,queueMicrotask(()=>{const o=st,n=at;st={},it=!1,at=null,!(!n||Object.keys(o).length===0)&&n(l=>{const c=new URLSearchParams(l);return Object.entries(o).forEach(([s,i])=>c.set(s,i)),c})}))};function Xl({enabled:r,snapshotKeys:t,perPageKey:o,readSnapshot:n,readPerPage:l}){const{searchParams:c,setSearchParams:s,location:i}=Te(),a=h.useRef(null);h.useEffect(()=>{if(!r||a.current===i.pathname)return;a.current=i.pathname;const d={};if(!c.has(o)){const y=l();y&&(d[o]=y)}if(!t.some(y=>c.has(y))){const y=n();y&&Object.assign(d,y)}Object.keys(d).length!==0&&Yl(d,s)},[i.pathname,r])}const $l=({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(N.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{minWidth:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&l&&e.jsx(N.Button,{variant:"link",tone:"brand",size:"xs",onClick:l,children:"Reset"})]}),children:r.map(c=>e.jsx(W.MenuItem,{selected:c.locked||t.includes(c.key),disabled:c.locked,closeOnSelect:!1,startIcon:c.icon??void 0,onClick:()=>{c.locked||o(c.key)},children:c.label},c.key))})})]}):null,Tr=({onClear:r,onRemove:t})=>e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(T.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(T.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(W.MenuItem,{intent:"danger",startIcon:e.jsx(T.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),Kl=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},ko=(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},Bo=r=>{const t=Kl(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:ko(t,-o,r.period),to:t}:{from:t,to:ko(t,o,r.period)}},mo=24,Fo=r=>r.length>mo?`${r.slice(0,mo)}...`:r,Ir=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Or={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"},Rl=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],dt={past:"Past",next:"Next",this:"This"},en=["day","week","month","year"],rn=["past","next","this"],tn=r=>r.field.type==="date-compact"?e.jsx(nn,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(on,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),on=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const c=t?Ir(new Date(t)):null,s=!!c,i=s?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Fo(c)})]}):r.label;return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s?e.jsx(T.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:i})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:e.jsx(er.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():o(a),withPadding:!1})})})]})},ln=r=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${Or[r.op]} ${Ir(new Date(r.date))}`:null;case"is-between":return r.from&&r.to?`${Ir(new Date(r.from))} - ${Ir(new Date(r.to))}`:null;case"is-relative-to-today":{const t=r.relative;if(!t)return null;if(t.direction==="this")return`This ${t.period}`;const o=t.count??1,n=o===1?t.period:`${t.period}s`;return`${dt[t.direction]} ${o} ${n}`}case"is-empty":case"is-not-empty":return Or[r.op];default:return null}},nn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const c=r.ops&&r.ops.length>0?r.ops:Rl,s=r.defaultOp&&c.includes(r.defaultOp)?r.defaultOp:c[0],i=(t==null?void 0:t.op)??s,a=t?ln(t):null,d=!!a,y=d?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Fo(a)})]}):r.label,b=p=>{if(p!==i){if(p==="is-empty"||p==="is-not-empty"){o({op:p});return}if(p==="is-relative-to-today"){o({op:p,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(p==="is-between"){o({op:p,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}o({op:p,date:t==null?void 0:t.date})}};return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:d?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:d?e.jsx(T.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:y})}),e.jsxs(W.MenuLists,{children:[e.jsx(W.MenuBody,{style:{width:320},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(cn,{op:i,ops:c,onChange:b})]}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:e.jsx(sn,{value:t,op:i,onChange:o})}),i==="is-relative-to-today"&&e.jsx(W.MenuFooter,{children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},cn=({op:r,ops:t,onChange:o})=>e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:Or[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(T.Icon,{name:"Check"}):void 0,children:Or[n]},n))})})]}),sn=({value:r,op:t,onChange:o})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const n=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(er.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:n,onChange:l=>{if(l==null){o({op:t});return}if(typeof l=="object"&&l!==null&&"from"in l&&"to"in l){let{from:c,to:s}=l;if(!c&&s&&(c=s,s=null),!c&&!s){o({op:t});return}o({op:t,from:c?c.toISOString():void 0,to:s?s.toISOString():void 0})}},withPadding:!1},"range")}return t==="is-relative-to-today"?e.jsx(an,{value:r==null?void 0:r.relative,onChange:n=>o({op:t,relative:n})}):e.jsx(er.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:r!=null&&r.date?new Date(r.date):void 0,onChange:n=>{if(n==null){o({op:t});return}n instanceof Date&&o({op:t,date:n.toISOString()})},withPadding:!1},"single")},an=({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",c=o!=="this",s=Bo({direction:o,count:n,period:l});return e.jsxs(u.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(u.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(N.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:dt[o]})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:140},children:rn.map(i=>e.jsx(W.MenuItem,{selected:o===i,endIcon:o===i?e.jsx(T.Icon,{name:"Check"}):void 0,onClick:()=>t(i==="this"?{direction:i,period:l}:{direction:i,count:n,period:l}),children:dt[i]},i))})})]}),c&&e.jsx(Xe.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:i=>{const a=Number(i.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(N.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:140},children:en.map(i=>e.jsx(W.MenuItem,{selected:l===i,endIcon:l===i?e.jsx(T.Icon,{name:"Check"}):void 0,onClick:()=>t(o==="this"?{direction:o,period:i}:{direction:o,count:n,period:i}),children:i},i))})})]})]}),e.jsx(er.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:s,onChange:()=>{},withPadding:!1},"relative-preview")]})},Eo=18,dn=r=>r.length>Eo?`${r.slice(0,Eo)}...`:r,hn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const c=r.type==="dropdown-multiple",s=t.length,i=r.searchable!==!1,[a,d]=h.useState(""),y=r.options,b=typeof r.onSearch=="function",p=(()=>{if(b)return y;const F=a.trim().toLowerCase();return F?y.filter(A=>A.label.toLowerCase().includes(F)):y})(),v=F=>t.some(A=>A.value===F.value),B=F=>{if(!c){o([{label:F.label,value:F.value}]),d("");return}o(v(F)?t.filter(A=>A.value!==F.value):[...t,{label:F.label,value:F.value}])},x=F=>{var A;d(F),(A=r.onSearch)==null||A.call(r,F)},L=s===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:s===1?dn(t[0].label):`${s} Selected`})]});return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:s>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s>0?e.jsx(T.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:L})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:e.jsxs(u.Box,{direction:"column",gap:"sm",children:[i&&e.jsx(lr.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:c,searchAble:!0,searchValue:a,onSearch:x,value:t,onChange:o,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(F=>e.jsx(W.MenuItem,{closeOnSelect:!c,selected:v(F),startIcon:F.avatar,endIcon:v(F)?e.jsx(T.Icon,{name:"Check"}):void 0,description:F.description,onClick:()=>B(F),children:F.label},F.value))})]})})})]})},Mo=18,fn=r=>r.length>Mo?`${r.slice(0,Mo)}...`:r,Lo=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(Ze.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),gn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const c=new Set(t.map(p=>p.value)),s=t.length,i=r.options.length>0&&r.options.every(p=>c.has(p.value)),a=s>0&&!i,d=p=>{o(c.has(p.value)?t.filter(v=>v.value!==p.value):[...t,{label:p.label,value:p.value}])},y=()=>{o(i?[]:r.options.map(p=>({label:p.label,value:p.value})))},b=s===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(k.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(k.Text,{as:"span",children:s===1?fn(t[0].label):`${s} Selected`})]});return e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:s>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s>0?e.jsx(T.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsx(W.MenuLists,{children:e.jsxs(W.MenuBody,{style:{width:240},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tr,{onClear:n,onRemove:l})]}),children:[e.jsx(W.MenuItem,{closeOnSelect:!1,selected:i,onClick:y,startIcon:e.jsx(Lo,{checked:i||a,indeterminate:a}),children:"Select All"}),r.options.map(p=>e.jsx(W.MenuItem,{closeOnSelect:!1,selected:c.has(p.value),onClick:()=>d(p),startIcon:e.jsx(Lo,{checked:c.has(p.value)}),children:p.label},p.value))]})})]})},To=({activeKeys:r,configByKey:t,getValue:o,setValue:n,clearValue:l,removeFilter:c})=>e.jsx(e.Fragment,{children:r.map(s=>{const i=t[s];if(!i)return null;const a=o(i),d=i.locked?void 0:()=>c(s);return i.type==="date"||i.type==="date-compact"?e.jsx(tn,{field:i,value:a,onChange:y=>n(i,y),onClear:()=>l(s),onRemove:d},s):i.type==="checkbox-multiple"?e.jsx(gn,{field:i,value:a||[],onChange:y=>n(i,y),onClear:()=>l(s),onRemove:d},s):e.jsx(hn,{field:i,value:a||[],onChange:y=>n(i,y),onClear:()=>l(s),onRemove:d},s)})}),Io=r=>`${r} Rows`,un=({pagination:r,pageKey:t="page",perPageKey:o="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:l=10,showResultCount:c=!0,showPageSize:s=!0,showPagination:i=!0})=>{var F;const{searchQueries:a,setSearchParams:d,searchParams:y}=Te(),b=y.get(o),p=b?Number(b):l,v=A=>{d({...a,[t]:String(A)})},B=A=>{d({...a,[o]:A,[t]:"1"})},x=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:0),L=(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:[c&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${x}-${L} of ${((F=r==null?void 0:r.totalData)==null?void 0:F.toLocaleString())||0}`}),s&&e.jsxs(W.Menu,{position:"bottom-left",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Io(p)})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{children:n.map(A=>e.jsx(W.MenuItem,{selected:A===p,onClick:()=>B(String(A)),children:Io(A)},A))})})]}),i&&((r==null?void 0:r.totalPage)??0)>1&&e.jsx(u.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(gr.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:v})})]})};function yn(r,t,o=!0){h.useEffect(()=>{if(!o)return;const n=l=>{var i;if(l.metaKey||l.ctrlKey||l.altKey||l.key!==r)return;const c=l.target,s=(i=c==null?void 0:c.tagName)==null?void 0:i.toLowerCase();s==="input"||s==="textarea"||c!=null&&c.isContentEditable||(l.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,o])}const pn=240,Oo=({searchKey:r="q",filterKey:t="filter",pageKey:o="page",placeholder:n="Search",shortcut:l="/",collapsible:c=!0})=>{const{searchParams:s,setSearchParams:i,searchQueries:a}=Te(),d=Mr(r,s,t)||"",[y,b]=h.useState(!c||!!d),[p,v]=h.useState(c&&!d),[B,x]=h.useState(d),L=be.useDebounce(B,350),F=h.useRef(null);h.useEffect(()=>{x(d),d&&b(!0)},[d]),h.useEffect(()=>{y&&v(!1)},[y]),h.useEffect(()=>{L!==d&&pr({value:L,name:r,type:"search",searchQueries:a,setSearchParams:i,filterKey:t,pageKey:o})},[L]);const A=h.useCallback(()=>{b(!0),requestAnimationFrame(()=>{var z;return(z=F.current)==null?void 0:z.focus()})},[]);yn(l,A);const D=()=>{c&&!B&&b(!1)},m=z=>{var I;c&&z.key==="Escape"&&!B&&(b(!1),(I=F.current)==null||I.blur())},H=()=>{y||v(!0)};return e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(N.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:A}),e.jsxs(u.Box,{onTransitionEnd:H,style:{position:"relative",width:y?pn:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(Xe.Input,{ref:F,size:"sm",fullWidth:!0,value:B,placeholder:n,leftIcon:e.jsx(T.Icon,{name:"Search",width:16,height:16}),onChange:z=>x(z.target.value),onKeyDown:m,onBlur:D,tabIndex:y?0:-1}),y&&!B&&e.jsx(u.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-surface-hover, #f1f2f4)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(k.Text,{fontSize:"xs",color:"subtle",children:l})})]})]})},Wo=({columns:r,allVisible:t,onToggle:o,onReorder:n,onSetAllHidden:l})=>{const[c,s]=h.useState(null),[i,a]=h.useState(null),d=()=>{c!==null&&i!==null&&c!==i&&n(c,i),s(null),a(null)},y=(b,p)=>{const v=b+p;v<0||v>=r.length||n(b,v)};return e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(W.MenuLists,{children:e.jsx(W.MenuBody,{children:e.jsxs(u.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(N.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>l(t),children:t?"Hide All":"Show All"})]}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((b,p)=>{const v=!b.locked,B=i===p&&c!==null&&c!==p;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:v,onDragStart:()=>v&&s(p),onDragOver:x=>{x.preventDefault(),a(p)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:B?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(u.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:v?0:-1,"aria-label":`Reorder ${b.title}`,"aria-disabled":!v||void 0,color:"icon-subtlest",onKeyDown:x=>{v&&(x.key==="ArrowUp"?(x.preventDefault(),y(p,-1)):x.key==="ArrowDown"&&(x.preventDefault(),y(p,1)))},style:{display:"inline-flex",cursor:v?"grab":"default",opacity:v?1:.4},children:e.jsx(T.Icon,{name:"DragVertical",width:16,height:16})}),b.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:b.icon}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:b.title}),e.jsx(u.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(sr.Toggle,{size:"sm",checked:b.visible,disabled:b.locked,onChange:()=>o(b.key),"aria-label":`Toggle ${b.title} column`})})]},b.key)})})]})})})]})},Ao=({views:r,onApply:t,onDelete:o,onSave:n})=>{const[l,c]=h.useState(""),s=()=>{const i=l.trim();i&&(n(i),c(""))};return e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(T.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(W.MenuLists,{style:{width:"260px"},children:[e.jsx(W.MenuBody,{children:e.jsxs(u.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(u.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(k.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(i=>e.jsx(W.MenuItem,{startIcon:e.jsx(T.Icon,{name:"Bookmark"}),onClick:()=>t(i),endIcon:e.jsx(N.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Trash2"}),"aria-label":`Delete ${i.name}`,onClick:a=>{a.stopPropagation(),o(i.id)}}),children:i.name},i.id))})]})}),e.jsx(W.MenuFooter,{children:e.jsxs(u.Box,{direction:"row",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(Xe.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:l,onChange:i=>c(i.target.value),onKeyDown:i=>{i.key==="Enter"&&s()}})}),e.jsx(N.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!l.trim(),onClick:s,children:"Save"})]})})]})]})},bn=({isOpen:r,onClose:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:c,onToggle:s,onReset:i,getValue:a,setValue:d,clearValue:y,removeFilter:b})=>{const p=n.length;return e.jsx(kr.Drawer,{position:"bottom",isShow:r,onHide:t,children:e.jsxs(u.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(u.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(u.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),p>0&&e.jsxs(k.Text,{fontSize:"sm",color:"subtle",children:["(",p,")"]})]}),e.jsx(N.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(u.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[p>0&&e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(u.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(To,{activeKeys:n,configByKey:l,getValue:a,setValue:d,clearValue:y,removeFilter:b})})]}),o.length>0&&e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(u.Box,{direction:"column",children:o.map(v=>{const B=n.includes(v.key),x=!!v.locked;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:x?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[v.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:v.icon}),e.jsx(k.Text,{fontSize:"sm",color:"primary",truncate:!0,children:v.label})]}),e.jsx(sr.Toggle,{size:"sm",checked:B||x,disabled:x,onChange:()=>s(v.key),"aria-label":`Toggle ${v.label}`})]},v.key)})})]})]}),e.jsxs(u.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(u.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(N.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!c,onClick:i,children:"Reset"})}),e.jsx(u.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(N.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},Cn=r=>`${r} Rows`,vn=({perPageKey:r,pageKey:t,pageSizeOptions:o,defaultPerPage:n=10,showPageSize:l})=>{const{searchQueries:c,setSearchParams:s,searchParams:i}=Te(),a=i.get(r),d=a?Number(a):n,y=b=>{s({...c,[r]:b,[t]:"1"})};return l?e.jsxs(W.Menu,{position:"bottom-right",children:[e.jsx(W.MenuButton,{children:e.jsx(N.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(W.MenuLists,{children:e.jsxs(W.MenuBody,{style:{minWidth:200},children:[e.jsx(u.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),o.map(b=>e.jsx(W.MenuItem,{selected:b===d,endIcon:b===d?e.jsx(T.Icon,{name:"Check"}):void 0,onClick:()=>y(String(b)),children:Cn(b)},b))]})})]}):null},xn=r=>{var we;const{withPadding:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:c,toggleFilter:s,removeFilter:i,getValue:a,setValue:d,clearValue:y,onReset:b,searchable:p,searchKey:v,filterKey:B,pageKey:x,searchPlaceholder:L,searchShortcut:F,searchCollapsible:A,pagination:D,perPageKey:m,pageSizeOptions:H,defaultPerPage:z,showPagination:I,showResultCount:E,showPageSize:U,hasColumns:X,orderedColumns:G,allVisible:R,onToggleVisibility:_,onReorder:K,onSetAllHidden:te,showSavedViews:q,savedViews:j,onApplyView:Z,onDeleteView:le,onSaveView:Ce,leadingActions:ve}=r,[he,ge]=h.useState(!1),{searchQueries:xe,setSearchParams:Ee}=Te(),Oe=(D==null?void 0:D.rangeStart)??(((D==null?void 0:D.currentPage)||0)>1?(((D==null?void 0:D.currentPage)||0)-1)*((D==null?void 0:D.perPage)||0)+1:1),Ve=(D==null?void 0:D.rangeEnd)??((D==null?void 0:D.totalCurrentPage)!==(D==null?void 0:D.perPage)?D==null?void 0:D.totalData:((D==null?void 0:D.currentPage)||1)*((D==null?void 0:D.totalCurrentPage)||0)),Pe=$e=>{Ee({...xe,[x]:String($e)})},ke=E||I&&!!(D!=null&&D.totalPage),je=()=>{b(),ge(!1)};return e.jsxs(u.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(u.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[p&&e.jsx(Oo,{searchKey:v,filterKey:B,pageKey:x,placeholder:L,shortcut:F,collapsible:A}),e.jsx(N.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"FilterHorizontal"}),onClick:()=>ge(!0),"aria-label":"Open filters",children:c?`Filter: ${n.length}`:null}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[ve,q&&e.jsx(Ao,{views:j,onApply:Z,onDelete:le,onSave:Ce}),X&&e.jsx(Wo,{columns:G,allVisible:R,onToggle:_,onReorder:K,onSetAllHidden:te}),e.jsx(vn,{perPageKey:m,pageKey:x,pageSizeOptions:H,defaultPerPage:z,showPageSize:U})]})]}),ke&&e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[E?e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Oe}-${Ve} of ${((we=D==null?void 0:D.totalData)==null?void 0:we.toLocaleString())||0}`}):e.jsx(u.Box,{direction:"column"}),I&&!!(D!=null&&D.totalPage)&&e.jsx(gr.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:D!=null&&D.currentPage?Number(D.currentPage):1,totalPages:Number(D.totalPage),onPageChange:Pe})]}),e.jsx(bn,{isOpen:he,onClose:()=>ge(!1),configs:o,activeKeys:n,configByKey:l,hasActiveFilter:c,onToggle:s,onReset:je,getValue:a,setValue:d,clearValue:y,removeFilter:i})]})},wn=({withPadding:r=!1,filterConfigs:t=[],filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:c="perPage",pageSizeOptions:s=[25,50,100],defaultPerPage:i,showPagination:a=!0,showResultCount:d=!0,showPageSize:y=!0,searchable:b=!1,searchKey:p="q",searchPlaceholder:v="Search",searchShortcut:B="/",searchPosition:x="right",searchCollapsible:L=!0,pagination:F,columns:A=[],onColumnsChange:D,columnsState:m,scopeId:H,savedViews:z,persistLastState:I=!0,persistSearch:E=!0,storage:U=ct,onReset:X,leadingActions:G})=>{const R=H??(z==null?void 0:z.scopeId),{activeKeys:_,configByKey:K,hasActiveFilter:te,toggleFilter:q,removeFilter:j,getValue:Z,setValue:le,clearValue:Ce,clearAll:ve}=nt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:p}),he=Zl({columns:A,scopeId:R,storage:U,onColumnsChange:D,value:m}),ge=Gl({scopeId:R,storage:U,snapshotKeys:[n,o,c],pageKey:l,getColumns:()=>he.state,applyColumns:he.applyState}),xe=Ul({scopeId:R,storage:U,snapshotKeys:[n,o,l],enabled:I,filterKey:o,searchKey:p,persistSearch:E}),Ee=Jl({scopeId:R,storage:U,perPageKey:c,pageSizeOptions:s,enabled:I});Xl({enabled:I&&!!R,snapshotKeys:[n,o,l],perPageKey:c,readSnapshot:xe.read,readPerPage:Ee.read});const Oe=i??s[0]??25,Ve=!!(z!=null&&z.enabled)&&ge.enabled,Pe=()=>{ve(),xe.clear(),X==null||X()},ke=be.useMediaQuery("md"),je=b?e.jsx(Oo,{searchKey:p,filterKey:o,pageKey:l,placeholder:v,shortcut:B,collapsible:L}):null;return ke?e.jsxs(u.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(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx($l,{configs:t,activeKeys:_,onToggle:q,hasActiveFilter:te,onReset:Pe}),x==="left"&&je,e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(To,{activeKeys:_,configByKey:K,getValue:Z,setValue:le,clearValue:Ce,removeFilter:j}),te&&e.jsx(N.Button,{variant:"link",tone:"brand",size:"sm",onClick:Pe,children:"Reset"})]})]}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[G,e.jsx(un,{pagination:F,pageKey:l,perPageKey:c,pageSizeOptions:s,defaultPerPage:Oe,showPagination:a,showResultCount:d,showPageSize:y}),x==="right"&&je,Ve&&e.jsx(Ao,{views:ge.views,onApply:ge.applyView,onDelete:ge.deleteView,onSave:ge.saveView}),A.length>0&&e.jsx(Wo,{columns:he.orderedColumns,allVisible:he.allVisible,onToggle:he.toggleVisibility,onReorder:he.reorder,onSetAllHidden:he.setAllHidden})]})]}):e.jsx(xn,{withPadding:r,configs:t,activeKeys:_,configByKey:K,hasActiveFilter:te,toggleFilter:q,removeFilter:j,getValue:Z,setValue:le,clearValue:Ce,onReset:Pe,searchable:b,searchKey:p,filterKey:o,pageKey:l,searchPlaceholder:v,searchShortcut:B,searchCollapsible:L,pagination:F,perPageKey:c,pageSizeOptions:s,defaultPerPage:Oe,showPagination:a,showResultCount:d,showPageSize:y,hasColumns:A.length>0,orderedColumns:he.orderedColumns,allVisible:he.allVisible,onToggleVisibility:he.toggleVisibility,onReorder:he.reorder,onSetAllHidden:he.setAllHidden,showSavedViews:Ve,savedViews:ge.views,onApplyView:ge.applyView,onDeleteView:ge.deleteView,onSaveView:ge.saveView,leadingActions:G})},Dn=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},Sn=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},kn=(r,t)=>{switch(r.type){case"dropdown":case"radio":return Dn(t);case"dropdown-multiple":case"checkbox-multiple":return Sn(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;default:return}},zo=(r,t)=>{if(r==null||r==="")return t;const o=Number(r);return Number.isFinite(o)&&o>0?o:t},Bn=r=>{const{filterConfigs:t,filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:c="perPage",searchKey:s="q",defaultPage:i=1,defaultPerPage:a=10,paramKeys:d,serialize:y}=r,{activeKeys:b,configByKey:p,hasActiveFilter:v,getValue:B}=nt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:s}),{searchParams:x}=Te(),L=x.toString();return h.useMemo(()=>{const A={},D={},m=zo(x.get(l),i),H=zo(x.get(c),a);A[(d==null?void 0:d.page)??"page"]=m,A[(d==null?void 0:d.perPage)??"perPage"]=H;const z=Mr(s,x,o)||"";z&&(A[(d==null?void 0:d.search)??"search"]=z);let I=!1;for(const E of b){const U=p[E];if(!U)continue;const X=B(U);D[E]=X;const G=y==null?void 0:y[E],R=G?G(X):kn(U,X);if(R==null||Array.isArray(R)&&R.length===0)continue;const _=(d==null?void 0:d[E])??E;A[_]=R,I=!0}return{params:A,raw:D,hasActiveFilter:v||!!z||I}},[L,b.join("|"),o,n,l,c,s,i,a,d,y,p])},mn=["dropdown","dropdown-multiple","checkbox-multiple","radio"],Fn=({filterConfigs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l})=>{const{configByKey:c,getValue:s,setValue:i,removeFilter:a,clearAll:d,hasActiveFilter:y}=nt({configs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l}),b=(F,A)=>{var m;const D=F.options;return((m=D==null?void 0:D.find(H=>H.value===A))==null?void 0:m.label)??A},p=h.useCallback(F=>{const A=c[F];if(!A)return[];const D=s(A);return Array.isArray(D)?D.map(m=>String(m.value)):[]},[c,s]),v=h.useCallback((F,A)=>{const D=c[F];if(!D||!mn.includes(D.type))return;const m=Array.isArray(A)?A:[A];if(m.length===0){a(F);return}i(D,m.map(H=>({label:b(D,H),value:H})))},[c,i,a]),B=h.useCallback((F,A)=>{const D=p(F);v(F,D.includes(A)?D.filter(m=>m!==A):[...D,A])},[p,v]),x=h.useCallback((F,A)=>p(F).includes(A),[p]),L=h.useCallback(F=>a(F),[a]);return{set:v,toggle:B,clear:L,clearAll:d,isActive:x,values:p,hasActiveFilter:y}},En=(r,t)=>{if(!r)return{};const{fromKey:o,toKey:n,opKey:l}=t,c={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(c[o]=new Date(r.date).toISOString()),l&&(c[l]=r.op),c;case"is-between":return r.from&&(c[o]=new Date(r.from).toISOString()),r.to&&(c[n]=new Date(r.to).toISOString()),c;case"is-relative-to-today":{if(!r.relative)return c;const{from:s,to:i}=Bo(r.relative);return c[o]=s.toISOString(),c[n]=i.toISOString(),c}case"is-empty":case"is-not-empty":return l&&(c[l]=r.op==="is-empty"?"empty":"not-empty"),c;default:return c}},Ho=({children:r,borderRadius:t,height:o})=>{const n=h.useRef(null),[l,c]=h.useState("100vh");return h.useEffect(()=>{if(o)return;const s=()=>{if(n.current){const i=n.current.getBoundingClientRect().top;c(`calc(100vh - ${i}px)`)}};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[o]),e.jsx(u.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})},Vo=({action:r,rightContent:t,leftContent:o,headerSlot:n,advanceFilter:l,showFilter:c=!0})=>{const s=be.useMediaQuery("md"),i=c?e.jsx(Do,{...l}):null,a=()=>r?h.isValidElement(r)?r:e.jsx(u.Box,{style:{display:"flex",flexDirection:s?"row":"column",gap:"8px",width:s?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:d,icon:y,buttonProps:b,onClick:p},v)=>!d&&!y?null:e.jsx(N.Button,{fullWidth:!s,iconLeft:y?e.jsx(T.Icon,{name:y}):void 0,onClick:p,...b,children:d},`action-${v}`))}):null;return e.jsx(u.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:s?"row":"column-reverse",gap:"16px"},children:n?n({filter:i}):e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[i,o]}),e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},Mn=({totalData:r,withMarginBottom:t=!0,withMarginTop:o=!0})=>e.jsxs(u.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:o?"16px":void 0},children:[e.jsxs(He.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(He.Body1,{children:r||0})]}),Po=({pagination:r,pageKey:t="page",perPageKey:o="perPage",defaultPerPage:n=10,showPagination:l=!0,totalData:c})=>{const{searchQueries:s,setSearchParams:i,searchParams:a}=Te(),d=a.get(o),y=B=>{i({...s,[t]:String(B)})},b=B=>{i({...s,[o]:B,[t]:"1"})},p=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),v=(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(u.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(u.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(k.Text,{children:"Rows Per Page: "}),e.jsx(lr.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:B=>{b(B[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(k.Text,{children:`${p}-${v} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(gr.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:y})]}):e.jsx(Mn,{totalData:c,withMarginBottom:!1,withMarginTop:!1})})},jo=({filter:r,columnTitle:t})=>{const[o,n]=h.useState(!1),l=h.useRef(null),c=h.useRef(null),s=h.useRef(null),[i,a]=h.useState(""),[d,y]=h.useState({top:0,left:0}),b=r.selectedValues,p=h.useMemo(()=>i?r.options.filter(x=>x.label.toLowerCase().includes(i.toLowerCase())):r.options,[r.options,i]);h.useEffect(()=>{if(o&&c.current){const x=c.current.getBoundingClientRect(),L=280,F={top:x.bottom+8};r.position==="left"||x.left+L>window.innerWidth?F.right=window.innerWidth-x.right:F.left=x.left,y(F)}},[o,r.position]),h.useEffect(()=>{o&&s.current?setTimeout(()=>{var x;return(x=s.current)==null?void 0:x.focus()},50):a("")},[o]),h.useEffect(()=>{const x=L=>{l.current&&!l.current.contains(L.target)&&c.current&&!c.current.contains(L.target)&&n(!1)};return o&&document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]);const v=x=>{const L=b.includes(x)?b.filter(F=>F!==x):[...b,x];r.onFilterChange(L)},B=()=>r.onFilterChange([]);return e.jsxs(u.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(u.Box,{ref:c,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:x=>{var L;x.stopPropagation(),o||(L=r.onOpen)==null||L.call(r),n(F=>!F)},children:e.jsx(T.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(u.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:"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(u.Box,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(k.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),b.length>0&&e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(k.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:x=>{x.stopPropagation(),B()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(u.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(Xe.Input,{ref:s,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(T.Icon,{name:"Search",size:"sm"}),value:i,onChange:x=>a(x.target.value),style:{fontSize:"14px"}})}),e.jsx(u.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:r.isLoadingOptions?e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(T.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):p.length>0?e.jsx(u.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:p.map(x=>e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:b.includes(x.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:L=>{L.stopPropagation(),v(x.value)},onMouseEnter:L=>{b.includes(x.value)||(L.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),L.currentTarget.style.transform="translateX(2px)"},onMouseLeave:L=>{L.currentTarget.style.backgroundColor=b.includes(x.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",L.currentTarget.style.transform="translateX(0)"},children:[e.jsx(Ze.Checkbox,{checked:b.includes(x.value),onChange:()=>{}}),e.jsx(k.Text,{fontSize:"sm",fontWeight:b.includes(x.value)?"medium":"normal",color:b.includes(x.value)?"primary":"gray-700",children:x.label})]},x.value))}):e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(T.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),b.length>0&&e.jsx(u.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(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(u.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:b.length}),e.jsxs(k.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",b.length>1?"s":""," selected"]})]})})]})]})},Ln=({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,c=r==="asc"?1:.45,s=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:c,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:s},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},Tn=({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"})]}),ht="var(--sa-background-primary, #ffffff)",No="var(--sa-background-primary-inverse, #f8f8f8)",_o=({columns:r,records:t,handleDetail:o,handleUpdate:n,handleDelete:l,isLoading:c,visibleHandleDelete:s,visibleHandleUpdate:i,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:y,frozenCount:b=0,onFrozenCountChange:p,customActions:v,actionsOrder:B=["detail","update","delete","custom"],customEmptyState:x,enableColumnResize:L=!1,defaultColumnWidths:F,onColumnWidthsChange:A,defaultMinColumnWidth:D=60,sort:m,defaultSort:H,onSortChange:z,showActionDivider:I=!1})=>{const E=m!==void 0,[U,X]=h.useState(H??null),G=E?m??null:U,R=P=>{if(P.sortKey)return P.sortKey;if(typeof P.accessor=="string")return P.accessor},_=P=>{const S=R(P);if(!S)return;let O;!G||G.key!==S?O={key:S,direction:"asc"}:G.direction==="asc"?O={key:S,direction:"desc"}:O=null,E||X(O),z==null||z(O)},te=[o,n,l].filter(P=>P!==void 0).length,q=!!v,j=!!o||!!n||!!l||q,Z="var(--sa-border-subtle, #0b120e24)",le=`1px solid ${Z}`,Ce=`inset 1px 0 0 ${Z}`,ve=`inset -1px 0 0 ${Z}`,he=te===3?q?"178px":"140px":te===2?q?"140px":"102px":te===1?q?"112px":"74px":q?"74px":"",ge=(P,S)=>{if(!S)return P;if(typeof S=="function")return S(P);if(typeof S=="string")return P[S]},[xe,Ee]=h.useState(!1);h.useEffect(()=>{if(!(y!=null&&y.current))return;const P=y.current;Ee(P.scrollHeight>P.clientHeight)},[t,y]);const Oe=h.useRef(null),[Ve,Pe]=h.useState([]),[ke,je]=h.useState(()=>F??{}),we=h.useRef(null);h.useLayoutEffect(()=>{if(!b||!Oe.current){Pe([]);return}const P=Array.from(Oe.current.querySelectorAll("thead tr th")),S=[];let O=0;P.forEach((V,J)=>{S[J]=O,J<b&&(O+=V.offsetWidth)}),Pe(S)},[b,r,t,ke]);const $e=P=>{p&&p(P<b?P:P+1)},De=(P,S)=>{const O=ke[P];if(O!==void 0){const V=`${O}px`;return{width:V,minWidth:V,maxWidth:V}}return S?{width:S}:{}},Ne=P=>L&&(P.resizable??!0),dr=(P,S)=>{P.preventDefault(),P.stopPropagation();const O=P.currentTarget.closest("th");if(!O)return;const V=Math.round(O.getBoundingClientRect().width);we.current={colIndex:S,startX:P.clientX,startWidth:V};const J=document.body.style.userSelect,de=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Me=oe=>{var Ke;const pe=we.current;if(!pe)return;const Le=((Ke=r[pe.colIndex])==null?void 0:Ke.minWidth)??D,Se=Math.max(Le,pe.startWidth+(oe.clientX-pe.startX));je(Re=>Re[pe.colIndex]===Se?Re:{...Re,[pe.colIndex]:Se})},fe=()=>{document.removeEventListener("mousemove",Me),document.removeEventListener("mouseup",fe),document.body.style.userSelect=J,document.body.style.cursor=de,we.current=null,A&&je(oe=>(A(oe),oe))};document.addEventListener("mousemove",Me),document.addEventListener("mouseup",fe)};return e.jsx("div",{ref:Oe,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,S)=>{var qr,hr;const O=b>0&&S<b,V=Ve[S]??0,J=Ne(P),Me=S===r.length-1&&j&&I,fe=R(P),oe=!!P.sortable&&!!fe,pe=oe&&(G==null?void 0:G.key)===fe?G.direction:null,Le=P.title||((qr=P.accessor)==null?void 0:qr.toString())||"",Se=(hr=P.headerTooltip)!=null&&hr.showIcon?e.jsx(T.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Ke=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Le}),Re=oe?e.jsxs("button",{type:"button",onClick:()=>_(P),title:pe==="asc"?"Sorted ascending — click to sort descending":pe==="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:[Ke,Se,e.jsx(Ln,{direction:pe})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Ke,Se]});return e.jsxs(Q.Th,{style:{position:"sticky",top:0,left:O?V:void 0,zIndex:O?4:2,paddingLeft:S===0?"12px":"",borderRight:d&&!Me&&!O?le:void 0,borderBottom:d?le:void 0,boxShadow:d&&O?ve:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left",...De(S,P.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[P.headerTooltip?e.jsx(me.Tooltip,{label:P.headerTooltip.content,position:"bottom",children:Re}):Re,P.filter&&e.jsx(jo,{filter:P.filter,columnTitle:P.title}),p&&e.jsx("button",{onClick:()=>$e(S),title:O?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:O?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:O?1:.45,transition:"opacity 0.15s"},children:e.jsx(Tn,{frozen:O})})]}),J&&e.jsx("div",{onMouseDown:wr=>dr(wr,S),onClick:wr=>wr.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-${S}`)}),j?e.jsx(Q.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?le:void 0,boxShadow:d&&I?Ce:void 0}}):null]})}),e.jsx(Q.Tbody,{children:c?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:r.length+1,children:e.jsxs(u.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&x?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:r.length+1,children:x})}):t==null?void 0:t.map((P,S)=>e.jsxs(Q.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:S===t.length-1&&xe?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:O=>{const V=O.currentTarget;V.style.backgroundColor=No,Array.from(V.querySelectorAll("td")).forEach(J=>{J.style.position==="sticky"&&(J.style.backgroundColor=No)})},onMouseLeave:O=>{const V=O.currentTarget;V.style.backgroundColor="",Array.from(V.querySelectorAll("td")).forEach(J=>{J.style.position==="sticky"&&(J.style.backgroundColor=ht)})},children:[r.map((O,V)=>{const J=O.render?O.render(P,S,t):ge(P,O.accessor),de=b>0&&V<b,Me=Ve[V]??0,fe=ke[V]!==void 0,oe=de&&V===b-1;return e.jsx(Q.Td,{style:{position:de?"sticky":void 0,left:de?Me:void 0,zIndex:de?1:void 0,backgroundColor:de?ht:void 0,transition:de?"background-color 0.3s ease":void 0,paddingLeft:V===0?"12px":"",whiteSpace:"nowrap",overflow:fe?"hidden":void 0,borderLeft:O.showBorderLeft?le:void 0,borderRight:O.showBorderRight?le:void 0,boxShadow:oe?ve:void 0,textAlign:O.textAlign==="text-right"?"right":O.textAlign==="text-center"?"center":"left",...De(V,O.width)},children:typeof J=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:O.textAlign==="text-right"?"right":O.textAlign==="text-center"?"center":"left"},children:J}):J},`row-${S}-col-${V}`)}),j?e.jsx(Q.Td,{style:{width:he,position:"sticky",right:0,zIndex:1,backgroundColor:ht,boxShadow:I?Ce:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ne.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:B.map(O=>{const V=S===t.length-1?"top":"bottom";return O==="detail"&&o&&(a==null?void 0:a(P))!==!1?e.jsx(me.Tooltip,{label:"Detail",position:V,children:e.jsx(N.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(P.id,P),iconLeft:e.jsx(T.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):O==="update"&&n&&(i==null?void 0:i(P))!==!1?e.jsx(me.Tooltip,{label:"Update",position:V,children:e.jsx(N.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(P),iconLeft:e.jsx(T.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):O==="delete"&&l&&(s==null?void 0:s(P))!==!1?e.jsx(me.Tooltip,{label:"Delete",position:V,children:e.jsx(N.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(P.id,P),iconLeft:e.jsx(T.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):O==="custom"?e.jsx(h.Fragment,{children:v==null?void 0:v(P)},"custom"):null})})}):null]},`${P}${S}`))})]})})},In=({wrapperProps:r,dataTableProps:t,headerProps:o,footerProps:n})=>{var b;const l=h.useRef(null),[c,s]=h.useState((t==null?void 0:t.defaultFrozenCount)??0),i=(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 y=(n==null?void 0:n.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(Ho,{...r,children:[i&&e.jsx(Vo,{...o}),e.jsx(u.Box,{direction:"column",ref:l,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(_o,{...t,scrollParentRef:l,frozenCount:t!=null&&t.enableFreezeColumns?c:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?s:void 0}):null}),y&&e.jsx(Po,{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 On(r){return h.memo(r)}const Wn=On(In),qo=200,ft="1px solid var(--sa-border-subtle, #0b120e24)",An=({sortDir:r,frozen:t})=>r==="asc"?e.jsx(T.Icon,{name:"ChevronSmallUp"}):r==="desc"?e.jsx(T.Icon,{name:"ChevronSmallDown"}):t?e.jsx(T.Icon,{name:"LockOn",size:"xs"}):e.jsx(T.Icon,{name:"Filter",size:"xs"}),Wr=({icon:r,label:t,active:o,danger:n,onClick:l})=>{const c=n?"var(--sa-color-error-600, #c9184a)":"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:c,textAlign:"left"},onMouseEnter:s=>{o||(s.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:s=>{s.currentTarget.style.background=o?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(T.Icon,{name:r,size:"sm",style:{color:c,flexShrink:0}}),e.jsx(k.Text,{as:"span",style:{color:c},children:t})]})},Zo=({active:r,canSort:t,canHide:o,sortDir:n,frozen:l,onSort:c,onClearSort:s,onToggleFreeze:i,onHide:a})=>{const[d,y]=h.useState(!1),b=h.useRef(null),p=h.useRef(null),[v,B]=h.useState({top:0,left:0});h.useEffect(()=>{if(d&&b.current){const L=b.current.getBoundingClientRect(),F=L.left+qo>window.innerWidth;B({top:L.bottom+6,...F?{right:window.innerWidth-L.right}:{left:L.left}})}},[d]),h.useEffect(()=>{if(!d)return;const L=F=>{p.current&&!p.current.contains(F.target)&&b.current&&!b.current.contains(F.target)&&y(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[d]);const x=L=>{L(),y(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:b,type:"button",className:"sa-tl-menu-trigger","data-active":r||d?"true":"false",onClick:L=>{L.stopPropagation(),y(F=>!F)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:ft,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(An,{sortDir:n,frozen:l})}),d&&e.jsxs(u.Box,{ref:p,onClick:L=>L.stopPropagation(),style:{position:"fixed",top:`${v.top}px`,...v.left!==void 0?{left:`${v.left}px`}:{right:`${v.right}px`},minWidth:qo,backgroundColor:"var(--sa-background-primary, #ffffff)",border:ft,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"0 6px 24px rgba(0,0,0,0.12)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[t&&e.jsxs(e.Fragment,{children:[e.jsx(Wr,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>x(()=>n==="asc"?s():c("asc"))}),e.jsx(Wr,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>x(()=>n==="desc"?s():c("desc"))}),e.jsx("div",{style:{borderTop:ft,margin:"4px 0"}})]}),e.jsx(Wr,{icon:"Pin1",label:l?"Unfreeze":"Freeze",active:l,onClick:()=>x(i)}),o&&e.jsx(Wr,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>x(a)})]})]})},br="1px solid var(--sa-border-subtle, #0b120e24)",zn="var(--sa-text-subtle, #8c8f97)",ar="var(--sa-background-neutral, #f0f1f2)",Go="2px 0 4px -2px rgba(0,0,0,0.15)",Cr=40,gt="var(--sa-background-brand-subtlest)",Ar={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Qo="sa-table-layout-styles",Hn=()=>{if(typeof document>"u"||document.getElementById(Qo))return;const r=document.createElement("style");r.id=Qo,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);
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
.sa-table-layout tfoot.sa-tl-sticky-foot > tr:first-child > th {
|
|
55
55
|
box-shadow: 0 -2px 4px -2px rgba(0,0,0,0.15);
|
|
56
56
|
}
|
|
57
|
-
`,document.head.appendChild(r)},vr=r=>r==="right"?"right":r==="center"?"center":"left",Vn=/^(#|rgb|hsl|var\()/,zr=r=>r?Vn.test(r)?r:`var(--sa-background-${r})`:void 0,Pn=(r,t)=>{if(t)return r[t]},jn=(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)),Nn=({columns:r,data:t,getRowKey:o,rowBg:n,size:l="md",resizable:c=!1,layout:s="auto",widthStorageKey:i,columnState:a,onColumnStateChange:d,columnMenu:p=!1,sort:b,defaultSort:u,onSortChange:v,height:B,mobileLayout:x="cards",mobileBreakpoint:L="md",groupSeparator:F,summary:A,footer:D,stickyFooter:m=!1,emptyState:H,loading:z=!1,loadingRows:I=8,rowActions:E,selectable:Z=!1,selectedKeys:$,defaultSelectedKeys:P,onSelectionChange:_,isRowSelectable:U})=>{Hn();const te=!Ce.useMediaQuery(L)&&x!=="scroll",Y=!!(E!=null&&E.length),[Q,J]=h.useState(null);h.useEffect(()=>{if(!Q)return;const C=()=>J(null),w=setTimeout(()=>document.addEventListener("click",C),0);return()=>{clearTimeout(w),document.removeEventListener("click",C)}},[Q]);const[ce,pe]=h.useState(()=>new Set),Be=a!==void 0,[fe,ge]=h.useState({}),ve=a??fe,Ee=C=>{d==null||d(C),Be||ge(C)},Oe=b!==void 0,[Ve,Pe]=h.useState(u??null),Se=Oe?b??null:Ve,je=!v,xe=C=>{v==null||v(C),Oe||Pe(C)},{headerGroups:$e,leafColumns:we,hasGroups:Ne}=h.useMemo(()=>{var ie;const C=new Set(ve.hidden??[]),w=(se,ue)=>se.key??(typeof se.accessor=="string"?se.accessor:`col-${ue}`),M=r.map((se,ue)=>{var We;if((We=se.children)!=null&&We.length){const Dr=se.children.map((qe,Sr)=>({col:qe,key:w(qe,`${ue}-${Sr}`)})).filter(qe=>!C.has(qe.key));return{col:se,key:se.key??`group-${ue}`,isGroup:!0,leaves:Dr}}const ye={col:se,key:w(se,`${ue}`)};return{col:se,key:ye.key,isGroup:!1,leaves:C.has(ye.key)?[]:[ye]}}).filter(se=>se.leaves.length>0),X=M.some(se=>se.isGroup);let re=M.flatMap(se=>se.leaves);if(!X&&((ie=ve.order)!=null&&ie.length)){const se=new Map(ve.order.map((ue,ye)=>[ue,ye]));re=[...re].sort((ue,ye)=>(se.get(ue.key)??1/0)-(se.get(ye.key)??1/0))}return{headerGroups:M,leafColumns:re,hasGroups:X}},[r,ve]),dr=h.useMemo(()=>new Map(we.map((C,w)=>[C.key,w])),[we]),j=!Ne&&we.some(C=>(C.col.headerColSpan??1)>1),S=we.map(C=>C.key).join("|"),O=(C,w)=>{const M=C.sortKey??(typeof C.accessor=="string"?C.accessor:void 0);return M?w[M]:void 0},V=C=>C.sortable??(!!C.sortKey||typeof C.accessor=="string"),G=h.useMemo(()=>{if(!je||!Se)return t;const C=we.find(M=>M.key===Se.key);if(!C)return t;const w=Se.direction==="asc"?1:-1;return[...t].sort((M,X)=>jn(O(C.col,M),O(C.col,X))*w)},[t,je,Se,we]),de=!Ne&&!j,Me=!!i&&de,[he,oe]=q.useColumnWidths(i??""),be=Me?he:void 0,Le=h.useRef(null),[De,Ke]=h.useState();h.useLayoutEffect(()=>{Ke(void 0)},[S]),h.useLayoutEffect(()=>{if(!de||De||!Le.current)return;const C=Le.current.querySelectorAll("th.sa-tl-leaf");Ke(Array.from(C).map(w=>w.offsetWidth))},[De,de]);const[Re,qr]=h.useState(0);h.useLayoutEffect(()=>{if(!Ne||!Le.current)return;const C=Le.current.querySelector(":scope > tr");C&&qr(C.offsetHeight)},[Ne,S]);const hr=(C,w)=>{if((be==null?void 0:be[w])!=null)return be[w];if(C.width!=null)return C.width;if((De==null?void 0:De[w])!=null)return De[w]},wr=(C,w)=>typeof C.width=="number"?C.width:De==null?void 0:De[w],Ct=ve.frozenKey&&!Ne&&!j?we.findIndex(C=>C.key===ve.frozenKey):-1,tl=C=>C<=Ct,ol=Z?Cr:0,ll=C=>{if(!De)return ol;let w=ol;for(let M=0;M<C;M++)w+=De[M]??0;return w},vt=h.useRef(null),[is,as]=h.useState("100vh");h.useLayoutEffect(()=>{if(B!==void 0)return;const C=()=>{if(vt.current){const w=vt.current.getBoundingClientRect().top;as(`calc(100vh - ${w}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[B]);const Ue=(C,w)=>o?o(C,w):w,xt=$!==void 0,[nl,ds]=h.useState(()=>new Set(P??[])),Je=h.useMemo(()=>xt?new Set($):nl,[xt,$,nl]);h.useEffect(()=>{Z&&!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).")},[Z,!o]);const cl=C=>{if(xt||ds(C),_){const w=G.filter((M,X)=>C.has(Ue(M,X)));_(Array.from(C),w)}},wt=(C,w)=>Z&&(U?U(C,w):!0),Dt=C=>{const w=new Set(Je);w.has(C)?w.delete(C):w.add(C),cl(w)},fr=h.useMemo(()=>Z?G.map((C,w)=>({row:C,i:w,key:Ue(C,w)})).filter(({row:C,i:w})=>U?U(C,w):!0).map(({key:C})=>C):[],[Z,G,U,o]),sl=fr.filter(C=>Je.has(C)),St=fr.length>0&&sl.length===fr.length,il=sl.length>0&&!St,hs=()=>{const C=new Set(Je);St?fr.forEach(w=>C.delete(w)):fr.forEach(w=>C.add(w)),cl(C)},kt=(C,w,M)=>C.render?C.render(w,M,G):Pn(w,C.accessor),Bt=we.length+(Z?1:0)+(Y?1:0),al=["80%","55%","70%","45%","90%","60%"],fs=(C,w)=>al[(C*7+w*3)%al.length],gs=(C,w)=>e.jsx(ze.Skeleton,{height:14,width:fs(C,w),borderRadius:"rounded-sm"}),us=Array.from({length:I},(C,w)=>e.jsxs(q.Tr,{children:[Z&&e.jsx(q.Td,{style:{width:Cr,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(ze.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),we.map(({col:M,key:X},re)=>e.jsx(q.Td,{style:{textAlign:vr(M.align)},children:gs(w,re)},`sa-tl-sk-${w}-${X}`)),Y&&e.jsx(q.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${w}`)),ys=(C,w)=>{w||Ee({...ve,hidden:[...ve.hidden??[],C]})},ps=C=>Ee({...ve,frozenKey:ve.frozenKey===C?void 0:C}),Zr=C=>(E??[]).filter(w=>{var M;return!((M=w.hidden)!=null&&M.call(w,C))}),dl={position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:4,paddingRight:16,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},Gr=(C,w,M,X)=>{var We;const re=(We=C.disabled)==null?void 0:We.call(C,w),ie=(X==null?void 0:X.showLabel)??C.showLabel,se=(X==null?void 0:X.size)??"xs",ue=e.jsx(N.Button,{size:se,variant:C.variant??"tertiary",tone:C.tone??"neutral",disabled:re,onClick:()=>C.onClick(w,M),iconLeft:C.icon?e.jsx(T.Icon,{name:C.icon,size:"sm"}):void 0,children:ie&&C.label}),ye=C.tooltip;return ye?e.jsx(me.Tooltip,{label:ye,position:"top-end",children:ue}):ue},bs=(C,w)=>{const M=Zr(C);if(!M.length)return null;if(M.length>5){const re=Ue(C,w),ie=(Q==null?void 0:Q.rowKey)===re;return e.jsx("div",{className:"sa-tl-row-actions",style:dl,onClick:se=>se.stopPropagation(),children:e.jsx(me.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(N.Button,{size:"xs",variant:"tertiary",onClick:se=>{const ue=se.currentTarget.getBoundingClientRect();J(ie?null:{rowKey:re,top:ue.bottom+4,right:window.innerWidth-ue.right})},children:e.jsx(T.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:dl,children:M.map(re=>e.jsx(h.Fragment,{children:Gr(re,C,w)},re.key))})},Cs=(C,w)=>{const M=Zr(C);return M.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:br},children:M.map(X=>e.jsx(h.Fragment,{children:Gr(X,C,w,{showLabel:!0,size:"sm"})},X.key))}):null},vs=(C,w)=>{const M=Zr(C);return M.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:M.map(X=>e.jsx(h.Fragment,{children:Gr(X,C,w,{showLabel:!1})},X.key))}):null},mt=(C,w)=>{const{col:M,key:X}=C,re=dr.get(X)??0,ie=tl(re),se=ie&&re===Ct,ue=(Se==null?void 0:Se.key)===X?Se.direction:null,ye=p&&!M.disableMenu?e.jsx(Zo,{active:!!ue||ie,canSort:V(M),canHide:!M.locked,sortDir:ue,frozen:ie,onSort:Sr=>xe({key:X,direction:Sr}),onClearSort:()=>xe(null),onToggleFreeze:()=>ps(X),onHide:()=>ys(X,M.locked)}):null,We=M.align==="right",Dr=M.align==="right"?"flex-end":M.align==="center"?"center":"flex-start",qe=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Dr,overflow:"hidden"},children:[M.icon&&e.jsx(T.Icon,{name:M.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Ar,children:M.title})]});return e.jsx(q.Th,{className:`sa-tl-leaf${ie?" sa-tl-frozen":""}`,rowSpan:w==null?void 0:w.rowSpan,colSpan:w==null?void 0:w.colSpan,minWidth:M.minWidth,resizable:de?M.resizable:!1,defaultWidth:wr(M,re),style:{textAlign:vr(M.align),width:hr(M,re),position:"sticky",top:(w==null?void 0:w.top)??0,left:ie?ll(re):void 0,zIndex:ie?3:2,backgroundColor:ar,boxShadow:se?Go:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:We?e.jsxs(e.Fragment,{children:[ye,qe]}):e.jsxs(e.Fragment,{children:[qe,ye]})})},`th-${X}`)},xs=()=>{const C=[];for(let w=0;w<we.length;){const M=we[w],X=M.col.headerColSpan??1,re=Math.max(1,Math.min(X,we.length-w));C.push(mt(M,re>1?{colSpan:re}:void 0)),w+=re}return C},hl=C=>e.jsx(q.Th,{rowSpan:C==null?void 0:C.rowSpan,style:{width:Cr,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(Ze.Checkbox,{size:"sm",variant:il?"indeterminate":"select",checked:St||il,disabled:fr.length===0,onChange:hs,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),ws=(C,w,M)=>{const X=Ue(C,w);return e.jsx(q.Td,{className:"sa-tl-frozen",style:{width:Cr,padding:0,position:"sticky",left:0,zIndex:2,...M?{"--sa-tl-bg":M}:{}},children:wt(C,w)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:re=>re.stopPropagation(),children:e.jsx(Ze.Checkbox,{size:"sm",checked:Je.has(X),onChange:()=>Dt(X),"aria-label":"Pilih baris"})})},`tl-select-${w}`)},Ft=we.filter(C=>!C.col.hideOnMobile),Et=Ft.find(C=>C.col.primary)??Ft[0],Ds=Ft.filter(C=>C!==Et),Ss=C=>pe(w=>{const M=new Set(w);return M.has(C)?M.delete(C):M.add(C),M}),fl=(C,w)=>Ds.map(({col:M,key:X})=>{const re=kt(M,C,w),ie=typeof re=="string"||typeof re=="number"?e.jsx(k.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:re}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:re});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof M.title=="string"?e.jsx(k.Text,{color:"subtle",fontWeight:"medium",style:{color:zn,flexShrink:0},children:M.title}):e.jsx("div",{style:{flexShrink:0},children:M.title}),ie]},X)}),Mt=(C,w)=>{const M=Et?kt(Et.col,C,w):null;return typeof M=="string"||typeof M=="number"?e.jsx(k.Text,{as:"span",style:Ar,children:M}):e.jsx("span",{style:Ar,children:M})},ks=e.jsx(y.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:I},(C,w)=>e.jsxs(y.Box,{style:{border:br,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(ze.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(ze.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(ze.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${w}`))}),gl=e.jsx(y.Box,{fullWidth:!0,style:{minHeight:(H==null?void 0:H.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:H==null?void 0:H.content}),Bs=z?ks:G.length===0?gl:x==="expand"?e.jsx(y.Box,{style:{display:"flex",flexDirection:"column"},children:G.map((C,w)=>{const M=Ue(C,w),X=ce.has(M),ie=Z&&Je.has(M)?gt:zr(n==null?void 0:n(C,w));return e.jsxs("div",{style:{borderBottom:br,backgroundColor:ie},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[wt(C,w)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(Ze.Checkbox,{size:"sm",checked:Je.has(M),onChange:()=>Dt(M),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>Ss(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:[Mt(C,w),e.jsx(T.Icon,{name:X?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),Y&&vs(C,w)]}),X&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:fl(C,w)})]},M)})}):e.jsx(y.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:G.map((C,w)=>{const M=Ue(C,w),X=Z&&Je.has(M);return e.jsxs(y.Box,{style:{border:br,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:X?gt:zr(n==null?void 0:n(C,w))},children:[wt(C,w)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(Ze.Checkbox,{size:"sm",checked:Je.has(M),onChange:()=>Dt(M),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:Mt(C,w)})]}):Mt(C,w),fl(C,w),Y&&Cs(C,w)]},M)})}),ms=c&&de&&De!==void 0,ul=s==="fixed"&&!c&&(de?De!==void 0:!0),Fs=ul&&!de,Qr=D&&D.length>0?D.map((C,w)=>e.jsx(q.Tr,{children:C.cells.map((M,X)=>e.jsx(q.Td,{colSpan:M.colSpan,rowSpan:M.rowSpan,style:{textAlign:vr(M.align)},children:M.content},`tl-foot-${w}-${X}`))},`tl-foot-${w}`)):null,Es=e.jsxs(q.Table,{className:"sa-table-layout",fullWidth:!0,size:l,resizable:ms,style:ul?{tableLayout:"fixed"}:void 0,onWidthsChange:Me?oe:void 0,children:[Fs&&e.jsxs("colgroup",{children:[Z&&e.jsx("col",{style:{width:Cr}}),we.map(({col:C,key:w},M)=>e.jsx("col",{style:{width:hr(C,M)}},`col-${w}`)),Y&&e.jsx("col",{style:{width:1}})]}),e.jsx(q.Thead,{ref:Le,children:Ne?e.jsxs(e.Fragment,{children:[e.jsxs(q.Tr,{children:[Z&&hl({rowSpan:2}),$e.map(C=>C.isGroup?e.jsx(q.Th,{colSpan:C.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:ar},children:e.jsx("span",{style:Ar,children:C.col.title})},`grp-${C.key}`):mt(C.leaves[0],{rowSpan:2})),Y&&e.jsx(q.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:ar}})]}),e.jsx(q.Tr,{children:$e.flatMap(C=>C.isGroup?C.leaves.map(w=>mt(w,{top:Re})):[])})]}):e.jsxs(q.Tr,{children:[Z&&hl(),xs(),Y&&e.jsx(q.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:ar}})]})}),e.jsx(q.Tbody,{children:z?us:G.length===0?e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:Bt,children:gl})}):e.jsxs(e.Fragment,{children:[G.map((C,w)=>{const M=F==null?void 0:F(C,w,w>0?G[w-1]:void 0),re=Z&&Je.has(Ue(C,w))?gt:zr(n==null?void 0:n(C,w));return e.jsxs(h.Fragment,{children:[M!=null&&M!==!1&&e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:Bt,style:{backgroundColor:ar},children:M})}),e.jsxs(q.Tr,{children:[Z&&ws(C,w,re),we.map(({col:ie,key:se},ue)=>{var pl;const ye=(pl=ie.cellProps)==null?void 0:pl.call(ie,C,w,G);if(ye!=null&&ye.hidden)return null;const We=tl(ue),Dr=We&&ue===Ct,qe=kt(ie,C,w),Sr=typeof ie.bg=="function"?ie.bg(C,w,G):ie.bg,yl=zr(Sr)??re;return e.jsx(q.Td,{className:We?"sa-tl-frozen":void 0,colSpan:ye==null?void 0:ye.colSpan,rowSpan:ye==null?void 0:ye.rowSpan,style:{textAlign:vr(ie.align),width:hr(ie,ue),minWidth:ie.minWidth,position:We?"sticky":void 0,left:We?ll(ue):void 0,zIndex:We?1:void 0,boxShadow:Dr?Go:void 0,...yl?{"--sa-tl-bg":yl}:{}},children:typeof qe=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:vr(ie.align)},children:qe}):qe},`tl-cell-${w}-${se}`)}),Y&&e.jsx(q.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:bs(C,w)})]})]},Ue(C,w))}),A!=null&&e.jsx(q.Tr,{children:e.jsx(q.Td,{colSpan:Bt,children:A})})]})}),Qr&&e.jsx(q.Tfoot,{className:m?"sa-tl-sticky-foot":void 0,children:Qr})]}),Lt=Q?G.findIndex((C,w)=>Ue(C,w)===Q.rowKey):-1,Tt=Lt>=0?G[Lt]:null;return e.jsxs(e.Fragment,{children:[e.jsx(y.Box,{ref:vt,fullWidth:!0,style:{overflow:"auto",height:B??is},children:te?e.jsxs(e.Fragment,{children:[Bs,Qr&&!z&&G.length>0&&e.jsx(y.Box,{style:{borderTop:br},children:e.jsx(q.Table,{fullWidth:!0,size:l,className:"sa-table-layout",children:e.jsx(q.Tbody,{children:Qr})})})]}):Es}),Q&&Tt&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:Q.top,right:Q.right},onClick:C=>C.stopPropagation(),children:Zr(Tt).map(C=>e.jsx("div",{style:{padding:"2px 4px"},children:Gr(C,Tt,Lt,{showLabel:!0,size:"sm"})},C.key))})]})},ut=r=>r==="asc"||r==="desc",_n=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:o="sortOrder",pageKey:n="page",defaultSort:l=null,paramKeys:c,scopeId:s,storage:i=ct}=r,{searchParams:a,setSearchParams:d,searchQueries:p}=Te(),b=a.toString(),u=s?ir.tableSort(s):void 0,v=h.useRef(!1);h.useEffect(()=>{if(v.current||(v.current=!0,!u)||a.has(t)||a.has(o))return;const D=i.get(u);!(D!=null&&D.key)||!ut(D.direction)||d({...Object.fromEntries(a.entries()),[t]:D.key,[o]:D.direction})},[]);const B=h.useMemo(()=>{const D=a.get(t),m=a.get(o);return D&&ut(m)?{key:D,direction:m}:l},[b,t,o,l]);h.useEffect(()=>{if(!u)return;const D=a.get(t),m=a.get(o);D&&ut(m)?i.set(u,{key:D,direction:m}):i.remove(u)},[b,u,t,o,i]);const x=(c==null?void 0:c.sortBy)??"sortBy",L=(c==null?void 0:c.sortOrder)??"sortOrder",F=h.useMemo(()=>B?{[x]:B.key,[L]:B.direction}:{},[B,x,L]),A=h.useCallback(D=>{const m={...p};D?(m[t]=D.key,m[o]=D.direction):(delete m[t],delete m[o]),delete m[n],d(m)},[p,t,o,n,d]);return{sort:B,setSort:A,params:F}},Hr=({of:r,render:t})=>h.Children.toArray(r==null?void 0:r.map((o,n,l)=>t(o,n,l))),ne=({condition:r,fallback:t,children:o,loading:n,isLoading:l})=>e.jsx(e.Fragment,{children:l?n:r?o:t}),ae=r=>e.jsx(k.Text,{...r,fontFamily:"Poppins",fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),Qe=r=>e.jsx(k.Text,{color:"red-600",fontSize:"sm",children:r.message}),qn=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ne,{condition:!!l.inputProps.required,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:l.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ne,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(y.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(Xe.Input,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default",fullWidth:!0}),!c&&l.errorMessage&&e.jsx(Qe,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},Zn=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(ne,{condition:!!l.inputProps.required,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:l.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ne,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(y.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(y.Box,{direction:"column",style:{width:l.inputProps.fullWidth?"100%":t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(lr.Dropdown,{size:r,...l.inputProps,error:!!l.errorMessage})}),!c&&l.errorMessage&&e.jsx(Qe,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},Gn=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Qn=r=>{var i;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))},c=a=>{a.preventDefault(),o(!0)},s=a=>{a.preventDefault(),o(!1)};return e.jsxs(y.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:l,onDragEnter:c,onDragLeave:s,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${Gn(r.errorMessage,r.status)}`},children:[e.jsx(T.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(le.Flex,{direction:"column",gap:"xs",children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(k.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",children:(i=r.fileSupports)==null?void 0:i.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function Un(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const Uo=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},Jn=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]],c=parseInt(o[2],10);return isNaN(n)||isNaN(l)||isNaN(c)?null:new Date(c,l,n)};function Yn(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,"."),c=n.length===2?l+"."+n[1]:l;return t?"Rp"+c:c}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 Xn=r=>{const t=r.split(" ");let o=t[0].charAt(0);return t.length>1&&(o+=""+t[1].charAt(0)),o.toUpperCase()};function $n(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 Kn="sa-admin",_e=r=>`var(--${Kn}-${r})`,Rn={base:{borderColor:_e("base-border-color"),textColor:_e("base-text-color"),iconColor:_e("base-icon-color"),placeholderColor:_e("base-placeholder-color")},document:{bgColor:_e("document-bg-color")},sidebar:{bgColor:_e("sidebar-bg-color"),borderColor:_e("sidebar-border-color"),maxWidth:_e("sidebar-max-width"),width:_e("sidebar-width"),collapseWidth:_e("sidebar-collapse-width"),collapseV2Width:_e("sidebar-v2-collapse-width")}},ec=24*60*60*1e3,rc=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))},tc=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,oc=/--+/,lc=/-$/;function nc(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function cc(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function sc(r){return/^[A-Za-z\s]+$/.test(r)}const ic=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()},ac=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()},dc=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()},hc=r=>tc.test(r);function fc(r){return!(oc.test(r)||lc.test(r))}const gc=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()},uc=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 yc(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(c=>t.endsWith(c)))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 pc(r){const t=r.split("/");return t[t.length-1]}const bc=r=>{var t,o;return e.jsxs(y.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(le.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(T.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(le.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(k.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?pc(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(T.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:yc(((o=r.fileSelected)==null?void 0:o.size.toString())||"100000")}),e.jsx(T.Icon,{name:"Dot",size:"xs"}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:Uo(new Date)})]})]})]}),e.jsx(N.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(T.Icon,{name:"Trash1"})})]})},Jo=({status:r="default",labelPosition:t="outside-top",...o})=>{var u;const n=h.useRef(null),l=()=>{if(o.defaultFile){window.open(o.defaultFile.url);return}n.current&&n.current.click()},c=Ce.useMediaQuery("md"),s=r==="error"||typeof o.errorMessage=="string"&&!!o.errorMessage,i=o.label?e.jsxs(le.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(k.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:o.label}),o.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"4px",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),o.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=o.description?e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.description}):null,d=e.jsxs(e.Fragment,{children:[o.helperText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.helperText}),o.errorText&&r==="error"&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorText}),o.errorMessage&&!o.errorText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorMessage})]}),p=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:v=>{var B;return o.handleOnChangeFile(((B=v.target.files)==null?void 0:B.item(0))||null)},accept:(u=o.fileSupportOption)==null?void 0:u.map(v=>"."+(v==null?void 0:v.toLowerCase())).join(", ")}),b=e.jsxs(y.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...o.containerProps,children:[p,(o.fileSelected||o.defaultFile)&&e.jsx(bc,{fileSelected:o.fileSelected,defaultFile:o.defaultFile,handleOnDeleteFile:o.handleOnDeleteFile,handleOnClickFile:l}),!o.fileSelected&&!o.defaultFile&&e.jsx(Qn,{fileSupports:o.fileSupportOption,isDesktop:c,errorMessage:s?o.errorText||o.errorMessage||" ":void 0,status:s?"error":"default",handleOnClick:l,handleOnFileChange:o.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(le.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(le.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[i,a]}),e.jsxs(le.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[b,d]})]}):e.jsxs(le.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[i,a,b,d]})},Cc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ne,{condition:!!l.inputProps.required,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:l.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ne,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(le.Flex,{direction:"column",gap:"xs",children:[e.jsx(Jo,{...l.inputProps,status:l.errorMessage?"error":"default"}),!c&&l.errorMessage&&e.jsx(Qe,{message:l.errorMessage})]})]})},vc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...c})=>{var a,d,p,b;const s=c.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(ne,{condition:!!l,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:c.title}),e.jsx(He.Body3,{props:{color:"gray-500"},children:c.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:c.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ne,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(me.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(p=c.tooltip)==null?void 0:p.arrowPosition,...c.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!c.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsx(y.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(Hr,{of:(b=c.checkBoxesList)==null?void 0:b.map(u=>({...u,isChecked:c.checkBoxesAreChecked.includes(u.id)})),render:u=>u.renderBadge?e.jsxs(y.Box,{direction:"row",justify:"space-between",gap:"lg",...c.badgeContainerProps,children:[e.jsx(Ze.Checkbox,{name:u.name,value:u.id,checked:u.isChecked,onChange:v=>c.onChecked(v.target.value,u),label:u.name,description:u.description}),u.renderBadge]}):e.jsx(Ze.Checkbox,{name:u.name,value:u.id,checked:u.isChecked,onChange:v=>c.onChecked(v.target.value,u),label:u.name,description:u.description})})}),!s&&c.errorMessage&&e.jsx(Qe,{message:c.errorMessage})]})},xc=({position:r="vertical",size:t="md",fullWidth:o=!1,...n})=>{var c;const l=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(ne,{condition:!!n.description||!!n.title,children:e.jsxs(y.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[n.title&&e.jsx(ae,{children:n.title}),e.jsx(ne,{condition:!!n.description,children:e.jsx(k.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(y.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(Hr,{of:(c=n.radioList)==null?void 0:c.map(s=>({...s,isChecked:n.radioIsChecked===s.id})),render:({value:s,id:i,isChecked:a,subInput:d,label:p,description:b})=>e.jsxs(y.Box,{direction:"column",gap:"xs",customMaxWidth:l,children:[e.jsx(Jr.Radio,{id:`${i.toString()}-${s}`,name:n.groupName||p,label:p,value:s,checked:a,onChange:u=>n.onChecked({id:i,label:u.target.name,value:u.target.value}),disabled:n.disableAll},i),b&&e.jsx(k.Text,{color:"gray-500",style:{marginLeft:28},children:b}),d]})})}),n.errorMessage&&e.jsx(Qe,{message:n.errorMessage})]})},wc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ne,{condition:!!l.inputProps.required,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:l.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ne,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(le.Flex,{direction:"column",gap:"xs",children:[e.jsx(Ur.Textarea,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default"}),!c&&l.errorMessage&&e.jsx(Qe,{message:l.errorMessage})]})]})},Dc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",required:n=!1,fullWidth:l=!1,...c})=>{var i,a,d;const s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(ne,{condition:n,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:l,children:[e.jsx(ae,{children:c.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:l,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:c.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ne,{condition:!!((i=c.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=c.tooltip)==null?void 0:a.label,arrowPosition:(d=c.tooltip)==null?void 0:d.arrowPosition,...c.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!c.titleDescription,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})})]})}),e.jsx(sr.Toggle,{checked:c.checked,onChange:c.onChange,label:c.label,description:c.description}),c.errorMessage&&e.jsx(Qe,{message:c.errorMessage})]})},Sc=({variant:r="primary",size:t="md",...o})=>{const n=cr.useColor(),l=s=>{var a,d,p,b,u,v;if(!s)return;const i=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=(p=n==null?void 0:n.computed)==null?void 0:p.blue)==null?void 0:b[700]:(v=(u=n==null?void 0:n.computed)==null?void 0:u.gray)==null?void 0:v[50];return e.jsx(T.Icon,{name:s,size:t,style:{color:i}})},c=()=>{var i,a,d,p;if(r!=="secondary-danger"&&r!=="secondary-primary")return o.title;const s={color:o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(i=n==null?void 0:n.computed)==null?void 0:i.red)==null?void 0:a[600]:(p=(d=n==null?void 0:n.computed)==null?void 0:d.blue)==null?void 0:p[700]};switch(t){case"xs":return e.jsx(He.Body2,{props:{style:s},children:o.title});case"sm":case"md":return e.jsx(He.SubH3,{props:{style:s},children:o.title});case"lg":return e.jsx(He.SubH2,{props:{style:s},children:o.title});default:return o.title}};return e.jsx(N.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:c()})},kc=r=>e.jsx(He.H5,{props:{...r},children:r.title}),Bc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(ne,{condition:!!l.inputProps.required,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:l.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ne,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(le.Flex,{direction:"column",gap:"xs",children:[e.jsx(y.Box,{direction:"column",style:{width:t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(er.StarasiaDate,{size:r,...l.inputProps,status:l.errorMessage?"error":void 0})}),!c&&l.errorMessage&&e.jsx(Qe,{message:l.errorMessage})]})]})};async function mc(r,t){const o=new Image;o.src=r,await new Promise((c,s)=>{o.onload=c,o.onerror=s});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((c,s)=>{n.toBlob(i=>{if(!i)return s("Canvas is empty");const a=new File([i],"cropped.png",{type:"image/png"});c(a)},"image/png")})}const Yo={"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},Xo=h.forwardRef(({handleUpload:r,urlImage:t,isUploading:o,croppedImage:n,setCroppedImage:l,size:c="96",aspect:s="1:1",containerProps:i,maxFileSize:a=2,onError:d},p)=>{const b=Ce.useMediaQuery("md"),[u,v]=h.useState(!1),[B,x]=h.useState(null),[L,F]=h.useState(!1),[A,D]=h.useState({x:0,y:0}),[m,H]=h.useState(1),[z,I]=h.useState(null);h.useEffect(()=>{t===null&&l(null)},[t]);const E=h.useCallback((Q,J)=>{I(J)},[]),Z=Q=>{var pe;const J=(pe=Q.target.files)==null?void 0:pe[0];if(!J)return;const ce=new FileReader;ce.onload=()=>{x(ce.result),F(!0)},ce.readAsDataURL(J)},$=async()=>{if(!(!B||!z))try{const Q=await mc(B,z);if(a&&Q.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(Q);const J=URL.createObjectURL(Q);l(J,Q),F(!1)}catch{d==null||d("Gagal memproses gambar")}},P=h.useRef(null),_=()=>{P.current&&P.current.click()};h.useImperativeHandle(p,()=>({openFileDialog:()=>{var Q;(Q=P.current)==null||Q.click()}}));const U=parseInt(c,10),K=Yo[s];let te,Y;return K>=1?(Y=U,te=U*K):(te=U,Y=U/K),e.jsxs(y.Box,{direction:"column",display:"flex",position:"relative",bg:(i==null?void 0:i.bg)||"gray-200",borderStyle:(i==null?void 0:i.borderStyle)||"border-none",borderColor:(i==null?void 0:i.borderColor)||"gray-200",borderWidth:(i==null?void 0:i.borderWidth)||"border-2",borderRadius:(i==null?void 0:i.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:i!=null&&i.fullWidth?"100%":`${te}px`,height:i!=null&&i.fullWidth?"auto":`${Y}px`,aspectRatio:K,flexShrink:0},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),children:[n||t?e.jsx("img",{src:n||t||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(y.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(T.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(c)/2<40?Number(c)/2:40,height:Number(c)/2<40?Number(c)/2:40}})}),e.jsxs(y.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214a)",opacity:u?1:0,transition:"opacity 0.3s ease-in-out"},onClick:_,children:[e.jsx("input",{ref:P,type:"file",accept:"image/*",onChange:Z,disabled:o,style:{display:"none"}}),e.jsxs(y.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(T.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(ne,{condition:c.toNumber()>80,children:e.jsx(k.Text,{color:"gray-50",fontSize:c.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),o&&e.jsx(y.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f640)"},children:e.jsx(y.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),L&&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:()=>F(!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?s==="1:1"?"min(90vw, 480px)":`min(90vw, ${te*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:Q=>Q.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:B&&e.jsx(bl,{image:B,crop:A,zoom:m,aspect:s?Yo[s]:void 0,onCropChange:D,onZoomChange:H,onCropComplete:E,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(N.Button,{size:"sm",secondary:!0,onClick:()=>F(!1),children:"Cancel"}),e.jsx(N.Button,{size:"sm",primary:!0,onClick:$,children:"Crop"})]})]})}),document.body)]})}),Fc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...c})=>{var a,d,p;const s=c.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(ne,{condition:!!l,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:c.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:c.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ne,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(me.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(p=c.tooltip)==null?void 0:p.arrowPosition,...c.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!c.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsxs(le.Flex,{direction:"column",gap:"xs",children:[e.jsx(Xo,{...c.inputProps}),!s&&c.errorMessage&&e.jsx(Qe,{message:c.errorMessage})]})]})},Ec=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var s,i,a;const c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ne,{condition:!!l.inputProps.required,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ae,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:l.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ne,{condition:!!((s=l.tooltip)!=null&&s.label),children:e.jsx(me.Tooltip,{label:(i=l.tooltip)==null?void 0:i.label,arrowPosition:(a=l.tooltip)==null?void 0:a.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),l.inputProps.extended&&l.inputProps.extended]})},Mc=({items:r,id:t,handleOnUpdate:o,width:n,toggleShow:l=!0,disabled:c=!1})=>{var p;const[s,i]=h.useState([]);h.useEffect(()=>{r&&i([...r.map(b=>({id:b.id,isActive:b.isActive}))])},[r]);const a=(p=s.find(b=>b.id===t))==null?void 0:p.isActive,d=h.useCallback(()=>{i(b=>b.map(u=>u.id===t?{...u,isActive:!u.isActive}:u)),o&&o(!a)},[t,o,a]);return e.jsx(y.Box,{direction:"row",gap:"md",style:{width:n},children:l&&e.jsx(sr.Toggle,{disabled:c,checked:a,onChange:d,label:a?"Active":"Inactive"})})},Lc={InputText:qn,InputDropdown:Zn,InputSingleFile:Cc,CheckBoxOptions:vc,RadioOptions:xc,InputTextArea:wc,ToggleForm:Dc,ActionButton:Sc,FormTitle:kc,InputDate:Bc,InputImgFile:Fc,Custom:Ec},$o=({customBottom:r})=>{const[t,o]=h.useState(!1),n=()=>{window.scrollY>window.screenY?o(!0):o(!1)},l=()=>{window.scrollTo({top:0,behavior:"smooth"})};return h.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(y.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(y.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(N.Button,{secondary:!0,size:"xs",onClick:l,type:"button",iconLeft:e.jsx(T.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Ie="sa-sidepanel-item",Ko="sa-sidepanel-item-styles",Tc=`
|
|
57
|
+
`,document.head.appendChild(r)},vr=r=>r==="right"?"right":r==="center"?"center":"left",Vn=/^(#|rgb|hsl|var\()/,zr=r=>r?Vn.test(r)?r:`var(--sa-background-${r})`:void 0,Pn=(r,t)=>{if(t)return r[t]},jn=(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)),Nn=({columns:r,data:t,getRowKey:o,rowBg:n,size:l="md",resizable:c=!1,layout:s="auto",widthStorageKey:i,columnState:a,onColumnStateChange:d,columnMenu:y=!1,sort:b,defaultSort:p,onSortChange:v,height:B,mobileLayout:x="cards",mobileBreakpoint:L="md",groupSeparator:F,summary:A,footer:D,stickyFooter:m=!1,emptyState:H,loading:z=!1,loadingRows:I=8,rowActions:E,selectable:U=!1,selectedKeys:X,defaultSelectedKeys:G,onSelectionChange:R,isRowSelectable:_})=>{Hn();const te=!be.useMediaQuery(L)&&x!=="scroll",q=!!(E!=null&&E.length),[j,Z]=h.useState(null);h.useEffect(()=>{if(!j)return;const C=()=>Z(null),w=setTimeout(()=>document.addEventListener("click",C),0);return()=>{clearTimeout(w),document.removeEventListener("click",C)}},[j]);const[le,Ce]=h.useState(()=>new Set),ve=a!==void 0,[he,ge]=h.useState({}),xe=a??he,Ee=C=>{d==null||d(C),ve||ge(C)},Oe=b!==void 0,[Ve,Pe]=h.useState(p??null),ke=Oe?b??null:Ve,je=!v,we=C=>{v==null||v(C),Oe||Pe(C)},{headerGroups:$e,leafColumns:De,hasGroups:Ne}=h.useMemo(()=>{var ie;const C=new Set(xe.hidden??[]),w=(se,ue)=>se.key??(typeof se.accessor=="string"?se.accessor:`col-${ue}`),M=r.map((se,ue)=>{var We;if((We=se.children)!=null&&We.length){const Dr=se.children.map((qe,Sr)=>({col:qe,key:w(qe,`${ue}-${Sr}`)})).filter(qe=>!C.has(qe.key));return{col:se,key:se.key??`group-${ue}`,isGroup:!0,leaves:Dr}}const ye={col:se,key:w(se,`${ue}`)};return{col:se,key:ye.key,isGroup:!1,leaves:C.has(ye.key)?[]:[ye]}}).filter(se=>se.leaves.length>0),Y=M.some(se=>se.isGroup);let re=M.flatMap(se=>se.leaves);if(!Y&&((ie=xe.order)!=null&&ie.length)){const se=new Map(xe.order.map((ue,ye)=>[ue,ye]));re=[...re].sort((ue,ye)=>(se.get(ue.key)??1/0)-(se.get(ye.key)??1/0))}return{headerGroups:M,leafColumns:re,hasGroups:Y}},[r,xe]),dr=h.useMemo(()=>new Map(De.map((C,w)=>[C.key,w])),[De]),P=!Ne&&De.some(C=>(C.col.headerColSpan??1)>1),S=De.map(C=>C.key).join("|"),O=(C,w)=>{const M=C.sortKey??(typeof C.accessor=="string"?C.accessor:void 0);return M?w[M]:void 0},V=C=>C.sortable??(!!C.sortKey||typeof C.accessor=="string"),J=h.useMemo(()=>{if(!je||!ke)return t;const C=De.find(M=>M.key===ke.key);if(!C)return t;const w=ke.direction==="asc"?1:-1;return[...t].sort((M,Y)=>jn(O(C.col,M),O(C.col,Y))*w)},[t,je,ke,De]),de=!Ne&&!P,Me=!!i&&de,[fe,oe]=Q.useColumnWidths(i??""),pe=Me?fe:void 0,Le=h.useRef(null),[Se,Ke]=h.useState();h.useLayoutEffect(()=>{Ke(void 0)},[S]),h.useLayoutEffect(()=>{if(!de||Se||!Le.current)return;const C=Le.current.querySelectorAll("th.sa-tl-leaf");Ke(Array.from(C).map(w=>w.offsetWidth))},[Se,de]);const[Re,qr]=h.useState(0);h.useLayoutEffect(()=>{if(!Ne||!Le.current)return;const C=Le.current.querySelector(":scope > tr");C&&qr(C.offsetHeight)},[Ne,S]);const hr=(C,w)=>{if((pe==null?void 0:pe[w])!=null)return pe[w];if(C.width!=null)return C.width;if((Se==null?void 0:Se[w])!=null)return Se[w]},wr=(C,w)=>typeof C.width=="number"?C.width:Se==null?void 0:Se[w],Ct=xe.frozenKey&&!Ne&&!P?De.findIndex(C=>C.key===xe.frozenKey):-1,tl=C=>C<=Ct,ol=U?Cr:0,ll=C=>{if(!Se)return ol;let w=ol;for(let M=0;M<C;M++)w+=Se[M]??0;return w},vt=h.useRef(null),[is,as]=h.useState("100vh");h.useLayoutEffect(()=>{if(B!==void 0)return;const C=()=>{if(vt.current){const w=vt.current.getBoundingClientRect().top;as(`calc(100vh - ${w}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[B]);const Ue=(C,w)=>o?o(C,w):w,xt=X!==void 0,[nl,ds]=h.useState(()=>new Set(G??[])),Je=h.useMemo(()=>xt?new Set(X):nl,[xt,X,nl]);h.useEffect(()=>{U&&!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).")},[U,!o]);const cl=C=>{if(xt||ds(C),R){const w=J.filter((M,Y)=>C.has(Ue(M,Y)));R(Array.from(C),w)}},wt=(C,w)=>U&&(_?_(C,w):!0),Dt=C=>{const w=new Set(Je);w.has(C)?w.delete(C):w.add(C),cl(w)},fr=h.useMemo(()=>U?J.map((C,w)=>({row:C,i:w,key:Ue(C,w)})).filter(({row:C,i:w})=>_?_(C,w):!0).map(({key:C})=>C):[],[U,J,_,o]),sl=fr.filter(C=>Je.has(C)),St=fr.length>0&&sl.length===fr.length,il=sl.length>0&&!St,hs=()=>{const C=new Set(Je);St?fr.forEach(w=>C.delete(w)):fr.forEach(w=>C.add(w)),cl(C)},kt=(C,w,M)=>C.render?C.render(w,M,J):Pn(w,C.accessor),Bt=De.length+(U?1:0)+(q?1:0),al=["80%","55%","70%","45%","90%","60%"],fs=(C,w)=>al[(C*7+w*3)%al.length],gs=(C,w)=>e.jsx(ze.Skeleton,{height:14,width:fs(C,w),borderRadius:"rounded-sm"}),us=Array.from({length:I},(C,w)=>e.jsxs(Q.Tr,{children:[U&&e.jsx(Q.Td,{style:{width:Cr,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(ze.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),De.map(({col:M,key:Y},re)=>e.jsx(Q.Td,{style:{textAlign:vr(M.align)},children:gs(w,re)},`sa-tl-sk-${w}-${Y}`)),q&&e.jsx(Q.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${w}`)),ys=(C,w)=>{w||Ee({...xe,hidden:[...xe.hidden??[],C]})},ps=C=>Ee({...xe,frozenKey:xe.frozenKey===C?void 0:C}),Zr=C=>(E??[]).filter(w=>{var M;return!((M=w.hidden)!=null&&M.call(w,C))}),dl={position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:4,paddingRight:16,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},Gr=(C,w,M,Y)=>{var We;const re=(We=C.disabled)==null?void 0:We.call(C,w),ie=(Y==null?void 0:Y.showLabel)??C.showLabel,se=(Y==null?void 0:Y.size)??"xs",ue=e.jsx(N.Button,{size:se,variant:C.variant??"tertiary",tone:C.tone??"neutral",disabled:re,onClick:()=>C.onClick(w,M),iconLeft:C.icon?e.jsx(T.Icon,{name:C.icon,size:"sm"}):void 0,children:ie&&C.label}),ye=C.tooltip;return ye?e.jsx(me.Tooltip,{label:ye,position:"top-end",children:ue}):ue},bs=(C,w)=>{const M=Zr(C);if(!M.length)return null;if(M.length>5){const re=Ue(C,w),ie=(j==null?void 0:j.rowKey)===re;return e.jsx("div",{className:"sa-tl-row-actions",style:dl,onClick:se=>se.stopPropagation(),children:e.jsx(me.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(N.Button,{size:"xs",variant:"tertiary",onClick:se=>{const ue=se.currentTarget.getBoundingClientRect();Z(ie?null:{rowKey:re,top:ue.bottom+4,right:window.innerWidth-ue.right})},children:e.jsx(T.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:dl,children:M.map(re=>e.jsx(h.Fragment,{children:Gr(re,C,w)},re.key))})},Cs=(C,w)=>{const M=Zr(C);return M.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:br},children:M.map(Y=>e.jsx(h.Fragment,{children:Gr(Y,C,w,{showLabel:!0,size:"sm"})},Y.key))}):null},vs=(C,w)=>{const M=Zr(C);return M.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:M.map(Y=>e.jsx(h.Fragment,{children:Gr(Y,C,w,{showLabel:!1})},Y.key))}):null},mt=(C,w)=>{const{col:M,key:Y}=C,re=dr.get(Y)??0,ie=tl(re),se=ie&&re===Ct,ue=(ke==null?void 0:ke.key)===Y?ke.direction:null,ye=y&&!M.disableMenu?e.jsx(Zo,{active:!!ue||ie,canSort:V(M),canHide:!M.locked,sortDir:ue,frozen:ie,onSort:Sr=>we({key:Y,direction:Sr}),onClearSort:()=>we(null),onToggleFreeze:()=>ps(Y),onHide:()=>ys(Y,M.locked)}):null,We=M.align==="right",Dr=M.align==="right"?"flex-end":M.align==="center"?"center":"flex-start",qe=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Dr,overflow:"hidden"},children:[M.icon&&e.jsx(T.Icon,{name:M.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Ar,children:M.title})]});return e.jsx(Q.Th,{className:`sa-tl-leaf${ie?" sa-tl-frozen":""}`,rowSpan:w==null?void 0:w.rowSpan,colSpan:w==null?void 0:w.colSpan,minWidth:M.minWidth,resizable:de?M.resizable:!1,defaultWidth:wr(M,re),style:{textAlign:vr(M.align),width:hr(M,re),position:"sticky",top:(w==null?void 0:w.top)??0,left:ie?ll(re):void 0,zIndex:ie?3:2,backgroundColor:ar,boxShadow:se?Go:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:We?e.jsxs(e.Fragment,{children:[ye,qe]}):e.jsxs(e.Fragment,{children:[qe,ye]})})},`th-${Y}`)},xs=()=>{const C=[];for(let w=0;w<De.length;){const M=De[w],Y=M.col.headerColSpan??1,re=Math.max(1,Math.min(Y,De.length-w));C.push(mt(M,re>1?{colSpan:re}:void 0)),w+=re}return C},hl=C=>e.jsx(Q.Th,{rowSpan:C==null?void 0:C.rowSpan,style:{width:Cr,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(Ze.Checkbox,{size:"sm",variant:il?"indeterminate":"select",checked:St||il,disabled:fr.length===0,onChange:hs,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),ws=(C,w,M)=>{const Y=Ue(C,w);return e.jsx(Q.Td,{className:"sa-tl-frozen",style:{width:Cr,padding:0,position:"sticky",left:0,zIndex:2,...M?{"--sa-tl-bg":M}:{}},children:wt(C,w)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:re=>re.stopPropagation(),children:e.jsx(Ze.Checkbox,{size:"sm",checked:Je.has(Y),onChange:()=>Dt(Y),"aria-label":"Pilih baris"})})},`tl-select-${w}`)},Ft=De.filter(C=>!C.col.hideOnMobile),Et=Ft.find(C=>C.col.primary)??Ft[0],Ds=Ft.filter(C=>C!==Et),Ss=C=>Ce(w=>{const M=new Set(w);return M.has(C)?M.delete(C):M.add(C),M}),fl=(C,w)=>Ds.map(({col:M,key:Y})=>{const re=kt(M,C,w),ie=typeof re=="string"||typeof re=="number"?e.jsx(k.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:re}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:re});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof M.title=="string"?e.jsx(k.Text,{color:"subtle",fontWeight:"medium",style:{color:zn,flexShrink:0},children:M.title}):e.jsx("div",{style:{flexShrink:0},children:M.title}),ie]},Y)}),Mt=(C,w)=>{const M=Et?kt(Et.col,C,w):null;return typeof M=="string"||typeof M=="number"?e.jsx(k.Text,{as:"span",style:Ar,children:M}):e.jsx("span",{style:Ar,children:M})},ks=e.jsx(u.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:I},(C,w)=>e.jsxs(u.Box,{style:{border:br,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(ze.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(ze.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(ze.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${w}`))}),gl=e.jsx(u.Box,{fullWidth:!0,style:{minHeight:(H==null?void 0:H.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:H==null?void 0:H.content}),Bs=z?ks:J.length===0?gl:x==="expand"?e.jsx(u.Box,{style:{display:"flex",flexDirection:"column"},children:J.map((C,w)=>{const M=Ue(C,w),Y=le.has(M),ie=U&&Je.has(M)?gt:zr(n==null?void 0:n(C,w));return e.jsxs("div",{style:{borderBottom:br,backgroundColor:ie},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[wt(C,w)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(Ze.Checkbox,{size:"sm",checked:Je.has(M),onChange:()=>Dt(M),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>Ss(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:[Mt(C,w),e.jsx(T.Icon,{name:Y?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),q&&vs(C,w)]}),Y&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:fl(C,w)})]},M)})}):e.jsx(u.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:J.map((C,w)=>{const M=Ue(C,w),Y=U&&Je.has(M);return e.jsxs(u.Box,{style:{border:br,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:Y?gt:zr(n==null?void 0:n(C,w))},children:[wt(C,w)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(Ze.Checkbox,{size:"sm",checked:Je.has(M),onChange:()=>Dt(M),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:Mt(C,w)})]}):Mt(C,w),fl(C,w),q&&Cs(C,w)]},M)})}),ms=c&&de&&Se!==void 0,ul=s==="fixed"&&!c&&(de?Se!==void 0:!0),Fs=ul&&!de,Qr=D&&D.length>0?D.map((C,w)=>e.jsx(Q.Tr,{children:C.cells.map((M,Y)=>e.jsx(Q.Td,{colSpan:M.colSpan,rowSpan:M.rowSpan,style:{textAlign:vr(M.align)},children:M.content},`tl-foot-${w}-${Y}`))},`tl-foot-${w}`)):null,Es=e.jsxs(Q.Table,{className:"sa-table-layout",fullWidth:!0,size:l,resizable:ms,style:ul?{tableLayout:"fixed"}:void 0,onWidthsChange:Me?oe:void 0,children:[Fs&&e.jsxs("colgroup",{children:[U&&e.jsx("col",{style:{width:Cr}}),De.map(({col:C,key:w},M)=>e.jsx("col",{style:{width:hr(C,M)}},`col-${w}`)),q&&e.jsx("col",{style:{width:1}})]}),e.jsx(Q.Thead,{ref:Le,children:Ne?e.jsxs(e.Fragment,{children:[e.jsxs(Q.Tr,{children:[U&&hl({rowSpan:2}),$e.map(C=>C.isGroup?e.jsx(Q.Th,{colSpan:C.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:ar},children:e.jsx("span",{style:Ar,children:C.col.title})},`grp-${C.key}`):mt(C.leaves[0],{rowSpan:2})),q&&e.jsx(Q.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:ar}})]}),e.jsx(Q.Tr,{children:$e.flatMap(C=>C.isGroup?C.leaves.map(w=>mt(w,{top:Re})):[])})]}):e.jsxs(Q.Tr,{children:[U&&hl(),xs(),q&&e.jsx(Q.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:ar}})]})}),e.jsx(Q.Tbody,{children:z?us:J.length===0?e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:Bt,children:gl})}):e.jsxs(e.Fragment,{children:[J.map((C,w)=>{const M=F==null?void 0:F(C,w,w>0?J[w-1]:void 0),re=U&&Je.has(Ue(C,w))?gt:zr(n==null?void 0:n(C,w));return e.jsxs(h.Fragment,{children:[M!=null&&M!==!1&&e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:Bt,style:{backgroundColor:ar},children:M})}),e.jsxs(Q.Tr,{children:[U&&ws(C,w,re),De.map(({col:ie,key:se},ue)=>{var pl;const ye=(pl=ie.cellProps)==null?void 0:pl.call(ie,C,w,J);if(ye!=null&&ye.hidden)return null;const We=tl(ue),Dr=We&&ue===Ct,qe=kt(ie,C,w),Sr=typeof ie.bg=="function"?ie.bg(C,w,J):ie.bg,yl=zr(Sr)??re;return e.jsx(Q.Td,{className:We?"sa-tl-frozen":void 0,colSpan:ye==null?void 0:ye.colSpan,rowSpan:ye==null?void 0:ye.rowSpan,style:{textAlign:vr(ie.align),width:hr(ie,ue),minWidth:ie.minWidth,position:We?"sticky":void 0,left:We?ll(ue):void 0,zIndex:We?1:void 0,boxShadow:Dr?Go:void 0,...yl?{"--sa-tl-bg":yl}:{}},children:typeof qe=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:vr(ie.align)},children:qe}):qe},`tl-cell-${w}-${se}`)}),q&&e.jsx(Q.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:bs(C,w)})]})]},Ue(C,w))}),A!=null&&e.jsx(Q.Tr,{children:e.jsx(Q.Td,{colSpan:Bt,children:A})})]})}),Qr&&e.jsx(Q.Tfoot,{className:m?"sa-tl-sticky-foot":void 0,children:Qr})]}),Lt=j?J.findIndex((C,w)=>Ue(C,w)===j.rowKey):-1,Tt=Lt>=0?J[Lt]:null;return e.jsxs(e.Fragment,{children:[e.jsx(u.Box,{ref:vt,fullWidth:!0,style:{overflow:"auto",height:B??is},children:te?e.jsxs(e.Fragment,{children:[Bs,Qr&&!z&&J.length>0&&e.jsx(u.Box,{style:{borderTop:br},children:e.jsx(Q.Table,{fullWidth:!0,size:l,className:"sa-table-layout",children:e.jsx(Q.Tbody,{children:Qr})})})]}):Es}),j&&Tt&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:j.top,right:j.right},onClick:C=>C.stopPropagation(),children:Zr(Tt).map(C=>e.jsx("div",{style:{padding:"2px 4px"},children:Gr(C,Tt,Lt,{showLabel:!0,size:"sm"})},C.key))})]})},ut=r=>r==="asc"||r==="desc",_n=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:o="sortOrder",pageKey:n="page",defaultSort:l=null,paramKeys:c,scopeId:s,storage:i=ct}=r,{searchParams:a,setSearchParams:d,searchQueries:y}=Te(),b=a.toString(),p=s?ir.tableSort(s):void 0,v=h.useRef(!1);h.useEffect(()=>{if(v.current||(v.current=!0,!p)||a.has(t)||a.has(o))return;const D=i.get(p);!(D!=null&&D.key)||!ut(D.direction)||d({...Object.fromEntries(a.entries()),[t]:D.key,[o]:D.direction})},[]);const B=h.useMemo(()=>{const D=a.get(t),m=a.get(o);return D&&ut(m)?{key:D,direction:m}:l},[b,t,o,l]);h.useEffect(()=>{if(!p)return;const D=a.get(t),m=a.get(o);D&&ut(m)?i.set(p,{key:D,direction:m}):i.remove(p)},[b,p,t,o,i]);const x=(c==null?void 0:c.sortBy)??"sortBy",L=(c==null?void 0:c.sortOrder)??"sortOrder",F=h.useMemo(()=>B?{[x]:B.key,[L]:B.direction}:{},[B,x,L]),A=h.useCallback(D=>{const m={...y};D?(m[t]=D.key,m[o]=D.direction):(delete m[t],delete m[o]),delete m[n],d(m)},[y,t,o,n,d]);return{sort:B,setSort:A,params:F}},Hr=({of:r,render:t})=>h.Children.toArray(r==null?void 0:r.map((o,n,l)=>t(o,n,l))),ce=({condition:r,fallback:t,children:o,loading:n,isLoading:l})=>e.jsx(e.Fragment,{children:l?n:r?o:t}),ae=r=>e.jsx(k.Text,{...r,fontFamily:"Poppins",fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),Qe=r=>e.jsx(k.Text,{color:"red-600",fontSize:"sm",children:r.message}),qn=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ce,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:l.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ce,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ce,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(Xe.Input,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default",fullWidth:!0}),!c&&l.errorMessage&&e.jsx(Qe,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},Zn=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(ce,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:l.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ce,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ce,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(u.Box,{direction:"column",style:{width:l.inputProps.fullWidth?"100%":t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(lr.Dropdown,{size:r,...l.inputProps,error:!!l.errorMessage})}),!c&&l.errorMessage&&e.jsx(Qe,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},Gn=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Qn=r=>{var i;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))},c=a=>{a.preventDefault(),o(!0)},s=a=>{a.preventDefault(),o(!1)};return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:l,onDragEnter:c,onDragLeave:s,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${Gn(r.errorMessage,r.status)}`},children:[e.jsx(T.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(k.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",children:(i=r.fileSupports)==null?void 0:i.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function Un(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const Uo=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},Jn=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]],c=parseInt(o[2],10);return isNaN(n)||isNaN(l)||isNaN(c)?null:new Date(c,l,n)};function Yn(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,"."),c=n.length===2?l+"."+n[1]:l;return t?"Rp"+c:c}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 Xn=r=>{const t=r.split(" ");let o=t[0].charAt(0);return t.length>1&&(o+=""+t[1].charAt(0)),o.toUpperCase()};function $n(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 Kn="sa-admin",_e=r=>`var(--${Kn}-${r})`,Rn={base:{borderColor:_e("base-border-color"),textColor:_e("base-text-color"),iconColor:_e("base-icon-color"),placeholderColor:_e("base-placeholder-color")},document:{bgColor:_e("document-bg-color")},sidebar:{bgColor:_e("sidebar-bg-color"),borderColor:_e("sidebar-border-color"),maxWidth:_e("sidebar-max-width"),width:_e("sidebar-width"),collapseWidth:_e("sidebar-collapse-width"),collapseV2Width:_e("sidebar-v2-collapse-width")}},ec=24*60*60*1e3,rc=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))},tc=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,oc=/--+/,lc=/-$/;function nc(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function cc(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function sc(r){return/^[A-Za-z\s]+$/.test(r)}const ic=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()},ac=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()},dc=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()},hc=r=>tc.test(r);function fc(r){return!(oc.test(r)||lc.test(r))}const gc=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()},uc=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 yc(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(c=>t.endsWith(c)))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 pc(r){const t=r.split("/");return t[t.length-1]}const bc=r=>{var t,o;return e.jsxs(u.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(ne.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(T.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(ne.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(k.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?pc(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(T.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:yc(((o=r.fileSelected)==null?void 0:o.size.toString())||"100000")}),e.jsx(T.Icon,{name:"Dot",size:"xs"}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:Uo(new Date)})]})]})]}),e.jsx(N.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(T.Icon,{name:"Trash1"})})]})},Jo=({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()},c=be.useMediaQuery("md"),s=r==="error"||typeof o.errorMessage=="string"&&!!o.errorMessage,i=o.label?e.jsxs(ne.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(k.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:o.label}),o.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"4px",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),o.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=o.description?e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.description}):null,d=e.jsxs(e.Fragment,{children:[o.helperText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.helperText}),o.errorText&&r==="error"&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorText}),o.errorMessage&&!o.errorText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorMessage})]}),y=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:v=>{var B;return o.handleOnChangeFile(((B=v.target.files)==null?void 0:B.item(0))||null)},accept:(p=o.fileSupportOption)==null?void 0:p.map(v=>"."+(v==null?void 0:v.toLowerCase())).join(", ")}),b=e.jsxs(u.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...o.containerProps,children:[y,(o.fileSelected||o.defaultFile)&&e.jsx(bc,{fileSelected:o.fileSelected,defaultFile:o.defaultFile,handleOnDeleteFile:o.handleOnDeleteFile,handleOnClickFile:l}),!o.fileSelected&&!o.defaultFile&&e.jsx(Qn,{fileSupports:o.fileSupportOption,isDesktop:c,errorMessage:s?o.errorText||o.errorMessage||" ":void 0,status:s?"error":"default",handleOnClick:l,handleOnFileChange:o.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(ne.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ne.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[i,a]}),e.jsxs(ne.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[b,d]})]}):e.jsxs(ne.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[i,a,b,d]})},Cc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ce,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:l.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ce,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ce,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(Jo,{...l.inputProps,status:l.errorMessage?"error":"default"}),!c&&l.errorMessage&&e.jsx(Qe,{message:l.errorMessage})]})]})},vc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...c})=>{var a,d,y,b;const s=c.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(ce,{condition:!!l,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:c.title}),e.jsx(He.Body3,{props:{color:"gray-500"},children:c.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:c.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ce,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(me.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(y=c.tooltip)==null?void 0:y.arrowPosition,...c.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ce,{condition:!!c.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsx(u.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(Hr,{of:(b=c.checkBoxesList)==null?void 0:b.map(p=>({...p,isChecked:c.checkBoxesAreChecked.includes(p.id)})),render:p=>p.renderBadge?e.jsxs(u.Box,{direction:"row",justify:"space-between",gap:"lg",...c.badgeContainerProps,children:[e.jsx(Ze.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:v=>c.onChecked(v.target.value,p),label:p.name,description:p.description}),p.renderBadge]}):e.jsx(Ze.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:v=>c.onChecked(v.target.value,p),label:p.name,description:p.description})})}),!s&&c.errorMessage&&e.jsx(Qe,{message:c.errorMessage})]})},xc=({position:r="vertical",size:t="md",fullWidth:o=!1,...n})=>{var c;const l=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(ce,{condition:!!n.description||!!n.title,children:e.jsxs(u.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[n.title&&e.jsx(ae,{children:n.title}),e.jsx(ce,{condition:!!n.description,children:e.jsx(k.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(u.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(Hr,{of:(c=n.radioList)==null?void 0:c.map(s=>({...s,isChecked:n.radioIsChecked===s.id})),render:({value:s,id:i,isChecked:a,subInput:d,label:y,description:b})=>e.jsxs(u.Box,{direction:"column",gap:"xs",customMaxWidth:l,children:[e.jsx(Jr.Radio,{id:`${i.toString()}-${s}`,name:n.groupName||y,label:y,value:s,checked:a,onChange:p=>n.onChecked({id:i,label:p.target.name,value:p.target.value}),disabled:n.disableAll},i),b&&e.jsx(k.Text,{color:"gray-500",style:{marginLeft:28},children:b}),d]})})}),n.errorMessage&&e.jsx(Qe,{message:n.errorMessage})]})},wc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ce,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:l.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ce,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ce,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(Ur.Textarea,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default"}),!c&&l.errorMessage&&e.jsx(Qe,{message:l.errorMessage})]})]})},Dc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",required:n=!1,fullWidth:l=!1,...c})=>{var i,a,d;const s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(ce,{condition:n,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:l,children:[e.jsx(ae,{children:c.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:l,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:c.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ce,{condition:!!((i=c.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=c.tooltip)==null?void 0:a.label,arrowPosition:(d=c.tooltip)==null?void 0:d.arrowPosition,...c.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ce,{condition:!!c.titleDescription,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})})]})}),e.jsx(sr.Toggle,{checked:c.checked,onChange:c.onChange,label:c.label,description:c.description}),c.errorMessage&&e.jsx(Qe,{message:c.errorMessage})]})},Sc=({variant:r="primary",size:t="md",...o})=>{const n=cr.useColor(),l=s=>{var a,d,y,b,p,v;if(!s)return;const i=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=(y=n==null?void 0:n.computed)==null?void 0:y.blue)==null?void 0:b[700]:(v=(p=n==null?void 0:n.computed)==null?void 0:p.gray)==null?void 0:v[50];return e.jsx(T.Icon,{name:s,size:t,style:{color:i}})},c=()=>{var i,a,d,y;if(r!=="secondary-danger"&&r!=="secondary-primary")return o.title;const s={color:o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(i=n==null?void 0:n.computed)==null?void 0:i.red)==null?void 0:a[600]:(y=(d=n==null?void 0:n.computed)==null?void 0:d.blue)==null?void 0:y[700]};switch(t){case"xs":return e.jsx(He.Body2,{props:{style:s},children:o.title});case"sm":case"md":return e.jsx(He.SubH3,{props:{style:s},children:o.title});case"lg":return e.jsx(He.SubH2,{props:{style:s},children:o.title});default:return o.title}};return e.jsx(N.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:c()})},kc=r=>e.jsx(He.H5,{props:{...r},children:r.title}),Bc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(ce,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ae,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:l.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ce,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ce,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{width:t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(er.StarasiaDate,{size:r,...l.inputProps,status:l.errorMessage?"error":void 0})}),!c&&l.errorMessage&&e.jsx(Qe,{message:l.errorMessage})]})]})};async function mc(r,t){const o=new Image;o.src=r,await new Promise((c,s)=>{o.onload=c,o.onerror=s});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((c,s)=>{n.toBlob(i=>{if(!i)return s("Canvas is empty");const a=new File([i],"cropped.png",{type:"image/png"});c(a)},"image/png")})}const Yo={"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},Xo=h.forwardRef(({handleUpload:r,urlImage:t,isUploading:o,croppedImage:n,setCroppedImage:l,size:c="96",aspect:s="1:1",containerProps:i,maxFileSize:a=2,onError:d},y)=>{const b=be.useMediaQuery("md"),[p,v]=h.useState(!1),[B,x]=h.useState(null),[L,F]=h.useState(!1),[A,D]=h.useState({x:0,y:0}),[m,H]=h.useState(1),[z,I]=h.useState(null);h.useEffect(()=>{t===null&&l(null)},[t]);const E=h.useCallback((j,Z)=>{I(Z)},[]),U=j=>{var Ce;const Z=(Ce=j.target.files)==null?void 0:Ce[0];if(!Z)return;const le=new FileReader;le.onload=()=>{x(le.result),F(!0)},le.readAsDataURL(Z)},X=async()=>{if(!(!B||!z))try{const j=await mc(B,z);if(a&&j.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(j);const Z=URL.createObjectURL(j);l(Z,j),F(!1)}catch{d==null||d("Gagal memproses gambar")}},G=h.useRef(null),R=()=>{G.current&&G.current.click()};h.useImperativeHandle(y,()=>({openFileDialog:()=>{var j;(j=G.current)==null||j.click()}}));const _=parseInt(c,10),K=Yo[s];let te,q;return K>=1?(q=_,te=_*K):(te=_,q=_/K),e.jsxs(u.Box,{direction:"column",display:"flex",position:"relative",bg:(i==null?void 0:i.bg)||"gray-200",borderStyle:(i==null?void 0:i.borderStyle)||"border-none",borderColor:(i==null?void 0:i.borderColor)||"gray-200",borderWidth:(i==null?void 0:i.borderWidth)||"border-2",borderRadius:(i==null?void 0:i.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:i!=null&&i.fullWidth?"100%":`${te}px`,height:i!=null&&i.fullWidth?"auto":`${q}px`,aspectRatio:K,flexShrink:0},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),children:[n||t?e.jsx("img",{src:n||t||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(u.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(T.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(c)/2<40?Number(c)/2:40,height:Number(c)/2<40?Number(c)/2:40}})}),e.jsxs(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214a)",opacity:p?1:0,transition:"opacity 0.3s ease-in-out"},onClick:R,children:[e.jsx("input",{ref:G,type:"file",accept:"image/*",onChange:U,disabled:o,style:{display:"none"}}),e.jsxs(u.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(T.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(ce,{condition:c.toNumber()>80,children:e.jsx(k.Text,{color:"gray-50",fontSize:c.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),o&&e.jsx(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f640)"},children:e.jsx(u.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),L&&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:()=>F(!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?s==="1:1"?"min(90vw, 480px)":`min(90vw, ${te*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:j=>j.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:B&&e.jsx(bl,{image:B,crop:A,zoom:m,aspect:s?Yo[s]:void 0,onCropChange:D,onZoomChange:H,onCropComplete:E,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(N.Button,{size:"sm",secondary:!0,onClick:()=>F(!1),children:"Cancel"}),e.jsx(N.Button,{size:"sm",primary:!0,onClick:X,children:"Crop"})]})]})}),document.body)]})}),Fc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...c})=>{var a,d,y;const s=c.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(ce,{condition:!!l,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ae,{children:c.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:c.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ce,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(me.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(y=c.tooltip)==null?void 0:y.arrowPosition,...c.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ce,{condition:!!c.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(Xo,{...c.inputProps}),!s&&c.errorMessage&&e.jsx(Qe,{message:c.errorMessage})]})]})},Ec=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var s,i,a;const c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ce,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ae,{children:l.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ae,{fontSize:r,children:l.title}),e.jsx(ae,{color:"error",fontSize:r,children:o}),e.jsx(ce,{condition:!!((s=l.tooltip)!=null&&s.label),children:e.jsx(me.Tooltip,{label:(i=l.tooltip)==null?void 0:i.label,arrowPosition:(a=l.tooltip)==null?void 0:a.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ce,{condition:!!l.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),l.inputProps.extended&&l.inputProps.extended]})},Mc=({items:r,id:t,handleOnUpdate:o,width:n,toggleShow:l=!0,disabled:c=!1})=>{var y;const[s,i]=h.useState([]);h.useEffect(()=>{r&&i([...r.map(b=>({id:b.id,isActive:b.isActive}))])},[r]);const a=(y=s.find(b=>b.id===t))==null?void 0:y.isActive,d=h.useCallback(()=>{i(b=>b.map(p=>p.id===t?{...p,isActive:!p.isActive}:p)),o&&o(!a)},[t,o,a]);return e.jsx(u.Box,{direction:"row",gap:"md",style:{width:n},children:l&&e.jsx(sr.Toggle,{disabled:c,checked:a,onChange:d,label:a?"Active":"Inactive"})})},Lc={InputText:qn,InputDropdown:Zn,InputSingleFile:Cc,CheckBoxOptions:vc,RadioOptions:xc,InputTextArea:wc,ToggleForm:Dc,ActionButton:Sc,FormTitle:kc,InputDate:Bc,InputImgFile:Fc,Custom:Ec},$o=({customBottom:r})=>{const[t,o]=h.useState(!1),n=()=>{window.scrollY>window.screenY?o(!0):o(!1)},l=()=>{window.scrollTo({top:0,behavior:"smooth"})};return h.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(u.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(u.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(N.Button,{secondary:!0,size:"xs",onClick:l,type:"button",iconLeft:e.jsx(T.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Ie="sa-sidepanel-item",Ko="sa-sidepanel-item-styles",Tc=`
|
|
58
58
|
.${Ie} {
|
|
59
59
|
display: block;
|
|
60
60
|
box-sizing: border-box;
|
|
@@ -105,4 +105,4 @@
|
|
|
105
105
|
cursor: not-allowed;
|
|
106
106
|
opacity: 0.55;
|
|
107
107
|
}
|
|
108
|
-
`;function Ic(){if(typeof document>"u"||document.getElementById(Ko))return;const r=document.createElement("style");r.id=Ko,r.textContent=Tc,document.head.appendChild(r)}const Oc=({active:r=!1,accentSide:t="left",onClick:o,title:n,badge:l,heading:c,meta:s,children:i,divider:a=!0,disabled:d,className:p,style:b,"aria-label":u})=>(h.useEffect(Ic,[]),e.jsx("button",{type:"button",className:[Ie,p].filter(Boolean).join(" "),"data-active":r?"true":"false","data-accent":t,"data-divider":a?"true":"false","aria-current":r?"true":void 0,"aria-label":u,disabled:d,onClick:o,style:b,children:i??e.jsxs(y.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(n||l)&&e.jsxs(le.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[n?e.jsx(k.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:n}):e.jsx("span",{}),l?e.jsx(y.Box,{style:{flexShrink:0},children:l}):null]}),c?e.jsx(k.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:c}):null,s?e.jsx(k.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:s}):null]})})),yt=18,Wc=40,Ro="280ms cubic-bezier(0.4, 0, 0.2, 1)",el="var(--sa-border-subtle, #0b120e24)",Ac=`1px solid ${el}`,rl="var(--sa-background-white, #ffffff)",zc=({children:r,header:t,collapsed:o,defaultCollapsed:n=!1,onToggle:l,width:c=337,side:s="left",offsetTop:i="4rem",height:a,showToggle:d=!0,togglePosition:p="top",toggleOffset:b=40,toggleLabel:u,style:v,bodyStyle:B,className:x,pageLayout:L,overlay:F="mobile",wrapperProps:A,contentProps:D})=>{const m=Ce.useMediaQuery("md"),H=o!==void 0,[z,I]=h.useState(n),E=H?o:z,Z=()=>{const ce=!E;H||I(ce),l==null||l(ce)},$=s==="left",P=typeof i=="number"?`${i}px`:i,_=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${P})`,U=u??{collapse:"Collapse panel",expand:"Expand panel"},K=p==="center"?{top:"50%",transform:"translateY(-50%)"}:p==="bottom"?{bottom:b}:{top:b},te=E?$?"ChevronRight":"ChevronLeft":$?"ChevronLeft":"ChevronRight",Y=L!==void 0&&(F==="mobile"?!m:F),Q=Y?{position:"absolute",top:0,bottom:0,width:c,transform:`translateX(${E?$?"-100%":"100%":"0"})`,transition:`transform ${Ro}`,zIndex:50,...$?{left:0}:{right:0},...v}:{position:"sticky",top:P,alignSelf:"flex-start",width:E?0:c,flexShrink:0,height:_,transition:`width ${Ro}`,...v},J=e.jsxs(y.Box,{className:x,style:Q,children:[e.jsx(y.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:E?void 0:$?"border-solid-r":"border-solid-l",borderWidth:E?void 0:$?"border-r":"border-l",style:{backgroundColor:rl,borderColor:el},children:e.jsxs(y.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:c,customMinWidth:c,style:$?void 0:{marginLeft:"auto"},children:[t?e.jsx(y.Box,{padding:"md",style:{flexShrink:0},children:t}):null,e.jsx(y.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...B},children:r})]})}),d&&e.jsx(yr,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:Z,"aria-label":E?U.expand:U.collapse,"aria-expanded":!E,"aria-pressed":E,customWidth:yt,customHeight:Wc,style:{...K,backgroundColor:rl,border:Ac,zIndex:5,...$?{right:-yt,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-yt,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(T.Icon,{name:te,size:"sm"})})]});return L===void 0?J:e.jsxs(y.Box,{direction:"row",position:"relative",...A,style:{height:`calc(100vh - ${P})`,overflow:"hidden",...(A==null?void 0:A.style)??{}},children:[!Y&&$?J:null,e.jsx(y.Box,{display:"block",...D,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(D==null?void 0:D.style)??{}},children:L}),!Y&&!$?J:null,Y&&e.jsxs(e.Fragment,{children:[!E&&e.jsx("div",{onClick:Z,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),J]})]})},Hc=({pageLayout:r,children:t,wrapperProps:o,containerProps:n})=>{const l=Ce.useMediaQuery("md"),c=(n==null?void 0:n.customWidth)??264;return e.jsxs(y.Box,{display:"block",direction:"row",...o,style:{marginRight:l?c:24,...(o==null?void 0:o.style)??{}},children:[r,e.jsx(y.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:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},pt="--sa-floating-footer-height",Vc=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:o,containerProps:n})=>{const l=h.useRef(null);return h.useLayoutEffect(()=>{const c=document.documentElement,s=()=>{var d;const a=((d=l.current)==null?void 0:d.getBoundingClientRect().height)??0;c.style.setProperty(pt,`${a}px`)};s();const i=new ResizeObserver(s);return l.current&&i.observe(l.current),()=>{i.disconnect(),c.style.removeProperty(pt)}},[]),e.jsx(y.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(y.Box,{ref:l,position:"fixed",bottom:"bottom-0",right:"right-0",bg:"white",direction:"row",align:"center",display:"flex",paddingBlock:"sm",paddingInline:"md",borderColor:"border-subtle",style:{left:"var(--app-sidebar-width, 0px)",transition:"left 0.3s ease-in-out"},justify:(n==null?void 0:n.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx($o,{...o,customBottom:(o==null?void 0:o.customBottom)||"5.7rem"}),r]})})},Pc=({fields:r})=>e.jsx(y.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(Hr,{of:r,render:(t,o)=>e.jsx(jc,{...t},o)})}),jc=({title:r,value:t,icon:o})=>e.jsxs(y.Box,{display:"flex",direction:"column",gap:"sm",children:[o?e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(T.Icon,{name:o,color:"subtle"}),e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(k.Text,{variant:"sub-h3",children:t}):t]}),ke={silhouette:"#A7B0AC",accent:"#78867F"};function Nc({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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.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:ke.accent,fillOpacity:"0.65"})]})})}const _c=({title:r="create",children:t,onClickAction:o,variant:n="primary",variantTitle:l,leftIcon:c,showButton:s=!0,customHeight:i,childrenButton:a,customIcon:d})=>{const p=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:c?e.jsx(N.Button,{primary:!0,iconLeft:c,onClick:o,children:a||r}):e.jsx(N.Button,{primary:!0,onClick:o,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:c?e.jsx(N.Button,{secondary:!0,iconLeft:c,onClick:o,children:l?e.jsx(k.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(N.Button,{secondary:!0,onClick:o,children:a||r})});case"success":return e.jsx(e.Fragment,{children:c?e.jsx(N.Button,{success:!0,iconLeft:c,onClick:o,children:a||r}):e.jsx(N.Button,{success:!0,onClick:o,children:a||r})});default:return e.jsx(e.Fragment,{children:c?e.jsx(N.Button,{primary:!0,iconLeft:c,onClick:o,children:a||r}):e.jsx(N.Button,{primary:!0,onClick:o,children:a||r})})}};return e.jsxs(y.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:i,children:[d||e.jsx(Nc,{}),e.jsx(y.Box,{direction:"column",children:t.map((b,u)=>e.jsx(He.Body1,{props:{align:"center",textAlign:"center"},children:u>2?null:b},u))}),s?p():null]})},R={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function qc({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 Zc({onClick:r}){const t=Ce.useMediaQuery("md");return e.jsxs(y.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(qc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(N.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const ee={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 Gc({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:ee.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:ee.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:ee.cEFF3F8,stroke:ee.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:ee.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:ee.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:ee.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:ee.c956847,stroke:ee.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:ee.c956847,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.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:ee.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:ee.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:ee.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:ee.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:ee.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:ee.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:ee.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:ee.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:ee.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:ee.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:ee.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:ee.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function Qc({onClick:r}){const t=Ce.useMediaQuery("md");return e.jsxs(y.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(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(N.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const f={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 Uc({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:f.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:f.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:f.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:f.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.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:f.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.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:f.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.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:f.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:f.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:f.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:f.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:f.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:f.c000D58,stroke:f.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:f.c000D58,stroke:f.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:f.cFFFFFF,stroke:f.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:f.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:f.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:f.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:f.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:f.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:f.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:f.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Jc({onClick:r}){const t=Ce.useMediaQuery("md");return e.jsxs(y.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Uc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(N.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const Yc=r=>{var o,n,l,c,s;const t=Ce.useMediaQuery("md");return e.jsxs(Ae.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(Ae.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(k.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Ae.DialogBody,{children:typeof r.description=="string"?e.jsx(k.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(Ae.DialogFooter,{children:e.jsx(y.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(y.Box,{display:"flex",direction:((l=r.wrapperConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((c=r.wrapperConfirmBtnProps)==null?void 0:c.justify)||"flex-end",gap:((s=r.wrapperConfirmBtnProps)==null?void 0:s.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(N.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(y.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(N.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},Xc=h.memo(({children:r,height:t,minHeight:o,customHeight:n,paddingInline:l="spacing-0",paddingBlock:c="spacing-0",header:s,footer:i,title:a,titleTag:d,action:p,actionContainer:b,containerProps:u,bodyProps:v,headerProps:B={borderBottom:!0},footerProps:x={borderTop:!0},variantTag:L="info"})=>{const F=h.useRef(null),[A,D]=h.useState("100vh");h.useEffect(()=>{const I=()=>{if(F.current){const E=F.current.getBoundingClientRect().top;D(`calc(100vh - ${E}px)`)}};return I(),window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]);const m=()=>d?e.jsxs(y.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:a}),e.jsx(Ye.Badges,{border:!0,text:d,variant:L})]}):e.jsx(k.Text,{fontWeight:"medium",children:a}),H=()=>s||e.jsxs(y.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(y.Box,{direction:"column",children:a?m():null}),e.jsx(y.Box,{direction:"column",...b,children:p??null})]}),z=!!(s||a||p);return e.jsxs(y.Box,{ref:F,height:t,customMinHeight:o,customHeight:n,paddingBlock:c,paddingInline:l,bg:"white",direction:"column",...u,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:A,...(u==null?void 0:u.style)??{}},children:[s!==null&&z?e.jsx(ot,{...B,children:H()}):null,e.jsx(y.Box,{direction:"column",padding:"spacing-0",...v,style:{flex:1,overflow:"auto",...(v==null?void 0:v.style)??{}},children:r}),i?e.jsx(lt,{...x,children:i}):null]})}),$c=h.memo(({value:r,options:t=[],onChange:o,multiple:n})=>{const l=(r==null?void 0:r.map(i=>i.value))||[],c=(t==null?void 0:t.filter(i=>l.includes(i.value)))||[],s=i=>{const a=[...c];let d=[];n?d=l.includes(i.value)?a.filter(p=>p.value!==i.value):[...a,i]:d=[i],o==null||o(d)};return e.jsx(y.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((i,a)=>e.jsx(N.Button,{...l.includes(i.value)?{primary:!0}:{secondary:!0},onClick:()=>s(i),children:i.label},a))})});function Vr(r){return null}Vr.displayName="LayoutDialog.Header";function Pr(r){return null}Pr.displayName="LayoutDialog.Body";function jr(r){return null}jr.displayName="LayoutDialog.Aside";function Nr(r){return null}Nr.displayName="LayoutDialog.Footer";const Fe={"lyd-root":"_lyd-root_14rlp_1","lyd-backdrop":"_lyd-backdrop_14rlp_34","lyd-panel":"_lyd-panel_14rlp_43","lyd-modal":"_lyd-modal_14rlp_54","lyd-fullscreen":"_lyd-fullscreen_14rlp_64","lyd-sidebar":"_lyd-sidebar_14rlp_72","lyd-header":"_lyd-header_14rlp_100","lyd-header-content":"_lyd-header-content_14rlp_111","lyd-header-actions":"_lyd-header-actions_14rlp_119","lyd-main":"_lyd-main_14rlp_126","lyd-body":"_lyd-body_14rlp_133","lyd-aside":"_lyd-aside_14rlp_139","lyd-footer":"_lyd-footer_14rlp_155","lyd-vm-group":"_lyd-vm-group_14rlp_168","lyd-vm-btn":"_lyd-vm-btn_14rlp_176","lyd-close-btn":"_lyd-close-btn_14rlp_199"},Kc=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(es,{})},{mode:"modal",label:"Modal",icon:e.jsx(T.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(T.Icon,{name:"Fullscreen",size:"sm"})}];function Rc({value:r,onChange:t}){return e.jsx("div",{className:Fe["lyd-vm-group"],role:"group","aria-label":"View mode",children:Kc.map(o=>e.jsx("button",{type:"button",className:Fe["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.icon},o.mode))})}function es(){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 bt={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function rs(r){return r?r in bt?bt[r]:r:bt.xl}function _r(r,t){let o=null;return h.Children.forEach(r,n=>{h.isValidElement(n)&&n.type===t&&(o=n.props.children??null)}),o}function ts(r){const{isOpen:t,onClose:o,viewMode:n,defaultViewMode:l="modal",onViewModeChange:c,showViewModeToggle:s=!0,showCloseButton:i=!0,size:a,asideWidth:d,disableEscapeClose:p=!1,disableBackdropClose:b=!1,lockBodyScroll:u=!0,children:v}=r,[B,x]=h.useState(l),L=n??B,A=Ce.useMediaQuery("md")?L:"fullscreen",D=h.useCallback(_=>{n===void 0&&x(_),c==null||c(_)},[n,c]),m=h.useRef(null);h.useEffect(()=>{if(!(!t||!u))return m.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=m.current??""}},[t,u]),h.useEffect(()=>{if(!t||p)return;const _=U=>{U.key==="Escape"&&o()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[t,p,o]);const H=h.useMemo(()=>_r(v,Vr),[v]),z=h.useMemo(()=>_r(v,Pr),[v]),I=h.useMemo(()=>_r(v,jr),[v]),E=h.useMemo(()=>_r(v,Nr),[v]);if(!t)return null;const Z=[Fe["lyd-panel"],A==="modal"&&Fe["lyd-modal"],A==="fullscreen"&&Fe["lyd-fullscreen"],A==="sidebar"&&Fe["lyd-sidebar"]].filter(Boolean).join(" "),$={"--lyd-max-w":rs(a),...d!==void 0&&{"--lyd-aside-w":d}},P=()=>{b||o()};return e.jsxs("div",{className:Fe["lyd-root"],style:$,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:Fe["lyd-backdrop"],onClick:P,"aria-hidden":"true"}),e.jsxs("div",{className:Z,children:[e.jsxs("div",{className:Fe["lyd-header"],children:[e.jsx("div",{className:Fe["lyd-header-content"],children:H}),e.jsxs("div",{className:Fe["lyd-header-actions"],children:[s&&e.jsx(Rc,{value:L,onChange:D}),i&&e.jsx("button",{type:"button",className:Fe["lyd-close-btn"],onClick:o,"aria-label":"Close dialog",children:e.jsx(T.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:Fe["lyd-main"],children:[e.jsx("div",{className:Fe["lyd-body"],children:z}),I&&e.jsx("aside",{className:Fe["lyd-aside"],children:I})]}),E&&e.jsx("div",{className:Fe["lyd-footer"],children:E})]})]})}const xr=ts;xr.Header=Vr,xr.Body=Pr,xr.Aside=jr,xr.Footer=Nr;function os({url:r,filename:t,onClose:o}){return h.useEffect(()=>{const n=l=>{l.key==="Escape"&&o()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[o]),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:n=>n.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:n=>n.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 ls=r=>{const{defaultTab:t=0,paramKey:o="tab"}=r||{},{useSearchParams:n}=Ge(),[l,c]=n(),s=nr.searchParamsToObject(l.toString());return{activeTab:s[o]?parseInt(s[o]):t,handleTabChange:d=>{c({...s,[o]:d.toString()})},searchQueries:s}};function ns({appName:r,menuConfig:t,formatTitle:o}){const{useLocation:n}=Ge(),l=n();h.useEffect(()=>{let c=null,s=null;for(const d of t){const p=d.items.find(b=>b.to?b.to==="/"?l.pathname==="/":!!(b.to===l.pathname||l.pathname.startsWith(b.to+"/")):!1);if(p){c=p,s=d;break}}const i=[];c!=null&&c.title&&i.push(c.title),s!=null&&s.name&&i.push(s.name.toTitleCase());const a=(d,p)=>d.length>0?`${d.join(" - ")} | ${p}`:p;document.title=(o||a)(i,r)},[l.pathname])}const cs=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=Ge(),[n,l]=r(),c=nr.searchParamsToObject(n.toString()),s=t(),i=o(),a=s.id;return{setSearchParams:l,searchParams:n,searchQueries:c,isHasQuery:(v,B)=>n.has(v)&&n.get(v)===B,getQueryParam:v=>n.get(v),getRouteParam:v=>s[v],params:s,location:i,id:a,hasId:!!a}};function ss(r){var n,l;const t=r.decodedAccessToken;return h.useMemo(()=>{var a,d;const c=((d=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:d.code)??"",s=Object.keys(r.role).reduce((p,b)=>{const u=`is${b.toLowerCase().replace(/(^\w|_\w)/g,v=>v.replace("_","").toUpperCase())}`;return{...p,[u]:!1}},{});return{...Object.keys(r.role).reduce((p,b)=>{const u=`is${b.toLowerCase().replace(/(^\w|_\w)/g,v=>v.replace("_","").toUpperCase())}`;return{...p,[u]:c===r.role[b]}},s),hasRole:p=>c===r.role[p],getRoleKey:()=>c}},[(l=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:l.code,r])}g.AdvanceFilterBar=Do,g.App=vl,g.AppComponent=Xt,g.AppContext=Xr,g.AppLayout=Sl,g.AsideBar=Hc,g.BackButton=Bl,g.ColumnFilterDropdown=jo,g.ColumnMenu=Zo,g.ConfirmationDialog=Yc,g.DataTable=_o,g.DecisionWrapper=ne,g.EachUtils=Hr,g.EmptyStatePage=_c,g.FLOATING_FOOTER_HEIGHT_VAR=pt,g.FilterBar=wn,g.FilterDrawer=wo,g.FloatingFooter=Vc,g.ForbiddenPage=Qc,g.Form=Lc,g.FullSection=Xc,g.HeaderLeftSlot=xl,g.HeaderLeftSlotOutlet=Rt,g.HeaderLeftSlotProvider=Kt,g.HorizontalField=Ll,g.ImagePreview=os,g.InputFile=Jo,g.InputImage=Xo,g.LayoutDialog=xr,g.LayoutDialogAside=jr,g.LayoutDialogBody=Pr,g.LayoutDialogFooter=Nr,g.LayoutDialogHeader=Vr,g.ModuleSwitcher=ml,g.ModuleSwitcherModal=fo,g.NotFoundPage=Zc,g.PageLayout=Ol,g.Pressable=yr,g.RightDrawer=uo,g.ScrollToTopButton=$o,g.Section=Hl,g.SectionFooter=lt,g.SectionHeader=ot,g.SelectButton=$c,g.ServerErrorPage=Jc,g.SidePanel=zc,g.SidePanelItem=Oc,g.SidebarBadgesProvider=qt,g.SidebarGroupSlot=wl,g.SidebarGroupSlotOutlet=ro,g.SidebarGroupSlotProvider=eo,g.SidebarHeaderSlot=$t,g.SidebarProvider=Qt,g.StarasiaRouterProvider=Yt,g.TableFooter=Po,g.TableHeader=Vo,g.TableLayout=Nn,g.TableSection=Wn,g.TableWrapper=Ho,g.ToggleStatus=Mc,g.Typography=He,g.VerticalField=Pc,g.clearModuleSelection=Dl,g.createInitialFromUserName=Un,g.cssVars=Rn,g.expandDateCompact=En,g.formHasChanged=nc,g.formatDate=$n,g.formatDateToIndonesian=Uo,g.formatRupiah=Yn,g.getDateFilterValue=xo,g.getDateRangeFilterValue=Nl,g.getInitials=Xn,g.getValueDropdownMultipleFilter=vo,g.getValueRadioFilter=jl,g.getValueSearch=Mr,g.getValuesFilter=Er,g.handleChangeFilter=pr,g.handleOnScroll=uc,g.isEmail=hc,g.isFilterActive=_l,g.isOnlyLettersAndSpaces=sc,g.isPhoneNumber=cc,g.isSlug=fc,g.localStorageAdapter=ct,g.oneDayInMs=ec,g.parseIndonesianDateToDate=Jn,g.preventNonCoordinateInput=gc,g.preventNonNumberAndDecimalInput=dc,g.preventNonNumberInput=ic,g.preventNumberInput=ac,g.resolveDateRangeValueToString=bo,g.resolveDateValueToString=Co,g.resolveDropdownValueToString=yo,g.resolveRadioValueToString=po,g.resolveSidebarBadge=Br,g.storageKeys=ir,g.textWidth=rc,g.useApp=$r,g.useAppState=Nt,g.useAuthRole=ss,g.useDynamicTitle=ns,g.useFilterBarApiParams=Bn,g.useFilterBarControls=Fn,g.useModuleSelection=rt,g.useRouteInfo=Te,g.useRouteParams=cs,g.useRouterAdapter=Ge,g.useSidebar=Ut,g.useSidebarBadges=Zt,g.useTabState=ls,g.useTableSortApiParams=_n,Object.keys(tr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>tr[r]})}),Object.keys(Ye).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ye[r]})}),Object.keys(y).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>y[r]})}),Object.keys(or).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>or[r]})}),Object.keys(N).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>N[r]})}),Object.keys(It).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>It[r]})}),Object.keys(er).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>er[r]})}),Object.keys(Ae).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ae[r]})}),Object.keys(kr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>kr[r]})}),Object.keys(lr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>lr[r]})}),Object.keys(Ce).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ce[r]})}),Object.keys(nr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>nr[r]})}),Object.keys(Xe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Xe[r]})}),Object.keys(W).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>W[r]})}),Object.keys(gr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>gr[r]})}),Object.keys(ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ur[r]})}),Object.keys(q).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>q[r]})}),Object.keys(Ot).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ot[r]})}),Object.keys(Ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ur[r]})}),Object.keys(cr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>cr[r]})}),Object.keys(Wt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Wt[r]})}),Object.keys(sr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>sr[r]})}),Object.keys(me).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>me[r]})}),Object.keys(Ze).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ze[r]})}),Object.keys(Jr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Jr[r]})}),Object.keys(k).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>k[r]})}),Object.keys(T).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>T[r]})}),Object.keys(le).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>le[r]})}),Object.keys(At).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>At[r]})}),Object.keys(zt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>zt[r]})}),Object.keys(Ht).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ht[r]})}),Object.keys(Vt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Vt[r]})}),Object.keys(Pt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Pt[r]})}),Object.keys(ze).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ze[r]})}),Object.keys(jt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>jt[r]})}),Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
108
|
+
`;function Ic(){if(typeof document>"u"||document.getElementById(Ko))return;const r=document.createElement("style");r.id=Ko,r.textContent=Tc,document.head.appendChild(r)}const Oc=({active:r=!1,accentSide:t="left",onClick:o,title:n,badge:l,heading:c,meta:s,children:i,divider:a=!0,disabled:d,className:y,style:b,"aria-label":p})=>(h.useEffect(Ic,[]),e.jsx("button",{type:"button",className:[Ie,y].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:i??e.jsxs(u.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(n||l)&&e.jsxs(ne.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[n?e.jsx(k.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:n}):e.jsx("span",{}),l?e.jsx(u.Box,{style:{flexShrink:0},children:l}):null]}),c?e.jsx(k.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:c}):null,s?e.jsx(k.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:s}):null]})})),yt=18,Wc=40,Ro="280ms cubic-bezier(0.4, 0, 0.2, 1)",el="var(--sa-border-subtle, #0b120e24)",Ac=`1px solid ${el}`,rl="var(--sa-background-white, #ffffff)",zc=({children:r,header:t,collapsed:o,defaultCollapsed:n=!1,onToggle:l,width:c=337,side:s="left",offsetTop:i="4rem",height:a,showToggle:d=!0,togglePosition:y="top",toggleOffset:b=40,toggleLabel:p,style:v,bodyStyle:B,className:x,pageLayout:L,overlay:F="mobile",wrapperProps:A,contentProps:D})=>{const m=be.useMediaQuery("md"),H=o!==void 0,[z,I]=h.useState(n),E=H?o:z,U=()=>{const le=!E;H||I(le),l==null||l(le)},X=s==="left",G=typeof i=="number"?`${i}px`:i,R=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${G})`,_=p??{collapse:"Collapse panel",expand:"Expand panel"},K=y==="center"?{top:"50%",transform:"translateY(-50%)"}:y==="bottom"?{bottom:b}:{top:b},te=E?X?"ChevronRight":"ChevronLeft":X?"ChevronLeft":"ChevronRight",q=L!==void 0&&(F==="mobile"?!m:F),j=q?{position:"absolute",top:0,bottom:0,width:c,transform:`translateX(${E?X?"-100%":"100%":"0"})`,transition:`transform ${Ro}`,zIndex:50,...X?{left:0}:{right:0},...v}:{position:"sticky",top:G,alignSelf:"flex-start",width:E?0:c,flexShrink:0,height:R,transition:`width ${Ro}`,...v},Z=e.jsxs(u.Box,{className:x,style:j,children:[e.jsx(u.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:E?void 0:X?"border-solid-r":"border-solid-l",borderWidth:E?void 0:X?"border-r":"border-l",style:{backgroundColor:rl,borderColor:el},children:e.jsxs(u.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:c,customMinWidth:c,style:X?void 0:{marginLeft:"auto"},children:[t?e.jsx(u.Box,{padding:"md",style:{flexShrink:0},children:t}):null,e.jsx(u.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...B},children:r})]})}),d&&e.jsx(yr,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:U,"aria-label":E?_.expand:_.collapse,"aria-expanded":!E,"aria-pressed":E,customWidth:yt,customHeight:Wc,style:{...K,backgroundColor:rl,border:Ac,zIndex:5,...X?{right:-yt,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-yt,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(T.Icon,{name:te,size:"sm"})})]});return L===void 0?Z:e.jsxs(u.Box,{direction:"row",position:"relative",...A,style:{height:`calc(100vh - ${G})`,overflow:"hidden",...(A==null?void 0:A.style)??{}},children:[!q&&X?Z:null,e.jsx(u.Box,{display:"block",...D,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(D==null?void 0:D.style)??{}},children:L}),!q&&!X?Z:null,q&&e.jsxs(e.Fragment,{children:[!E&&e.jsx("div",{onClick:U,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),Z]})]})},Hc=({pageLayout:r,children:t,wrapperProps:o,containerProps:n})=>{const l=be.useMediaQuery("md"),c=(n==null?void 0:n.customWidth)??264;return e.jsxs(u.Box,{display:"block",direction:"row",...o,style:{marginRight:l?c:24,...(o==null?void 0:o.style)??{}},children:[r,e.jsx(u.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:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},pt="--sa-floating-footer-height",Vc=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:o,containerProps:n})=>{const l=h.useRef(null);return h.useLayoutEffect(()=>{const c=document.documentElement,s=()=>{var d;const a=((d=l.current)==null?void 0:d.getBoundingClientRect().height)??0;c.style.setProperty(pt,`${a}px`)};s();const i=new ResizeObserver(s);return l.current&&i.observe(l.current),()=>{i.disconnect(),c.style.removeProperty(pt)}},[]),e.jsx(u.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(u.Box,{ref:l,position:"fixed",bottom:"bottom-0",right:"right-0",bg:"white",direction:"row",align:"center",display:"flex",paddingBlock:"sm",paddingInline:"md",borderColor:"border-subtle",style:{left:"var(--app-sidebar-width, 0px)",transition:"left 0.3s ease-in-out"},justify:(n==null?void 0:n.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx($o,{...o,customBottom:(o==null?void 0:o.customBottom)||"5.7rem"}),r]})})},Pc=({fields:r})=>e.jsx(u.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(Hr,{of:r,render:(t,o)=>e.jsx(jc,{...t},o)})}),jc=({title:r,value:t,icon:o})=>e.jsxs(u.Box,{display:"flex",direction:"column",gap:"sm",children:[o?e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(T.Icon,{name:o,color:"subtle"}),e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(k.Text,{variant:"sub-h3",children:t}):t]}),Be={silhouette:"#A7B0AC",accent:"#78867F"};function Nc({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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.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:Be.accent,fillOpacity:"0.65"})]})})}const _c=({title:r="create",children:t,onClickAction:o,variant:n="primary",variantTitle:l,leftIcon:c,showButton:s=!0,customHeight:i,childrenButton:a,customIcon:d})=>{const y=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:c?e.jsx(N.Button,{primary:!0,iconLeft:c,onClick:o,children:a||r}):e.jsx(N.Button,{primary:!0,onClick:o,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:c?e.jsx(N.Button,{secondary:!0,iconLeft:c,onClick:o,children:l?e.jsx(k.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(N.Button,{secondary:!0,onClick:o,children:a||r})});case"success":return e.jsx(e.Fragment,{children:c?e.jsx(N.Button,{success:!0,iconLeft:c,onClick:o,children:a||r}):e.jsx(N.Button,{success:!0,onClick:o,children:a||r})});default:return e.jsx(e.Fragment,{children:c?e.jsx(N.Button,{primary:!0,iconLeft:c,onClick:o,children:a||r}):e.jsx(N.Button,{primary:!0,onClick:o,children:a||r})})}};return e.jsxs(u.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:i,children:[d||e.jsx(Nc,{}),e.jsx(u.Box,{direction:"column",children:t.map((b,p)=>e.jsx(He.Body1,{props:{align:"center",textAlign:"center"},children:p>2?null:b},p))}),s?y():null]})},$={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function qc({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:$.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:$.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:$.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:$.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:$.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:$.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:$.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:$.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:$.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:$.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:$.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:$.cFFFFFF,stroke:$.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:$.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:$.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:$.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:$.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:$.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:$.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:$.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:$.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:$.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:$.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:$.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:$.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:$.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:$.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:$.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:$.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:$.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:$.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:$.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:$.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:$.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:$.c001A72})]})})}function Zc({onClick:r}){const t=be.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(qc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(N.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const ee={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 Gc({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:ee.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:ee.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:ee.cEFF3F8,stroke:ee.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:ee.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:ee.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:ee.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:ee.c956847,stroke:ee.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:ee.c956847,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.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:ee.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:ee.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:ee.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:ee.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:ee.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:ee.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:ee.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:ee.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:ee.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:ee.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:ee.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:ee.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function Qc({onClick:r}){const t=be.useMediaQuery("md");return e.jsxs(u.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(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(N.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const f={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 Uc({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:f.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:f.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:f.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:f.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.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:f.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.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:f.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.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:f.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:f.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:f.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:f.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:f.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:f.c000D58,stroke:f.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:f.c000D58,stroke:f.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:f.cFFFFFF,stroke:f.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:f.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:f.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:f.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:f.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:f.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:f.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:f.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Jc({onClick:r}){const t=be.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Uc,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(N.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const Yc=r=>{var o,n,l,c,s;const t=be.useMediaQuery("md");return e.jsxs(Ae.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(Ae.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(k.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Ae.DialogBody,{children:typeof r.description=="string"?e.jsx(k.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(Ae.DialogFooter,{children:e.jsx(u.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(u.Box,{display:"flex",direction:((l=r.wrapperConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((c=r.wrapperConfirmBtnProps)==null?void 0:c.justify)||"flex-end",gap:((s=r.wrapperConfirmBtnProps)==null?void 0:s.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(N.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(u.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(N.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},Xc=h.memo(({children:r,height:t,minHeight:o,customHeight:n,paddingInline:l="spacing-0",paddingBlock:c="spacing-0",header:s,footer:i,title:a,titleTag:d,action:y,actionContainer:b,containerProps:p,bodyProps:v,headerProps:B={borderBottom:!0},footerProps:x={borderTop:!0},variantTag:L="info"})=>{const F=h.useRef(null),[A,D]=h.useState("100vh");h.useEffect(()=>{const I=()=>{if(F.current){const E=F.current.getBoundingClientRect().top;D(`calc(100vh - ${E}px)`)}};return I(),window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]);const m=()=>d?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:a}),e.jsx(Ye.Badges,{border:!0,text:d,variant:L})]}):e.jsx(k.Text,{fontWeight:"medium",children:a}),H=()=>s||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:a?m():null}),e.jsx(u.Box,{direction:"column",...b,children:y??null})]}),z=!!(s||a||y);return e.jsxs(u.Box,{ref:F,height:t,customMinHeight:o,customHeight:n,paddingBlock:c,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:[s!==null&&z?e.jsx(ot,{...B,children:H()}):null,e.jsx(u.Box,{direction:"column",padding:"spacing-0",...v,style:{flex:1,overflow:"auto",...(v==null?void 0:v.style)??{}},children:r}),i?e.jsx(lt,{...x,children:i}):null]})}),$c=h.memo(({value:r,options:t=[],onChange:o,multiple:n})=>{const l=(r==null?void 0:r.map(i=>i.value))||[],c=(t==null?void 0:t.filter(i=>l.includes(i.value)))||[],s=i=>{const a=[...c];let d=[];n?d=l.includes(i.value)?a.filter(y=>y.value!==i.value):[...a,i]:d=[i],o==null||o(d)};return e.jsx(u.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((i,a)=>e.jsx(N.Button,{...l.includes(i.value)?{primary:!0}:{secondary:!0},onClick:()=>s(i),children:i.label},a))})});function Vr(r){return null}Vr.displayName="LayoutDialog.Header";function Pr(r){return null}Pr.displayName="LayoutDialog.Body";function jr(r){return null}jr.displayName="LayoutDialog.Aside";function Nr(r){return null}Nr.displayName="LayoutDialog.Footer";const Fe={"lyd-root":"_lyd-root_14rlp_1","lyd-backdrop":"_lyd-backdrop_14rlp_34","lyd-panel":"_lyd-panel_14rlp_43","lyd-modal":"_lyd-modal_14rlp_54","lyd-fullscreen":"_lyd-fullscreen_14rlp_64","lyd-sidebar":"_lyd-sidebar_14rlp_72","lyd-header":"_lyd-header_14rlp_100","lyd-header-content":"_lyd-header-content_14rlp_111","lyd-header-actions":"_lyd-header-actions_14rlp_119","lyd-main":"_lyd-main_14rlp_126","lyd-body":"_lyd-body_14rlp_133","lyd-aside":"_lyd-aside_14rlp_139","lyd-footer":"_lyd-footer_14rlp_155","lyd-vm-group":"_lyd-vm-group_14rlp_168","lyd-vm-btn":"_lyd-vm-btn_14rlp_176","lyd-close-btn":"_lyd-close-btn_14rlp_199"},Kc=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(es,{})},{mode:"modal",label:"Modal",icon:e.jsx(T.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(T.Icon,{name:"Fullscreen",size:"sm"})}];function Rc({value:r,onChange:t}){return e.jsx("div",{className:Fe["lyd-vm-group"],role:"group","aria-label":"View mode",children:Kc.map(o=>e.jsx("button",{type:"button",className:Fe["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.icon},o.mode))})}function es(){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 bt={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function rs(r){return r?r in bt?bt[r]:r:bt.xl}function _r(r,t){let o=null;return h.Children.forEach(r,n=>{h.isValidElement(n)&&n.type===t&&(o=n.props.children??null)}),o}function ts(r){const{isOpen:t,onClose:o,viewMode:n,defaultViewMode:l="modal",onViewModeChange:c,showViewModeToggle:s=!0,showCloseButton:i=!0,size:a,asideWidth:d,disableEscapeClose:y=!1,disableBackdropClose:b=!1,lockBodyScroll:p=!0,children:v}=r,[B,x]=h.useState(l),L=n??B,A=be.useMediaQuery("md")?L:"fullscreen",D=h.useCallback(R=>{n===void 0&&x(R),c==null||c(R)},[n,c]),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]),h.useEffect(()=>{if(!t||y)return;const R=_=>{_.key==="Escape"&&o()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[t,y,o]);const H=h.useMemo(()=>_r(v,Vr),[v]),z=h.useMemo(()=>_r(v,Pr),[v]),I=h.useMemo(()=>_r(v,jr),[v]),E=h.useMemo(()=>_r(v,Nr),[v]);if(!t)return null;const U=[Fe["lyd-panel"],A==="modal"&&Fe["lyd-modal"],A==="fullscreen"&&Fe["lyd-fullscreen"],A==="sidebar"&&Fe["lyd-sidebar"]].filter(Boolean).join(" "),X={"--lyd-max-w":rs(a),...d!==void 0&&{"--lyd-aside-w":d}},G=()=>{b||o()};return e.jsxs("div",{className:Fe["lyd-root"],style:X,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:Fe["lyd-backdrop"],onClick:G,"aria-hidden":"true"}),e.jsxs("div",{className:U,children:[e.jsxs("div",{className:Fe["lyd-header"],children:[e.jsx("div",{className:Fe["lyd-header-content"],children:H}),e.jsxs("div",{className:Fe["lyd-header-actions"],children:[s&&e.jsx(Rc,{value:L,onChange:D}),i&&e.jsx("button",{type:"button",className:Fe["lyd-close-btn"],onClick:o,"aria-label":"Close dialog",children:e.jsx(T.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:Fe["lyd-main"],children:[e.jsx("div",{className:Fe["lyd-body"],children:z}),I&&e.jsx("aside",{className:Fe["lyd-aside"],children:I})]}),E&&e.jsx("div",{className:Fe["lyd-footer"],children:E})]})]})}const xr=ts;xr.Header=Vr,xr.Body=Pr,xr.Aside=jr,xr.Footer=Nr;function os({url:r,filename:t,onClose:o}){return h.useEffect(()=>{const n=l=>{l.key==="Escape"&&o()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[o]),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:n=>n.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:n=>n.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 ls=r=>{const{defaultTab:t=0,paramKey:o="tab"}=r||{},{useSearchParams:n}=Ge(),[l,c]=n(),s=nr.searchParamsToObject(l.toString());return{activeTab:s[o]?parseInt(s[o]):t,handleTabChange:d=>{c({...s,[o]:d.toString()})},searchQueries:s}};function ns({appName:r,menuConfig:t,formatTitle:o}){const{useLocation:n}=Ge(),l=n();h.useEffect(()=>{let c=null,s=null;for(const d of t){const y=d.items.find(b=>b.to?b.to==="/"?l.pathname==="/":!!(b.to===l.pathname||l.pathname.startsWith(b.to+"/")):!1);if(y){c=y,s=d;break}}const i=[];c!=null&&c.title&&i.push(c.title),s!=null&&s.name&&i.push(s.name.toTitleCase());const a=(d,y)=>d.length>0?`${d.join(" - ")} | ${y}`:y;document.title=(o||a)(i,r)},[l.pathname])}const cs=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=Ge(),[n,l]=r(),c=nr.searchParamsToObject(n.toString()),s=t(),i=o(),a=s.id;return{setSearchParams:l,searchParams:n,searchQueries:c,isHasQuery:(v,B)=>n.has(v)&&n.get(v)===B,getQueryParam:v=>n.get(v),getRouteParam:v=>s[v],params:s,location:i,id:a,hasId:!!a}};function ss(r){var n,l;const t=r.decodedAccessToken;return h.useMemo(()=>{var a,d;const c=((d=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:d.code)??"",s=Object.keys(r.role).reduce((y,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,v=>v.replace("_","").toUpperCase())}`;return{...y,[p]:!1}},{});return{...Object.keys(r.role).reduce((y,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,v=>v.replace("_","").toUpperCase())}`;return{...y,[p]:c===r.role[b]}},s),hasRole:y=>c===r.role[y],getRoleKey:()=>c}},[(l=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:l.code,r])}g.AdvanceFilterBar=Do,g.App=vl,g.AppComponent=Xt,g.AppContext=Xr,g.AppLayout=Sl,g.AsideBar=Hc,g.BackButton=Bl,g.ColumnFilterDropdown=jo,g.ColumnMenu=Zo,g.ConfirmationDialog=Yc,g.DataTable=_o,g.DecisionWrapper=ce,g.EachUtils=Hr,g.EmptyStatePage=_c,g.FLOATING_FOOTER_HEIGHT_VAR=pt,g.FilterBar=wn,g.FilterDrawer=wo,g.FloatingFooter=Vc,g.ForbiddenPage=Qc,g.Form=Lc,g.FullSection=Xc,g.HeaderLeftSlot=xl,g.HeaderLeftSlotOutlet=Rt,g.HeaderLeftSlotProvider=Kt,g.HorizontalField=Ll,g.ImagePreview=os,g.InputFile=Jo,g.InputImage=Xo,g.LayoutDialog=xr,g.LayoutDialogAside=jr,g.LayoutDialogBody=Pr,g.LayoutDialogFooter=Nr,g.LayoutDialogHeader=Vr,g.ModuleSwitcher=ml,g.ModuleSwitcherModal=fo,g.NotFoundPage=Zc,g.PageLayout=Ol,g.Pressable=yr,g.RightDrawer=uo,g.ScrollToTopButton=$o,g.Section=Hl,g.SectionFooter=lt,g.SectionHeader=ot,g.SelectButton=$c,g.ServerErrorPage=Jc,g.SidePanel=zc,g.SidePanelItem=Oc,g.SidebarBadgesProvider=qt,g.SidebarGroupSlot=wl,g.SidebarGroupSlotOutlet=ro,g.SidebarGroupSlotProvider=eo,g.SidebarHeaderSlot=$t,g.SidebarProvider=Qt,g.StarasiaRouterProvider=Yt,g.TableFooter=Po,g.TableHeader=Vo,g.TableLayout=Nn,g.TableSection=Wn,g.TableWrapper=Ho,g.ToggleStatus=Mc,g.Typography=He,g.VerticalField=Pc,g.clearModuleSelection=Dl,g.createInitialFromUserName=Un,g.cssVars=Rn,g.expandDateCompact=En,g.formHasChanged=nc,g.formatDate=$n,g.formatDateToIndonesian=Uo,g.formatRupiah=Yn,g.getDateFilterValue=xo,g.getDateRangeFilterValue=Nl,g.getInitials=Xn,g.getValueDropdownMultipleFilter=vo,g.getValueRadioFilter=jl,g.getValueSearch=Mr,g.getValuesFilter=Er,g.handleChangeFilter=pr,g.handleOnScroll=uc,g.isEmail=hc,g.isFilterActive=_l,g.isOnlyLettersAndSpaces=sc,g.isPhoneNumber=cc,g.isSlug=fc,g.localStorageAdapter=ct,g.oneDayInMs=ec,g.parseIndonesianDateToDate=Jn,g.preventNonCoordinateInput=gc,g.preventNonNumberAndDecimalInput=dc,g.preventNonNumberInput=ic,g.preventNumberInput=ac,g.resolveDateRangeValueToString=bo,g.resolveDateValueToString=Co,g.resolveDropdownValueToString=yo,g.resolveRadioValueToString=po,g.resolveSidebarBadge=Br,g.storageKeys=ir,g.textWidth=rc,g.useApp=$r,g.useAppState=Nt,g.useAuthRole=ss,g.useDynamicTitle=ns,g.useFilterBarApiParams=Bn,g.useFilterBarControls=Fn,g.useModuleSelection=rt,g.useRouteInfo=Te,g.useRouteParams=cs,g.useRouterAdapter=Ge,g.useSidebar=Ut,g.useSidebarBadges=Zt,g.useTabState=ls,g.useTableSortApiParams=_n,Object.keys(tr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>tr[r]})}),Object.keys(Ye).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ye[r]})}),Object.keys(u).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>u[r]})}),Object.keys(or).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>or[r]})}),Object.keys(N).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>N[r]})}),Object.keys(It).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>It[r]})}),Object.keys(er).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>er[r]})}),Object.keys(Ae).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ae[r]})}),Object.keys(kr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>kr[r]})}),Object.keys(lr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>lr[r]})}),Object.keys(be).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>be[r]})}),Object.keys(nr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>nr[r]})}),Object.keys(Xe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Xe[r]})}),Object.keys(W).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>W[r]})}),Object.keys(gr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>gr[r]})}),Object.keys(ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ur[r]})}),Object.keys(Q).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Q[r]})}),Object.keys(Ot).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ot[r]})}),Object.keys(Ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ur[r]})}),Object.keys(cr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>cr[r]})}),Object.keys(Wt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Wt[r]})}),Object.keys(sr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>sr[r]})}),Object.keys(me).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>me[r]})}),Object.keys(Ze).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ze[r]})}),Object.keys(Jr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Jr[r]})}),Object.keys(k).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>k[r]})}),Object.keys(T).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>T[r]})}),Object.keys(ne).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ne[r]})}),Object.keys(At).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>At[r]})}),Object.keys(zt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>zt[r]})}),Object.keys(Ht).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ht[r]})}),Object.keys(Vt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Vt[r]})}),Object.keys(Pt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Pt[r]})}),Object.keys(ze).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ze[r]})}),Object.keys(jt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>jt[r]})}),Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|