@starasia/admin 14.17.1 → 14.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const bn=require("@starasia/alert"),er=require("@starasia/avatar"),dt=require("@starasia/badges"),x=require("@starasia/box"),wt=require("@starasia/breadcrumb"),P=require("@starasia/button"),Hr=require("@starasia/card"),gt=require("@starasia/date"),Ne=require("@starasia/dialog"),tr=require("@starasia/drawer"),St=require("@starasia/dropdown"),be=require("@starasia/hooks"),kt=require("@starasia/http"),ot=require("@starasia/input"),R=require("@starasia/menu"),Rt=require("@starasia/pagination"),Tt=require("@starasia/storage"),G=require("@starasia/table"),vn=require("@starasia/tabs"),Pr=require("@starasia/textarea"),Dt=require("@starasia/theme"),Cn=require("@starasia/toast"),Bt=require("@starasia/toggle"),Ee=require("@starasia/tooltip"),nt=require("@starasia/checkbox"),Vr=require("@starasia/radio"),w=require("@starasia/text"),E=require("@starasia/icon"),ce=require("@starasia/flex"),wn=require("@starasia/grid"),Dn=require("@starasia/progress"),Sn=require("@starasia/stepper"),kn=require("@starasia/accordion"),Bn=require("@starasia/story-record"),Je=require("@starasia/skeleton"),En=require("@starasia/progress-stepper"),e=require("react/jsx-runtime"),u=require("react"),sr=require("react-dom"),Fs=require("react-easy-crop"),Ms={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Jr=u.createContext(Ms),Yr=()=>u.useContext(Jr),io=t=>{const[r,n]=u.useState((t==null?void 0:t.initialUserData)||null);return{userData:r,setUserData:n}},lo=u.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),co=({children:t})=>{const[r,n]=u.useState({}),s=u.useCallback(c=>{n(a=>typeof c=="function"?c(a):c)},[]),o=u.useCallback((c,a)=>{n(d=>{const h=typeof a=="function"?a(d[c]):a;return{...d,[c]:h}})},[]),i=u.useCallback(c=>{n(a=>{if(!(c in a))return a;const d={...a};return delete d[c],d})},[]),l=u.useMemo(()=>({badges:r,setBadge:o,setBadges:s,clearBadge:i}),[r,o,s,i]);return e.jsx(lo.Provider,{value:l,children:t})},ao=()=>u.useContext(lo),$t=(t,r)=>{const n=r!==void 0?r:t;return n==null?null:typeof n=="string"||typeof n=="number"?{value:n}:n},Xr=240,$r=200,Kr=480,Is="sa-sidebar-width",Nr=(t,r,n)=>Math.min(Math.max(t,r),n),Ls=(t,r,n,s)=>{if(typeof window>"u")return r;try{const o=window.localStorage.getItem(t);if(!o)return r;const i=parseInt(o,10);return Number.isFinite(i)?Nr(i,n,s):r}catch{return r}},Fn=(t,r)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(t,String(r))}catch{}},uo=u.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},width:Xr,setWidth:()=>{},resetWidth:()=>{},minWidth:$r,maxWidth:Kr,mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),xo=({children:t,defaultCollapsed:r=!1,defaultWidth:n=Xr,minWidth:s=$r,maxWidth:o=Kr,widthStorageKey:i=Is})=>{const[l,c]=u.useState(r),[a,d]=u.useState(!1),[h,g]=u.useState(()=>Ls(i,n,s,o)),m=u.useCallback(D=>{c(O=>typeof D=="function"?D(O):D)},[]),y=u.useCallback(()=>c(D=>!D),[]),S=u.useCallback(()=>c(!0),[]),C=u.useCallback(()=>c(!1),[]),T=u.useCallback(D=>{g(O=>{const A=typeof D=="function"?D(O):D,Y=Nr(Math.round(A),s,o);return Fn(i,Y),Y})},[s,o,i]),M=u.useCallback(()=>{const D=Nr(n,s,o);Fn(i,D),g(D)},[n,s,o,i]),L=u.useCallback(D=>{d(O=>typeof D=="function"?D(O):D)},[]),b=u.useCallback(()=>d(!0),[]),j=u.useCallback(()=>d(!1),[]),I=u.useCallback(()=>d(D=>!D),[]),F=u.useMemo(()=>({collapsed:l,setCollapsed:m,toggle:y,collapse:S,expand:C,width:h,setWidth:T,resetWidth:M,minWidth:s,maxWidth:o,mobileOpen:a,setMobileOpen:L,openMobile:b,closeMobile:j,toggleMobile:I}),[l,m,y,S,C,h,T,M,s,o,a,L,b,j,I]);return e.jsx(uo.Provider,{value:F,children:t})},ho=()=>u.useContext(uo),fo=u.createContext(null),mo=({adapter:t,children:r})=>e.jsx(fo.Provider,{value:t,children:r}),st=()=>{const t=u.useContext(fo);if(!t)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 t},go=({router:t,routerAdapter:r,menus:n=[],menuBottom:s,logo:o,appName:i="Workspace",initialUserData:l,theme:c})=>{const a=io({initialUserData:l}),{theme:d}=Dt.useTheme();return e.jsx(mo,{adapter:r,children:e.jsx(Jr.Provider,{value:{logo:o,appName:i,menus:n,userData:a.userData,setUserData:a.setUserData,menuBottom:s},children:e.jsx(co,{children:e.jsx(xo,{children:c?e.jsx(Dt.ThemeProvider,{value:c,children:t}):d?e.jsx(Dt.ThemeProvider,{value:d,children:t}):t})})})})},Ts=u.memo(go);function po({collapsed:t=!1,children:r}){if(!r)return null;const n=typeof r=="function",s=n?r({collapsed:t}):r;return s==null||s===!1?null:e.jsx("div",{style:{position:"sticky",top:"var(--app-header-height, 4rem)",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:t?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingRight:t?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:n?s:e.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.3s",visibility:t?"hidden":"visible"},children:s})})}const en=u.createContext(null);function yo({children:t}){const[r,n]=u.useState(null),[s,o]=u.useState(null),[i,l]=u.useState(null),[c,a]=u.useState(0),d=u.useCallback(()=>(a(h=>h+1),()=>a(h=>h-1)),[]);return e.jsx(en.Provider,{value:{prependNode:r,appendNode:s,replaceNode:i,setPrependNode:n,setAppendNode:o,setReplaceNode:l,replaceCount:c,registerReplace:d},children:t})}function jo({children:t}){const r=u.useContext(en);return r?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:r.setPrependNode,style:{display:"contents"}}),r.replaceCount>0?e.jsx("div",{ref:r.setReplaceNode,style:{display:"contents"}}):t,e.jsx("div",{ref:r.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:t})}function Rs({children:t,mode:r="append"}){const n=u.useContext(en);if(u.useEffect(()=>{if(!(r!=="replace"||!n))return n.registerReplace()},[r,n]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const s=r==="prepend"?n.prependNode:r==="replace"?n.replaceNode:n.appendNode;return s?sr.createPortal(t,s):null}const tn=u.createContext(null);function bo({children:t}){const[r,n]=u.useState({}),[s,o]=u.useState({}),i=u.useCallback((a,d)=>{n(h=>h[a]===d?h:{...h,[a]:d})},[]),l=u.useCallback(a=>(o(d=>({...d,[a]:(d[a]??0)+1})),()=>o(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),c=u.useMemo(()=>({outletNodes:r,setOutletNode:i,slotCounts:s,registerSlot:l}),[r,i,s,l]);return e.jsx(tn.Provider,{value:c,children:t})}function _r({slotKey:t,fallback:r}){const n=u.useContext(tn),s=n?(n.slotCounts[t]??0)>0:!1,o=u.useRef(n==null?void 0:n.setOutletNode);o.current=n==null?void 0:n.setOutletNode;const i=u.useCallback(l=>{var c;return(c=o.current)==null?void 0:c.call(o,t,l)},[t]);return e.jsx(e.Fragment,{children:s?e.jsx("div",{ref:i,style:{display:"contents"}}):r})}function Os({slotKey:t,children:r}){const n=u.useContext(tn),s=u.useRef(n==null?void 0:n.registerSlot);if(s.current=n==null?void 0:n.registerSlot,u.useEffect(()=>{var i;return(i=s.current)==null?void 0:i.call(s,t)},[t]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=n.outletNodes[t];return o?sr.createPortal(r,o):null}const rr="moduleSwitcherGroupId",qr="sa-module-switcher-change";function Mn(){if(typeof window>"u")return null;const t=window.localStorage.getItem(rr);if(t===null)return null;const r=Number(t);return Number.isFinite(r)?r:null}function vo(t){typeof window>"u"||(t===null?window.localStorage.removeItem(rr):window.localStorage.setItem(rr,String(t)),window.dispatchEvent(new CustomEvent(qr,{detail:t})))}function As(){vo(null)}function rn(){const[t,r]=u.useState(()=>Mn());return u.useEffect(()=>{const s=()=>{r(Mn())},o=i=>{i.key===rr&&s()};return window.addEventListener(qr,s),window.addEventListener("storage",o),()=>{window.removeEventListener(qr,s),window.removeEventListener("storage",o)}},[]),{selectedGroupId:t,setSelectedGroupId:s=>{vo(s),r(s)}}}let qt=0,yt=!1,In=new Set;const Ln=new Set;function Ws(t,r){const[n,s]=u.useState(!1),o=u.useRef(null),i=u.useRef(null);return u.useLayoutEffect(()=>{const l=o.current;if(!l)return;let c=0;const a=()=>{c=0;const h=i.current;if(!h)return;const g=h.scrollWidth>l.clientWidth;s(m=>m===g?m:g)},d=new ResizeObserver(()=>{c||(c=requestAnimationFrame(a))});return d.observe(l),a(),()=>{c&&cancelAnimationFrame(c),d.disconnect()}},[t,r]),{containerRef:o,textRef:i,truncated:n}}function Tn({text:t,textStyle:r,active:n=!1}){const{containerRef:s,textRef:o,truncated:i}=Ws(t,n),l=e.jsx(w.Text,{ref:o,as:"span",fontSize:"md",fontWeight:n?"medium":"normal",truncate:!0,style:{display:"block",...r},children:t});return e.jsx(x.Box,{ref:s,display:"block",style:{flex:1,minWidth:0},children:i?e.jsx(Ee.Tooltip,{fluid:!0,label:t,position:"top",children:l}):l})}const zs=200,Zr="var(--app-header-height, 4rem)",Rn="44px",Sr=`calc((${Zr} - 2rem) / 2)`,On=16;function Hs({children:t,headerLeftSlot:r,profile:n,isLoadingProfile:s,onLogout:o,isLoggingOut:i,loadingComponent:l,sidebarHeaderContent:c,headerActions:a,profileRole:d,profileMenuButtons:h,profileMenuItems:g,logoutButton:m,resizableSidebar:y=!0}){var ht,ft;const{useSearchParams:S,useNavigate:C,useLocation:T,Outlet:M}=st(),[L]=S(),b=L.get("embed")==="true",j=Yr(),{badges:I}=ao(),F=C(),D=T(),A=!be.useMediaQuery("md"),[Y,H]=u.useState(!1),{collapsed:_,setCollapsed:q,width:X,setWidth:K,resetWidth:Q,minWidth:Z,maxWidth:z,mobileOpen:ie,setMobileOpen:ue}=ho(),[Ce,ke]=u.useState(!1),[je,he]=u.useState(()=>new Set(In)),[ae,Ae]=u.useState(null),{selectedGroupId:Be,setSelectedGroupId:qe}=rn(),re=_&&!A;u.useEffect(()=>{In=je},[je]);const fe=u.useRef(null),Fe=u.useRef(null),ve=u.useRef(null),[we,et]=u.useState(!1),[tt,W]=u.useState(null),J=y&&!A&&!_,U=k=>Math.min(Math.max(k,Z),z),le=tt??X,De=k=>{var Qe,Ve,Oe;if(!J)return;k.preventDefault();const V=k.clientX,$=((Qe=ve.current)==null?void 0:Qe.getBoundingClientRect().width)??X;(Oe=(Ve=k.currentTarget).setPointerCapture)==null||Oe.call(Ve,k.pointerId),et(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize";let Me=0,Re=$;const Ie=mt=>{Re=$+(mt.clientX-V),Me||(Me=requestAnimationFrame(()=>{Me=0,W(U(Re))}))},Le=()=>{Me&&cancelAnimationFrame(Me),window.removeEventListener("pointermove",Ie),window.removeEventListener("pointerup",Le),document.body.style.userSelect="",document.body.style.cursor="",W(null),et(!1),Re<zs?q(!0):K(U(Re))};window.addEventListener("pointermove",Ie),window.addEventListener("pointerup",Le)},me=k=>{J&&(k.key==="ArrowLeft"?(k.preventDefault(),K(V=>V-On)):k.key==="ArrowRight"?(k.preventDefault(),K(V=>V+On)):k.key==="Home"?(k.preventDefault(),K(Z)):k.key==="End"&&(k.preventDefault(),K(z)))};u.useEffect(()=>{const k=fe.current;if(!k)return;const V=()=>{yt||(qt=k.scrollTop)};return k.addEventListener("scroll",V),()=>k.removeEventListener("scroll",V)},[]);const Se=()=>{const k=fe.current;k&&qt>0&&(yt=!0,k.scrollTop=qt,requestAnimationFrame(()=>{yt=!1}))};u.useLayoutEffect(()=>{yt=!0,Se();const k=setTimeout(()=>{yt=!1},300);return()=>clearTimeout(k)},[]),u.useLayoutEffect(()=>{j.menus.length>0&&(qt>0?Se():requestAnimationFrame(()=>{var V;const k=(V=fe.current)==null?void 0:V.querySelector("[data-menu-active='true']");k&&k.scrollIntoView({block:"center",behavior:"instant"})}))},[j.menus]),u.useEffect(()=>{yt=!0,Se();const k=setTimeout(Se,0),V=setTimeout(Se,50),$=setTimeout(Se,100),Me=setTimeout(Se,200),Re=setTimeout(()=>{yt=!1},300),Ie=setTimeout(()=>{const Le=fe.current,Qe=Le==null?void 0:Le.querySelector("[data-menu-active='true']");if(Le&&Qe){const Ve=Le.getBoundingClientRect(),Oe=Qe.getBoundingClientRect();Oe.top>=Ve.top&&Oe.bottom<=Ve.bottom||Qe.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(k),clearTimeout(V),clearTimeout($),clearTimeout(Me),clearTimeout(Re),clearTimeout(Ie)}},[D.pathname]),u.useEffect(()=>{Fe.current&&(Fe.current.scrollTop=0)},[D.pathname]),u.useEffect(()=>{A&&ue(!1)},[D.pathname,A]),u.useEffect(()=>{A&&q(!0)},[A]),u.useEffect(()=>{const k=document.documentElement;return k.style.setProperty("--app-header-height",Rn),()=>{k.style.removeProperty("--app-header-height")}},[]);const Xe=()=>{H(!0)},Pe=()=>{H(!1)},We=()=>{H(!1),o()},it=k=>{const V=k.slotKey?[]:[k.to];return k.children&&V.push(...k.children.map($=>$.to)),V},lt=[...j.menus.flatMap(k=>k.items.flatMap(it)),...((ht=j.menuBottom)==null?void 0:ht.flatMap(it))??[]],ge=k=>{if(!D.pathname.startsWith(k))return!1;const V=lt.filter($=>D.pathname.startsWith($)).sort(($,Me)=>Me.length-$.length)[0];return k===V};u.useEffect(()=>{var V;const k=$=>{var Re;const Me=$.defaultExpanded&&!Ln.has($.id);Me&&Ln.add($.id),(Me||(Re=$.children)!=null&&Re.some(Ie=>D.pathname.startsWith(Ie.to)))&&he(Ie=>{const Le=new Set(Ie);return Le.add($.id),Le})};j.menus.forEach($=>{$.items.forEach(k)}),(V=j.menuBottom)==null||V.forEach(k)},[D.pathname,j.menus,j.menuBottom]);const ze=k=>{he(V=>{const $=new Set(V);return $.has(k)?$.delete(k):$.add(k),$})};u.useEffect(()=>{j.menus.length!==0&&Be!==null&&!j.menus.some(k=>k.id===Be)&&qe(null)},[j.menus,Be,qe]);const pt=u.useMemo(()=>{if(Be!==null)return j.menus.filter($=>$.id===Be||$.parentGroupId===Be);const k=j.menus.filter($=>$.parentGroupId===void 0),V=j.menus.filter($=>$.parentGroupId!==void 0).flatMap($=>$.items);return V.length===0?k:[...k,{id:18,name:"Pengaturan",items:V,parentGroupId:void 0}]},[j.menus,Be]);if(b)return e.jsx(x.Box,{as:"main",overflow:"overflow-y-auto",bg:"surface-inverse",style:{height:"100vh"},children:t||e.jsx(M,{})});const xt=k=>{const V=k.children&&k.children.length>0,$=!!k.slotKey,Me=V||$,Re=je.has(k.id),Ie=V?k.children.some(Ve=>ge(Ve.to)):$?!1:ge(k.to),Le=$t(k.badge,I[k.id]),Qe=!!Le&&_&&!A;return e.jsxs(x.Box,{display:"block","data-menu-active":Ie||void 0,children:[e.jsxs(x.Box,{as:"button",onClick:Ve=>{if($&&_&&!A)F(k.to);else if(Me)if(_&&!A){const Oe=Ve.currentTarget.getBoundingClientRect();Ae({item:k,top:Oe.top,left:Oe.right+8})}else ze(k.id);else F(k.to)},fullWidth:!0,direction:"row",align:"center",justify:_&&!A?"center":void 0,gap:"sm",paddingInline:_&&!A?void 0:"sm",paddingBlock:"xs",height:"height-32",borderRadius:Ie?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:Ie?"white":void 0,hover:Ie?void 0:{bg:"neutral"},title:_&&!A?k.title:void 0,style:{textAlign:"left",color:Ie?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:Ie?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsxs(x.Box,{position:"relative",display:"inline-flex",flexShrink:"0",style:{alignItems:"center"},children:[e.jsx(E.Icon,{name:k.icon,size:"sm",style:{flexShrink:0}}),Qe&&e.jsx(x.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",style:{boxShadow:"0 0 0 1px var(--sa-background-primary, #ffffff)"},children:e.jsx(dt.BadgeDot,{tone:"error",variant:"solid",size:"xs"})})]}),(!_||A)&&e.jsxs(e.Fragment,{children:[e.jsx(Tn,{text:k.title,active:Ie,textStyle:{transition:"opacity 0.3s"}}),Le&&e.jsx(dt.Badge,{text:String(Le.value),variant:Le.variant??"info",size:"xs",border:!0}),Me&&e.jsx(E.Icon,{name:"ChevronDown",size:"sm",style:{flexShrink:0,transition:"transform 0.2s",transform:Re?"rotate(180deg)":"rotate(0deg)"}})]})]}),Me&&(!_||A)&&(()=>{const Ve=k.children??[],Oe=$?-1:Ve.findIndex(Ue=>ge(Ue.to)),mt=Ve.map(Ue=>{const jt=$t(Ue.badge,I[Ue.id]),rt=ge(Ue.to);return e.jsxs(x.Box,{as:"button",onClick:()=>F(Ue.to),fullWidth:!0,direction:"row",align:"center",gap:"sm",paddingLeft:"sm",paddingRight:"sm",paddingBlock:"xs",height:"height-32",borderRadius:rt?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:rt?"white":void 0,hover:rt?void 0:{bg:"neutral"},style:{textAlign:"left",color:rt?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:rt?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsx(E.Icon,{name:Ue.icon,size:"sm",style:{flexShrink:0}}),e.jsx(Tn,{text:Ue.title,active:rt}),jt&&e.jsx(dt.Badge,{text:String(jt.value),variant:jt.variant??"info",size:"xs",border:!0})]},Ue.id)});return e.jsxs(x.Box,{position:"relative",overflow:"overflow-hidden",style:{marginLeft:"1rem",paddingLeft:"0.75rem",transition:"all 0.3s ease-in-out",maxHeight:Re?$?"none":`${Ve.length*36}px`:"0px",opacity:Re?1:0,marginTop:Re?"0.25rem":"0px"},children:[e.jsx(x.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",top:"top-0",fullHeight:!0,style:{width:"1.5px",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),Oe>=0&&e.jsx(x.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",height:"height-32",zIndex:"10",style:{top:`${Oe*32}px`,width:"1.5px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none"}}),$?e.jsx(_r,{slotKey:k.slotKey,fallback:mt}):mt]})})()]},k.id)};return e.jsx(bo,{children:e.jsxs(yo,{children:[e.jsxs(x.Box,{direction:"row",position:"relative",style:{height:"100vh","--app-header-height":Rn,"--app-sidebar-width":A?"0px":_?Zr:`${le}px`,"--app-footer-zindex":A&&ie?"40":"998"},children:[A&&e.jsx(x.Box,{position:"fixed",zIndex:"40",bg:"black-alpha-a50",style:{inset:0,opacity:ie?.5:0,pointerEvents:ie?"auto":"none",transition:"opacity 0.3s"},onClick:()=>ue(!1)}),e.jsxs(x.Box,{as:"aside",ref:ve,bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:A?void 0:"0",style:{width:A?"16.375rem":_?Zr:`${le}px`,position:A?"fixed":"relative",...A&&{inset:0,zIndex:50,transform:ie?"translateX(0)":"translateX(-100%)"},transition:we?"none":"all 0.3s ease-in-out",minWidth:0},children:[e.jsx(x.Box,{onMouseEnter:()=>ke(!0),onMouseLeave:()=>ke(!1),direction:"row",align:"center",justify:"space-between",paddingInline:re?void 0:"lg",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",position:"relative",style:{height:"var(--app-header-height, 4rem)",...re?{paddingInline:Sr}:null},children:(()=>{const k=!A&&_&&!ie,V=k&&Ce;return e.jsxs(e.Fragment,{children:[e.jsxs(x.Box,{direction:"row",align:"center",gap:"sm",flex:k?"1":void 0,justify:k?"center":void 0,style:{transition:"opacity 0.2s",opacity:V?0:1,pointerEvents:V?"none":"auto"},children:[e.jsx("img",{src:j.logo,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",flexShrink:0}}),(!_||ie)&&e.jsx(w.Text,{as:"span",fontSize:"md",fontWeight:"semibold",color:"primary",truncate:!0,style:{transition:"opacity 0.3s"},children:j.appName})]}),!A&&!_&&e.jsx(x.Box,{as:"button",onClick:()=>q(!0),"aria-label":"Collapse sidebar",display:"inline-flex",align:"center",justify:"center",flexShrink:"0",style:{color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(E.Icon,{name:"LayoutLeft",size:"sm"})}),k&&e.jsx(x.Box,{as:"button",onClick:()=>q(!1),"aria-label":"Expand sidebar",position:"absolute",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-sm",style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"var(--sa-text-primary, #292a2e)",opacity:V?1:0,pointerEvents:V?"auto":"none",transition:"opacity 0.2s"},children:e.jsx(E.Icon,{name:"LayoutLeft",size:"sm"})}),A&&e.jsx(x.Box,{as:"button",onClick:()=>ue(!1),"aria-label":"Close menu",align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(E.Icon,{name:"Cross",size:"md"})})]})})()}),c&&e.jsx(po,{collapsed:A?!1:_,children:c}),e.jsx(x.Box,{ref:fe,flex:"1",overflow:"overflow-y-auto",paddingBlock:"lg",children:pt.map(k=>e.jsxs(x.Box,{marginBottom:"lg",children:[!_||A?k.name&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"semibold",color:"subtlest",textTransform:"uppercase",truncate:!0,style:{letterSpacing:"0.06em",paddingLeft:"1.25rem",paddingRight:"0.75rem",paddingBottom:"0.25rem",transition:"opacity 0.3s"},children:k.name}):k.name&&e.jsx(x.Box,{"aria-label":k.name,direction:"row",align:"center",justify:"center",paddingBlock:"md",children:e.jsx(x.Box,{width:"width-16",style:{height:"2px",borderRadius:"1px",backgroundColor:k.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx(x.Box,{paddingInline:re?void 0:"md",gap:"xs",style:re?{paddingInline:Sr}:void 0,children:k.slotKey?e.jsx(_r,{slotKey:k.slotKey,fallback:k.items.map(V=>xt(V))}):k.items.map(V=>xt(V))})]},k.id))}),j.menuBottom&&j.menuBottom.length>0&&e.jsx(x.Box,{borderWidth:"border-t",borderStyle:"border-solid-t",borderColor:"border-base",paddingBlock:"md",paddingInline:re?void 0:"md",bg:"surface-inverse",gap:"xs",flexShrink:"0",style:re?{paddingInline:Sr}:void 0,children:j.menuBottom.map(k=>xt(k))}),J&&e.jsx(x.Box,{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":X,"aria-valuemin":Z,"aria-valuemax":z,tabIndex:0,onPointerDown:De,onKeyDown:me,onDoubleClick:Q,title:"Drag to resize · double-click to reset",position:"absolute",top:"top-0",right:"right-0",fullHeight:!0,style:{width:"6px",transform:"translateX(50%)",cursor:"col-resize",zIndex:5,touchAction:"none",background:we?"var(--sa-background-brand, #04254f)":"transparent",transition:"background 0.15s"},onMouseEnter:k=>{we||(k.currentTarget.style.background="var(--sa-border-bold, #0b120e40)")},onMouseLeave:k=>{we||(k.currentTarget.style.background="transparent")}})]}),e.jsxs(x.Box,{flex:"1",overflow:"overflow-hidden",children:[e.jsxs(x.Box,{as:"header",bg:"white",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",direction:"row",align:"center",justify:"space-between",paddingInline:"lg",flexShrink:"0",style:{height:"var(--app-header-height, 4rem)"},children:[e.jsxs(x.Box,{direction:"row",align:"center",gap:A?"lg":void 0,children:[A&&e.jsx(x.Box,{as:"button",onClick:()=>ue(!0),align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(E.Icon,{name:"MenuBurger",size:"lg"})}),e.jsx(jo,{children:r})]}),e.jsxs(x.Box,{direction:"row",align:"center",gap:"md",children:[a,e.jsxs(R.Menu,{position:"bottom-right",children:[e.jsx(R.MenuButton,{children:e.jsxs(x.Box,{direction:"row",align:"center",gap:"sm",cursor:"pointer",children:[!A&&e.jsxs(x.Box,{display:"block",textAlign:"right",customMaxWidth:"12.5rem",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",textAlign:"right",truncate:!0,lineHeight:"leading-none",children:s?"Loading...":(n==null?void 0:n.name)||"unknown"}),e.jsx(w.Text,{fontSize:"sm",color:"subtle",textAlign:"right",truncate:!0,children:s?"":(n==null?void 0:n.email)||"unknown"})]}),e.jsx(er.Avatar,{size:"sm",initials:((n==null?void 0:n.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)"}),e.jsx(E.Icon,{name:"ChevronDown",size:"xs",color:"subtle"})]})}),e.jsxs(R.MenuLists,{width:280,style:{paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(R.MenuHeading,{children:e.jsxs(x.Box,{align:"center",textAlign:"center",paddingBlock:"sm",fullWidth:!0,children:[e.jsx(er.Avatar,{customSize:64,initials:((n==null?void 0:n.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)",style:{fontSize:"1.25rem",marginBottom:"0.75rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)"}}),e.jsx(w.Text,{fontSize:"md",fontWeight:"semibold",color:"primary",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(n==null?void 0:n.name)||"unknown"}),e.jsx(w.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(n==null?void 0:n.email)||"unknown"}),d&&e.jsx(w.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:d})]})}),(h&&h.length>0||g)&&e.jsxs(R.MenuBody,{children:[h==null?void 0:h.map((k,V)=>e.jsx(R.MenuItem,{onClick:k.onClick,startIcon:e.jsx(E.Icon,{name:k.icon,size:"md"}),children:k.label},`${k.label}-${V}`)),g]}),m??e.jsx(R.MenuFooter,{children:e.jsx(R.MenuItem,{intent:"danger",onClick:Xe,startIcon:e.jsx(E.Icon,{name:"Logout",size:"md"}),children:"Logout"})})]})]})]})]}),e.jsx(x.Box,{as:"main",ref:Fe,flex:"1",overflow:"overflow-y-auto",children:t||e.jsx(M,{})})]})]}),i&&l&&e.jsx(x.Box,{position:"fixed",align:"center",justify:"center",bg:"black-alpha-a70",style:{inset:0,zIndex:9999},children:l}),e.jsxs(Ne.Dialog,{isShow:Y,onHide:Pe,children:[e.jsx(Ne.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Ne.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Ne.DialogFooter,{children:e.jsx(x.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(ce.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(x.Box,{direction:"column",children:e.jsx(P.Button,{secondary:!0,onClick:Pe,children:"Cancel"})}),e.jsx(x.Box,{direction:"column",children:e.jsx(P.Button,{primary:!0,onClick:We,children:"Yes, Sure"})})]})})})]}),ae&&e.jsxs(e.Fragment,{children:[e.jsx(x.Box,{onClick:()=>Ae(null),position:"fixed",style:{inset:0,zIndex:60}}),e.jsxs(x.Box,{role:"dialog","aria-label":ae.item.title,position:"fixed",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-md",shadow:"shadow-lg",padding:"sm",gap:"spacing-2",style:{top:ae.top,left:ae.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem"},children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-500",textTransform:"uppercase",style:{padding:"0.25rem 0.5rem 0.5rem",letterSpacing:"0.05em"},children:ae.item.title}),(ft=ae.item.children)==null?void 0:ft.map(k=>{const V=ge(k.to),$=$t(k.badge,I[k.id]);return e.jsxs(x.Box,{as:"button",onClick:()=>{F(k.to),Ae(null)},fullWidth:!0,direction:"row",align:"center",gap:"md",paddingBlock:"sm",paddingInline:"md",borderRadius:"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:V?"primary-inverse":void 0,hover:V?void 0:{bg:"primary-inverse"},style:{textAlign:"left",borderColor:"transparent",color:V?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)"},children:[k.icon&&e.jsx(E.Icon,{name:k.icon,size:"sm",style:{flexShrink:0}}),e.jsx(w.Text,{as:"span",fontSize:"md",fontWeight:V?"medium":"normal",whiteSpace:"nowrap",style:{flex:1},children:k.title}),$&&e.jsx(dt.Badge,{text:String($.value),variant:$.variant??"info",size:"xs",border:!0})]},k.id)})]})]})]})})}const Wt=u.forwardRef(({children:t,...r},n)=>e.jsx(x.Box,{ref:n,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...r,children:t})),An=({title:t,iconName:r,textColor:n,iconColor:s,hoverTextColor:o,hoverIconColor:i})=>{const[l,c]=u.useState(!1),a=s??"var(--sa-text-subtle, #8c8f97)",d=n??"var(--sa-text-subtle, #8c8f97)",h=i??"var(--sa-text-subtle, #8c8f97)",g=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(x.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{cursor:"pointer"},children:[e.jsx(E.Icon,{name:r||"ChevronLeft",size:"xs",style:{color:l?h:a,transition:"color 0.15s ease"}}),e.jsx(w.Text,{variant:"sub-h3",style:{color:l?g:d,transition:"color 0.15s ease"},children:t||"Back"})]})},Ps=({items:t,separator:r="/",iconName:n,iconColor:s,hoverIconColor:o})=>{const{Link:i}=st(),[l,c]=u.useState(!1),a=s??"var(--sa-text-subtle, #8c8f97)",d=o??"var(--sa-text-subtle, #8c8f97)",h=t.length>1?t[0]:void 0,g=!!(h!=null&&h.to||h!=null&&h.onClick),m=e.jsx(E.Icon,{name:n||"ChevronLeft",size:"xs",onMouseEnter:g?()=>c(!0):void 0,onMouseLeave:g?()=>c(!1):void 0,style:{color:g&&l?d:a,transition:"color 0.15s ease",cursor:g?"pointer":void 0}}),y=h!=null&&h.to?e.jsx(i,{to:h.to,replace:!0,style:{textDecoration:"none"},children:m}):h!=null&&h.onClick?e.jsx(Wt,{onClick:h.onClick,children:m}):m;return e.jsxs(x.Box,{direction:"row",gap:"xs",align:"center",children:[y,e.jsx(wt.Breadcrumb,{separator:r,size:"md",children:t.map((S,C)=>{const T=C===t.length-1;return S.to&&!T?e.jsx(wt.BreadcrumbItem,{children:e.jsx(i,{to:S.to,children:S.label})},C):e.jsx(wt.BreadcrumbItem,{currentPage:T,children:e.jsx(wt.BreadcrumbLink,{onClick:T?void 0:S.onClick,children:S.label})},C)})})]})},Vs=t=>{const{Link:r}=st(),{items:n,separator:s,onClick:o,navigateTo:i,...l}=t;return n&&n.length>0?e.jsx(Ps,{items:n,separator:s,iconName:l.iconName,iconColor:l.iconColor,hoverIconColor:l.hoverIconColor}):i?e.jsx(x.Box,{direction:"row",children:e.jsx(r,{to:i,replace:!0,style:{textDecoration:"none"},children:e.jsx(An,{...l})})}):e.jsx(x.Box,{direction:"row",children:e.jsx(Wt,{onClick:o,children:e.jsx(An,{...l})})})},kr=[{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 Wn(t,r,n){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:t?`2px solid ${n.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:t?n.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:t?r?`0 8px 20px ${n.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${n.activeShadow}`:r?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:r?"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 zn={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Hn={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function Co({isShow:t,onHide:r,menus:n,selectedGroupId:s,onSelect:o}){const[i,l]=u.useState(void 0),c=d=>{o(d),r()},a=kr[0];return e.jsx(Ne.Dialog,{isShow:t,onHide:r,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Ne.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>c(null),onMouseEnter:()=>l("all"),onMouseLeave:()=>l(void 0),style:Hn,children:[e.jsx("div",{style:Wn(s===null,i==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(E.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:zn,children:"Semua"})]}),n.map((d,h)=>{var C;const g=s===d.id,m=i===d.id,y=((C=d.items[0])==null?void 0:C.icon)??"Grid",S=kr[(h+1)%kr.length];return e.jsxs("button",{onClick:()=>c(d.id),onMouseEnter:()=>l(d.id),onMouseLeave:()=>l(void 0),style:Hn,children:[e.jsx("div",{style:Wn(g,m,S),children:e.jsx("div",{style:{color:S.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(E.Icon,{name:y,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:zn,children:d.name})]},d.id)})]})})})}function Ns({onSelect:t,"aria-label":r="Pilih module"}={}){const n=Yr(),{useNavigate:s}=st(),o=s(),{selectedGroupId:i,setSelectedGroupId:l}=rn(),[c,a]=u.useState(!1),d=h=>{var g;if(l(h),h!==null){const m=n.menus.find(S=>S.id===h),y=(g=m==null?void 0:m.items[0])==null?void 0:g.to;y&&o(y)}t==null||t(h)};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":r,onMouseEnter:h=>{h.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="transparent"},children:e.jsx(E.Icon,{name:"GridApplication",size:"sm"})}),i!==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(Co,{isShow:c,onHide:()=>a(!1),menus:n.menus.filter(h=>h.parentGroupId===void 0),selectedGroupId:i,onSelect:d})]})}const _s=(t,r)=>{const n=[];if(r===0)return n.push(t),n;for(let s=0;s<t.length;s+=r){const o=t.slice(s,s+r);n.push(o)}return n},qs=u.memo(({value:t,label:r,separator:n,labelWidth:s,lastIndex:o,labelAlign:i="top"})=>{const l=u.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:i}),[o,i]),c=u.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:i}),[o,i]),a=()=>typeof r=="string"?e.jsx(w.Text,{fontWeight:"medium",color:"subtlest",children:r}):r,d=()=>typeof t=="string"||typeof t=="number"?e.jsx(w.Text,{color:"primary",fontWeight:"medium",children:t}):t,h=()=>typeof n=="string"||typeof n=="number"?e.jsx(w.Text,{fontWeight:"medium",color:"subtlest",children:n}):n;return e.jsxs(G.Tr,{children:[e.jsx(G.Td,{style:l,width:s,children:a()}),n?e.jsx(G.Td,{style:c,width:24,children:h()}):null,e.jsx(G.Td,{style:l,children:d()})]})}),Zs=u.memo(({fields:t,separator:r,labelWidth:n})=>e.jsx(G.Table,{withColumnBorder:!1,withRowBorder:!1,children:t.map((s,o)=>e.jsx(qs,{separator:r,labelWidth:n,lastIndex:o===t.length-1,...s},`field-group-field-${o}`))})),Gs=u.memo(({maxRow:t=0,maxColumn:r=2,separator:n=":",fields:s=[],labelWidth:o=150,bordered:i=!1})=>{const l=u.useMemo(()=>_s(s,t),[s,t]),c=l.length>2,a=()=>{switch(r){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(x.Box,{gap:c?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:c?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:i?"border":void 0,borderStyle:i?"border-solid":void 0,borderColor:i?"border-subtle":void 0,children:l.map((d,h)=>e.jsx(x.Box,{direction:"column",flex:c?void 0:"1",width:c?a():void 0,marginBottom:c?"lg":void 0,children:e.jsx(Zs,{labelWidth:o,fields:d,separator:n})},h))})}),Qs=({backButton:t})=>{const[r,n]=u.useState(!1),s=(t==null?void 0:t.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(t==null?void 0:t.textColor)??"var(--sa-text-subtle, #8c8f97)",i=(t==null?void 0:t.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",l=(t==null?void 0:t.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(x.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{cursor:"pointer"},children:[e.jsx(E.Icon,{name:(t==null?void 0:t.iconName)||"ChevronLeft",size:"xs",style:{color:r?i:s,transition:"color 0.15s ease"}}),e.jsx(w.Text,{variant:"sub-h3",style:{color:r?l:o,textDecoration:r?"underline":"none",transition:"color 0.15s ease"},children:(t==null?void 0:t.title)||"Back"})]})},Us=({backButton:t,title:r,titleIcon:n,titleTag:s,children:o,header:i=!0,headerBorder:l=!1,disableAnimation:c=!1,scrollable:a=!1,stickyHeader:d=!1,subHeaders:h,action:g,titleTagProps:m,containerProps:y,headerProps:S})=>{const C=be.useMediaQuery("md"),{Link:T,useNavigate:M,useLocation:L}=st(),b=M(),j=L(),I=t==null?void 0:t.show,F=()=>{if(typeof(t==null?void 0:t.onClick)=="function"){t.onClick();return}b(-1,{replace:!0})},D=()=>{if(!g)return null;if(u.isValidElement(g))return g;const q=g.filter(X=>X&&(X.title||X.icon));return q.length===0?null:C?e.jsx(x.Box,{direction:"row",gap:"md",children:q.map(({title:X,icon:K,buttonProps:Q,onClick:Z},z)=>e.jsx(P.Button,{iconLeft:K?e.jsx(E.Icon,{name:K,size:"md"}):void 0,onClick:Z,...Q,children:X},`action-${z}`))}):e.jsxs(R.Menu,{position:"bottom-right",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(E.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{minWidth:200},children:q.map(({title:X,icon:K,buttonProps:Q,onClick:Z},z)=>{const ie=(Q==null?void 0:Q.tone)==="error"||(Q==null?void 0:Q.danger)===!0;return e.jsx(R.MenuItem,{intent:ie?"danger":void 0,disabled:Q==null?void 0:Q.disabled,startIcon:K?e.jsx(E.Icon,{name:K}):void 0,onClick:Z,children:X},`action-${z}`)})})})]})},O=()=>{const q=e.jsx(Qs,{backButton:t});return t!=null&&t.navigateTo?e.jsx(x.Box,{direction:"row",children:e.jsx(T,{to:t.navigateTo,replace:!0,style:{textDecoration:"none"},children:q})}):e.jsx(x.Box,{direction:"row",children:e.jsx(Wt,{onClick:F,children:q})})},A=()=>{const q=!!r,X=Array.isArray(g)&&g.length>0,K=u.isValidElement(g)?!0:X;if(!q&&!K&&!I)return null;const Z=C||!C&&X;return e.jsxs(x.Box,{direction:"column",gap:"xs",paddingBlock:(S==null?void 0:S.paddingBlock)??"sm",paddingInline:(S==null?void 0:S.paddingInline)??"md",...S,style:{...l?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...S==null?void 0:S.style},children:[I&&O(),(q||K)&&e.jsxs(x.Box,{direction:Z?"row":"column",gap:"sm",justify:"space-between",align:Z?"center":"flex-start",children:[q?typeof r=="string"?e.jsxs(x.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(x.Box,{direction:"row",gap:"sm",align:"center",children:[n&&e.jsx(E.Icon,{name:n,size:"md",color:"primary"}),e.jsx(w.Text,{variant:"h3",fontWeight:"semibold",children:r})]}),s&&e.jsx(dt.Badge,{border:!0,size:"lg",text:s,...m})]}):r:null,D()]})]})},Y=()=>{if(!h||h.length===0)return null;const q=h.filter(Q=>Q.show!==!1);if(q.length===0)return null;let X=0,K=-1/0;return q.forEach((Q,Z)=>{const z=Q.order??0;z>=K&&(K=z,X=Z)}),q.map(({content:Q,order:Z,borderBottom:z=!0,keepBottomPadding:ie=!1,paddingInline:ue=!0,paddingBlock:Ce=!0},ke)=>e.jsx(x.Box,{direction:"column",paddingTop:Ce?"sm":"spacing-0",paddingBottom:Ce&&(z||ie||ke===X)?"sm":"spacing-0",paddingInline:ue?"md":"spacing-0",style:{...z?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...Z!==void 0?{order:Z}:{}},children:Q},`sub-header-${ke}`))},H=()=>{const q=i?A():null,X=Y();return!q&&!X?null:e.jsxs(x.Box,{direction:"column",style:{...a?{position:"sticky",left:0,...d?{top:0}:{},zIndex:2,background:"var(--sa-background-primary, #ffffff)"}:{},marginBottom:X?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[q,X]})},_=()=>o;return e.jsxs(x.Box,{direction:"column",as:"main",...y,style:{...a?{height:"100%",minHeight:0,overflow:"auto"}:{},...(y==null?void 0:y.style)??{},...c?{}:{animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"}},children:[H(),_()]},j.pathname)},Js=u.memo(Us),Ys={icon:"Cross",title:""},Xs=320,Pn=16,Vn=4,$s=8,wo=u.forwardRef(({onHide:t,show:r,withBlur:n=!1,style:s,children:o,closeButton:i=Ys,paddingHorizontal:l=!0,width:c,minWidth:a,maxWidth:d,hideBackdrop:h=!1,title:g,headerAction:m,header:y=!0,widthPresets:S,resizable:C=!0,resizeMin:T=Xs,resizeMax:M,onWidthChange:L},b)=>{const I=!be.useMediaQuery("md"),F=c??d??a??"357px",D=S??[],O=D.length>1,[A,Y]=u.useState(()=>{const re=D.indexOf(F);return re>=0?re:0}),[H,_]=u.useState(null),[q,X]=u.useState(!1),[K,Q]=u.useState(!1),Z=u.useRef(null),z=re=>{Z.current=re,typeof b=="function"?b(re):b&&(b.current=re)},ie=O?D[A]:F,ue=H!=null?`${H}px`:ie,Ce=C&&!I,ke=A===D.length-1,je=()=>{const re=(A+1)%D.length;_(null),Y(re),L==null||L(D[re])},he=u.useCallback(re=>{const fe=M??window.innerWidth;return Math.min(Math.max(re,T),fe)},[T,M]),ae=u.useRef(null),Ae=re=>{if(!Ce)return;re.preventDefault();const fe=re.currentTarget;fe.setPointerCapture(re.pointerId),X(!0);const Fe=document.body.style.cursor,ve=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let we=null;const et=W=>{const J=he(window.innerWidth-W.clientX);ae.current=J,we==null&&(we=window.requestAnimationFrame(()=>{we=null,ae.current!=null&&_(ae.current)}))},tt=W=>{we!=null&&window.cancelAnimationFrame(we),ae.current!=null&&_(ae.current),fe.releasePointerCapture(W.pointerId),fe.removeEventListener("pointermove",et),fe.removeEventListener("pointerup",tt),fe.removeEventListener("pointercancel",tt),document.body.style.cursor=Fe,document.body.style.userSelect=ve,X(!1),ae.current!=null&&(L==null||L(`${ae.current}px`))};fe.addEventListener("pointermove",et),fe.addEventListener("pointerup",tt),fe.addEventListener("pointercancel",tt)},Be=re=>{var we;if(!Ce||re.key!=="ArrowLeft"&&re.key!=="ArrowRight")return;re.preventDefault();const fe=re.key==="ArrowLeft"?Pn:-Pn,Fe=H??((we=Z.current)==null?void 0:we.offsetWidth)??T,ve=he(Fe+fe);_(ve),L==null||L(`${ve}px`)},qe=()=>{Ce&&(_(null),L==null||L(ie))};return e.jsx(tr.Drawer,{blur:n,isShow:r,position:"right",onHide:t,ref:z,size:ue,style:s,flush:!0,radius:"none",hideBackdrop:h,children:e.jsxs(x.Box,{direction:"column",height:"height-full",children:[Ce?e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Ubah lebar panel",tabIndex:0,onPointerDown:Ae,onKeyDown:Be,onDoubleClick:qe,title:"Tarik untuk mengubah lebar — klik dua kali untuk reset",onPointerEnter:()=>Q(!0),onPointerLeave:()=>Q(!1),style:{position:"absolute",left:0,top:0,bottom:0,width:$s,cursor:"col-resize",zIndex:1,background:q||K?`linear-gradient(to right, var(--sa-border-brand, var(--sa-border-subtle)) 0 ${Vn}px, transparent ${Vn}px)`:"transparent",transition:"background 0.15s",touchAction:"none"}}):null,y?e.jsxs(x.Box,{direction:"row",align:"center",justify:"space-between",gap:"sm",paddingInline:"md",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",customHeight:"var(--app-header-height, 44px)",flexShrink:"0",children:[e.jsx(x.Box,{direction:"row",align:"center",gap:"sm",overflow:"overflow-hidden",children:typeof g=="string"?e.jsx(w.Text,{fontSize:"md",fontWeight:"bold",children:g}):g}),e.jsxs(x.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[m,O?e.jsx(P.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:je,"aria-label":ke?"Kecilkan panel":"Lebarkan panel",iconRight:e.jsx(E.Icon,{name:ke?"ChevronRight":"ChevronLeft"})}):null,i?e.jsx(P.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:t,"aria-label":i.title||"Tutup",iconRight:e.jsx(E.Icon,{name:i.icon}),children:i.title||void 0}):null]})]}):null,e.jsx(x.Box,{direction:"column",paddingBlock:"md",paddingInline:l?"md":"spacing-0",overflow:"overflow-y-auto",style:{flex:1,minHeight:0},children:o})]})})}),nn=u.memo(({children:t,borderBottom:r=!0,padding:n=!0})=>{const s=be.useMediaQuery("lg");return e.jsx(x.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),on=u.memo(({children:t,borderTop:r=!0,padding:n=!0})=>{const s=be.useMediaQuery("lg");return e.jsx(x.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),Ks=u.memo(({children:t,...r})=>e.jsx(x.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...r,children:t})),ei=u.memo(({children:t,title:r,titleTag:n,action:s,header:o,footer:i,actionContainer:l,containerProps:c,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:h={borderTop:!0},variantTag:g="info"})=>{const m=be.useMediaQuery("lg"),y=()=>n?e.jsxs(x.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(w.Text,{fontWeight:"medium",children:r}),e.jsx(dt.Badges,{border:!0,text:n,variant:g})]}):e.jsx(w.Text,{fontWeight:"medium",children:r}),S=()=>o||e.jsxs(x.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(x.Box,{direction:"column",children:r?y():null}),e.jsx(x.Box,{direction:"column",style:m?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...l,children:s??null})]}),C=!!(o||r||s);return e.jsxs(x.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...c,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(c==null?void 0:c.style)??{}},children:[o!==null&&C?e.jsx(nn,{...d,children:S()}):null,e.jsx(Ks,{...a,children:t}),i?e.jsx(on,{...h,children:i}):null]})}),ti=t=>e.jsx(w.Text,{variant:"h1",children:t.children,...t.props}),ri=t=>e.jsx(w.Text,{variant:"h2",children:t.children,...t.props}),ni=t=>e.jsx(w.Text,{variant:"h3",children:t.children,...t.props}),oi=t=>e.jsx(w.Text,{variant:"h4",children:t.children,...t.props}),si=t=>e.jsx(w.Text,{variant:"h5",children:t.children,...t.props}),ii=t=>e.jsx(w.Text,{variant:"h6",children:t.children,...t.props}),li=t=>e.jsx(w.Text,{variant:"sub-h1",children:t.children,...t.props}),ci=t=>e.jsx(w.Text,{variant:"sub-h2",children:t.children,...t.props}),ai=t=>e.jsx(w.Text,{variant:"sub-h3",children:t.children,...t.props}),di=t=>e.jsx(w.Text,{variant:"body-1",children:t.children,...t.props}),ui=t=>e.jsx(w.Text,{variant:"body-2",children:t.children,...t.props}),xi=t=>e.jsx(w.Text,{variant:"body-3",children:t.children,...t.props}),Ye={H1:ti,H2:ri,H3:ni,H4:oi,H5:si,H6:ii,SubH1:li,SubH2:ci,SubH3:ai,Body1:di,Body2:ui,Body3:xi},_e=()=>{const{useSearchParams:t,useParams:r,useLocation:n}=st(),[s,o]=t(),i=kt.searchParamsToObject(s.toString()),l=r(),c=n(),a=l.id;return{setSearchParams:o,searchParams:s,searchQueries:i,isHasQuery:(y,S)=>s.has(y)&&s.get(y)===S,getQueryParam:y=>s.get(y),getRouteParam:y=>l[y],params:l,location:c,id:a,hasId:!!a}},Do=t=>JSON.stringify(t),So=t=>JSON.stringify(t),ko=t=>JSON.stringify(t),Bo=t=>JSON.stringify(t),hi=t=>t,fi=t=>JSON.stringify(t),Ot=t=>{if(typeof t!="string"||t==="")return{};try{const r=JSON.parse(t);return!r||typeof r!="object"||Array.isArray(r)?{}:r}catch{return{}}},At=({value:t,name:r,type:n,withSearchParam:s=!0,setSearchParams:o,searchQueries:i,dropdownSearchKey:l,filterKey:c="filter",pageKey:a="page"})=>{if(s){let d;switch(n){case"search":d=hi(t);break;case"dropdown":case"dropdown-multiple":d=Do(t);break;case"radio":d=So(t);break;case"date-range":d=ko(t);break;case"advanced-date-range":d=fi(t);break;case"date":d=Bo(t);break;default:d=t;break}if(typeof d<"u"){const h={...Ot(i[c]),[r]:d},g={...i};l&&typeof l=="string"&&delete g[l],delete g[a];const m={...g,[c]:JSON.stringify(h)},y=new URLSearchParams(i).toString(),S=new URLSearchParams(m).toString();if(y===S)return;o(m)}}},Kt=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,l=i?i[t]:void 0;return s==="label"&&l?JSON.parse(l)[0].label:s==="value"&&l?JSON.parse(l)[0].value:l},Eo=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,l=i?i[t]:void 0;return s==="label"&&l?JSON.parse(l).map(c=>c.label):s==="value"&&l?JSON.parse(l).map(c=>c.value):s==="array"&&l?JSON.parse(l):l},mi=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,l=i?i[t]:void 0;return s==="id"&&l?JSON.parse(l).id:s==="label"&&l?JSON.parse(l).label:s==="value"&&l?JSON.parse(l).value:l},ir=(t,r,n)=>{const s=r.get(n||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0;return o?o[t]:void 0},gi=({name:t,filterKey:r="filter",searchParams:n})=>{const s=n.get(r||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0,i=o?o[t]:void 0;return{start:i?JSON.parse(i).from:void 0,end:i?JSON.parse(i).to:void 0}},Fo=({name:t,filterKey:r="filter",searchParams:n})=>{const s=n.get(r||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0,i=o?o[t]:void 0;return i?JSON.parse(i):void 0},pi=(t,{filterKey:r="filter",perPageKey:n="perPage",pageKey:s="page"})=>{const o=t.get(r)||void 0,i=t.get(n)||void 0,l=t.get(s)||void 0;return!!o||!!i||!!l},Mo=({isOpen:t,onClose:r,filterKey:n,pageKey:s,filters:o})=>{const{searchParams:i,setSearchParams:l,searchQueries:c}=_e(),[a,d]=u.useState({}),h=()=>{i.delete(n||"filter"),l(i)},g=(m,y)=>{switch(m.type){case"radio":{const{show:S=!0}=m;return S&&e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y)}case"dropdown":{const{show:S=!0}=m;return S&&e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y)}case"date-range":return e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y);case"date":return e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y);case"dropdown-multiple":{const{show:S=!0}=m;return S&&e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y)}default:return null}};return e.jsx(wo,{onHide:r,show:t||!1,children:e.jsxs(x.Box,{direction:"column",gap:"md",children:[e.jsxs(ce.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(x.Box,{direction:"column",children:"Filter"}),e.jsx(x.Box,{direction:"column",style:{cursor:"pointer"},onClick:h,children:"Reset"})]}),o==null?void 0:o.map((m,y)=>g(m,y))]})})},Io=({searchKey:t="q",statusKey:r="status",searchPlaceholder:n="Search",searchHighlightPlaceholder:s,extendedFilter:o,showSearchFilter:i=!0,showStatusFilter:l=!0,filterKey:c="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:h,filterConfigs:g,buttonToggleProps:m,position:y="right",titleSearchLabel:S="Work Order",withTitleLabels:C=!1})=>{const M=(m==null?void 0:m.isShowLabel)??!0,[L,b]=u.useState(!1),[j,I]=u.useState(0),F=()=>{I(z=>z+1)},{searchParams:D,setSearchParams:O,getQueryParam:A}=_e(),Y=kt.searchParamsToObject(D.toString()),H=ir(t,D,c)||"",[_,q]=u.useState(H),X=A(c),Q=!!(X&&!(()=>{if(X)try{const z=JSON.parse(X);return Object.keys(z).length===1&&z[t]===""}catch(z){console.error("Filter parameter is not a valid JSON:",z)}return!1})()),Z=be.useMediaQuery("md");return u.useEffect(()=>{q(H)},[H]),u.useEffect(()=>{if(_===H)return;const z=window.setTimeout(()=>{At({value:_,name:t,type:"search",searchQueries:Y,setSearchParams:O,filterKey:c,pageKey:a})},350);return()=>{window.clearTimeout(z)}},[_,H,t,Y,O,c,a]),e.jsxs(ce.Flex,{gap:"md",style:{flexDirection:Z&&y==="left"?"row":Z&&y==="right"?"row-reverse":"column"},align:"flex-end",children:[Q&&e.jsx(x.Box,{direction:"column",justify:"flex-end",children:e.jsx(P.Button,{onClick:()=>{const z=new URLSearchParams(D);z.delete(c),O(z),q(""),F(),h&&h()},variant:"outline",tone:"neutral",children:e.jsx(w.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:z,content:ie,title:ue,onClickContainer:Ce},ke)=>e.jsxs(x.Box,{direction:"column",gap:"sm",onClick:Ce,style:{minWidth:z},children:[ue&&e.jsx(Ye.SubH3,{children:ue}),ie]},`extended-filter-${ke}-${j}`)),!!(g!=null&&g.length)&&e.jsx(P.Button,{primary:Q,secondary:!Q,iconLeft:e.jsx(E.Icon,{size:"sm",name:(m==null?void 0:m.icon)||"FilterHorizontal",style:{color:X?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!Z,onClick:()=>b(!0),children:M?"Filter":void 0}),l&&e.jsxs(x.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[C&&e.jsx(Ye.SubH3,{children:"Status"}),e.jsx(St.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Kt({get:"value",name:r,searchParams:D,filterKey:c})?[{label:Kt({get:"value",name:r,searchParams:D,filterKey:c})==="active"?"Active":"InActive",value:Kt({get:"value",name:r,searchParams:D,filterKey:c})}]:[],onChange:z=>At({value:z,name:r,type:"dropdown",searchQueries:Y,setSearchParams:O,filterKey:c}),placeholder:C?"All":"All Status"},j)]}),i&&e.jsxs(x.Box,{direction:"column",gap:"sm",style:{width:d&&Z?d:Z?"310px":""},children:[C&&e.jsxs(Ye.SubH3,{children:["Search for ",S]}),e.jsx(ot.Input,{placeholder:n,leftIcon:e.jsx(E.Icon,{name:"Search",width:20,height:20}),onChange:z=>q(z.target.value),value:_,fullWidth:!0},j+1+c)]}),e.jsx(Mo,{isOpen:L,onClose:()=>b(!1),filterKey:c,filters:g,pageKey:a})]})},yi=t=>t==="checkbox-multiple"?"dropdown-multiple":t==="radio"?"dropdown":t==="date-compact"?"date":t==="text"?"search":t;function sn({configs:t,filterKey:r="filter",activeFilterKey:n="filters",pageKey:s="page",searchKey:o="q"}){const{searchParams:i,setSearchParams:l,searchQueries:c}=_e(),a=u.useMemo(()=>Object.fromEntries(t.map(j=>[j.key,j])),[t]),d=u.useMemo(()=>{const j=(i.get(n)||"").split(",").map(F=>F.trim()).filter(Boolean),I=Object.keys(Ot(i.get(r))).filter(F=>F!==o);return t.map(F=>F.key).filter(F=>{const D=a[F];return(D==null?void 0:D.locked)||j.includes(F)||I.includes(F)})},[i,n,r,o,t,a]),h=u.useCallback(j=>Ot(j[r]),[r]),g=u.useCallback(j=>{const I={...c};j.length?I[n]=j.join(","):delete I[n],l(I)},[c,n,l]),m=u.useCallback(j=>{d.includes(j)||g([...d,j])},[d,g]),y=u.useCallback(j=>{var O;if((O=a[j])!=null&&O.locked)return;const I={...c},F=d.filter(A=>A!==j);F.length?I[n]=F.join(","):delete I[n];const D=h(I);j in D&&(delete D[j],Object.keys(D).length?I[r]=JSON.stringify(D):delete I[r]),delete I[s],l(I)},[c,d,n,r,s,h,l,a]),S=u.useCallback(j=>d.includes(j)?y(j):m(j),[d,m,y]),C=u.useCallback(j=>{switch(j.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return Eo({name:j.key,get:"array",searchParams:i,filterKey:r})||[];case"date":{const I=Fo({name:j.key,searchParams:i,filterKey:r});return I?new Date(I):void 0}case"date-compact":{const F=h(Object.fromEntries(i.entries()))[j.key];return F&&typeof F=="object"?F:void 0}case"text":{const F=h(Object.fromEntries(i.entries()))[j.key];return typeof F=="string"?F:void 0}default:return}},[i,r,h]),T=u.useCallback((j,I)=>{if(j.type==="date-compact"||j.type==="text"){const F={...c},D=h(F);I==null||I===""?delete D[j.key]:D[j.key]=I,Object.keys(D).length?F[r]=JSON.stringify(D):delete F[r],delete F[s],l(F);return}At({value:I,name:j.key,type:yi(j.type),searchQueries:c,setSearchParams:l,filterKey:r,pageKey:s})},[c,l,r,s,h]),M=u.useCallback(j=>{const I={...c},F=h(I);j in F&&(delete F[j],Object.keys(F).length?I[r]=JSON.stringify(F):delete I[r]),delete I[s],l(I)},[c,r,s,h,l]),L=u.useCallback(()=>{const j={...c};delete j[r],delete j[n],delete j[s],l(j)},[c,r,n,s,l]),b=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:b,addFilter:m,removeFilter:y,toggleFilter:S,getValue:C,setValue:T,clearValue:M,clearAll:L}}const ln={get(t){return Tt.storage.get(t)??null},set(t,r){Tt.storage.save(t,r)},remove(t){Tt.storage.delete(t)}},Et={columns:t=>`filterbar:colprefs:${t}`,savedViews:t=>`filterbar:views:${t}`,lastState:t=>`filterbar:last:${t}`,perPage:t=>`filterbar:perpage:${t}`,tableSort:t=>`tablelayout:sort:${t}`},Zt=(t,r)=>{const n=new Set(r.map(i=>i.key)),s=t.order.filter(i=>n.has(i));for(const i of r)s.includes(i.key)||s.push(i.key);const o=t.hidden.filter(i=>n.has(i));return{order:s,hidden:o}};function ji({columns:t,scopeId:r,storage:n,onColumnsChange:s,value:o}){const i=u.useMemo(()=>({order:t.map(D=>D.key),hidden:[]}),[t]),l=r?Et.columns(r):void 0,c=(D,O)=>Zt({order:D.order??O,hidden:D.hidden??[]},t),[a,d]=u.useState(()=>{if(o&&(o.order||o.hidden))return c(o,t.map(D=>D.key));if(l){const D=n.get(l);if(D&&Array.isArray(D.order))return Zt(D,t)}return i}),h=t.map(D=>D.key).join("|");u.useEffect(()=>d(D=>Zt(D,t)),[h]);const g=u.useRef(a);g.current=a;const m=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,y=u.useRef(m);u.useEffect(()=>{if(m==null||y.current===m)return;y.current=m;const D=g.current,O=c(o,D.order);O.order.join("|")===D.order.join("|")&&O.hidden.join("|")===D.hidden.join("|")||(d(O),l&&n.set(l,O))},[m,h]);const S=u.useRef(!1);u.useEffect(()=>{S.current||(S.current=!0,s==null||s(a))},[]);const C=u.useCallback(D=>{d(D),l&&n.set(l,D),s==null||s(D)},[l,n,s]),T=u.useMemo(()=>{const D=new Map(t.map(O=>[O.key,O]));return a.order.filter(O=>D.has(O)).map(O=>({...D.get(O),visible:!a.hidden.includes(O)}))},[a,t]),M=u.useCallback(D=>{const O=a.hidden.includes(D)?a.hidden.filter(A=>A!==D):[...a.hidden,D];C({...a,hidden:O})},[a,C]),L=u.useCallback((D,O)=>{if(D===O)return;const A=[...a.order],[Y]=A.splice(D,1);A.splice(O,0,Y),C({...a,order:A})},[a,C]),b=u.useCallback(D=>{C({...a,hidden:D?t.filter(O=>!O.locked).map(O=>O.key):[]})},[a,t,C]),j=u.useCallback(()=>C(i),[C,i]),I=u.useCallback(D=>C(Zt(D,t)),[C,t]),F=a.hidden.length===0;return{state:a,orderedColumns:T,allVisible:F,toggleVisibility:M,reorder:L,setAllHidden:b,reset:j,applyState:I}}function bi({scopeId:t,storage:r,snapshotKeys:n,pageKey:s="page",getColumns:o,applyColumns:i}){const{searchParams:l,setSearchParams:c}=_e(),a=t?Et.savedViews(t):void 0,[d,h]=u.useState(()=>a?r.get(a)||[]:[]),g=u.useCallback(C=>{h(C),a&&r.set(a,C)},[a]),m=u.useCallback(C=>{const T=C.trim();if(!T)return;const M={};n.forEach(b=>{const j=l.get(b);j!=null&&(M[b]=j)});const L={id:`${Date.now()}`,name:T,query:M,columns:o==null?void 0:o(),createdAt:Date.now()};g([...d,L])},[n,l,o,g,d]),y=u.useCallback(C=>g(d.filter(T=>T.id!==C)),[g,d]),S=u.useCallback(C=>{const T=Object.fromEntries(l.entries());n.forEach(M=>delete T[M]),Object.assign(T,C.query),delete T[s],c(T),C.columns&&(i==null||i(C.columns))},[l,n,s,c,i]);return{enabled:!!a,views:d,saveView:m,deleteView:y,applyView:S}}function vi(t,r){const n=Ot(t);return delete n[r],Object.keys(n).length>0?JSON.stringify(n):void 0}function Nn(t,r,n){const s=t[r];if(s==null)return;const o=vi(s,n);o===void 0?delete t[r]:t[r]=o}function Ci({scopeId:t,storage:r,snapshotKeys:n,enabled:s=!0,filterKey:o="filter",searchKey:i="q",persistSearch:l=!0}){const{searchParams:c}=_e(),a=t&&s?Et.lastState(t):void 0,d=u.useRef(a),h=u.useRef(!1);u.useEffect(()=>{if(!a){d.current=a;return}if(d.current!==a){d.current=a,h.current=!1;return}const y={};if(n.forEach(S=>{const C=c.get(S);C!=null&&(y[S]=C)}),l||Nn(y,o,i),Object.keys(y).length===0){h.current&&r.remove(a);return}h.current=!0,r.set(a,y)},[c,a,n,r,l,o,i]);const g=u.useCallback(()=>{if(!a)return null;const y=r.get(a);if(!y||typeof y!="object"||Array.isArray(y)||Object.keys(y).length===0)return null;const S=y[o];return S!=null&&Object.keys(Ot(S)).length===0&&delete y[o],l||Nn(y,o,i),Object.keys(y).length>0?y:null},[a,r,l,o,i]),m=u.useCallback(()=>{a&&r.remove(a)},[a,r]);return{enabled:!!a,read:g,clear:m}}function wi({scopeId:t,storage:r,perPageKey:n,pageSizeOptions:s,enabled:o=!0}){const{searchParams:i}=_e(),l=t&&o?Et.perPage(t):void 0,c=i.toString(),a=u.useRef(l);u.useEffect(()=>{if(!l){a.current=l;return}if(a.current!==l){a.current=l;return}const g=i.get(n);if(!g)return;const m=Number(g);!Number.isFinite(m)||m<=0||r.set(l,m)},[c,l,n,r]);const d=u.useCallback(()=>{if(!l)return null;const g=r.get(l);if(g==null)return null;const m=Number(g);return!Number.isFinite(m)||m<=0||s&&!s.includes(m)?null:String(m)},[l,r,s]),h=u.useCallback(()=>{l&&r.remove(l)},[l,r]);return{enabled:!!l,read:d,clear:h}}let Br={},Er=!1,Fr=null;const Di=(t,r)=>{Object.assign(Br,t),Fr=r,!Er&&(Er=!0,queueMicrotask(()=>{const n=Br,s=Fr;Br={},Er=!1,Fr=null,!(!s||Object.keys(n).length===0)&&s(o=>{const i=new URLSearchParams(o);return Object.entries(n).forEach(([l,c])=>i.set(l,c)),i},{replace:!0})}))};function Si({enabled:t,snapshotKeys:r,perPageKey:n,readSnapshot:s,readPerPage:o}){const{searchParams:i,setSearchParams:l,location:c}=_e(),a=u.useRef(null);u.useEffect(()=>{if(!t||a.current===c.pathname)return;a.current=c.pathname;const d={};if(!i.has(n)){const h=o();h&&(d[n]=h)}if(!r.some(h=>i.has(h))){const h=s();h&&Object.assign(d,h)}Object.keys(d).length!==0&&Di(d,l)},[c.pathname,t])}const ki=({configs:t,activeKeys:r,onToggle:n,hasActiveFilter:s,onReset:o})=>t.length?e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{minWidth:260},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),s&&o&&e.jsx(P.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:t.map(i=>e.jsx(R.MenuItem,{selected:i.locked||r.includes(i.key),disabled:i.locked,closeOnSelect:!1,startIcon:i.icon??void 0,onClick:()=>{i.locked||n(i.key)},children:i.label},i.key))})})]}):null,zt=({onClear:t,onRemove:r})=>e.jsxs(R.Menu,{position:"bottom-right",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(E.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(R.MenuLists,{children:e.jsxs(R.MenuBody,{style:{width:180},children:[e.jsx(R.MenuItem,{startIcon:e.jsx(E.Icon,{name:"CrossCircle"}),onClick:t,children:"Clear value"}),r&&e.jsx(R.MenuItem,{intent:"danger",startIcon:e.jsx(E.Icon,{name:"Trash1"}),onClick:r,children:"Remove filter"})]})})]}),Bi=t=>{const r=new Date(t);return r.setHours(0,0,0,0),r},_n=(t,r,n)=>{const s=new Date(t);return n==="day"?s.setDate(s.getDate()+r):n==="week"?s.setDate(s.getDate()+r*7):n==="month"?s.setMonth(s.getMonth()+r):s.setFullYear(s.getFullYear()+r),s},Lo=t=>{const r=Bi(new Date);if(t.direction==="this"){const s=new Date(r),o=new Date(r);return t.period==="week"?(s.setDate(r.getDate()-r.getDay()),o.setDate(s.getDate()+6)):t.period==="month"?(s.setDate(1),o.setMonth(o.getMonth()+1,0)):t.period==="year"&&(s.setMonth(0,1),o.setMonth(11,31)),{from:s,to:o}}const n=t.count??1;return t.direction==="past"?{from:_n(r,-n,t.period),to:r}:{from:r,to:_n(r,n,t.period)}},qn=24,To=t=>t.length>qn?`${t.slice(0,qn)}...`:t,Ro=t=>t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Mr=(t,r="days")=>r==="months"?t.toLocaleDateString(void 0,{month:"short",year:"numeric"}):r==="years"?String(t.getFullYear()):Ro(t),nr={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"},Oo=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],Gr={past:"Past",next:"Next",this:"This"},Ei=["day","week","month","year"],Fi=["past","next","this"],Mi=t=>t.field.type==="date-compact"?e.jsx(Ti,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}):e.jsx(Ii,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}),Ii=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=r?Ro(new Date(r)):null,l=!!i,c=l?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:To(i)})]}):t.label;return e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:l?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l?e.jsx(E.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:c})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{width:260},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(zt,{onClear:s,onRemove:o})]}),children:e.jsx(gt.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:t.mode,value:r,onChange:a=>a==null?s():n(a),withPadding:!1})})})]})},Li=(t,r="days")=>{switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date?`${nr[t.op]} ${Mr(new Date(t.date),r)}`:null;case"is-between":return t.from&&t.to?`${Mr(new Date(t.from),r)} - ${Mr(new Date(t.to),r)}`:null;case"is-relative-to-today":{const n=t.relative;if(!n)return null;if(n.direction==="this")return`This ${n.period}`;const s=n.count??1,o=s===1?n.period:`${n.period}s`;return`${Gr[n.direction]} ${s} ${o}`}case"is-empty":case"is-not-empty":return nr[t.op];default:return null}},Ti=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=t.ops&&t.ops.length>0?t.ops:Oo,l=t.defaultOp&&i.includes(t.defaultOp)?t.defaultOp:i[0],c=t.mode??"days",a=(r==null?void 0:r.op)??l,d=r?Li(r,c):null,h=!!d,g=h?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:To(d)})]}):t.label,m=y=>{if(y!==a){if(y==="is-empty"||y==="is-not-empty"){n({op:y});return}if(y==="is-relative-to-today"){n({op:y,relative:(r==null?void 0:r.relative)??{direction:"past",count:1,period:"week"}});return}if(y==="is-between"){n({op:y,from:r==null?void 0:r.from,to:r==null?void 0:r.to});return}n({op:y,date:r==null?void 0:r.date})}};return e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:h?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:h?e.jsx(E.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:g})}),e.jsxs(R.MenuLists,{children:[e.jsx(R.MenuBody,{style:{width:320},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Ao,{op:a,ops:i,onChange:m})]}),e.jsx(zt,{onClear:s,onRemove:o})]}),children:e.jsx(Wo,{value:r,op:a,mode:c,onChange:n})}),a==="is-relative-to-today"&&e.jsx(R.MenuFooter,{children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},Ao=({op:t,ops:r,onChange:n})=>e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:nr[t]})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{width:200},children:r.map(s=>e.jsx(R.MenuItem,{selected:t===s,onClick:()=>n(s),endIcon:t===s?e.jsx(E.Icon,{name:"Check"}):void 0,children:nr[s]},s))})})]}),Wo=({value:t,op:r,mode:n="days",onChange:s})=>{if(r==="is-empty"||r==="is-not-empty")return e.jsx(x.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(r==="is-between"){const o=t!=null&&t.from||t!=null&&t.to?{from:t!=null&&t.from?new Date(t.from):null,to:t!=null&&t.to?new Date(t.to):null}:void 0;return e.jsx(gt.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,filter:n,value:o,onChange:i=>{if(i==null){s({op:r});return}if(typeof i=="object"&&i!==null&&"from"in i&&"to"in i){let{from:l,to:c}=i;if(!l&&c&&(l=c,c=null),!l&&!c){s({op:r});return}s({op:r,from:l?l.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},`range-${n}`)}return r==="is-relative-to-today"?e.jsx(Ri,{value:t==null?void 0:t.relative,onChange:o=>s({op:r,relative:o})}):e.jsx(gt.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:n,value:t!=null&&t.date?new Date(t.date):void 0,onChange:o=>{if(o==null){s({op:r});return}o instanceof Date&&s({op:r,date:o.toISOString()})},withPadding:!1},`single-${n}`)},Ri=({value:t,onChange:r})=>{const n=(t==null?void 0:t.direction)??"past",s=(t==null?void 0:t.count)??1,o=(t==null?void 0:t.period)??"week",i=n!=="this",l=Lo({direction:n,count:s,period:o});return e.jsxs(x.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:Gr[n]})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{width:140},children:Fi.map(c=>e.jsx(R.MenuItem,{selected:n===c,endIcon:n===c?e.jsx(E.Icon,{name:"Check"}):void 0,onClick:()=>r(c==="this"?{direction:c,period:o}:{direction:c,count:s,period:o}),children:Gr[c]},c))})})]}),i&&e.jsx(ot.Input,{type:"number",size:"sm",min:1,clearable:!1,value:s,onChange:c=>{const a=Number(c.target.value);r({direction:n,count:Number.isFinite(a)&&a>0?a:1,period:o})},style:{width:72}}),e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{width:140},children:Ei.map(c=>e.jsx(R.MenuItem,{selected:o===c,endIcon:o===c?e.jsx(E.Icon,{name:"Check"}):void 0,onClick:()=>r(n==="this"?{direction:n,period:c}:{direction:n,count:s,period:c}),children:c},c))})})]})]}),e.jsx(gt.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:l,onChange:()=>{},withPadding:!1},"relative-preview")]})},Zn=18,Oi=t=>t.length>Zn?`${t.slice(0,Zn)}...`:t,Ai=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=t.type==="dropdown-multiple",l=r.length,c=t.searchable!==!1,[a,d]=u.useState(""),h=t.options,g=typeof t.onSearch=="function",m=(()=>{if(g)return h;const M=a.trim().toLowerCase();return M?h.filter(L=>L.label.toLowerCase().includes(M)):h})(),y=M=>r.some(L=>L.value===M.value),S=M=>{if(!i){n([{label:M.label,value:M.value}]),d("");return}n(y(M)?r.filter(L=>L.value!==M.value):[...r,{label:M.label,value:M.value}])},C=M=>{var L;d(M),(L=t.onSearch)==null||L.call(t,M)},T=l===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:l===1?Oi(r[0].label):`${l} Selected`})]});return e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:l>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l>0?e.jsx(E.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:T})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{width:260},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(zt,{onClear:s,onRemove:o})]}),children:e.jsxs(x.Box,{direction:"column",gap:"sm",children:[c&&e.jsx(St.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:i,searchAble:!0,searchValue:a,onSearch:C,value:r,onChange:n,placeholder:`Search ${t.label.toLowerCase()}…`}),e.jsx(x.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:t.isLoading?e.jsx(x.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):m.length===0?e.jsx(x.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):m.map(M=>e.jsx(R.MenuItem,{closeOnSelect:!i,selected:y(M),startIcon:M.avatar,endIcon:y(M)?e.jsx(E.Icon,{name:"Check"}):void 0,description:M.description,onClick:()=>S(M),children:M.label},M.value))})]})})})]})},Gn=18,Wi=t=>t.length>Gn?`${t.slice(0,Gn)}...`:t,Qn=({checked:t,indeterminate:r})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(nt.Checkbox,{size:"sm",checked:t,readOnly:!0,onChange:()=>{},variant:r?"indeterminate":"select"})}),zi=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=new Set(r.map(m=>m.value)),l=r.length,c=t.options.length>0&&t.options.every(m=>i.has(m.value)),a=l>0&&!c,d=m=>{n(i.has(m.value)?r.filter(y=>y.value!==m.value):[...r,{label:m.label,value:m.value}])},h=()=>{n(c?[]:t.options.map(m=>({label:m.label,value:m.value})))},g=l===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs(w.Text,{as:"span",fontWeight:"semibold",children:[t.label,":"]})," ",e.jsx(w.Text,{as:"span",children:l===1?Wi(r[0].label):`${l} Selected`})]});return e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:l>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l>0?e.jsx(E.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:g})}),e.jsx(R.MenuLists,{children:e.jsxs(R.MenuBody,{style:{width:240},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(zt,{onClear:s,onRemove:o})]}),children:[e.jsx(R.MenuItem,{closeOnSelect:!1,selected:c,onClick:h,startIcon:e.jsx(Qn,{checked:c||a,indeterminate:a}),children:"Select All"}),t.options.map(m=>e.jsx(R.MenuItem,{closeOnSelect:!1,selected:i.has(m.value),onClick:()=>d(m),startIcon:e.jsx(Qn,{checked:i.has(m.value)}),children:m.label},m.value))]})})]})},Un=18,Hi=t=>t.length>Un?`${t.slice(0,Un)}...`:t,Pi=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const[i,l]=u.useState(r??""),c=be.useDebounce(i,t.debounceMs??300);u.useEffect(()=>{c!==(r??"")&&n(c)},[c]),u.useEffect(()=>{l(r??"")},[r]);const a=!!r,d=a?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Hi(r)})]}):t.label;return e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:a?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:a?e.jsx(E.Icon,{name:"Search",size:"sm"}):void 0,iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),children:d})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{width:260},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(zt,{onClear:s,onRemove:o})]}),children:e.jsx(ot.Input,{size:"sm",fullWidth:!0,value:i,placeholder:t.placeholder??"Cari…",leftIcon:e.jsx(E.Icon,{name:"Search",width:16,height:16}),onChange:h=>l(h.target.value)})})})]})},zo=({activeKeys:t,configByKey:r,getValue:n,setValue:s,clearValue:o,removeFilter:i})=>e.jsx(e.Fragment,{children:t.map(l=>{const c=r[l];if(!c)return null;const a=n(c),d=c.locked?void 0:()=>i(l);return c.type==="date"||c.type==="date-compact"?e.jsx(Mi,{field:c,value:a,onChange:h=>s(c,h),onClear:()=>o(l),onRemove:d},l):c.type==="text"?e.jsx(Pi,{field:c,value:a||"",onChange:h=>s(c,h),onClear:()=>o(l),onRemove:d},l):c.type==="checkbox-multiple"?e.jsx(zi,{field:c,value:a||[],onChange:h=>s(c,h),onClear:()=>o(l),onRemove:d},l):e.jsx(Ai,{field:c,value:a||[],onChange:h=>s(c,h),onClear:()=>o(l),onRemove:d},l)})}),Jn=t=>`${t} Rows`,Vi=({pagination:t,pageKey:r="page",perPageKey:n="perPage",pageSizeOptions:s=[10,25,50,100],defaultPerPage:o=10,showResultCount:i=!0,showPageSize:l=!0,showPagination:c=!0})=>{var M;const{searchQueries:a,setSearchParams:d,searchParams:h}=_e(),g=h.get(n),m=g?Number(g):o,y=L=>{d({...a,[r]:String(L)})},S=L=>{d({...a,[n]:L,[r]:"1"})},C=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:0),T=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[i&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${C}-${T} of ${((M=t==null?void 0:t.totalData)==null?void 0:M.toLocaleString())||0}`}),l&&e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(E.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Jn(m)})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{children:s.map(L=>e.jsx(R.MenuItem,{selected:L===m,onClick:()=>S(String(L)),children:Jn(L)},L))})})]}),c&&((t==null?void 0:t.totalPage)??0)>1&&e.jsx(x.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(Rt.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:t!=null&&t.currentPage?Number(t.currentPage):1,totalPages:Number(t==null?void 0:t.totalPage),onPageChange:y})})]})};function Ni(t,r,n=!0){u.useEffect(()=>{if(!n)return;const s=o=>{var c;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==t||Ne.isOverlayOpen())return;const i=o.target,l=(c=i==null?void 0:i.tagName)==null?void 0:c.toLowerCase();l==="input"||l==="textarea"||i!=null&&i.isContentEditable||(o.preventDefault(),r())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,r,n])}const _i=240,Ho=({searchKey:t="q",filterKey:r="filter",pageKey:n="page",placeholder:s="Search",shortcut:o="/",collapsible:i=!0})=>{const{searchParams:l,setSearchParams:c,searchQueries:a}=_e(),d=ir(t,l,r)||"",[h,g]=u.useState(!i||!!d),[m,y]=u.useState(i&&!d),[S,C]=u.useState(d),T=be.useDebounce(S,350),M=u.useRef(null);u.useEffect(()=>{C(d),d&&g(!0)},[d]),u.useEffect(()=>{h&&y(!1)},[h]),u.useEffect(()=>{T!==d&&At({value:T,name:t,type:"search",searchQueries:a,setSearchParams:c,filterKey:r,pageKey:n})},[T]);const L=u.useCallback(()=>{g(!0),requestAnimationFrame(()=>{var F;return(F=M.current)==null?void 0:F.focus()})},[]);Ni(o,L);const b=()=>{i&&!S&&g(!1)},j=F=>{var D;i&&F.key==="Escape"&&!S&&(g(!1),(D=M.current)==null||D.blur())},I=()=>{h||y(!0)};return e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[m&&e.jsx(P.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:L}),e.jsxs(x.Box,{onTransitionEnd:I,style:{position:"relative",width:h?_i:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(ot.Input,{ref:M,size:"sm",fullWidth:!0,value:S,placeholder:s,leftIcon:e.jsx(E.Icon,{name:"Search",width:16,height:16}),onChange:F=>C(F.target.value),onKeyDown:j,onBlur:b,tabIndex:h?0:-1}),h&&!S&&e.jsx(x.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(w.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},Po=({columns:t,allVisible:r,onToggle:n,onReorder:s,onSetAllHidden:o})=>{const[i,l]=u.useState(null),[c,a]=u.useState(null),d=()=>{i!==null&&c!==null&&i!==c&&s(i,c),l(null),a(null)},h=(g,m)=>{const y=g+m;y<0||y>=t.length||s(g,y)};return e.jsxs(R.Menu,{position:"bottom-right",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:r?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{children:e.jsxs(x.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(P.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(r),children:r?"Hide All":"Show All"})]}),e.jsx(x.Box,{direction:"column",overflow:"overflow-y-auto",children:t.map((g,m)=>{const y=!g.locked,S=c===m&&i!==null&&i!==m;return e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:y,onDragStart:()=>y&&l(m),onDragOver:C=>{C.preventDefault(),a(m)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:S?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(x.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:y?0:-1,"aria-label":`Reorder ${g.title}`,"aria-disabled":!y||void 0,color:"icon-subtlest",onKeyDown:C=>{y&&(C.key==="ArrowUp"?(C.preventDefault(),h(m,-1)):C.key==="ArrowDown"&&(C.preventDefault(),h(m,1)))},style:{display:"inline-flex",cursor:y?"grab":"default",opacity:y?1:.4},children:e.jsx(E.Icon,{name:"DragVertical",width:16,height:16})}),g.icon&&e.jsx(x.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:g.icon}),e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:g.title}),e.jsx(x.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(Bt.Toggle,{size:"sm",checked:g.visible,disabled:g.locked,onChange:()=>n(g.key),"aria-label":`Toggle ${g.title} column`})})]},g.key)})})]})})})]})},Vo=({views:t,onApply:r,onDelete:n,onSave:s})=>{const[o,i]=u.useState(""),l=()=>{const c=o.trim();c&&(s(c),i(""))};return e.jsxs(R.Menu,{position:"bottom-right",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:t.length>0?"secondary":"outline",tone:(t.length>0,"neutral"),size:"sm",iconLeft:e.jsx(E.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(R.MenuLists,{style:{width:"260px"},children:[e.jsx(R.MenuBody,{children:e.jsxs(x.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(x.Box,{direction:"column",overflow:"overflow-y-auto",children:t.length===0?e.jsx(x.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(w.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):t.map(c=>e.jsx(R.MenuItem,{startIcon:e.jsx(E.Icon,{name:"Bookmark"}),onClick:()=>r(c),endIcon:e.jsx(P.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Trash2"}),"aria-label":`Delete ${c.name}`,onClick:a=>{a.stopPropagation(),n(c.id)}}),children:c.name},c.id))})]})}),e.jsx(R.MenuFooter,{children:e.jsxs(x.Box,{direction:"row",gap:"xs",children:[e.jsx(x.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(ot.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:c=>i(c.target.value),onKeyDown:c=>{c.key==="Enter"&&l()}})}),e.jsx(P.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:l,children:"Save"})]})})]})]})},qi=({isOpen:t,onClose:r,configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,onToggle:l,onReset:c,getValue:a,setValue:d,clearValue:h,removeFilter:g})=>{const m=s.length;return e.jsx(tr.Drawer,{position:"bottom",isShow:t,onHide:r,children:e.jsxs(x.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(x.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(x.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),m>0&&e.jsxs(w.Text,{fontSize:"sm",color:"subtle",children:["(",m,")"]})]}),e.jsx(P.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:r})]}),e.jsxs(x.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[m>0&&e.jsxs(x.Box,{direction:"column",gap:"sm",children:[e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(x.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(zo,{activeKeys:s,configByKey:o,getValue:a,setValue:d,clearValue:h,removeFilter:g})})]}),n.length>0&&e.jsxs(x.Box,{direction:"column",gap:"sm",children:[e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(x.Box,{direction:"column",children:n.map(y=>{const S=s.includes(y.key),C=!!y.locked;return e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:C?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[y.icon&&e.jsx(x.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:y.icon}),e.jsx(w.Text,{fontSize:"sm",color:"primary",truncate:!0,children:y.label})]}),e.jsx(Bt.Toggle,{size:"sm",checked:S||C,disabled:C,onChange:()=>l(y.key),"aria-label":`Toggle ${y.label}`})]},y.key)})})]})]}),e.jsxs(x.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(x.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(P.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!i,onClick:c,children:"Reset"})}),e.jsx(x.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(P.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:r,children:"Selesai"})})]})]})})},Zi=t=>`${t} Rows`,Gi=({perPageKey:t,pageKey:r,pageSizeOptions:n,defaultPerPage:s=10,showPageSize:o})=>{const{searchQueries:i,setSearchParams:l,searchParams:c}=_e(),a=c.get(t),d=a?Number(a):s,h=g=>{l({...i,[t]:g,[r]:"1"})};return o?e.jsxs(R.Menu,{position:"bottom-right",children:[e.jsx(R.MenuButton,{children:e.jsx(P.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(R.MenuLists,{children:e.jsxs(R.MenuBody,{style:{minWidth:200},children:[e.jsx(x.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),n.map(g=>e.jsx(R.MenuItem,{selected:g===d,endIcon:g===d?e.jsx(E.Icon,{name:"Check"}):void 0,onClick:()=>h(String(g)),children:Zi(g)},g))]})})]}):null},Qi=t=>{var ve;const{withPadding:r,configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,toggleFilter:l,removeFilter:c,getValue:a,setValue:d,clearValue:h,onReset:g,searchable:m,searchKey:y,filterKey:S,pageKey:C,searchPlaceholder:T,searchShortcut:M,searchCollapsible:L,pagination:b,perPageKey:j,pageSizeOptions:I,defaultPerPage:F,showPagination:D,showResultCount:O,showPageSize:A,hasColumns:Y,orderedColumns:H,allVisible:_,onToggleVisibility:q,onReorder:X,onSetAllHidden:K,showSavedViews:Q,savedViews:Z,onApplyView:z,onDeleteView:ie,onSaveView:ue,leadingActions:Ce,trailingActions:ke}=t,[je,he]=u.useState(!1),{searchQueries:ae,setSearchParams:Ae}=_e(),Be=(b==null?void 0:b.rangeStart)??(((b==null?void 0:b.currentPage)||0)>1?(((b==null?void 0:b.currentPage)||0)-1)*((b==null?void 0:b.perPage)||0)+1:1),qe=(b==null?void 0:b.rangeEnd)??((b==null?void 0:b.totalCurrentPage)!==(b==null?void 0:b.perPage)?b==null?void 0:b.totalData:((b==null?void 0:b.currentPage)||1)*((b==null?void 0:b.totalCurrentPage)||0)),re=we=>{Ae({...ae,[C]:String(we)})},fe=O||D&&!!(b!=null&&b.totalPage),Fe=()=>{g(),he(!1)};return e.jsxs(x.Box,{direction:"column",gap:"sm",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(x.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[m&&e.jsx(Ho,{searchKey:y,filterKey:S,pageKey:C,placeholder:T,shortcut:M,collapsible:L}),e.jsx(P.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"FilterHorizontal"}),onClick:()=>he(!0),"aria-label":"Open filters",children:i?`Filter: ${s.length}`:null}),e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[Ce,Q&&e.jsx(Vo,{views:Z,onApply:z,onDelete:ie,onSave:ue}),Y&&e.jsx(Po,{columns:H,allVisible:_,onToggle:q,onReorder:X,onSetAllHidden:K}),e.jsx(Gi,{perPageKey:j,pageKey:C,pageSizeOptions:I,defaultPerPage:F,showPageSize:A}),ke]})]}),fe&&e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[O?e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Be}-${qe} of ${((ve=b==null?void 0:b.totalData)==null?void 0:ve.toLocaleString())||0}`}):e.jsx(x.Box,{direction:"column"}),D&&!!(b!=null&&b.totalPage)&&e.jsx(Rt.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:b!=null&&b.currentPage?Number(b.currentPage):1,totalPages:Number(b.totalPage),onPageChange:re})]}),e.jsx(qi,{isOpen:je,onClose:()=>he(!1),configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,onToggle:l,onReset:Fe,getValue:a,setValue:d,clearValue:h,removeFilter:c})]})},Ui=({withPadding:t=!1,filterConfigs:r=[],filterKey:n="filter",activeFilterKey:s="filters",pageKey:o="page",perPageKey:i="perPage",pageSizeOptions:l=[25,50,100],defaultPerPage:c,showPagination:a=!0,showResultCount:d=!0,showPageSize:h=!0,searchable:g=!1,searchKey:m="q",searchPlaceholder:y="Search",searchShortcut:S="/",searchPosition:C="right",searchCollapsible:T=!0,pagination:M,columns:L=[],onColumnsChange:b,columnsState:j,scopeId:I,savedViews:F,persistLastState:D=!0,persistSearch:O=!0,storage:A=ln,onReset:Y,leadingActions:H,trailingActions:_})=>{const q=I??(F==null?void 0:F.scopeId),{activeKeys:X,configByKey:K,hasActiveFilter:Q,toggleFilter:Z,removeFilter:z,getValue:ie,setValue:ue,clearValue:Ce,clearAll:ke}=sn({configs:r,filterKey:n,activeFilterKey:s,pageKey:o,searchKey:m}),je=ji({columns:L,scopeId:q,storage:A,onColumnsChange:b,value:j}),he=bi({scopeId:q,storage:A,snapshotKeys:[s,n,i],pageKey:o,getColumns:()=>je.state,applyColumns:je.applyState}),ae=Ci({scopeId:q,storage:A,snapshotKeys:[s,n,o],enabled:D,filterKey:n,searchKey:m,persistSearch:O}),Ae=wi({scopeId:q,storage:A,perPageKey:i,pageSizeOptions:l,enabled:D});Si({enabled:D&&!!q,snapshotKeys:[s,n,o],perPageKey:i,readSnapshot:ae.read,readPerPage:Ae.read});const Be=c??l[0]??25,qe=!!(F!=null&&F.enabled)&&he.enabled,re=()=>{ke(),ae.clear(),Y==null||Y()},fe=be.useMediaQuery("md"),Fe=g?e.jsx(Ho,{searchKey:m,filterKey:n,pageKey:o,placeholder:y,shortcut:S,collapsible:T}):null;return fe?e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",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(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(ki,{configs:r,activeKeys:X,onToggle:Z,hasActiveFilter:Q,onReset:re}),C==="left"&&Fe,e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(zo,{activeKeys:X,configByKey:K,getValue:ie,setValue:ue,clearValue:Ce,removeFilter:z}),Q&&e.jsx(P.Button,{variant:"link",tone:"brand",size:"sm",onClick:re,children:"Reset"})]})]}),e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[H,e.jsx(Vi,{pagination:M,pageKey:o,perPageKey:i,pageSizeOptions:l,defaultPerPage:Be,showPagination:a,showResultCount:d,showPageSize:h}),C==="right"&&Fe,qe&&e.jsx(Vo,{views:he.views,onApply:he.applyView,onDelete:he.deleteView,onSave:he.saveView}),L.length>0&&e.jsx(Po,{columns:je.orderedColumns,allVisible:je.allVisible,onToggle:je.toggleVisibility,onReorder:je.reorder,onSetAllHidden:je.setAllHidden}),_]})]}):e.jsx(Qi,{withPadding:t,configs:r,activeKeys:X,configByKey:K,hasActiveFilter:Q,toggleFilter:Z,removeFilter:z,getValue:ie,setValue:ue,clearValue:Ce,onReset:re,searchable:g,searchKey:m,filterKey:n,pageKey:o,searchPlaceholder:y,searchShortcut:S,searchCollapsible:T,pagination:M,perPageKey:i,pageSizeOptions:l,defaultPerPage:Be,showPagination:a,showResultCount:d,showPageSize:h,hasColumns:L.length>0,orderedColumns:je.orderedColumns,allVisible:je.allVisible,onToggleVisibility:je.toggleVisibility,onReorder:je.reorder,onSetAllHidden:je.setAllHidden,showSavedViews:qe,savedViews:he.views,onApplyView:he.applyView,onDeleteView:he.deleteView,onSaveView:he.saveView,leadingActions:H,trailingActions:_})},Ji=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t[0];return(r==null?void 0:r.value)!=null?String(r.value):void 0},Yi=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t.map(n=>(n==null?void 0:n.value)!=null?String(n.value):null).filter(n=>n!=null);return r.length?r:void 0},Xi=(t,r)=>{switch(t.type){case"dropdown":case"radio":return Ji(r);case"dropdown-multiple":case"checkbox-multiple":return Yi(r);case"date":return r instanceof Date?r.toISOString():void 0;case"date-compact":return r;case"text":return typeof r=="string"&&r?r:void 0;default:return}},Yn=(t,r)=>{if(t==null||t==="")return r;const n=Number(t);return Number.isFinite(n)&&n>0?n:r},$i=t=>{const{filterConfigs:r,filterKey:n="filter",activeFilterKey:s="filters",pageKey:o="page",perPageKey:i="perPage",searchKey:l="q",defaultPage:c=1,defaultPerPage:a=10,paramKeys:d,serialize:h}=t,{activeKeys:g,configByKey:m,hasActiveFilter:y,getValue:S}=sn({configs:r,filterKey:n,activeFilterKey:s,pageKey:o,searchKey:l}),{searchParams:C}=_e(),T=C.toString();return u.useMemo(()=>{const L={},b={},j=Yn(C.get(o),c),I=Yn(C.get(i),a);L[(d==null?void 0:d.page)??"page"]=j,L[(d==null?void 0:d.perPage)??"perPage"]=I;const F=ir(l,C,n)||"";F&&(L[(d==null?void 0:d.search)??"search"]=F);let D=!1;for(const O of g){const A=m[O];if(!A)continue;const Y=S(A);b[O]=Y;const H=h==null?void 0:h[O],_=H?H(Y):Xi(A,Y);if(_==null||Array.isArray(_)&&_.length===0)continue;const q=(d==null?void 0:d[O])??O;L[q]=_,D=!0}return{params:L,raw:b,hasActiveFilter:y||!!F||D}},[T,g.join("|"),n,s,o,i,l,c,a,d,h,m])},Ki=["dropdown","dropdown-multiple","checkbox-multiple","radio"],el=({filterConfigs:t,filterKey:r,activeFilterKey:n,pageKey:s,searchKey:o})=>{const{configByKey:i,getValue:l,setValue:c,removeFilter:a,clearAll:d,hasActiveFilter:h}=sn({configs:t,filterKey:r,activeFilterKey:n,pageKey:s,searchKey:o}),g=(b,j)=>{var F;const I=b.options;return((F=I==null?void 0:I.find(D=>D.value===j))==null?void 0:F.label)??j},m=u.useCallback(b=>{const j=i[b];if(!j)return[];const I=l(j);return Array.isArray(I)?I.map(F=>String(F.value)):[]},[i,l]),y=u.useCallback((b,j)=>{const I=i[b];if(!I||!Ki.includes(I.type))return;const F=Array.isArray(j)?j:[j];if(F.length===0){a(b);return}c(I,F.map(D=>({label:g(I,D),value:D})))},[i,c,a]),S=u.useCallback((b,j)=>{const I=m(b);y(b,I.includes(j)?I.filter(F=>F!==j):[...I,j])},[m,y]),C=u.useCallback((b,j)=>m(b).includes(j),[m]),T=u.useCallback(b=>a(b),[a]),M=u.useCallback(b=>{const j=i[b];return j?l(j):void 0},[i,l]),L=u.useCallback((b,j)=>{const I=i[b];if(I){if(j==null){a(b);return}c(I,j)}},[i,c,a]);return{set:y,toggle:S,clear:T,clearAll:d,isActive:C,values:m,getRaw:M,setRaw:L,hasActiveFilter:h}},Ir="var(--sa-background-brand, #04254f)",tl="var(--sa-text-brand, #031f43)",rl={padding:"6px 8px",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:4,font:"inherit",fontSize:13,outline:"none",width:"100%",boxSizing:"border-box"},cn={padding:"4px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",fontSize:13,color:tl},No=(t,r)=>{if(t.type==="text"||t.type==="date")return!!r.getRaw(t.key);if(t.type==="date-compact"){const n=r.getRaw(t.key);return!!(n&&(n.date||n.from||n.to||n.relative||n.op==="is-empty"||n.op==="is-not-empty"))}return r.values(t.key).length>0},nl=({field:t,controls:r})=>{const[n,s]=u.useState(""),o=t.type==="dropdown"||t.type==="radio",i=t.type==="checkbox-multiple"?!1:t.searchable!==!1,l=r.values(t.key),c=i&&n.trim()?t.options.filter(d=>d.label.toLowerCase().includes(n.toLowerCase())):t.options,a=d=>{o?r.set(t.key,l.includes(d)?[]:d):r.toggle(t.key,d)};return e.jsxs(x.Box,{style:{display:"flex",flexDirection:"column",gap:4,minWidth:200},children:[i&&e.jsx("input",{value:n,onChange:d=>{var h;s(d.target.value),(h=t.onSearch)==null||h.call(t,d.target.value)},placeholder:"Cari…",style:rl}),e.jsxs(x.Box,{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:220,overflowY:"auto"},children:[c.map(d=>{const h=l.includes(d.value);return e.jsxs("button",{type:"button",onClick:()=>a(d.value),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",borderRadius:4},children:[e.jsx("span",{style:{width:16,height:16,flexShrink:0,borderRadius:o?"50%":4,display:"inline-flex",alignItems:"center",justifyContent:"center",border:`1px solid ${h?Ir:"var(--sa-border-subtle, #0b120e24)"}`,background:h&&!o?Ir:"transparent"},children:h&&(o?e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:Ir}}):e.jsx(E.Icon,{name:"Check",size:"xs",style:{color:"#fff"}}))}),e.jsx(w.Text,{as:"span",style:{fontSize:14},children:d.label})]},d.value)}),c.length===0&&e.jsx(w.Text,{as:"span",style:{fontSize:13,color:"var(--sa-text-subtlest, #8c8f97)",padding:"6px 8px"},children:"Tak ada hasil"})]}),l.length>0&&e.jsx("button",{type:"button",onClick:()=>r.clear(t.key),style:cn,children:"Clear"})]})},ol=({field:t,controls:r})=>{const n=r.getRaw(t.key);return e.jsx(x.Box,{style:{minWidth:240},children:e.jsx(gt.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:t.mode,value:n,onChange:s=>r.setRaw(t.key,s??null),withPadding:!1})})},sl=({field:t,controls:r})=>{const n=r.getRaw(t.key),s=t.ops&&t.ops.length>0?t.ops:Oo,o=t.defaultOp&&s.includes(t.defaultOp)?t.defaultOp:s[0],i=t.mode??"days",l=(n==null?void 0:n.op)??o,c=d=>r.setRaw(t.key,d),a=d=>{if(d!==l)return c(d==="is-empty"||d==="is-not-empty"?{op:d}:d==="is-relative-to-today"?{op:d,relative:(n==null?void 0:n.relative)??{direction:"past",count:1,period:"week"}}:d==="is-between"?{op:d,from:n==null?void 0:n.from,to:n==null?void 0:n.to}:{op:d,date:n==null?void 0:n.date})};return e.jsxs(x.Box,{style:{display:"flex",flexDirection:"column",gap:6,minWidth:280},children:[e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Ao,{op:l,ops:s,onChange:a})]}),e.jsx(Wo,{value:n,op:l,mode:i,onChange:c}),No(t,r)&&e.jsx("button",{type:"button",onClick:()=>r.setRaw(t.key,null),style:cn,children:"Clear"})]})},il=({field:t,controls:r})=>{const n=r.getRaw(t.key)??"",[s,o]=u.useState(n),i=be.useDebounce(s,t.debounceMs??300);return u.useEffect(()=>{const l=r.getRaw(t.key)??"";i!==l&&r.setRaw(t.key,i||null)},[i]),e.jsxs(x.Box,{style:{display:"flex",flexDirection:"column",gap:6,minWidth:220},children:[e.jsx(ot.Input,{size:"sm",fullWidth:!0,value:s,placeholder:t.placeholder??"Cari…",leftIcon:e.jsx(E.Icon,{name:"Search",width:16,height:16}),onChange:l=>o(l.target.value)}),s&&e.jsx("button",{type:"button",onClick:()=>{o(""),r.setRaw(t.key,null)},style:cn,children:"Clear"})]})},ll=({field:t,controls:r})=>t.type==="text"?e.jsx(il,{field:t,controls:r}):t.type==="date"?e.jsx(ol,{field:t,controls:r}):t.type==="date-compact"?e.jsx(sl,{field:t,controls:r}):e.jsx(nl,{field:t,controls:r}),cl=(t,r)=>{if(!t)return{};const{fromKey:n,toKey:s,opKey:o}=r,i={};switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date&&(i[n]=new Date(t.date).toISOString()),o&&(i[o]=t.op),i;case"is-between":return t.from&&(i[n]=new Date(t.from).toISOString()),t.to&&(i[s]=new Date(t.to).toISOString()),i;case"is-relative-to-today":{if(!t.relative)return i;const{from:l,to:c}=Lo(t.relative);return i[n]=l.toISOString(),i[s]=c.toISOString(),i}case"is-empty":case"is-not-empty":return o&&(i[o]=t.op==="is-empty"?"empty":"not-empty"),i;default:return i}},_o=({children:t,borderRadius:r,height:n})=>{const s=u.useRef(null),[o,i]=u.useState("100vh");return u.useEffect(()=>{if(n)return;const l=()=>{if(s.current){const c=s.current.getBoundingClientRect().top;i(`calc(100vh - ${c}px)`)}};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[n]),e.jsx(x.Box,{ref:s,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:r||"rounded-xs",style:{height:n??o,display:"flex",flexDirection:"column"},children:t})},qo=({action:t,rightContent:r,leftContent:n,headerSlot:s,advanceFilter:o,showFilter:i=!0})=>{const l=be.useMediaQuery("md"),c=i?e.jsx(Io,{...o}):null,a=()=>t?u.isValidElement(t)?t:e.jsx(x.Box,{style:{display:"flex",flexDirection:l?"row":"column",gap:"8px",width:l?"auto":"100%",textWrap:"nowrap"},children:t.map(({title:d,icon:h,buttonProps:g,onClick:m},y)=>!d&&!h?null:e.jsx(P.Button,{fullWidth:!l,iconLeft:h?e.jsx(E.Icon,{name:h}):void 0,onClick:m,...g,children:d},`action-${y}`))}):null;return e.jsx(x.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:l?"row":"column-reverse",gap:"16px"},children:s?s({filter:c}):e.jsxs(e.Fragment,{children:[e.jsxs(x.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[c,n]}),e.jsxs(x.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[r,a()]})]})})},al=({totalData:t,withMarginBottom:r=!0,withMarginTop:n=!0})=>e.jsxs(x.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:r?"16px":void 0,marginTop:n?"16px":void 0},children:[e.jsxs(Ye.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Ye.Body1,{children:t||0})]}),Zo=({pagination:t,pageKey:r="page",perPageKey:n="perPage",defaultPerPage:s=10,showPagination:o=!0,totalData:i})=>{const{searchQueries:l,setSearchParams:c,searchParams:a}=_e(),d=a.get(n),h=S=>{c({...l,[r]:String(S)})},g=S=>{c({...l,[n]:S,[r]:"1"})},m=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:1),y=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsx(x.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:o?e.jsxs(e.Fragment,{children:[e.jsxs(x.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(w.Text,{children:"Rows Per Page: "}),e.jsx(St.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:S=>{g(S[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${s} per row`,value:`${s}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${s} per row`,value:`${s}`}]}),e.jsx(w.Text,{children:`${m}-${y} of ${(t==null?void 0:t.totalData)||0}`})]}),e.jsx(Rt.Pagination,{currentPage:t!=null&&t.currentPage?Number(t==null?void 0:t.currentPage):1,totalPages:t!=null&&t.totalPage?Number(t==null?void 0:t.totalPage):1,onPageChange:h})]}):e.jsx(al,{totalData:i,withMarginBottom:!1,withMarginTop:!1})})},Go=({filter:t,columnTitle:r})=>{const[n,s]=u.useState(!1),o=u.useRef(null),i=u.useRef(null),l=u.useRef(null),[c,a]=u.useState(""),[d,h]=u.useState({top:0,left:0}),g=t.selectedValues,m=u.useMemo(()=>c?t.options.filter(C=>C.label.toLowerCase().includes(c.toLowerCase())):t.options,[t.options,c]);u.useEffect(()=>{if(n&&i.current){const C=i.current.getBoundingClientRect(),T=280,M={top:C.bottom+8};t.position==="left"||C.left+T>window.innerWidth?M.right=window.innerWidth-C.right:M.left=C.left,h(M)}},[n,t.position]),u.useEffect(()=>{n&&l.current?setTimeout(()=>{var C;return(C=l.current)==null?void 0:C.focus()},50):a("")},[n]),u.useEffect(()=>{const C=T=>{o.current&&!o.current.contains(T.target)&&i.current&&!i.current.contains(T.target)&&s(!1)};return n&&document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[n]);const y=C=>{const T=g.includes(C)?g.filter(M=>M!==C):[...g,C];t.onFilterChange(T)},S=()=>t.onFilterChange([]);return e.jsxs(x.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(x.Box,{ref:i,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:C=>{var T;C.stopPropagation(),n||(T=t.onOpen)==null||T.call(t),s(M=>!M)},children:e.jsx(E.Icon,{name:n?"ChevronUp":"ChevronDown",size:"sm",style:{color:g.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),n&&e.jsxs(x.Box,{ref:o,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(x.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(w.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",r]}),g.length>0&&e.jsx(x.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(w.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:C=>{C.stopPropagation(),S()},children:"CLEAR"})})]}),!t.hideSearch&&e.jsx(x.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(ot.Input,{ref:l,placeholder:`Search ${r.toLowerCase()}...`,leftIcon:e.jsx(E.Icon,{name:"Search",size:"sm"}),value:c,onChange:C=>a(C.target.value),style:{fontSize:"14px"}})}),e.jsx(x.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:t.isLoadingOptions?e.jsxs(x.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(E.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):m.length>0?e.jsx(x.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:m.map(C=>e.jsxs(x.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:g.includes(C.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:T=>{T.stopPropagation(),y(C.value)},onMouseEnter:T=>{g.includes(C.value)||(T.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),T.currentTarget.style.transform="translateX(2px)"},onMouseLeave:T=>{T.currentTarget.style.backgroundColor=g.includes(C.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",T.currentTarget.style.transform="translateX(0)"},children:[e.jsx(nt.Checkbox,{checked:g.includes(C.value),onChange:()=>{}}),e.jsx(w.Text,{fontSize:"sm",fontWeight:g.includes(C.value)?"medium":"normal",color:g.includes(C.value)?"primary":"gray-700",children:C.label})]},C.value))}):e.jsxs(x.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(E.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),g.length>0&&e.jsx(x.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(x.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(x.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:g.length}),e.jsxs(w.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",g.length>1?"s":""," selected"]})]})})]})]})},dl=({direction:t})=>{const r="var(--sa-text-primary, #292a2e)",n="var(--sa-text-subtle, #8c8f97)",s=t==="asc"?r:n,o=t==="desc"?r:n,i=t==="asc"?1:.45,l=t==="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:s,opacity:i,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:o,opacity:l},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},ul=({frozen:t})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:t?"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:t?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),Lr="var(--sa-background-primary, #ffffff)",Xn="var(--sa-background-primary-inverse, #f8f8f8)",Qo=({columns:t,records:r,handleDetail:n,handleUpdate:s,handleDelete:o,isLoading:i,visibleHandleDelete:l,visibleHandleUpdate:c,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:h,frozenCount:g=0,onFrozenCountChange:m,customActions:y,actionsOrder:S=["detail","update","delete","custom"],customEmptyState:C,enableColumnResize:T=!1,defaultColumnWidths:M,onColumnWidthsChange:L,defaultMinColumnWidth:b=60,sort:j,defaultSort:I,onSortChange:F,showActionDivider:D=!1})=>{const O=j!==void 0,[A,Y]=u.useState(I??null),H=O?j??null:A,_=W=>{if(W.sortKey)return W.sortKey;if(typeof W.accessor=="string")return W.accessor},q=W=>{const J=_(W);if(!J)return;let U;!H||H.key!==J?U={key:J,direction:"asc"}:H.direction==="asc"?U={key:J,direction:"desc"}:U=null,O||Y(U),F==null||F(U)},K=[n,s,o].filter(W=>W!==void 0).length,Q=!!y,Z=!!n||!!s||!!o||Q,z="var(--sa-border-subtle, #0b120e24)",ie=`1px solid ${z}`,ue=`inset 1px 0 0 ${z}`,Ce=`inset -1px 0 0 ${z}`,ke=K===3?Q?"178px":"140px":K===2?Q?"140px":"102px":K===1?Q?"112px":"74px":Q?"74px":"",je=(W,J)=>{if(!J)return W;if(typeof J=="function")return J(W);if(typeof J=="string")return W[J]},[he,ae]=u.useState(!1);u.useEffect(()=>{if(!(h!=null&&h.current))return;const W=h.current;ae(W.scrollHeight>W.clientHeight)},[r,h]);const Ae=u.useRef(null),[Be,qe]=u.useState([]),[re,fe]=u.useState(()=>M??{}),Fe=u.useRef(null);u.useLayoutEffect(()=>{if(!g||!Ae.current){qe([]);return}const W=Array.from(Ae.current.querySelectorAll("thead tr th")),J=[];let U=0;W.forEach((le,De)=>{J[De]=U,De<g&&(U+=le.offsetWidth)}),qe(J)},[g,t,r,re]);const ve=W=>{m&&m(W<g?W:W+1)},we=(W,J)=>{const U=re[W];if(U!==void 0){const le=`${U}px`;return{width:le,minWidth:le,maxWidth:le}}return J?{width:J}:{}},et=W=>T&&(W.resizable??!0),tt=(W,J)=>{W.preventDefault(),W.stopPropagation();const U=W.currentTarget.closest("th");if(!U)return;const le=Math.round(U.getBoundingClientRect().width);Fe.current={colIndex:J,startX:W.clientX,startWidth:le};const De=document.body.style.userSelect,me=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Se=Pe=>{var ge;const We=Fe.current;if(!We)return;const it=((ge=t[We.colIndex])==null?void 0:ge.minWidth)??b,lt=Math.max(it,We.startWidth+(Pe.clientX-We.startX));fe(ze=>ze[We.colIndex]===lt?ze:{...ze,[We.colIndex]:lt})},Xe=()=>{document.removeEventListener("mousemove",Se),document.removeEventListener("mouseup",Xe),document.body.style.userSelect=De,document.body.style.cursor=me,Fe.current=null,L&&fe(Pe=>(L(Pe),Pe))};document.addEventListener("mousemove",Se),document.addEventListener("mouseup",Xe)};return e.jsx("div",{ref:Ae,children:e.jsxs(G.Table,{fullWidth:!0,children:[e.jsx(G.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(G.Tr,{children:[t.map((W,J)=>{var pt,xt;const U=g>0&&J<g,le=Be[J]??0,De=et(W),Se=J===t.length-1&&Z&&D,Xe=_(W),Pe=!!W.sortable&&!!Xe,We=Pe&&(H==null?void 0:H.key)===Xe?H.direction:null,it=W.title||((pt=W.accessor)==null?void 0:pt.toString())||"",lt=(xt=W.headerTooltip)!=null&&xt.showIcon?e.jsx(E.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,ge=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:it}),ze=Pe?e.jsxs("button",{type:"button",onClick:()=>q(W),title:We==="asc"?"Sorted ascending — click to sort descending":We==="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:W.textAlign==="text-right"?"right":W.textAlign==="text-center"?"center":"left"},children:[ge,lt,e.jsx(dl,{direction:We})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[ge,lt]});return e.jsxs(G.Th,{style:{position:"sticky",top:0,left:U?le:void 0,zIndex:U?4:2,paddingLeft:J===0?"12px":"",borderRight:d&&!Se&&!U?ie:void 0,borderBottom:d?ie:void 0,boxShadow:d&&U?Ce:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:W.textAlign==="text-right"?"right":W.textAlign==="text-center"?"center":"left",...we(J,W.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[W.headerTooltip?e.jsx(Ee.Tooltip,{label:W.headerTooltip.content,position:"bottom",children:ze}):ze,W.filter&&e.jsx(Go,{filter:W.filter,columnTitle:W.title}),m&&e.jsx("button",{onClick:()=>ve(J),title:U?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:U?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:U?1:.45,transition:"opacity 0.15s"},children:e.jsx(ul,{frozen:U})})]}),De&&e.jsx("div",{onMouseDown:ht=>tt(ht,J),onClick:ht=>ht.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-${J}`)}),Z?e.jsx(G.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?ie:void 0,boxShadow:d&&D?ue:void 0}}):null]})}),e.jsx(G.Tbody,{children:i?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:t.length+1,children:e.jsxs(x.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Je.Skeleton,{variant:"list"}),e.jsx(Je.Skeleton,{variant:"list"}),e.jsx(Je.Skeleton,{variant:"list"}),e.jsx(Je.Skeleton,{variant:"list"}),e.jsx(Je.Skeleton,{variant:"list"})]})})}):!(r!=null&&r.length)&&C?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:t.length+1,children:C})}):r==null?void 0:r.map((W,J)=>e.jsxs(G.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:J===r.length-1&&he?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:U=>{const le=U.currentTarget;le.style.backgroundColor=Xn,Array.from(le.querySelectorAll("td")).forEach(De=>{De.style.position==="sticky"&&(De.style.backgroundColor=Xn)})},onMouseLeave:U=>{const le=U.currentTarget;le.style.backgroundColor="",Array.from(le.querySelectorAll("td")).forEach(De=>{De.style.position==="sticky"&&(De.style.backgroundColor=Lr)})},children:[t.map((U,le)=>{const De=U.render?U.render(W,J,r):je(W,U.accessor),me=g>0&&le<g,Se=Be[le]??0,Xe=re[le]!==void 0,Pe=me&&le===g-1;return e.jsx(G.Td,{style:{position:me?"sticky":void 0,left:me?Se:void 0,zIndex:me?1:void 0,backgroundColor:me?Lr:void 0,transition:me?"background-color 0.3s ease":void 0,paddingLeft:le===0?"12px":"",whiteSpace:"nowrap",overflow:Xe?"hidden":void 0,borderLeft:U.showBorderLeft?ie:void 0,borderRight:U.showBorderRight?ie:void 0,boxShadow:Pe?Ce:void 0,textAlign:U.textAlign==="text-right"?"right":U.textAlign==="text-center"?"center":"left",...we(le,U.width)},children:typeof De=="string"?e.jsx(w.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:U.textAlign==="text-right"?"right":U.textAlign==="text-center"?"center":"left"},children:De}):De},`row-${J}-col-${le}`)}),Z?e.jsx(G.Td,{style:{width:ke,position:"sticky",right:0,zIndex:1,backgroundColor:Lr,boxShadow:D?ue:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ce.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:S.map(U=>{const le=J===r.length-1?"top":"bottom";return U==="detail"&&n&&(a==null?void 0:a(W))!==!1?e.jsx(Ee.Tooltip,{label:"Detail",position:le,children:e.jsx(P.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(W.id,W),iconLeft:e.jsx(E.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):U==="update"&&s&&(c==null?void 0:c(W))!==!1?e.jsx(Ee.Tooltip,{label:"Update",position:le,children:e.jsx(P.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>s(W),iconLeft:e.jsx(E.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):U==="delete"&&o&&(l==null?void 0:l(W))!==!1?e.jsx(Ee.Tooltip,{label:"Delete",position:le,children:e.jsx(P.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(W.id,W),iconLeft:e.jsx(E.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):U==="custom"?e.jsx(u.Fragment,{children:y==null?void 0:y(W)},"custom"):null})})}):null]},`${W}${J}`))})]})})};let $n=!1;const xl=({wrapperProps:t,dataTableProps:r,headerProps:n,footerProps:s})=>{var g;process.env.NODE_ENV!=="production"&&!$n&&($n=!0,console.warn("[@starasia/admin] `TableSection` deprecated — pakai `<FilterBar>` + `<TableLayout>`. Lihat skill `starasia-list-page-pattern`. Akan dihapus di salah satu major berikutnya."));const o=u.useRef(null),[i,l]=u.useState((r==null?void 0:r.defaultFrozenCount)??0),c=(n==null?void 0:n.show)??!0,a=u.useRef(null),d=(g=r==null?void 0:r.pagination)==null?void 0:g.totalData;typeof d=="number"&&(a.current=d);const h=(s==null?void 0:s.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(_o,{...t,children:[c&&e.jsx(qo,{...n}),e.jsx(x.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:r?e.jsx(Qo,{...r,scrollParentRef:o,frozenCount:r!=null&&r.enableFreezeColumns?i:0,onFrozenCountChange:r!=null&&r.enableFreezeColumns?l:void 0}):null}),h&&e.jsx(Zo,{pagination:r==null?void 0:r.pagination,pageKey:r==null?void 0:r.pageKey,perPageKey:r==null?void 0:r.perPageKey,defaultPerPage:r==null?void 0:r.defaultPerPage,showPagination:r==null?void 0:r.showPagination,totalData:s==null?void 0:s.totalData})]})};function hl(t){return u.memo(t)}const fl=hl(xl),Uo="(any-pointer: coarse)",ml=t=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const r=window.matchMedia(Uo);return r.addEventListener("change",t),()=>r.removeEventListener("change",t)},gl=()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(Uo).matches,pl=()=>!1;function Jo(){return u.useSyncExternalStore(ml,gl,pl)}const Kn=200,Gt="1px solid var(--sa-border-subtle, #0b120e24)",yl=({sortDir:t,frozen:r,filterActive:n})=>t==="asc"?e.jsx(E.Icon,{name:"ChevronSmallUp"}):t==="desc"?e.jsx(E.Icon,{name:"ChevronSmallDown"}):r?e.jsx(E.Icon,{name:"LockOn",size:"xs"}):e.jsx(E.Icon,{name:"Filter",size:"xs",style:n?{color:"var(--sa-text-brand, #031f43)"}:void 0}),Qt=({icon:t,label:r,active:n,danger:s,onClick:o})=>{const i=s?"var(--sa-text-error, #a4133c)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:n?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:i,textAlign:"left"},onMouseEnter:l=>{n||(l.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:l=>{l.currentTarget.style.background=n?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(E.Icon,{name:t,size:"sm",style:{color:i,flexShrink:0}}),e.jsx(w.Text,{as:"span",style:{color:i},children:r})]})},jl=t=>{let r=(t==null?void 0:t.parentElement)??null;for(;r;){const n=getComputedStyle(r).overflowX;if((n==="auto"||n==="scroll")&&r.scrollWidth>r.clientWidth)return r;r=r.parentElement}return null},Yo=({active:t,canSort:r,canHide:n,sortDir:s,frozen:o,onSort:i,onClearSort:l,onToggleFreeze:c,onHide:a,filterSlot:d,filterActive:h})=>{const[g,m]=u.useState(!1),y=u.useRef(null),S=u.useRef(null),[C,T]=u.useState({top:0,left:0}),M=u.useCallback(()=>{var H;const b=y.current;if(!b)return;const j=b.getBoundingClientRect(),I=b.closest(".sa-tl-scroll")??jl(b),F=I==null?void 0:I.getBoundingClientRect();if(F&&(j.left<F.left||j.left>F.right)){m(!1);return}const D=Math.min(window.innerWidth-8,F?F.right:window.innerWidth),O=((H=S.current)==null?void 0:H.offsetWidth)||Kn,A=F?F.left:8,Y=Math.max(A,Math.min(j.left,D-O));T({top:j.bottom+6,left:Y})},[]);u.useEffect(()=>{if(!g)return;M();const b=()=>M();return window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),()=>{window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b)}},[g,M]),u.useEffect(()=>{if(!g)return;const b=j=>{S.current&&!S.current.contains(j.target)&&y.current&&!y.current.contains(j.target)&&m(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[g]);const L=b=>{b(),m(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:y,type:"button",className:"sa-tl-menu-trigger","data-active":t||g?"true":"false",onClick:b=>{b.stopPropagation(),m(j=>!j)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:Gt,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(yl,{sortDir:s,frozen:o,filterActive:h})}),g&&e.jsxs(x.Box,{ref:S,onClick:b=>b.stopPropagation(),style:{position:"fixed",top:`${C.top}px`,...C.left!==void 0?{left:`${C.left}px`}:{right:`${C.right}px`},minWidth:Kn,backgroundColor:"var(--sa-background-primary, #ffffff)",border:Gt,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-xl, 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[d!=null&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:"6px 12px 2px"},children:e.jsx(w.Text,{as:"span",style:{fontSize:12,fontWeight:500,color:"var(--sa-text-subtlest, #8c8f97)"},children:"Filter"})}),e.jsx("div",{style:{padding:"2px 8px 4px"},children:d}),e.jsx("div",{style:{borderTop:Gt,margin:"4px 0"}})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx(Qt,{icon:"ChevronUp",label:"Ascending",active:s==="asc",onClick:()=>L(()=>s==="asc"?l():i("asc"))}),e.jsx(Qt,{icon:"ChevronDown",label:"Descending",active:s==="desc",onClick:()=>L(()=>s==="desc"?l():i("desc"))}),e.jsx("div",{style:{borderTop:Gt,margin:"4px 0"}})]}),e.jsx(Qt,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>L(c)}),n&&e.jsx(Qt,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>L(a)})]})]})},bl=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),vl={background:"var(--sa-background-warning-subtlest, #fef2e6)",color:"inherit",padding:0,borderRadius:2},Xo=({text:t,query:r,markStyle:n})=>{const s=r==null?void 0:r.trim();if(!s||!t)return e.jsx(e.Fragment,{children:t});const o=s.split(/\s+/).filter(Boolean);if(!o.length)return e.jsx(e.Fragment,{children:t});const i=new Set(o.map(a=>a.toLowerCase())),l=new RegExp(`(${o.map(bl).join("|")})`,"gi"),c=t.split(l);return e.jsx(e.Fragment,{children:c.map((a,d)=>a&&i.has(a.toLowerCase())?e.jsx("mark",{style:{...vl,...n},children:a},d):e.jsx(u.Fragment,{children:a},d))})},Mt="1px solid var(--sa-border-subtle, #0b120e24)",Cl="var(--sa-text-subtle, #8c8f97)",Ct="var(--sa-background-neutral, #f0f1f2)",eo="2px 0 4px -2px var(--sa-border-subtle, #0b120e24)",It=40,Tr=5,wl=28,Rr=4,Ut=16,Or="var(--sa-background-brand-subtlest)",Jt={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},to="sa-table-layout-styles",Dl=()=>{if(typeof document>"u"||document.getElementById(to))return;const t=document.createElement("style");t.id=to,t.textContent=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const bn=require("@starasia/alert"),er=require("@starasia/avatar"),dt=require("@starasia/badges"),x=require("@starasia/box"),wt=require("@starasia/breadcrumb"),H=require("@starasia/button"),Hr=require("@starasia/card"),gt=require("@starasia/date"),Re=require("@starasia/dialog"),tr=require("@starasia/drawer"),St=require("@starasia/dropdown"),be=require("@starasia/hooks"),kt=require("@starasia/http"),ot=require("@starasia/input"),R=require("@starasia/menu"),Rt=require("@starasia/pagination"),Lt=require("@starasia/storage"),G=require("@starasia/table"),vn=require("@starasia/tabs"),Pr=require("@starasia/textarea"),Dt=require("@starasia/theme"),Cn=require("@starasia/toast"),Bt=require("@starasia/toggle"),Ee=require("@starasia/tooltip"),nt=require("@starasia/checkbox"),Vr=require("@starasia/radio"),w=require("@starasia/text"),B=require("@starasia/icon"),ce=require("@starasia/flex"),wn=require("@starasia/grid"),Dn=require("@starasia/progress"),Sn=require("@starasia/stepper"),kn=require("@starasia/accordion"),Bn=require("@starasia/story-record"),Je=require("@starasia/skeleton"),En=require("@starasia/progress-stepper"),e=require("react/jsx-runtime"),u=require("react"),sr=require("react-dom"),Ms=require("react-easy-crop"),Is={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Jr=u.createContext(Is),Yr=()=>u.useContext(Jr),lo=t=>{const[r,n]=u.useState((t==null?void 0:t.initialUserData)||null);return{userData:r,setUserData:n}},co=u.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),ao=({children:t})=>{const[r,n]=u.useState({}),s=u.useCallback(c=>{n(a=>typeof c=="function"?c(a):c)},[]),o=u.useCallback((c,a)=>{n(d=>{const h=typeof a=="function"?a(d[c]):a;return{...d,[c]:h}})},[]),i=u.useCallback(c=>{n(a=>{if(!(c in a))return a;const d={...a};return delete d[c],d})},[]),l=u.useMemo(()=>({badges:r,setBadge:o,setBadges:s,clearBadge:i}),[r,o,s,i]);return e.jsx(co.Provider,{value:l,children:t})},uo=()=>u.useContext(co),$t=(t,r)=>{const n=r!==void 0?r:t;return n==null?null:typeof n=="string"||typeof n=="number"?{value:n}:n},Xr=240,$r=200,Kr=480,Ts="sa-sidebar-width",Nr=(t,r,n)=>Math.min(Math.max(t,r),n),Ls=(t,r,n,s)=>{if(typeof window>"u")return r;try{const o=window.localStorage.getItem(t);if(!o)return r;const i=parseInt(o,10);return Number.isFinite(i)?Nr(i,n,s):r}catch{return r}},Fn=(t,r)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(t,String(r))}catch{}},xo=u.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},width:Xr,setWidth:()=>{},resetWidth:()=>{},minWidth:$r,maxWidth:Kr,mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),ho=({children:t,defaultCollapsed:r=!1,defaultWidth:n=Xr,minWidth:s=$r,maxWidth:o=Kr,widthStorageKey:i=Ts})=>{const[l,c]=u.useState(r),[a,d]=u.useState(!1),[h,g]=u.useState(()=>Ls(i,n,s,o)),m=u.useCallback(D=>{c(O=>typeof D=="function"?D(O):D)},[]),y=u.useCallback(()=>c(D=>!D),[]),S=u.useCallback(()=>c(!0),[]),C=u.useCallback(()=>c(!1),[]),L=u.useCallback(D=>{g(O=>{const A=typeof D=="function"?D(O):D,Y=Nr(Math.round(A),s,o);return Fn(i,Y),Y})},[s,o,i]),M=u.useCallback(()=>{const D=Nr(n,s,o);Fn(i,D),g(D)},[n,s,o,i]),T=u.useCallback(D=>{d(O=>typeof D=="function"?D(O):D)},[]),b=u.useCallback(()=>d(!0),[]),j=u.useCallback(()=>d(!1),[]),I=u.useCallback(()=>d(D=>!D),[]),F=u.useMemo(()=>({collapsed:l,setCollapsed:m,toggle:y,collapse:S,expand:C,width:h,setWidth:L,resetWidth:M,minWidth:s,maxWidth:o,mobileOpen:a,setMobileOpen:T,openMobile:b,closeMobile:j,toggleMobile:I}),[l,m,y,S,C,h,L,M,s,o,a,T,b,j,I]);return e.jsx(xo.Provider,{value:F,children:t})},fo=()=>u.useContext(xo),mo=u.createContext(null),go=({adapter:t,children:r})=>e.jsx(mo.Provider,{value:t,children:r}),st=()=>{const t=u.useContext(mo);if(!t)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 t},po=({router:t,routerAdapter:r,menus:n=[],menuBottom:s,logo:o,appName:i="Workspace",initialUserData:l,theme:c})=>{const a=lo({initialUserData:l}),{theme:d}=Dt.useTheme();return e.jsx(go,{adapter:r,children:e.jsx(Jr.Provider,{value:{logo:o,appName:i,menus:n,userData:a.userData,setUserData:a.setUserData,menuBottom:s},children:e.jsx(ao,{children:e.jsx(ho,{children:c?e.jsx(Dt.ThemeProvider,{value:c,children:t}):d?e.jsx(Dt.ThemeProvider,{value:d,children:t}):t})})})})},Rs=u.memo(po);function yo({collapsed:t=!1,children:r}){if(!r)return null;const n=typeof r=="function",s=n?r({collapsed:t}):r;return s==null||s===!1?null:e.jsx("div",{style:{position:"sticky",top:"var(--app-header-height, 4rem)",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:t?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingRight:t?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:n?s:e.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.3s",visibility:t?"hidden":"visible"},children:s})})}const en=u.createContext(null);function jo({children:t}){const[r,n]=u.useState(null),[s,o]=u.useState(null),[i,l]=u.useState(null),[c,a]=u.useState(0),d=u.useCallback(()=>(a(h=>h+1),()=>a(h=>h-1)),[]);return e.jsx(en.Provider,{value:{prependNode:r,appendNode:s,replaceNode:i,setPrependNode:n,setAppendNode:o,setReplaceNode:l,replaceCount:c,registerReplace:d},children:t})}function bo({children:t}){const r=u.useContext(en);return r?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:r.setPrependNode,style:{display:"contents"}}),r.replaceCount>0?e.jsx("div",{ref:r.setReplaceNode,style:{display:"contents"}}):t,e.jsx("div",{ref:r.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:t})}function Os({children:t,mode:r="append"}){const n=u.useContext(en);if(u.useEffect(()=>{if(!(r!=="replace"||!n))return n.registerReplace()},[r,n]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const s=r==="prepend"?n.prependNode:r==="replace"?n.replaceNode:n.appendNode;return s?sr.createPortal(t,s):null}const tn=u.createContext(null);function vo({children:t}){const[r,n]=u.useState({}),[s,o]=u.useState({}),i=u.useCallback((a,d)=>{n(h=>h[a]===d?h:{...h,[a]:d})},[]),l=u.useCallback(a=>(o(d=>({...d,[a]:(d[a]??0)+1})),()=>o(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),c=u.useMemo(()=>({outletNodes:r,setOutletNode:i,slotCounts:s,registerSlot:l}),[r,i,s,l]);return e.jsx(tn.Provider,{value:c,children:t})}function _r({slotKey:t,fallback:r}){const n=u.useContext(tn),s=n?(n.slotCounts[t]??0)>0:!1,o=u.useRef(n==null?void 0:n.setOutletNode);o.current=n==null?void 0:n.setOutletNode;const i=u.useCallback(l=>{var c;return(c=o.current)==null?void 0:c.call(o,t,l)},[t]);return e.jsx(e.Fragment,{children:s?e.jsx("div",{ref:i,style:{display:"contents"}}):r})}function As({slotKey:t,children:r}){const n=u.useContext(tn),s=u.useRef(n==null?void 0:n.registerSlot);if(s.current=n==null?void 0:n.registerSlot,u.useEffect(()=>{var i;return(i=s.current)==null?void 0:i.call(s,t)},[t]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=n.outletNodes[t];return o?sr.createPortal(r,o):null}const rr="moduleSwitcherGroupId",qr="sa-module-switcher-change";function Mn(){if(typeof window>"u")return null;const t=window.localStorage.getItem(rr);if(t===null)return null;const r=Number(t);return Number.isFinite(r)?r:null}function Co(t){typeof window>"u"||(t===null?window.localStorage.removeItem(rr):window.localStorage.setItem(rr,String(t)),window.dispatchEvent(new CustomEvent(qr,{detail:t})))}function Ws(){Co(null)}function rn(){const[t,r]=u.useState(()=>Mn());return u.useEffect(()=>{const s=()=>{r(Mn())},o=i=>{i.key===rr&&s()};return window.addEventListener(qr,s),window.addEventListener("storage",o),()=>{window.removeEventListener(qr,s),window.removeEventListener("storage",o)}},[]),{selectedGroupId:t,setSelectedGroupId:s=>{Co(s),r(s)}}}let qt=0,yt=!1,In=new Set;const Tn=new Set;function zs(t,r){const[n,s]=u.useState(!1),o=u.useRef(null),i=u.useRef(null);return u.useLayoutEffect(()=>{const l=o.current;if(!l)return;let c=0;const a=()=>{c=0;const h=i.current;if(!h)return;const g=h.scrollWidth>l.clientWidth;s(m=>m===g?m:g)},d=new ResizeObserver(()=>{c||(c=requestAnimationFrame(a))});return d.observe(l),a(),()=>{c&&cancelAnimationFrame(c),d.disconnect()}},[t,r]),{containerRef:o,textRef:i,truncated:n}}function Ln({text:t,textStyle:r,active:n=!1}){const{containerRef:s,textRef:o,truncated:i}=zs(t,n),l=e.jsx(w.Text,{ref:o,as:"span",fontSize:"md",fontWeight:n?"medium":"normal",truncate:!0,style:{display:"block",...r},children:t});return e.jsx(x.Box,{ref:s,display:"block",style:{flex:1,minWidth:0},children:i?e.jsx(Ee.Tooltip,{fluid:!0,label:t,position:"top",children:l}):l})}const Hs=200,Zr="var(--app-header-height, 4rem)",Rn="44px",Sr=`calc((${Zr} - 2rem) / 2)`,On=16;function Ps({children:t,headerLeftSlot:r,profile:n,isLoadingProfile:s,onLogout:o,isLoggingOut:i,loadingComponent:l,sidebarHeaderContent:c,headerActions:a,profileRole:d,profileMenuButtons:h,profileMenuItems:g,logoutButton:m,resizableSidebar:y=!0}){var ht,ft;const{useSearchParams:S,useNavigate:C,useLocation:L,Outlet:M}=st(),[T]=S(),b=T.get("embed")==="true",j=Yr(),{badges:I}=uo(),F=C(),D=L(),A=!be.useMediaQuery("md"),[Y,P]=u.useState(!1),{collapsed:_,setCollapsed:q,width:X,setWidth:K,resetWidth:Q,minWidth:Z,maxWidth:z,mobileOpen:ie,setMobileOpen:ue}=fo(),[Ce,ke]=u.useState(!1),[je,he]=u.useState(()=>new Set(In)),[ae,We]=u.useState(null),{selectedGroupId:Be,setSelectedGroupId:qe}=rn(),re=_&&!A;u.useEffect(()=>{In=je},[je]);const fe=u.useRef(null),Fe=u.useRef(null),ve=u.useRef(null),[we,et]=u.useState(!1),[tt,W]=u.useState(null),J=y&&!A&&!_,U=k=>Math.min(Math.max(k,Z),z),le=tt??X,De=k=>{var Qe,Ne,Ae;if(!J)return;k.preventDefault();const V=k.clientX,$=((Qe=ve.current)==null?void 0:Qe.getBoundingClientRect().width)??X;(Ae=(Ne=k.currentTarget).setPointerCapture)==null||Ae.call(Ne,k.pointerId),et(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize";let Me=0,Oe=$;const Ie=mt=>{Oe=$+(mt.clientX-V),Me||(Me=requestAnimationFrame(()=>{Me=0,W(U(Oe))}))},Te=()=>{Me&&cancelAnimationFrame(Me),window.removeEventListener("pointermove",Ie),window.removeEventListener("pointerup",Te),document.body.style.userSelect="",document.body.style.cursor="",W(null),et(!1),Oe<Hs?q(!0):K(U(Oe))};window.addEventListener("pointermove",Ie),window.addEventListener("pointerup",Te)},me=k=>{J&&(k.key==="ArrowLeft"?(k.preventDefault(),K(V=>V-On)):k.key==="ArrowRight"?(k.preventDefault(),K(V=>V+On)):k.key==="Home"?(k.preventDefault(),K(Z)):k.key==="End"&&(k.preventDefault(),K(z)))};u.useEffect(()=>{const k=fe.current;if(!k)return;const V=()=>{yt||(qt=k.scrollTop)};return k.addEventListener("scroll",V),()=>k.removeEventListener("scroll",V)},[]);const Se=()=>{const k=fe.current;k&&qt>0&&(yt=!0,k.scrollTop=qt,requestAnimationFrame(()=>{yt=!1}))};u.useLayoutEffect(()=>{yt=!0,Se();const k=setTimeout(()=>{yt=!1},300);return()=>clearTimeout(k)},[]),u.useLayoutEffect(()=>{j.menus.length>0&&(qt>0?Se():requestAnimationFrame(()=>{var V;const k=(V=fe.current)==null?void 0:V.querySelector("[data-menu-active='true']");k&&k.scrollIntoView({block:"center",behavior:"instant"})}))},[j.menus]),u.useEffect(()=>{yt=!0,Se();const k=setTimeout(Se,0),V=setTimeout(Se,50),$=setTimeout(Se,100),Me=setTimeout(Se,200),Oe=setTimeout(()=>{yt=!1},300),Ie=setTimeout(()=>{const Te=fe.current,Qe=Te==null?void 0:Te.querySelector("[data-menu-active='true']");if(Te&&Qe){const Ne=Te.getBoundingClientRect(),Ae=Qe.getBoundingClientRect();Ae.top>=Ne.top&&Ae.bottom<=Ne.bottom||Qe.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(k),clearTimeout(V),clearTimeout($),clearTimeout(Me),clearTimeout(Oe),clearTimeout(Ie)}},[D.pathname]),u.useEffect(()=>{Fe.current&&(Fe.current.scrollTop=0)},[D.pathname]),u.useEffect(()=>{A&&ue(!1)},[D.pathname,A]),u.useEffect(()=>{A&&q(!0)},[A]),u.useEffect(()=>{const k=document.documentElement;return k.style.setProperty("--app-header-height",Rn),()=>{k.style.removeProperty("--app-header-height")}},[]);const Xe=()=>{P(!0)},Ve=()=>{P(!1)},ze=()=>{P(!1),o()},it=k=>{const V=k.slotKey?[]:[k.to];return k.children&&V.push(...k.children.map($=>$.to)),V},lt=[...j.menus.flatMap(k=>k.items.flatMap(it)),...((ht=j.menuBottom)==null?void 0:ht.flatMap(it))??[]],ge=k=>{if(!D.pathname.startsWith(k))return!1;const V=lt.filter($=>D.pathname.startsWith($)).sort(($,Me)=>Me.length-$.length)[0];return k===V};u.useEffect(()=>{var V;const k=$=>{var Oe;const Me=$.defaultExpanded&&!Tn.has($.id);Me&&Tn.add($.id),(Me||(Oe=$.children)!=null&&Oe.some(Ie=>D.pathname.startsWith(Ie.to)))&&he(Ie=>{const Te=new Set(Ie);return Te.add($.id),Te})};j.menus.forEach($=>{$.items.forEach(k)}),(V=j.menuBottom)==null||V.forEach(k)},[D.pathname,j.menus,j.menuBottom]);const He=k=>{he(V=>{const $=new Set(V);return $.has(k)?$.delete(k):$.add(k),$})};u.useEffect(()=>{j.menus.length!==0&&Be!==null&&!j.menus.some(k=>k.id===Be)&&qe(null)},[j.menus,Be,qe]);const pt=u.useMemo(()=>{if(Be!==null)return j.menus.filter($=>$.id===Be||$.parentGroupId===Be);const k=j.menus.filter($=>$.parentGroupId===void 0),V=j.menus.filter($=>$.parentGroupId!==void 0).flatMap($=>$.items);return V.length===0?k:[...k,{id:18,name:"Pengaturan",items:V,parentGroupId:void 0}]},[j.menus,Be]);if(b)return e.jsx(x.Box,{as:"main",overflow:"overflow-y-auto",bg:"surface-inverse",style:{height:"100vh"},children:t||e.jsx(M,{})});const xt=k=>{const V=k.children&&k.children.length>0,$=!!k.slotKey,Me=V||$,Oe=je.has(k.id),Ie=V?k.children.some(Ne=>ge(Ne.to)):$?!1:ge(k.to),Te=$t(k.badge,I[k.id]),Qe=!!Te&&_&&!A;return e.jsxs(x.Box,{display:"block","data-menu-active":Ie||void 0,children:[e.jsxs(x.Box,{as:"button",onClick:Ne=>{if($&&_&&!A)F(k.to);else if(Me)if(_&&!A){const Ae=Ne.currentTarget.getBoundingClientRect();We({item:k,top:Ae.top,left:Ae.right+8})}else He(k.id);else F(k.to)},fullWidth:!0,direction:"row",align:"center",justify:_&&!A?"center":void 0,gap:"sm",paddingInline:_&&!A?void 0:"sm",paddingBlock:"xs",height:"height-32",borderRadius:Ie?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:Ie?"white":void 0,hover:Ie?void 0:{bg:"neutral"},title:_&&!A?k.title:void 0,style:{textAlign:"left",color:Ie?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:Ie?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsxs(x.Box,{position:"relative",display:"inline-flex",flexShrink:"0",style:{alignItems:"center"},children:[e.jsx(B.Icon,{name:k.icon,size:"sm",style:{flexShrink:0}}),Qe&&e.jsx(x.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",style:{boxShadow:"0 0 0 1px var(--sa-background-primary, #ffffff)"},children:e.jsx(dt.BadgeDot,{tone:"error",variant:"solid",size:"xs"})})]}),(!_||A)&&e.jsxs(e.Fragment,{children:[e.jsx(Ln,{text:k.title,active:Ie,textStyle:{transition:"opacity 0.3s"}}),Te&&e.jsx(dt.Badge,{text:String(Te.value),variant:Te.variant??"info",size:"xs",border:!0}),Me&&e.jsx(B.Icon,{name:"ChevronDown",size:"sm",style:{flexShrink:0,transition:"transform 0.2s",transform:Oe?"rotate(180deg)":"rotate(0deg)"}})]})]}),Me&&(!_||A)&&(()=>{const Ne=k.children??[],Ae=$?-1:Ne.findIndex(Ue=>ge(Ue.to)),mt=Ne.map(Ue=>{const jt=$t(Ue.badge,I[Ue.id]),rt=ge(Ue.to);return e.jsxs(x.Box,{as:"button",onClick:()=>F(Ue.to),fullWidth:!0,direction:"row",align:"center",gap:"sm",paddingLeft:"sm",paddingRight:"sm",paddingBlock:"xs",height:"height-32",borderRadius:rt?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:rt?"white":void 0,hover:rt?void 0:{bg:"neutral"},style:{textAlign:"left",color:rt?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",borderColor:rt?"var(--sa-border-subtle, #0b120e24)":"transparent"},children:[e.jsx(B.Icon,{name:Ue.icon,size:"sm",style:{flexShrink:0}}),e.jsx(Ln,{text:Ue.title,active:rt}),jt&&e.jsx(dt.Badge,{text:String(jt.value),variant:jt.variant??"info",size:"xs",border:!0})]},Ue.id)});return e.jsxs(x.Box,{position:"relative",overflow:"overflow-hidden",style:{marginLeft:"1rem",paddingLeft:"0.75rem",transition:"all 0.3s ease-in-out",maxHeight:Oe?$?"none":`${Ne.length*36}px`:"0px",opacity:Oe?1:0,marginTop:Oe?"0.25rem":"0px"},children:[e.jsx(x.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",top:"top-0",fullHeight:!0,style:{width:"1.5px",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),Ae>=0&&e.jsx(x.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",height:"height-32",zIndex:"10",style:{top:`${Ae*32}px`,width:"1.5px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none"}}),$?e.jsx(_r,{slotKey:k.slotKey,fallback:mt}):mt]})})()]},k.id)};return e.jsx(vo,{children:e.jsxs(jo,{children:[e.jsxs(x.Box,{direction:"row",position:"relative",style:{height:"100vh","--app-header-height":Rn,"--app-sidebar-width":A?"0px":_?Zr:`${le}px`,"--app-footer-zindex":A&&ie?"40":"998"},children:[A&&e.jsx(x.Box,{position:"fixed",zIndex:"40",bg:"black-alpha-a50",style:{inset:0,opacity:ie?.5:0,pointerEvents:ie?"auto":"none",transition:"opacity 0.3s"},onClick:()=>ue(!1)}),e.jsxs(x.Box,{as:"aside",ref:ve,bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:A?void 0:"0",style:{width:A?"16.375rem":_?Zr:`${le}px`,position:A?"fixed":"relative",...A&&{inset:0,zIndex:50,transform:ie?"translateX(0)":"translateX(-100%)"},transition:we?"none":"all 0.3s ease-in-out",minWidth:0},children:[e.jsx(x.Box,{onMouseEnter:()=>ke(!0),onMouseLeave:()=>ke(!1),direction:"row",align:"center",justify:"space-between",paddingInline:re?void 0:"lg",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",position:"relative",style:{height:"var(--app-header-height, 4rem)",...re?{paddingInline:Sr}:null},children:(()=>{const k=!A&&_&&!ie,V=k&&Ce;return e.jsxs(e.Fragment,{children:[e.jsxs(x.Box,{direction:"row",align:"center",gap:"sm",flex:k?"1":void 0,justify:k?"center":void 0,style:{transition:"opacity 0.2s",opacity:V?0:1,pointerEvents:V?"none":"auto"},children:[e.jsx("img",{src:j.logo,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",flexShrink:0}}),(!_||ie)&&e.jsx(w.Text,{as:"span",fontSize:"md",fontWeight:"semibold",color:"primary",truncate:!0,style:{transition:"opacity 0.3s"},children:j.appName})]}),!A&&!_&&e.jsx(x.Box,{as:"button",onClick:()=>q(!0),"aria-label":"Collapse sidebar",display:"inline-flex",align:"center",justify:"center",flexShrink:"0",style:{color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(B.Icon,{name:"LayoutLeft",size:"sm"})}),k&&e.jsx(x.Box,{as:"button",onClick:()=>q(!1),"aria-label":"Expand sidebar",position:"absolute",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-sm",style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"var(--sa-text-primary, #292a2e)",opacity:V?1:0,pointerEvents:V?"auto":"none",transition:"opacity 0.2s"},children:e.jsx(B.Icon,{name:"LayoutLeft",size:"sm"})}),A&&e.jsx(x.Box,{as:"button",onClick:()=>ue(!1),"aria-label":"Close menu",align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(B.Icon,{name:"Cross",size:"md"})})]})})()}),c&&e.jsx(yo,{collapsed:A?!1:_,children:c}),e.jsx(x.Box,{ref:fe,flex:"1",overflow:"overflow-y-auto",paddingBlock:"lg",children:pt.map(k=>e.jsxs(x.Box,{marginBottom:"lg",children:[!_||A?k.name&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"semibold",color:"subtlest",textTransform:"uppercase",truncate:!0,style:{letterSpacing:"0.06em",paddingLeft:"1.25rem",paddingRight:"0.75rem",paddingBottom:"0.25rem",transition:"opacity 0.3s"},children:k.name}):k.name&&e.jsx(x.Box,{"aria-label":k.name,direction:"row",align:"center",justify:"center",paddingBlock:"md",children:e.jsx(x.Box,{width:"width-16",style:{height:"2px",borderRadius:"1px",backgroundColor:k.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx(x.Box,{paddingInline:re?void 0:"md",gap:"xs",style:re?{paddingInline:Sr}:void 0,children:k.slotKey?e.jsx(_r,{slotKey:k.slotKey,fallback:k.items.map(V=>xt(V))}):k.items.map(V=>xt(V))})]},k.id))}),j.menuBottom&&j.menuBottom.length>0&&e.jsx(x.Box,{borderWidth:"border-t",borderStyle:"border-solid-t",borderColor:"border-base",paddingBlock:"md",paddingInline:re?void 0:"md",bg:"surface-inverse",gap:"xs",flexShrink:"0",style:re?{paddingInline:Sr}:void 0,children:j.menuBottom.map(k=>xt(k))}),J&&e.jsx(x.Box,{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":X,"aria-valuemin":Z,"aria-valuemax":z,tabIndex:0,onPointerDown:De,onKeyDown:me,onDoubleClick:Q,title:"Drag to resize · double-click to reset",position:"absolute",top:"top-0",right:"right-0",fullHeight:!0,style:{width:"6px",transform:"translateX(50%)",cursor:"col-resize",zIndex:5,touchAction:"none",background:we?"var(--sa-background-brand, #04254f)":"transparent",transition:"background 0.15s"},onMouseEnter:k=>{we||(k.currentTarget.style.background="var(--sa-border-bold, #0b120e40)")},onMouseLeave:k=>{we||(k.currentTarget.style.background="transparent")}})]}),e.jsxs(x.Box,{flex:"1",overflow:"overflow-hidden",children:[e.jsxs(x.Box,{as:"header",bg:"white",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",direction:"row",align:"center",justify:"space-between",paddingInline:"lg",flexShrink:"0",style:{height:"var(--app-header-height, 4rem)"},children:[e.jsxs(x.Box,{direction:"row",align:"center",gap:A?"lg":void 0,children:[A&&e.jsx(x.Box,{as:"button",onClick:()=>ue(!0),align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(B.Icon,{name:"MenuBurger",size:"lg"})}),e.jsx(bo,{children:r})]}),e.jsxs(x.Box,{direction:"row",align:"center",gap:"md",children:[a,e.jsxs(R.Menu,{position:"bottom-right",children:[e.jsx(R.MenuButton,{children:e.jsxs(x.Box,{direction:"row",align:"center",gap:"sm",cursor:"pointer",children:[!A&&e.jsxs(x.Box,{display:"block",textAlign:"right",customMaxWidth:"12.5rem",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",textAlign:"right",truncate:!0,lineHeight:"leading-none",children:s?"Loading...":(n==null?void 0:n.name)||"unknown"}),e.jsx(w.Text,{fontSize:"sm",color:"subtle",textAlign:"right",truncate:!0,children:s?"":(n==null?void 0:n.email)||"unknown"})]}),e.jsx(er.Avatar,{size:"sm",initials:((n==null?void 0:n.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)"}),e.jsx(B.Icon,{name:"ChevronDown",size:"xs",color:"subtle"})]})}),e.jsxs(R.MenuLists,{width:280,style:{paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(R.MenuHeading,{children:e.jsxs(x.Box,{align:"center",textAlign:"center",paddingBlock:"sm",fullWidth:!0,children:[e.jsx(er.Avatar,{customSize:64,initials:((n==null?void 0:n.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)",style:{fontSize:"1.25rem",marginBottom:"0.75rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)"}}),e.jsx(w.Text,{fontSize:"md",fontWeight:"semibold",color:"primary",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(n==null?void 0:n.name)||"unknown"}),e.jsx(w.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:(n==null?void 0:n.email)||"unknown"}),d&&e.jsx(w.Text,{fontSize:"sm",color:"subtle",textAlign:"center",truncate:!0,style:{maxWidth:"100%"},children:d})]})}),(h&&h.length>0||g)&&e.jsxs(R.MenuBody,{children:[h==null?void 0:h.map((k,V)=>e.jsx(R.MenuItem,{onClick:k.onClick,startIcon:e.jsx(B.Icon,{name:k.icon,size:"md"}),children:k.label},`${k.label}-${V}`)),g]}),m??e.jsx(R.MenuFooter,{children:e.jsx(R.MenuItem,{intent:"danger",onClick:Xe,startIcon:e.jsx(B.Icon,{name:"Logout",size:"md"}),children:"Logout"})})]})]})]})]}),e.jsx(x.Box,{as:"main",ref:Fe,flex:"1",overflow:"overflow-y-auto",children:t||e.jsx(M,{})})]})]}),i&&l&&e.jsx(x.Box,{position:"fixed",align:"center",justify:"center",bg:"black-alpha-a70",style:{inset:0,zIndex:9999},children:l}),e.jsxs(Re.Dialog,{isShow:Y,onHide:Ve,children:[e.jsx(Re.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Re.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Re.DialogFooter,{children:e.jsx(x.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(ce.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(x.Box,{direction:"column",children:e.jsx(H.Button,{secondary:!0,onClick:Ve,children:"Cancel"})}),e.jsx(x.Box,{direction:"column",children:e.jsx(H.Button,{primary:!0,onClick:ze,children:"Yes, Sure"})})]})})})]}),ae&&e.jsxs(e.Fragment,{children:[e.jsx(x.Box,{onClick:()=>We(null),position:"fixed",style:{inset:0,zIndex:60}}),e.jsxs(x.Box,{role:"dialog","aria-label":ae.item.title,position:"fixed",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-md",shadow:"shadow-lg",padding:"sm",gap:"spacing-2",style:{top:ae.top,left:ae.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem"},children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-500",textTransform:"uppercase",style:{padding:"0.25rem 0.5rem 0.5rem",letterSpacing:"0.05em"},children:ae.item.title}),(ft=ae.item.children)==null?void 0:ft.map(k=>{const V=ge(k.to),$=$t(k.badge,I[k.id]);return e.jsxs(x.Box,{as:"button",onClick:()=>{F(k.to),We(null)},fullWidth:!0,direction:"row",align:"center",gap:"md",paddingBlock:"sm",paddingInline:"md",borderRadius:"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:V?"primary-inverse":void 0,hover:V?void 0:{bg:"primary-inverse"},style:{textAlign:"left",borderColor:"transparent",color:V?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)"},children:[k.icon&&e.jsx(B.Icon,{name:k.icon,size:"sm",style:{flexShrink:0}}),e.jsx(w.Text,{as:"span",fontSize:"md",fontWeight:V?"medium":"normal",whiteSpace:"nowrap",style:{flex:1},children:k.title}),$&&e.jsx(dt.Badge,{text:String($.value),variant:$.variant??"info",size:"xs",border:!0})]},k.id)})]})]})]})})}const Wt=u.forwardRef(({children:t,...r},n)=>e.jsx(x.Box,{ref:n,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...r,children:t})),An=({title:t,iconName:r,textColor:n,iconColor:s,hoverTextColor:o,hoverIconColor:i})=>{const[l,c]=u.useState(!1),a=s??"var(--sa-text-subtle, #8c8f97)",d=n??"var(--sa-text-subtle, #8c8f97)",h=i??"var(--sa-text-subtle, #8c8f97)",g=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(x.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{cursor:"pointer"},children:[e.jsx(B.Icon,{name:r||"ChevronLeft",size:"xs",style:{color:l?h:a,transition:"color 0.15s ease"}}),e.jsx(w.Text,{variant:"sub-h3",style:{color:l?g:d,transition:"color 0.15s ease"},children:t||"Back"})]})},Vs=({items:t,separator:r="/",iconName:n,iconColor:s,hoverIconColor:o})=>{const{Link:i}=st(),[l,c]=u.useState(!1),a=s??"var(--sa-text-subtle, #8c8f97)",d=o??"var(--sa-text-subtle, #8c8f97)",h=t.length>1?t[0]:void 0,g=!!(h!=null&&h.to||h!=null&&h.onClick),m=e.jsx(B.Icon,{name:n||"ChevronLeft",size:"xs",onMouseEnter:g?()=>c(!0):void 0,onMouseLeave:g?()=>c(!1):void 0,style:{color:g&&l?d:a,transition:"color 0.15s ease",cursor:g?"pointer":void 0}}),y=h!=null&&h.to?e.jsx(i,{to:h.to,replace:!0,style:{textDecoration:"none"},children:m}):h!=null&&h.onClick?e.jsx(Wt,{onClick:h.onClick,children:m}):m;return e.jsxs(x.Box,{direction:"row",gap:"xs",align:"center",children:[y,e.jsx(wt.Breadcrumb,{separator:r,size:"md",children:t.map((S,C)=>{const L=C===t.length-1;return S.to&&!L?e.jsx(wt.BreadcrumbItem,{children:e.jsx(i,{to:S.to,children:S.label})},C):e.jsx(wt.BreadcrumbItem,{currentPage:L,children:e.jsx(wt.BreadcrumbLink,{onClick:L?void 0:S.onClick,children:S.label})},C)})})]})},Ns=t=>{const{Link:r}=st(),{items:n,separator:s,onClick:o,navigateTo:i,...l}=t;return n&&n.length>0?e.jsx(Vs,{items:n,separator:s,iconName:l.iconName,iconColor:l.iconColor,hoverIconColor:l.hoverIconColor}):i?e.jsx(x.Box,{direction:"row",children:e.jsx(r,{to:i,replace:!0,style:{textDecoration:"none"},children:e.jsx(An,{...l})})}):e.jsx(x.Box,{direction:"row",children:e.jsx(Wt,{onClick:o,children:e.jsx(An,{...l})})})},kr=[{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 Wn(t,r,n){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:t?`2px solid ${n.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:t?n.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:t?r?`0 8px 20px ${n.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${n.activeShadow}`:r?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:r?"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 zn={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Hn={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function wo({isShow:t,onHide:r,menus:n,selectedGroupId:s,onSelect:o}){const[i,l]=u.useState(void 0),c=d=>{o(d),r()},a=kr[0];return e.jsx(Re.Dialog,{isShow:t,onHide:r,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Re.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>c(null),onMouseEnter:()=>l("all"),onMouseLeave:()=>l(void 0),style:Hn,children:[e.jsx("div",{style:Wn(s===null,i==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(B.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:zn,children:"Semua"})]}),n.map((d,h)=>{var C;const g=s===d.id,m=i===d.id,y=((C=d.items[0])==null?void 0:C.icon)??"Grid",S=kr[(h+1)%kr.length];return e.jsxs("button",{onClick:()=>c(d.id),onMouseEnter:()=>l(d.id),onMouseLeave:()=>l(void 0),style:Hn,children:[e.jsx("div",{style:Wn(g,m,S),children:e.jsx("div",{style:{color:S.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(B.Icon,{name:y,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:zn,children:d.name})]},d.id)})]})})})}function _s({onSelect:t,"aria-label":r="Pilih module"}={}){const n=Yr(),{useNavigate:s}=st(),o=s(),{selectedGroupId:i,setSelectedGroupId:l}=rn(),[c,a]=u.useState(!1),d=h=>{var g;if(l(h),h!==null){const m=n.menus.find(S=>S.id===h),y=(g=m==null?void 0:m.items[0])==null?void 0:g.to;y&&o(y)}t==null||t(h)};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":r,onMouseEnter:h=>{h.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:h=>{h.currentTarget.style.backgroundColor="transparent"},children:e.jsx(B.Icon,{name:"GridApplication",size:"sm"})}),i!==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(wo,{isShow:c,onHide:()=>a(!1),menus:n.menus.filter(h=>h.parentGroupId===void 0),selectedGroupId:i,onSelect:d})]})}const qs=(t,r)=>{const n=[];if(r===0)return n.push(t),n;for(let s=0;s<t.length;s+=r){const o=t.slice(s,s+r);n.push(o)}return n},Zs=u.memo(({value:t,label:r,separator:n,labelWidth:s,lastIndex:o,labelAlign:i="top"})=>{const l=u.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:i}),[o,i]),c=u.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:i}),[o,i]),a=()=>typeof r=="string"?e.jsx(w.Text,{fontWeight:"medium",color:"subtlest",children:r}):r,d=()=>typeof t=="string"||typeof t=="number"?e.jsx(w.Text,{color:"primary",fontWeight:"medium",children:t}):t,h=()=>typeof n=="string"||typeof n=="number"?e.jsx(w.Text,{fontWeight:"medium",color:"subtlest",children:n}):n;return e.jsxs(G.Tr,{children:[e.jsx(G.Td,{style:l,width:s,children:a()}),n?e.jsx(G.Td,{style:c,width:24,children:h()}):null,e.jsx(G.Td,{style:l,children:d()})]})}),Gs=u.memo(({fields:t,separator:r,labelWidth:n})=>e.jsx(G.Table,{withColumnBorder:!1,withRowBorder:!1,children:t.map((s,o)=>e.jsx(Zs,{separator:r,labelWidth:n,lastIndex:o===t.length-1,...s},`field-group-field-${o}`))})),Qs=u.memo(({maxRow:t=0,maxColumn:r=2,separator:n=":",fields:s=[],labelWidth:o=150,bordered:i=!1})=>{const l=u.useMemo(()=>qs(s,t),[s,t]),c=l.length>2,a=()=>{switch(r){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(x.Box,{gap:c?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:c?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:i?"border":void 0,borderStyle:i?"border-solid":void 0,borderColor:i?"border-subtle":void 0,children:l.map((d,h)=>e.jsx(x.Box,{direction:"column",flex:c?void 0:"1",width:c?a():void 0,marginBottom:c?"lg":void 0,children:e.jsx(Gs,{labelWidth:o,fields:d,separator:n})},h))})}),Us=({backButton:t})=>{const[r,n]=u.useState(!1),s=(t==null?void 0:t.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(t==null?void 0:t.textColor)??"var(--sa-text-subtle, #8c8f97)",i=(t==null?void 0:t.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",l=(t==null?void 0:t.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(x.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{cursor:"pointer"},children:[e.jsx(B.Icon,{name:(t==null?void 0:t.iconName)||"ChevronLeft",size:"xs",style:{color:r?i:s,transition:"color 0.15s ease"}}),e.jsx(w.Text,{variant:"sub-h3",style:{color:r?l:o,textDecoration:r?"underline":"none",transition:"color 0.15s ease"},children:(t==null?void 0:t.title)||"Back"})]})},Js=({backButton:t,title:r,titleIcon:n,titleTag:s,children:o,header:i=!0,headerBorder:l=!1,disableAnimation:c=!1,scrollable:a=!1,stickyHeader:d=!1,subHeaders:h,action:g,titleTagProps:m,containerProps:y,headerProps:S})=>{const C=be.useMediaQuery("md"),{Link:L,useNavigate:M,useLocation:T}=st(),b=M(),j=T(),I=t==null?void 0:t.show,F=()=>{if(typeof(t==null?void 0:t.onClick)=="function"){t.onClick();return}b(-1,{replace:!0})},D=()=>{if(!g)return null;if(u.isValidElement(g))return g;const q=g.filter(X=>X&&(X.title||X.icon));return q.length===0?null:C?e.jsx(x.Box,{direction:"row",gap:"md",children:q.map(({title:X,icon:K,buttonProps:Q,onClick:Z},z)=>e.jsx(H.Button,{iconLeft:K?e.jsx(B.Icon,{name:K,size:"md"}):void 0,onClick:Z,...Q,children:X},`action-${z}`))}):e.jsxs(R.Menu,{position:"bottom-right",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(B.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{minWidth:200},children:q.map(({title:X,icon:K,buttonProps:Q,onClick:Z},z)=>{const ie=(Q==null?void 0:Q.tone)==="error"||(Q==null?void 0:Q.danger)===!0;return e.jsx(R.MenuItem,{intent:ie?"danger":void 0,disabled:Q==null?void 0:Q.disabled,startIcon:K?e.jsx(B.Icon,{name:K}):void 0,onClick:Z,children:X},`action-${z}`)})})})]})},O=()=>{const q=e.jsx(Us,{backButton:t});return t!=null&&t.navigateTo?e.jsx(x.Box,{direction:"row",children:e.jsx(L,{to:t.navigateTo,replace:!0,style:{textDecoration:"none"},children:q})}):e.jsx(x.Box,{direction:"row",children:e.jsx(Wt,{onClick:F,children:q})})},A=()=>{const q=!!r,X=Array.isArray(g)&&g.length>0,K=u.isValidElement(g)?!0:X;if(!q&&!K&&!I)return null;const Z=C||!C&&X;return e.jsxs(x.Box,{direction:"column",gap:"xs",paddingBlock:(S==null?void 0:S.paddingBlock)??"sm",paddingInline:(S==null?void 0:S.paddingInline)??"md",...S,style:{...l?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...S==null?void 0:S.style},children:[I&&O(),(q||K)&&e.jsxs(x.Box,{direction:Z?"row":"column",gap:"sm",justify:"space-between",align:Z?"center":"flex-start",children:[q?typeof r=="string"?e.jsxs(x.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(x.Box,{direction:"row",gap:"sm",align:"center",children:[n&&e.jsx(B.Icon,{name:n,size:"md",color:"primary"}),e.jsx(w.Text,{variant:"h3",fontWeight:"semibold",children:r})]}),s&&e.jsx(dt.Badge,{border:!0,size:"lg",text:s,...m})]}):r:null,D()]})]})},Y=()=>{if(!h||h.length===0)return null;const q=h.filter(Q=>Q.show!==!1);if(q.length===0)return null;let X=0,K=-1/0;return q.forEach((Q,Z)=>{const z=Q.order??0;z>=K&&(K=z,X=Z)}),q.map(({content:Q,order:Z,borderBottom:z=!0,keepBottomPadding:ie=!1,paddingInline:ue=!0,paddingBlock:Ce=!0},ke)=>e.jsx(x.Box,{direction:"column",paddingTop:Ce?"sm":"spacing-0",paddingBottom:Ce&&(z||ie||ke===X)?"sm":"spacing-0",paddingInline:ue?"md":"spacing-0",style:{...z?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...Z!==void 0?{order:Z}:{}},children:Q},`sub-header-${ke}`))},P=()=>{const q=i?A():null,X=Y();return!q&&!X?null:e.jsxs(x.Box,{direction:"column",style:{...a?{position:"sticky",left:0,...d?{top:0}:{},zIndex:2,background:"var(--sa-background-primary, #ffffff)"}:{},marginBottom:X?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[q,X]})},_=()=>o;return e.jsxs(x.Box,{direction:"column",as:"main",...y,style:{...a?{height:"100%",minHeight:0,overflow:"auto"}:{},...(y==null?void 0:y.style)??{},...c?{}:{animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"}},children:[P(),_()]},j.pathname)},Ys=u.memo(Js),Xs={icon:"Cross",title:""},$s=320,Pn=16,Vn=4,Ks=8,Do=u.forwardRef(({onHide:t,show:r,withBlur:n=!1,style:s,children:o,closeButton:i=Xs,paddingHorizontal:l=!0,width:c,minWidth:a,maxWidth:d,hideBackdrop:h=!1,title:g,headerAction:m,header:y=!0,widthPresets:S,resizable:C=!0,resizeMin:L=$s,resizeMax:M,onWidthChange:T},b)=>{const I=!be.useMediaQuery("md"),F=c??d??a??"357px",D=S??[],O=D.length>1,[A,Y]=u.useState(()=>{const re=D.indexOf(F);return re>=0?re:0}),[P,_]=u.useState(null),[q,X]=u.useState(!1),[K,Q]=u.useState(!1),Z=u.useRef(null),z=re=>{Z.current=re,typeof b=="function"?b(re):b&&(b.current=re)},ie=O?D[A]:F,ue=P!=null?`${P}px`:ie,Ce=C&&!I,ke=A===D.length-1,je=()=>{const re=(A+1)%D.length;_(null),Y(re),T==null||T(D[re])},he=u.useCallback(re=>{const fe=M??window.innerWidth;return Math.min(Math.max(re,L),fe)},[L,M]),ae=u.useRef(null),We=re=>{if(!Ce)return;re.preventDefault();const fe=re.currentTarget;fe.setPointerCapture(re.pointerId),X(!0);const Fe=document.body.style.cursor,ve=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let we=null;const et=W=>{const J=he(window.innerWidth-W.clientX);ae.current=J,we==null&&(we=window.requestAnimationFrame(()=>{we=null,ae.current!=null&&_(ae.current)}))},tt=W=>{we!=null&&window.cancelAnimationFrame(we),ae.current!=null&&_(ae.current),fe.releasePointerCapture(W.pointerId),fe.removeEventListener("pointermove",et),fe.removeEventListener("pointerup",tt),fe.removeEventListener("pointercancel",tt),document.body.style.cursor=Fe,document.body.style.userSelect=ve,X(!1),ae.current!=null&&(T==null||T(`${ae.current}px`))};fe.addEventListener("pointermove",et),fe.addEventListener("pointerup",tt),fe.addEventListener("pointercancel",tt)},Be=re=>{var we;if(!Ce||re.key!=="ArrowLeft"&&re.key!=="ArrowRight")return;re.preventDefault();const fe=re.key==="ArrowLeft"?Pn:-Pn,Fe=P??((we=Z.current)==null?void 0:we.offsetWidth)??L,ve=he(Fe+fe);_(ve),T==null||T(`${ve}px`)},qe=()=>{Ce&&(_(null),T==null||T(ie))};return e.jsx(tr.Drawer,{blur:n,isShow:r,position:"right",onHide:t,ref:z,size:ue,style:s,flush:!0,radius:"none",hideBackdrop:h,children:e.jsxs(x.Box,{direction:"column",height:"height-full",children:[Ce?e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Ubah lebar panel",tabIndex:0,onPointerDown:We,onKeyDown:Be,onDoubleClick:qe,title:"Tarik untuk mengubah lebar — klik dua kali untuk reset",onPointerEnter:()=>Q(!0),onPointerLeave:()=>Q(!1),style:{position:"absolute",left:0,top:0,bottom:0,width:Ks,cursor:"col-resize",zIndex:1,background:q||K?`linear-gradient(to right, var(--sa-border-brand, var(--sa-border-subtle)) 0 ${Vn}px, transparent ${Vn}px)`:"transparent",transition:"background 0.15s",touchAction:"none"}}):null,y?e.jsxs(x.Box,{direction:"row",align:"center",justify:"space-between",gap:"sm",paddingInline:"md",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",customHeight:"var(--app-header-height, 44px)",flexShrink:"0",children:[e.jsx(x.Box,{direction:"row",align:"center",gap:"sm",overflow:"overflow-hidden",children:typeof g=="string"?e.jsx(w.Text,{fontSize:"md",fontWeight:"bold",children:g}):g}),e.jsxs(x.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[m,O?e.jsx(H.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:je,"aria-label":ke?"Kecilkan panel":"Lebarkan panel",iconRight:e.jsx(B.Icon,{name:ke?"ChevronRight":"ChevronLeft"})}):null,i?e.jsx(H.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:t,"aria-label":i.title||"Tutup",iconRight:e.jsx(B.Icon,{name:i.icon}),children:i.title||void 0}):null]})]}):null,e.jsx(x.Box,{direction:"column",paddingBlock:"md",paddingInline:l?"md":"spacing-0",overflow:"overflow-y-auto",style:{flex:1,minHeight:0},children:o})]})})}),nn=u.memo(({children:t,borderBottom:r=!0,padding:n=!0})=>{const s=be.useMediaQuery("lg");return e.jsx(x.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),on=u.memo(({children:t,borderTop:r=!0,padding:n=!0})=>{const s=be.useMediaQuery("lg");return e.jsx(x.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),ei=u.memo(({children:t,...r})=>e.jsx(x.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...r,children:t})),ti=u.memo(({children:t,title:r,titleTag:n,action:s,header:o,footer:i,actionContainer:l,containerProps:c,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:h={borderTop:!0},variantTag:g="info"})=>{const m=be.useMediaQuery("lg"),y=()=>n?e.jsxs(x.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(w.Text,{fontWeight:"medium",children:r}),e.jsx(dt.Badges,{border:!0,text:n,variant:g})]}):e.jsx(w.Text,{fontWeight:"medium",children:r}),S=()=>o||e.jsxs(x.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(x.Box,{direction:"column",children:r?y():null}),e.jsx(x.Box,{direction:"column",style:m?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...l,children:s??null})]}),C=!!(o||r||s);return e.jsxs(x.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...c,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(c==null?void 0:c.style)??{}},children:[o!==null&&C?e.jsx(nn,{...d,children:S()}):null,e.jsx(ei,{...a,children:t}),i?e.jsx(on,{...h,children:i}):null]})}),ri=t=>e.jsx(w.Text,{variant:"h1",children:t.children,...t.props}),ni=t=>e.jsx(w.Text,{variant:"h2",children:t.children,...t.props}),oi=t=>e.jsx(w.Text,{variant:"h3",children:t.children,...t.props}),si=t=>e.jsx(w.Text,{variant:"h4",children:t.children,...t.props}),ii=t=>e.jsx(w.Text,{variant:"h5",children:t.children,...t.props}),li=t=>e.jsx(w.Text,{variant:"h6",children:t.children,...t.props}),ci=t=>e.jsx(w.Text,{variant:"sub-h1",children:t.children,...t.props}),ai=t=>e.jsx(w.Text,{variant:"sub-h2",children:t.children,...t.props}),di=t=>e.jsx(w.Text,{variant:"sub-h3",children:t.children,...t.props}),ui=t=>e.jsx(w.Text,{variant:"body-1",children:t.children,...t.props}),xi=t=>e.jsx(w.Text,{variant:"body-2",children:t.children,...t.props}),hi=t=>e.jsx(w.Text,{variant:"body-3",children:t.children,...t.props}),Ye={H1:ri,H2:ni,H3:oi,H4:si,H5:ii,H6:li,SubH1:ci,SubH2:ai,SubH3:di,Body1:ui,Body2:xi,Body3:hi},_e=()=>{const{useSearchParams:t,useParams:r,useLocation:n}=st(),[s,o]=t(),i=kt.searchParamsToObject(s.toString()),l=r(),c=n(),a=l.id;return{setSearchParams:o,searchParams:s,searchQueries:i,isHasQuery:(y,S)=>s.has(y)&&s.get(y)===S,getQueryParam:y=>s.get(y),getRouteParam:y=>l[y],params:l,location:c,id:a,hasId:!!a}},So=t=>JSON.stringify(t),ko=t=>JSON.stringify(t),Bo=t=>JSON.stringify(t),Eo=t=>JSON.stringify(t),fi=t=>t,mi=t=>JSON.stringify(t),Ot=t=>{if(typeof t!="string"||t==="")return{};try{const r=JSON.parse(t);return!r||typeof r!="object"||Array.isArray(r)?{}:r}catch{return{}}},At=({value:t,name:r,type:n,withSearchParam:s=!0,setSearchParams:o,searchQueries:i,dropdownSearchKey:l,filterKey:c="filter",pageKey:a="page"})=>{if(s){let d;switch(n){case"search":d=fi(t);break;case"dropdown":case"dropdown-multiple":d=So(t);break;case"radio":d=ko(t);break;case"date-range":d=Bo(t);break;case"advanced-date-range":d=mi(t);break;case"date":d=Eo(t);break;default:d=t;break}if(typeof d<"u"){const h={...Ot(i[c]),[r]:d},g={...i};l&&typeof l=="string"&&delete g[l],delete g[a];const m={...g,[c]:JSON.stringify(h)},y=new URLSearchParams(i).toString(),S=new URLSearchParams(m).toString();if(y===S)return;o(m)}}},Kt=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,l=i?i[t]:void 0;return s==="label"&&l?JSON.parse(l)[0].label:s==="value"&&l?JSON.parse(l)[0].value:l},Fo=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,l=i?i[t]:void 0;return s==="label"&&l?JSON.parse(l).map(c=>c.label):s==="value"&&l?JSON.parse(l).map(c=>c.value):s==="array"&&l?JSON.parse(l):l},gi=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,l=i?i[t]:void 0;return s==="id"&&l?JSON.parse(l).id:s==="label"&&l?JSON.parse(l).label:s==="value"&&l?JSON.parse(l).value:l},ir=(t,r,n)=>{const s=r.get(n||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0;return o?o[t]:void 0},pi=({name:t,filterKey:r="filter",searchParams:n})=>{const s=n.get(r||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0,i=o?o[t]:void 0;return{start:i?JSON.parse(i).from:void 0,end:i?JSON.parse(i).to:void 0}},Mo=({name:t,filterKey:r="filter",searchParams:n})=>{const s=n.get(r||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0,i=o?o[t]:void 0;return i?JSON.parse(i):void 0},yi=(t,{filterKey:r="filter",perPageKey:n="perPage",pageKey:s="page"})=>{const o=t.get(r)||void 0,i=t.get(n)||void 0,l=t.get(s)||void 0;return!!o||!!i||!!l},Io=({isOpen:t,onClose:r,filterKey:n,pageKey:s,filters:o})=>{const{searchParams:i,setSearchParams:l,searchQueries:c}=_e(),[a,d]=u.useState({}),h=()=>{i.delete(n||"filter"),l(i)},g=(m,y)=>{switch(m.type){case"radio":{const{show:S=!0}=m;return S&&e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y)}case"dropdown":{const{show:S=!0}=m;return S&&e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y)}case"date-range":return e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y);case"date":return e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y);case"dropdown-multiple":{const{show:S=!0}=m;return S&&e.jsx(x.Box,{direction:"column",children:e.jsx(x.Box,{direction:"column",children:m.title})},y)}default:return null}};return e.jsx(Do,{onHide:r,show:t||!1,children:e.jsxs(x.Box,{direction:"column",gap:"md",children:[e.jsxs(ce.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(x.Box,{direction:"column",children:"Filter"}),e.jsx(x.Box,{direction:"column",style:{cursor:"pointer"},onClick:h,children:"Reset"})]}),o==null?void 0:o.map((m,y)=>g(m,y))]})})},To=({searchKey:t="q",statusKey:r="status",searchPlaceholder:n="Search",searchHighlightPlaceholder:s,extendedFilter:o,showSearchFilter:i=!0,showStatusFilter:l=!0,filterKey:c="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:h,filterConfigs:g,buttonToggleProps:m,position:y="right",titleSearchLabel:S="Work Order",withTitleLabels:C=!1})=>{const M=(m==null?void 0:m.isShowLabel)??!0,[T,b]=u.useState(!1),[j,I]=u.useState(0),F=()=>{I(z=>z+1)},{searchParams:D,setSearchParams:O,getQueryParam:A}=_e(),Y=kt.searchParamsToObject(D.toString()),P=ir(t,D,c)||"",[_,q]=u.useState(P),X=A(c),Q=!!(X&&!(()=>{if(X)try{const z=JSON.parse(X);return Object.keys(z).length===1&&z[t]===""}catch(z){console.error("Filter parameter is not a valid JSON:",z)}return!1})()),Z=be.useMediaQuery("md");return u.useEffect(()=>{q(P)},[P]),u.useEffect(()=>{if(_===P)return;const z=window.setTimeout(()=>{At({value:_,name:t,type:"search",searchQueries:Y,setSearchParams:O,filterKey:c,pageKey:a})},350);return()=>{window.clearTimeout(z)}},[_,P,t,Y,O,c,a]),e.jsxs(ce.Flex,{gap:"md",style:{flexDirection:Z&&y==="left"?"row":Z&&y==="right"?"row-reverse":"column"},align:"flex-end",children:[Q&&e.jsx(x.Box,{direction:"column",justify:"flex-end",children:e.jsx(H.Button,{onClick:()=>{const z=new URLSearchParams(D);z.delete(c),O(z),q(""),F(),h&&h()},variant:"outline",tone:"neutral",children:e.jsx(w.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:z,content:ie,title:ue,onClickContainer:Ce},ke)=>e.jsxs(x.Box,{direction:"column",gap:"sm",onClick:Ce,style:{minWidth:z},children:[ue&&e.jsx(Ye.SubH3,{children:ue}),ie]},`extended-filter-${ke}-${j}`)),!!(g!=null&&g.length)&&e.jsx(H.Button,{primary:Q,secondary:!Q,iconLeft:e.jsx(B.Icon,{size:"sm",name:(m==null?void 0:m.icon)||"FilterHorizontal",style:{color:X?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!Z,onClick:()=>b(!0),children:M?"Filter":void 0}),l&&e.jsxs(x.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[C&&e.jsx(Ye.SubH3,{children:"Status"}),e.jsx(St.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Kt({get:"value",name:r,searchParams:D,filterKey:c})?[{label:Kt({get:"value",name:r,searchParams:D,filterKey:c})==="active"?"Active":"InActive",value:Kt({get:"value",name:r,searchParams:D,filterKey:c})}]:[],onChange:z=>At({value:z,name:r,type:"dropdown",searchQueries:Y,setSearchParams:O,filterKey:c}),placeholder:C?"All":"All Status"},j)]}),i&&e.jsxs(x.Box,{direction:"column",gap:"sm",style:{width:d&&Z?d:Z?"310px":""},children:[C&&e.jsxs(Ye.SubH3,{children:["Search for ",S]}),e.jsx(ot.Input,{placeholder:n,leftIcon:e.jsx(B.Icon,{name:"Search",width:20,height:20}),onChange:z=>q(z.target.value),value:_,fullWidth:!0},j+1+c)]}),e.jsx(Io,{isOpen:T,onClose:()=>b(!1),filterKey:c,filters:g,pageKey:a})]})},ji=t=>t==="checkbox-multiple"?"dropdown-multiple":t==="radio"?"dropdown":t==="date-compact"?"date":t==="text"?"search":t;function sn({configs:t,filterKey:r="filter",activeFilterKey:n="filters",pageKey:s="page",searchKey:o="q"}){const{searchParams:i,setSearchParams:l,searchQueries:c}=_e(),a=u.useMemo(()=>Object.fromEntries(t.map(j=>[j.key,j])),[t]),d=u.useMemo(()=>{const j=(i.get(n)||"").split(",").map(F=>F.trim()).filter(Boolean),I=Object.keys(Ot(i.get(r))).filter(F=>F!==o);return t.map(F=>F.key).filter(F=>{const D=a[F];return(D==null?void 0:D.locked)||j.includes(F)||I.includes(F)})},[i,n,r,o,t,a]),h=u.useCallback(j=>Ot(j[r]),[r]),g=u.useCallback(j=>{const I={...c};j.length?I[n]=j.join(","):delete I[n],l(I)},[c,n,l]),m=u.useCallback(j=>{d.includes(j)||g([...d,j])},[d,g]),y=u.useCallback(j=>{var O;if((O=a[j])!=null&&O.locked)return;const I={...c},F=d.filter(A=>A!==j);F.length?I[n]=F.join(","):delete I[n];const D=h(I);j in D&&(delete D[j],Object.keys(D).length?I[r]=JSON.stringify(D):delete I[r]),delete I[s],l(I)},[c,d,n,r,s,h,l,a]),S=u.useCallback(j=>d.includes(j)?y(j):m(j),[d,m,y]),C=u.useCallback(j=>{switch(j.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return Fo({name:j.key,get:"array",searchParams:i,filterKey:r})||[];case"date":{const I=Mo({name:j.key,searchParams:i,filterKey:r});return I?new Date(I):void 0}case"date-compact":{const F=h(Object.fromEntries(i.entries()))[j.key];return F&&typeof F=="object"?F:void 0}case"text":{const F=h(Object.fromEntries(i.entries()))[j.key];return typeof F=="string"?F:void 0}default:return}},[i,r,h]),L=u.useCallback((j,I)=>{if(j.type==="date-compact"||j.type==="text"){const F={...c},D=h(F);I==null||I===""?delete D[j.key]:D[j.key]=I,Object.keys(D).length?F[r]=JSON.stringify(D):delete F[r],delete F[s],l(F);return}At({value:I,name:j.key,type:ji(j.type),searchQueries:c,setSearchParams:l,filterKey:r,pageKey:s})},[c,l,r,s,h]),M=u.useCallback(j=>{const I={...c},F=h(I);j in F&&(delete F[j],Object.keys(F).length?I[r]=JSON.stringify(F):delete I[r]),delete I[s],l(I)},[c,r,s,h,l]),T=u.useCallback(()=>{const j={...c};delete j[r],delete j[n],delete j[s],l(j)},[c,r,n,s,l]),b=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:b,addFilter:m,removeFilter:y,toggleFilter:S,getValue:C,setValue:L,clearValue:M,clearAll:T}}const ln={get(t){return Lt.storage.get(t)??null},set(t,r){Lt.storage.save(t,r)},remove(t){Lt.storage.delete(t)}},Et={columns:t=>`filterbar:colprefs:${t}`,savedViews:t=>`filterbar:views:${t}`,lastState:t=>`filterbar:last:${t}`,perPage:t=>`filterbar:perpage:${t}`,tableSort:t=>`tablelayout:sort:${t}`},Zt=(t,r)=>{const n=new Set(r.map(i=>i.key)),s=t.order.filter(i=>n.has(i));for(const i of r)s.includes(i.key)||s.push(i.key);const o=t.hidden.filter(i=>n.has(i));return{order:s,hidden:o}};function bi({columns:t,scopeId:r,storage:n,onColumnsChange:s,value:o}){const i=u.useMemo(()=>({order:t.map(D=>D.key),hidden:[]}),[t]),l=r?Et.columns(r):void 0,c=(D,O)=>Zt({order:D.order??O,hidden:D.hidden??[]},t),[a,d]=u.useState(()=>{if(o&&(o.order||o.hidden))return c(o,t.map(D=>D.key));if(l){const D=n.get(l);if(D&&Array.isArray(D.order))return Zt(D,t)}return i}),h=t.map(D=>D.key).join("|");u.useEffect(()=>d(D=>Zt(D,t)),[h]);const g=u.useRef(a);g.current=a;const m=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,y=u.useRef(m);u.useEffect(()=>{if(m==null||y.current===m)return;y.current=m;const D=g.current,O=c(o,D.order);O.order.join("|")===D.order.join("|")&&O.hidden.join("|")===D.hidden.join("|")||(d(O),l&&n.set(l,O))},[m,h]);const S=u.useRef(!1);u.useEffect(()=>{S.current||(S.current=!0,s==null||s(a))},[]);const C=u.useCallback(D=>{d(D),l&&n.set(l,D),s==null||s(D)},[l,n,s]),L=u.useMemo(()=>{const D=new Map(t.map(O=>[O.key,O]));return a.order.filter(O=>D.has(O)).map(O=>({...D.get(O),visible:!a.hidden.includes(O)}))},[a,t]),M=u.useCallback(D=>{const O=a.hidden.includes(D)?a.hidden.filter(A=>A!==D):[...a.hidden,D];C({...a,hidden:O})},[a,C]),T=u.useCallback((D,O)=>{if(D===O)return;const A=[...a.order],[Y]=A.splice(D,1);A.splice(O,0,Y),C({...a,order:A})},[a,C]),b=u.useCallback(D=>{C({...a,hidden:D?t.filter(O=>!O.locked).map(O=>O.key):[]})},[a,t,C]),j=u.useCallback(()=>C(i),[C,i]),I=u.useCallback(D=>C(Zt(D,t)),[C,t]),F=a.hidden.length===0;return{state:a,orderedColumns:L,allVisible:F,toggleVisibility:M,reorder:T,setAllHidden:b,reset:j,applyState:I}}function vi({scopeId:t,storage:r,snapshotKeys:n,pageKey:s="page",getColumns:o,applyColumns:i}){const{searchParams:l,setSearchParams:c}=_e(),a=t?Et.savedViews(t):void 0,[d,h]=u.useState(()=>a?r.get(a)||[]:[]),g=u.useCallback(C=>{h(C),a&&r.set(a,C)},[a]),m=u.useCallback(C=>{const L=C.trim();if(!L)return;const M={};n.forEach(b=>{const j=l.get(b);j!=null&&(M[b]=j)});const T={id:`${Date.now()}`,name:L,query:M,columns:o==null?void 0:o(),createdAt:Date.now()};g([...d,T])},[n,l,o,g,d]),y=u.useCallback(C=>g(d.filter(L=>L.id!==C)),[g,d]),S=u.useCallback(C=>{const L=Object.fromEntries(l.entries());n.forEach(M=>delete L[M]),Object.assign(L,C.query),delete L[s],c(L),C.columns&&(i==null||i(C.columns))},[l,n,s,c,i]);return{enabled:!!a,views:d,saveView:m,deleteView:y,applyView:S}}function Ci(t,r){const n=Ot(t);return delete n[r],Object.keys(n).length>0?JSON.stringify(n):void 0}function Nn(t,r,n){const s=t[r];if(s==null)return;const o=Ci(s,n);o===void 0?delete t[r]:t[r]=o}function wi({scopeId:t,storage:r,snapshotKeys:n,enabled:s=!0,filterKey:o="filter",searchKey:i="q",persistSearch:l=!0}){const{searchParams:c}=_e(),a=t&&s?Et.lastState(t):void 0,d=u.useRef(a),h=u.useRef(!1);u.useEffect(()=>{if(!a){d.current=a;return}if(d.current!==a){d.current=a,h.current=!1;return}const y={};if(n.forEach(S=>{const C=c.get(S);C!=null&&(y[S]=C)}),l||Nn(y,o,i),Object.keys(y).length===0){h.current&&r.remove(a);return}h.current=!0,r.set(a,y)},[c,a,n,r,l,o,i]);const g=u.useCallback(()=>{if(!a)return null;const y=r.get(a);if(!y||typeof y!="object"||Array.isArray(y)||Object.keys(y).length===0)return null;const S=y[o];return S!=null&&Object.keys(Ot(S)).length===0&&delete y[o],l||Nn(y,o,i),Object.keys(y).length>0?y:null},[a,r,l,o,i]),m=u.useCallback(()=>{a&&r.remove(a)},[a,r]);return{enabled:!!a,read:g,clear:m}}function Di({scopeId:t,storage:r,perPageKey:n,pageSizeOptions:s,enabled:o=!0}){const{searchParams:i}=_e(),l=t&&o?Et.perPage(t):void 0,c=i.toString(),a=u.useRef(l);u.useEffect(()=>{if(!l){a.current=l;return}if(a.current!==l){a.current=l;return}const g=i.get(n);if(!g)return;const m=Number(g);!Number.isFinite(m)||m<=0||r.set(l,m)},[c,l,n,r]);const d=u.useCallback(()=>{if(!l)return null;const g=r.get(l);if(g==null)return null;const m=Number(g);return!Number.isFinite(m)||m<=0||s&&!s.includes(m)?null:String(m)},[l,r,s]),h=u.useCallback(()=>{l&&r.remove(l)},[l,r]);return{enabled:!!l,read:d,clear:h}}let Br={},Er=!1,Fr=null;const Si=(t,r)=>{Object.assign(Br,t),Fr=r,!Er&&(Er=!0,queueMicrotask(()=>{const n=Br,s=Fr;Br={},Er=!1,Fr=null,!(!s||Object.keys(n).length===0)&&s(o=>{const i=new URLSearchParams(o);return Object.entries(n).forEach(([l,c])=>i.set(l,c)),i},{replace:!0})}))};function ki({enabled:t,snapshotKeys:r,perPageKey:n,readSnapshot:s,readPerPage:o}){const{searchParams:i,setSearchParams:l,location:c}=_e(),a=u.useRef(null);u.useEffect(()=>{if(!t||a.current===c.pathname)return;a.current=c.pathname;const d={};if(!i.has(n)){const h=o();h&&(d[n]=h)}if(!r.some(h=>i.has(h))){const h=s();h&&Object.assign(d,h)}Object.keys(d).length!==0&&Si(d,l)},[c.pathname,t])}const Bi=({configs:t,activeKeys:r,onToggle:n,hasActiveFilter:s,onReset:o})=>t.length?e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{minWidth:260},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),s&&o&&e.jsx(H.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:t.map(i=>e.jsx(R.MenuItem,{selected:i.locked||r.includes(i.key),disabled:i.locked,closeOnSelect:!1,startIcon:i.icon??void 0,onClick:()=>{i.locked||n(i.key)},children:i.label},i.key))})})]}):null,zt=({onClear:t,onRemove:r})=>e.jsxs(R.Menu,{position:"bottom-right",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(B.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(R.MenuLists,{children:e.jsxs(R.MenuBody,{style:{width:180},children:[e.jsx(R.MenuItem,{startIcon:e.jsx(B.Icon,{name:"CrossCircle"}),onClick:t,children:"Clear value"}),r&&e.jsx(R.MenuItem,{intent:"danger",startIcon:e.jsx(B.Icon,{name:"Trash1"}),onClick:r,children:"Remove filter"})]})})]}),Ei=t=>{const r=new Date(t);return r.setHours(0,0,0,0),r},_n=(t,r,n)=>{const s=new Date(t);return n==="day"?s.setDate(s.getDate()+r):n==="week"?s.setDate(s.getDate()+r*7):n==="month"?s.setMonth(s.getMonth()+r):s.setFullYear(s.getFullYear()+r),s},Lo=t=>{const r=Ei(new Date);if(t.direction==="this"){const s=new Date(r),o=new Date(r);return t.period==="week"?(s.setDate(r.getDate()-r.getDay()),o.setDate(s.getDate()+6)):t.period==="month"?(s.setDate(1),o.setMonth(o.getMonth()+1,0)):t.period==="year"&&(s.setMonth(0,1),o.setMonth(11,31)),{from:s,to:o}}const n=t.count??1;return t.direction==="past"?{from:_n(r,-n,t.period),to:r}:{from:r,to:_n(r,n,t.period)}},qn=24,Ro=t=>t.length>qn?`${t.slice(0,qn)}...`:t,Oo=t=>t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Mr=(t,r="days")=>r==="months"?t.toLocaleDateString(void 0,{month:"short",year:"numeric"}):r==="years"?String(t.getFullYear()):Oo(t),nr={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"},Ao=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],Gr={past:"Past",next:"Next",this:"This"},Fi=["day","week","month","year"],Mi=["past","next","this"],Ii=t=>t.field.type==="date-compact"?e.jsx(Ri,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}):e.jsx(Ti,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}),Ti=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=r?Oo(new Date(r)):null,l=!!i,c=l?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Ro(i)})]}):t.label;return e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:l?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l?e.jsx(B.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:c})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{width:260},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(zt,{onClear:s,onRemove:o})]}),children:e.jsx(gt.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:t.mode,value:r,onChange:a=>a==null?s():n(a),withPadding:!1})})})]})},Li=(t,r="days")=>{switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date?`${nr[t.op]} ${Mr(new Date(t.date),r)}`:null;case"is-between":return t.from&&t.to?`${Mr(new Date(t.from),r)} - ${Mr(new Date(t.to),r)}`:null;case"is-relative-to-today":{const n=t.relative;if(!n)return null;if(n.direction==="this")return`This ${n.period}`;const s=n.count??1,o=s===1?n.period:`${n.period}s`;return`${Gr[n.direction]} ${s} ${o}`}case"is-empty":case"is-not-empty":return nr[t.op];default:return null}},Ri=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=t.ops&&t.ops.length>0?t.ops:Ao,l=t.defaultOp&&i.includes(t.defaultOp)?t.defaultOp:i[0],c=t.mode??"days",a=(r==null?void 0:r.op)??l,d=r?Li(r,c):null,h=!!d,g=h?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Ro(d)})]}):t.label,m=y=>{if(y!==a){if(y==="is-empty"||y==="is-not-empty"){n({op:y});return}if(y==="is-relative-to-today"){n({op:y,relative:(r==null?void 0:r.relative)??{direction:"past",count:1,period:"week"}});return}if(y==="is-between"){n({op:y,from:r==null?void 0:r.from,to:r==null?void 0:r.to});return}n({op:y,date:r==null?void 0:r.date})}};return e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:h?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:h?e.jsx(B.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:g})}),e.jsxs(R.MenuLists,{children:[e.jsx(R.MenuBody,{style:{width:320},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Wo,{op:a,ops:i,onChange:m})]}),e.jsx(zt,{onClear:s,onRemove:o})]}),children:e.jsx(zo,{value:r,op:a,mode:c,onChange:n})}),a==="is-relative-to-today"&&e.jsx(R.MenuFooter,{children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},Wo=({op:t,ops:r,onChange:n})=>e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:nr[t]})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{width:200},children:r.map(s=>e.jsx(R.MenuItem,{selected:t===s,onClick:()=>n(s),endIcon:t===s?e.jsx(B.Icon,{name:"Check"}):void 0,children:nr[s]},s))})})]}),zo=({value:t,op:r,mode:n="days",onChange:s})=>{if(r==="is-empty"||r==="is-not-empty")return e.jsx(x.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(r==="is-between"){const o=t!=null&&t.from||t!=null&&t.to?{from:t!=null&&t.from?new Date(t.from):null,to:t!=null&&t.to?new Date(t.to):null}:void 0;return e.jsx(gt.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,filter:n,value:o,onChange:i=>{if(i==null){s({op:r});return}if(typeof i=="object"&&i!==null&&"from"in i&&"to"in i){let{from:l,to:c}=i;if(!l&&c&&(l=c,c=null),!l&&!c){s({op:r});return}s({op:r,from:l?l.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},`range-${n}`)}return r==="is-relative-to-today"?e.jsx(Oi,{value:t==null?void 0:t.relative,onChange:o=>s({op:r,relative:o})}):e.jsx(gt.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:n,value:t!=null&&t.date?new Date(t.date):void 0,onChange:o=>{if(o==null){s({op:r});return}o instanceof Date&&s({op:r,date:o.toISOString()})},withPadding:!1},`single-${n}`)},Oi=({value:t,onChange:r})=>{const n=(t==null?void 0:t.direction)??"past",s=(t==null?void 0:t.count)??1,o=(t==null?void 0:t.period)??"week",i=n!=="this",l=Lo({direction:n,count:s,period:o});return e.jsxs(x.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:Gr[n]})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{width:140},children:Mi.map(c=>e.jsx(R.MenuItem,{selected:n===c,endIcon:n===c?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>r(c==="this"?{direction:c,period:o}:{direction:c,count:s,period:o}),children:Gr[c]},c))})})]}),i&&e.jsx(ot.Input,{type:"number",size:"sm",min:1,clearable:!1,value:s,onChange:c=>{const a=Number(c.target.value);r({direction:n,count:Number.isFinite(a)&&a>0?a:1,period:o})},style:{width:72}}),e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{width:140},children:Fi.map(c=>e.jsx(R.MenuItem,{selected:o===c,endIcon:o===c?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>r(n==="this"?{direction:n,period:c}:{direction:n,count:s,period:c}),children:c},c))})})]})]}),e.jsx(gt.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:l,onChange:()=>{},withPadding:!1},"relative-preview")]})},Zn=18,Ai=t=>t.length>Zn?`${t.slice(0,Zn)}...`:t,Wi=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=t.type==="dropdown-multiple",l=r.length,c=t.searchable!==!1,[a,d]=u.useState(""),h=t.options,g=typeof t.onSearch=="function",m=(()=>{if(g)return h;const M=a.trim().toLowerCase();return M?h.filter(T=>T.label.toLowerCase().includes(M)):h})(),y=M=>r.some(T=>T.value===M.value),S=M=>{if(!i){n([{label:M.label,value:M.value}]),d("");return}n(y(M)?r.filter(T=>T.value!==M.value):[...r,{label:M.label,value:M.value}])},C=M=>{var T;d(M),(T=t.onSearch)==null||T.call(t,M)},L=l===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:l===1?Ai(r[0].label):`${l} Selected`})]});return e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:l>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l>0?e.jsx(B.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:L})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{width:260},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(zt,{onClear:s,onRemove:o})]}),children:e.jsxs(x.Box,{direction:"column",gap:"sm",children:[c&&e.jsx(St.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:i,searchAble:!0,searchValue:a,onSearch:C,value:r,onChange:n,placeholder:`Search ${t.label.toLowerCase()}…`}),e.jsx(x.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:t.isLoading?e.jsx(x.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):m.length===0?e.jsx(x.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):m.map(M=>e.jsx(R.MenuItem,{closeOnSelect:!i,selected:y(M),startIcon:M.avatar,endIcon:y(M)?e.jsx(B.Icon,{name:"Check"}):void 0,description:M.description,onClick:()=>S(M),children:M.label},M.value))})]})})})]})},Gn=18,zi=t=>t.length>Gn?`${t.slice(0,Gn)}...`:t,Qn=({checked:t,indeterminate:r})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(nt.Checkbox,{size:"sm",checked:t,readOnly:!0,onChange:()=>{},variant:r?"indeterminate":"select"})}),Hi=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=new Set(r.map(m=>m.value)),l=r.length,c=t.options.length>0&&t.options.every(m=>i.has(m.value)),a=l>0&&!c,d=m=>{n(i.has(m.value)?r.filter(y=>y.value!==m.value):[...r,{label:m.label,value:m.value}])},h=()=>{n(c?[]:t.options.map(m=>({label:m.label,value:m.value})))},g=l===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs(w.Text,{as:"span",fontWeight:"semibold",children:[t.label,":"]})," ",e.jsx(w.Text,{as:"span",children:l===1?zi(r[0].label):`${l} Selected`})]});return e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:l>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l>0?e.jsx(B.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:g})}),e.jsx(R.MenuLists,{children:e.jsxs(R.MenuBody,{style:{width:240},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(zt,{onClear:s,onRemove:o})]}),children:[e.jsx(R.MenuItem,{closeOnSelect:!1,selected:c,onClick:h,startIcon:e.jsx(Qn,{checked:c||a,indeterminate:a}),children:"Select All"}),t.options.map(m=>e.jsx(R.MenuItem,{closeOnSelect:!1,selected:i.has(m.value),onClick:()=>d(m),startIcon:e.jsx(Qn,{checked:i.has(m.value)}),children:m.label},m.value))]})})]})},Un=18,Pi=t=>t.length>Un?`${t.slice(0,Un)}...`:t,Vi=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const[i,l]=u.useState(r??""),c=be.useDebounce(i,t.debounceMs??300);u.useEffect(()=>{c!==(r??"")&&n(c)},[c]),u.useEffect(()=>{l(r??"")},[r]);const a=!!r,d=a?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Pi(r)})]}):t.label;return e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:a?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:a?e.jsx(B.Icon,{name:"Search",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:d})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{style:{width:260},title:e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(zt,{onClear:s,onRemove:o})]}),children:e.jsx(ot.Input,{size:"sm",fullWidth:!0,value:i,placeholder:t.placeholder??"Cari…",leftIcon:e.jsx(B.Icon,{name:"Search",width:16,height:16}),onChange:h=>l(h.target.value)})})})]})},Ho=({activeKeys:t,configByKey:r,getValue:n,setValue:s,clearValue:o,removeFilter:i})=>e.jsx(e.Fragment,{children:t.map(l=>{const c=r[l];if(!c)return null;const a=n(c),d=c.locked?void 0:()=>i(l);return c.type==="date"||c.type==="date-compact"?e.jsx(Ii,{field:c,value:a,onChange:h=>s(c,h),onClear:()=>o(l),onRemove:d},l):c.type==="text"?e.jsx(Vi,{field:c,value:a||"",onChange:h=>s(c,h),onClear:()=>o(l),onRemove:d},l):c.type==="checkbox-multiple"?e.jsx(Hi,{field:c,value:a||[],onChange:h=>s(c,h),onClear:()=>o(l),onRemove:d},l):e.jsx(Wi,{field:c,value:a||[],onChange:h=>s(c,h),onClear:()=>o(l),onRemove:d},l)})}),Jn=t=>`${t} Rows`,Ni=({pagination:t,pageKey:r="page",perPageKey:n="perPage",pageSizeOptions:s=[10,25,50,100],defaultPerPage:o=10,showResultCount:i=!0,showPageSize:l=!0,showPagination:c=!0})=>{var M;const{searchQueries:a,setSearchParams:d,searchParams:h}=_e(),g=h.get(n),m=g?Number(g):o,y=T=>{d({...a,[r]:String(T)})},S=T=>{d({...a,[n]:T,[r]:"1"})},C=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:0),L=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[i&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${C}-${L} of ${((M=t==null?void 0:t.totalData)==null?void 0:M.toLocaleString())||0}`}),l&&e.jsxs(R.Menu,{position:"bottom-left",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Jn(m)})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{children:s.map(T=>e.jsx(R.MenuItem,{selected:T===m,onClick:()=>S(String(T)),children:Jn(T)},T))})})]}),c&&((t==null?void 0:t.totalPage)??0)>1&&e.jsx(x.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(Rt.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:t!=null&&t.currentPage?Number(t.currentPage):1,totalPages:Number(t==null?void 0:t.totalPage),onPageChange:y})})]})};function _i(t,r,n=!0){u.useEffect(()=>{if(!n)return;const s=o=>{var c;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==t||Re.isOverlayOpen())return;const i=o.target,l=(c=i==null?void 0:i.tagName)==null?void 0:c.toLowerCase();l==="input"||l==="textarea"||i!=null&&i.isContentEditable||(o.preventDefault(),r())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,r,n])}const qi=240,Po=({searchKey:t="q",filterKey:r="filter",pageKey:n="page",placeholder:s="Search",shortcut:o="/",collapsible:i=!0})=>{const{searchParams:l,setSearchParams:c,searchQueries:a}=_e(),d=ir(t,l,r)||"",[h,g]=u.useState(!i||!!d),[m,y]=u.useState(i&&!d),[S,C]=u.useState(d),L=be.useDebounce(S,350),M=u.useRef(null);u.useEffect(()=>{C(d),d&&g(!0)},[d]),u.useEffect(()=>{h&&y(!1)},[h]),u.useEffect(()=>{L!==d&&At({value:L,name:t,type:"search",searchQueries:a,setSearchParams:c,filterKey:r,pageKey:n})},[L]);const T=u.useCallback(()=>{g(!0),requestAnimationFrame(()=>{var F;return(F=M.current)==null?void 0:F.focus()})},[]);_i(o,T);const b=()=>{i&&!S&&g(!1)},j=F=>{var D;i&&F.key==="Escape"&&!S&&(g(!1),(D=M.current)==null||D.blur())},I=()=>{h||y(!0)};return e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[m&&e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:T}),e.jsxs(x.Box,{onTransitionEnd:I,style:{position:"relative",width:h?qi:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(ot.Input,{ref:M,size:"sm",fullWidth:!0,value:S,placeholder:s,leftIcon:e.jsx(B.Icon,{name:"Search",width:16,height:16}),onChange:F=>C(F.target.value),onKeyDown:j,onBlur:b,tabIndex:h?0:-1}),h&&!S&&e.jsx(x.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(w.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},Vo=({columns:t,allVisible:r,onToggle:n,onReorder:s,onSetAllHidden:o})=>{const[i,l]=u.useState(null),[c,a]=u.useState(null),d=()=>{i!==null&&c!==null&&i!==c&&s(i,c),l(null),a(null)},h=(g,m)=>{const y=g+m;y<0||y>=t.length||s(g,y)};return e.jsxs(R.Menu,{position:"bottom-right",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:r?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(R.MenuLists,{children:e.jsx(R.MenuBody,{children:e.jsxs(x.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(H.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(r),children:r?"Hide All":"Show All"})]}),e.jsx(x.Box,{direction:"column",overflow:"overflow-y-auto",children:t.map((g,m)=>{const y=!g.locked,S=c===m&&i!==null&&i!==m;return e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:y,onDragStart:()=>y&&l(m),onDragOver:C=>{C.preventDefault(),a(m)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:S?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(x.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:y?0:-1,"aria-label":`Reorder ${g.title}`,"aria-disabled":!y||void 0,color:"icon-subtlest",onKeyDown:C=>{y&&(C.key==="ArrowUp"?(C.preventDefault(),h(m,-1)):C.key==="ArrowDown"&&(C.preventDefault(),h(m,1)))},style:{display:"inline-flex",cursor:y?"grab":"default",opacity:y?1:.4},children:e.jsx(B.Icon,{name:"DragVertical",width:16,height:16})}),g.icon&&e.jsx(x.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:g.icon}),e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:g.title}),e.jsx(x.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(Bt.Toggle,{size:"sm",checked:g.visible,disabled:g.locked,onChange:()=>n(g.key),"aria-label":`Toggle ${g.title} column`})})]},g.key)})})]})})})]})},No=({views:t,onApply:r,onDelete:n,onSave:s})=>{const[o,i]=u.useState(""),l=()=>{const c=o.trim();c&&(s(c),i(""))};return e.jsxs(R.Menu,{position:"bottom-right",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:t.length>0?"secondary":"outline",tone:(t.length>0,"neutral"),size:"sm",iconLeft:e.jsx(B.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(R.MenuLists,{style:{width:"260px"},children:[e.jsx(R.MenuBody,{children:e.jsxs(x.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(x.Box,{direction:"column",overflow:"overflow-y-auto",children:t.length===0?e.jsx(x.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(w.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):t.map(c=>e.jsx(R.MenuItem,{startIcon:e.jsx(B.Icon,{name:"Bookmark"}),onClick:()=>r(c),endIcon:e.jsx(H.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Trash2"}),"aria-label":`Delete ${c.name}`,onClick:a=>{a.stopPropagation(),n(c.id)}}),children:c.name},c.id))})]})}),e.jsx(R.MenuFooter,{children:e.jsxs(x.Box,{direction:"row",gap:"xs",children:[e.jsx(x.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(ot.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:c=>i(c.target.value),onKeyDown:c=>{c.key==="Enter"&&l()}})}),e.jsx(H.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:l,children:"Save"})]})})]})]})},Zi=({isOpen:t,onClose:r,configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,onToggle:l,onReset:c,getValue:a,setValue:d,clearValue:h,removeFilter:g})=>{const m=s.length;return e.jsx(tr.Drawer,{position:"bottom",isShow:t,onHide:r,children:e.jsxs(x.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(x.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(x.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),m>0&&e.jsxs(w.Text,{fontSize:"sm",color:"subtle",children:["(",m,")"]})]}),e.jsx(H.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:r})]}),e.jsxs(x.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[m>0&&e.jsxs(x.Box,{direction:"column",gap:"sm",children:[e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(x.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(Ho,{activeKeys:s,configByKey:o,getValue:a,setValue:d,clearValue:h,removeFilter:g})})]}),n.length>0&&e.jsxs(x.Box,{direction:"column",gap:"sm",children:[e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(x.Box,{direction:"column",children:n.map(y=>{const S=s.includes(y.key),C=!!y.locked;return e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:C?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[y.icon&&e.jsx(x.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:y.icon}),e.jsx(w.Text,{fontSize:"sm",color:"primary",truncate:!0,children:y.label})]}),e.jsx(Bt.Toggle,{size:"sm",checked:S||C,disabled:C,onChange:()=>l(y.key),"aria-label":`Toggle ${y.label}`})]},y.key)})})]})]}),e.jsxs(x.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(x.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!i,onClick:c,children:"Reset"})}),e.jsx(x.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(H.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:r,children:"Selesai"})})]})]})})},Gi=t=>`${t} Rows`,Qi=({perPageKey:t,pageKey:r,pageSizeOptions:n,defaultPerPage:s=10,showPageSize:o})=>{const{searchQueries:i,setSearchParams:l,searchParams:c}=_e(),a=c.get(t),d=a?Number(a):s,h=g=>{l({...i,[t]:g,[r]:"1"})};return o?e.jsxs(R.Menu,{position:"bottom-right",children:[e.jsx(R.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(R.MenuLists,{children:e.jsxs(R.MenuBody,{style:{minWidth:200},children:[e.jsx(x.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),n.map(g=>e.jsx(R.MenuItem,{selected:g===d,endIcon:g===d?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>h(String(g)),children:Gi(g)},g))]})})]}):null},Ui=t=>{var ve;const{withPadding:r,configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,toggleFilter:l,removeFilter:c,getValue:a,setValue:d,clearValue:h,onReset:g,searchable:m,searchKey:y,filterKey:S,pageKey:C,searchPlaceholder:L,searchShortcut:M,searchCollapsible:T,pagination:b,perPageKey:j,pageSizeOptions:I,defaultPerPage:F,showPagination:D,showResultCount:O,showPageSize:A,hasColumns:Y,orderedColumns:P,allVisible:_,onToggleVisibility:q,onReorder:X,onSetAllHidden:K,showSavedViews:Q,savedViews:Z,onApplyView:z,onDeleteView:ie,onSaveView:ue,leadingActions:Ce,trailingActions:ke}=t,[je,he]=u.useState(!1),{searchQueries:ae,setSearchParams:We}=_e(),Be=(b==null?void 0:b.rangeStart)??(((b==null?void 0:b.currentPage)||0)>1?(((b==null?void 0:b.currentPage)||0)-1)*((b==null?void 0:b.perPage)||0)+1:1),qe=(b==null?void 0:b.rangeEnd)??((b==null?void 0:b.totalCurrentPage)!==(b==null?void 0:b.perPage)?b==null?void 0:b.totalData:((b==null?void 0:b.currentPage)||1)*((b==null?void 0:b.totalCurrentPage)||0)),re=we=>{We({...ae,[C]:String(we)})},fe=O||D&&!!(b!=null&&b.totalPage),Fe=()=>{g(),he(!1)};return e.jsxs(x.Box,{direction:"column",gap:"sm",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(x.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[m&&e.jsx(Po,{searchKey:y,filterKey:S,pageKey:C,placeholder:L,shortcut:M,collapsible:T}),e.jsx(H.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"FilterHorizontal"}),onClick:()=>he(!0),"aria-label":"Open filters",children:i?`Filter: ${s.length}`:null}),e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[Ce,Q&&e.jsx(No,{views:Z,onApply:z,onDelete:ie,onSave:ue}),Y&&e.jsx(Vo,{columns:P,allVisible:_,onToggle:q,onReorder:X,onSetAllHidden:K}),e.jsx(Qi,{perPageKey:j,pageKey:C,pageSizeOptions:I,defaultPerPage:F,showPageSize:A}),ke]})]}),fe&&e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[O?e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Be}-${qe} of ${((ve=b==null?void 0:b.totalData)==null?void 0:ve.toLocaleString())||0}`}):e.jsx(x.Box,{direction:"column"}),D&&!!(b!=null&&b.totalPage)&&e.jsx(Rt.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:b!=null&&b.currentPage?Number(b.currentPage):1,totalPages:Number(b.totalPage),onPageChange:re})]}),e.jsx(Zi,{isOpen:je,onClose:()=>he(!1),configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,onToggle:l,onReset:Fe,getValue:a,setValue:d,clearValue:h,removeFilter:c})]})},Ji=({withPadding:t=!1,filterConfigs:r=[],filterKey:n="filter",activeFilterKey:s="filters",pageKey:o="page",perPageKey:i="perPage",pageSizeOptions:l=[25,50,100],defaultPerPage:c,showPagination:a=!0,showResultCount:d=!0,showPageSize:h=!0,searchable:g=!1,searchKey:m="q",searchPlaceholder:y="Search",searchShortcut:S="/",searchPosition:C="right",searchCollapsible:L=!0,pagination:M,columns:T=[],onColumnsChange:b,columnsState:j,scopeId:I,savedViews:F,persistLastState:D=!0,persistSearch:O=!0,storage:A=ln,onReset:Y,leadingActions:P,trailingActions:_})=>{const q=I??(F==null?void 0:F.scopeId),{activeKeys:X,configByKey:K,hasActiveFilter:Q,toggleFilter:Z,removeFilter:z,getValue:ie,setValue:ue,clearValue:Ce,clearAll:ke}=sn({configs:r,filterKey:n,activeFilterKey:s,pageKey:o,searchKey:m}),je=bi({columns:T,scopeId:q,storage:A,onColumnsChange:b,value:j}),he=vi({scopeId:q,storage:A,snapshotKeys:[s,n,i],pageKey:o,getColumns:()=>je.state,applyColumns:je.applyState}),ae=wi({scopeId:q,storage:A,snapshotKeys:[s,n,o],enabled:D,filterKey:n,searchKey:m,persistSearch:O}),We=Di({scopeId:q,storage:A,perPageKey:i,pageSizeOptions:l,enabled:D});ki({enabled:D&&!!q,snapshotKeys:[s,n,o],perPageKey:i,readSnapshot:ae.read,readPerPage:We.read});const Be=c??l[0]??25,qe=!!(F!=null&&F.enabled)&&he.enabled,re=()=>{ke(),ae.clear(),Y==null||Y()},fe=be.useMediaQuery("md"),Fe=g?e.jsx(Po,{searchKey:m,filterKey:n,pageKey:o,placeholder:y,shortcut:S,collapsible:L}):null;return fe?e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",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(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Bi,{configs:r,activeKeys:X,onToggle:Z,hasActiveFilter:Q,onReset:re}),C==="left"&&Fe,e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Ho,{activeKeys:X,configByKey:K,getValue:ie,setValue:ue,clearValue:Ce,removeFilter:z}),Q&&e.jsx(H.Button,{variant:"link",tone:"brand",size:"sm",onClick:re,children:"Reset"})]})]}),e.jsxs(x.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[P,e.jsx(Ni,{pagination:M,pageKey:o,perPageKey:i,pageSizeOptions:l,defaultPerPage:Be,showPagination:a,showResultCount:d,showPageSize:h}),C==="right"&&Fe,qe&&e.jsx(No,{views:he.views,onApply:he.applyView,onDelete:he.deleteView,onSave:he.saveView}),T.length>0&&e.jsx(Vo,{columns:je.orderedColumns,allVisible:je.allVisible,onToggle:je.toggleVisibility,onReorder:je.reorder,onSetAllHidden:je.setAllHidden}),_]})]}):e.jsx(Ui,{withPadding:t,configs:r,activeKeys:X,configByKey:K,hasActiveFilter:Q,toggleFilter:Z,removeFilter:z,getValue:ie,setValue:ue,clearValue:Ce,onReset:re,searchable:g,searchKey:m,filterKey:n,pageKey:o,searchPlaceholder:y,searchShortcut:S,searchCollapsible:L,pagination:M,perPageKey:i,pageSizeOptions:l,defaultPerPage:Be,showPagination:a,showResultCount:d,showPageSize:h,hasColumns:T.length>0,orderedColumns:je.orderedColumns,allVisible:je.allVisible,onToggleVisibility:je.toggleVisibility,onReorder:je.reorder,onSetAllHidden:je.setAllHidden,showSavedViews:qe,savedViews:he.views,onApplyView:he.applyView,onDeleteView:he.deleteView,onSaveView:he.saveView,leadingActions:P,trailingActions:_})},Yi=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t[0];return(r==null?void 0:r.value)!=null?String(r.value):void 0},Xi=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t.map(n=>(n==null?void 0:n.value)!=null?String(n.value):null).filter(n=>n!=null);return r.length?r:void 0},$i=(t,r)=>{switch(t.type){case"dropdown":case"radio":return Yi(r);case"dropdown-multiple":case"checkbox-multiple":return Xi(r);case"date":return r instanceof Date?r.toISOString():void 0;case"date-compact":return r;case"text":return typeof r=="string"&&r?r:void 0;default:return}},Yn=(t,r)=>{if(t==null||t==="")return r;const n=Number(t);return Number.isFinite(n)&&n>0?n:r},Ki=t=>{const{filterConfigs:r,filterKey:n="filter",activeFilterKey:s="filters",pageKey:o="page",perPageKey:i="perPage",searchKey:l="q",defaultPage:c=1,defaultPerPage:a=10,paramKeys:d,serialize:h}=t,{activeKeys:g,configByKey:m,hasActiveFilter:y,getValue:S}=sn({configs:r,filterKey:n,activeFilterKey:s,pageKey:o,searchKey:l}),{searchParams:C}=_e(),L=C.toString();return u.useMemo(()=>{const T={},b={},j=Yn(C.get(o),c),I=Yn(C.get(i),a);T[(d==null?void 0:d.page)??"page"]=j,T[(d==null?void 0:d.perPage)??"perPage"]=I;const F=ir(l,C,n)||"";F&&(T[(d==null?void 0:d.search)??"search"]=F);let D=!1;for(const O of g){const A=m[O];if(!A)continue;const Y=S(A);b[O]=Y;const P=h==null?void 0:h[O],_=P?P(Y):$i(A,Y);if(_==null||Array.isArray(_)&&_.length===0)continue;const q=(d==null?void 0:d[O])??O;T[q]=_,D=!0}return{params:T,raw:b,hasActiveFilter:y||!!F||D}},[L,g.join("|"),n,s,o,i,l,c,a,d,h,m])},el=["dropdown","dropdown-multiple","checkbox-multiple","radio"],tl=({filterConfigs:t,filterKey:r,activeFilterKey:n,pageKey:s,searchKey:o})=>{const{configByKey:i,getValue:l,setValue:c,removeFilter:a,clearAll:d,hasActiveFilter:h}=sn({configs:t,filterKey:r,activeFilterKey:n,pageKey:s,searchKey:o}),g=(b,j)=>{var F;const I=b.options;return((F=I==null?void 0:I.find(D=>D.value===j))==null?void 0:F.label)??j},m=u.useCallback(b=>{const j=i[b];if(!j)return[];const I=l(j);return Array.isArray(I)?I.map(F=>String(F.value)):[]},[i,l]),y=u.useCallback((b,j)=>{const I=i[b];if(!I||!el.includes(I.type))return;const F=Array.isArray(j)?j:[j];if(F.length===0){a(b);return}c(I,F.map(D=>({label:g(I,D),value:D})))},[i,c,a]),S=u.useCallback((b,j)=>{const I=m(b);y(b,I.includes(j)?I.filter(F=>F!==j):[...I,j])},[m,y]),C=u.useCallback((b,j)=>m(b).includes(j),[m]),L=u.useCallback(b=>a(b),[a]),M=u.useCallback(b=>{const j=i[b];return j?l(j):void 0},[i,l]),T=u.useCallback((b,j)=>{const I=i[b];if(I){if(j==null){a(b);return}c(I,j)}},[i,c,a]);return{set:y,toggle:S,clear:L,clearAll:d,isActive:C,values:m,getRaw:M,setRaw:T,hasActiveFilter:h}},Ir="var(--sa-background-brand, #04254f)",rl="var(--sa-text-brand, #031f43)",nl={padding:"6px 8px",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:4,font:"inherit",fontSize:13,outline:"none",width:"100%",boxSizing:"border-box"},cn={padding:"4px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",fontSize:13,color:rl},_o=(t,r)=>{if(t.type==="text"||t.type==="date")return!!r.getRaw(t.key);if(t.type==="date-compact"){const n=r.getRaw(t.key);return!!(n&&(n.date||n.from||n.to||n.relative||n.op==="is-empty"||n.op==="is-not-empty"))}return r.values(t.key).length>0},ol=({field:t,controls:r})=>{const[n,s]=u.useState(""),o=t.type==="dropdown"||t.type==="radio",i=t.type==="checkbox-multiple"?!1:t.searchable!==!1,l=r.values(t.key),c=i&&n.trim()?t.options.filter(d=>d.label.toLowerCase().includes(n.toLowerCase())):t.options,a=d=>{o?r.set(t.key,l.includes(d)?[]:d):r.toggle(t.key,d)};return e.jsxs(x.Box,{style:{display:"flex",flexDirection:"column",gap:4,minWidth:200},children:[i&&e.jsx("input",{value:n,onChange:d=>{var h;s(d.target.value),(h=t.onSearch)==null||h.call(t,d.target.value)},placeholder:"Cari…",style:nl}),e.jsxs(x.Box,{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:220,overflowY:"auto"},children:[c.map(d=>{const h=l.includes(d.value);return e.jsxs("button",{type:"button",onClick:()=>a(d.value),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 8px",border:"none",background:"none",cursor:"pointer",font:"inherit",textAlign:"left",borderRadius:4},children:[e.jsx("span",{style:{width:16,height:16,flexShrink:0,borderRadius:o?"50%":4,display:"inline-flex",alignItems:"center",justifyContent:"center",border:`1px solid ${h?Ir:"var(--sa-border-subtle, #0b120e24)"}`,background:h&&!o?Ir:"transparent"},children:h&&(o?e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:Ir}}):e.jsx(B.Icon,{name:"Check",size:"xs",style:{color:"#fff"}}))}),e.jsx(w.Text,{as:"span",style:{fontSize:14},children:d.label})]},d.value)}),c.length===0&&e.jsx(w.Text,{as:"span",style:{fontSize:13,color:"var(--sa-text-subtlest, #8c8f97)",padding:"6px 8px"},children:"Tak ada hasil"})]}),l.length>0&&e.jsx("button",{type:"button",onClick:()=>r.clear(t.key),style:cn,children:"Clear"})]})},sl=({field:t,controls:r})=>{const n=r.getRaw(t.key);return e.jsx(x.Box,{style:{minWidth:240},children:e.jsx(gt.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:t.mode,value:n,onChange:s=>r.setRaw(t.key,s??null),withPadding:!1})})},il=({field:t,controls:r})=>{const n=r.getRaw(t.key),s=t.ops&&t.ops.length>0?t.ops:Ao,o=t.defaultOp&&s.includes(t.defaultOp)?t.defaultOp:s[0],i=t.mode??"days",l=(n==null?void 0:n.op)??o,c=d=>r.setRaw(t.key,d),a=d=>{if(d!==l)return c(d==="is-empty"||d==="is-not-empty"?{op:d}:d==="is-relative-to-today"?{op:d,relative:(n==null?void 0:n.relative)??{direction:"past",count:1,period:"week"}}:d==="is-between"?{op:d,from:n==null?void 0:n.from,to:n==null?void 0:n.to}:{op:d,date:n==null?void 0:n.date})};return e.jsxs(x.Box,{style:{display:"flex",flexDirection:"column",gap:6,minWidth:280},children:[e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Wo,{op:l,ops:s,onChange:a})]}),e.jsx(zo,{value:n,op:l,mode:i,onChange:c}),_o(t,r)&&e.jsx("button",{type:"button",onClick:()=>r.setRaw(t.key,null),style:cn,children:"Clear"})]})},ll=({field:t,controls:r})=>{const n=r.getRaw(t.key)??"",[s,o]=u.useState(n),i=be.useDebounce(s,t.debounceMs??300);return u.useEffect(()=>{const l=r.getRaw(t.key)??"";i!==l&&r.setRaw(t.key,i||null)},[i]),e.jsxs(x.Box,{style:{display:"flex",flexDirection:"column",gap:6,minWidth:220},children:[e.jsx(ot.Input,{size:"sm",fullWidth:!0,value:s,placeholder:t.placeholder??"Cari…",leftIcon:e.jsx(B.Icon,{name:"Search",width:16,height:16}),onChange:l=>o(l.target.value)}),s&&e.jsx("button",{type:"button",onClick:()=>{o(""),r.setRaw(t.key,null)},style:cn,children:"Clear"})]})},cl=({field:t,controls:r})=>t.type==="text"?e.jsx(ll,{field:t,controls:r}):t.type==="date"?e.jsx(sl,{field:t,controls:r}):t.type==="date-compact"?e.jsx(il,{field:t,controls:r}):e.jsx(ol,{field:t,controls:r}),al=(t,r)=>{if(!t)return{};const{fromKey:n,toKey:s,opKey:o}=r,i={};switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date&&(i[n]=new Date(t.date).toISOString()),o&&(i[o]=t.op),i;case"is-between":return t.from&&(i[n]=new Date(t.from).toISOString()),t.to&&(i[s]=new Date(t.to).toISOString()),i;case"is-relative-to-today":{if(!t.relative)return i;const{from:l,to:c}=Lo(t.relative);return i[n]=l.toISOString(),i[s]=c.toISOString(),i}case"is-empty":case"is-not-empty":return o&&(i[o]=t.op==="is-empty"?"empty":"not-empty"),i;default:return i}},qo=({children:t,borderRadius:r,height:n})=>{const s=u.useRef(null),[o,i]=u.useState("100vh");return u.useEffect(()=>{if(n)return;const l=()=>{if(s.current){const c=s.current.getBoundingClientRect().top;i(`calc(100vh - ${c}px)`)}};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[n]),e.jsx(x.Box,{ref:s,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:r||"rounded-xs",style:{height:n??o,display:"flex",flexDirection:"column"},children:t})},Zo=({action:t,rightContent:r,leftContent:n,headerSlot:s,advanceFilter:o,showFilter:i=!0})=>{const l=be.useMediaQuery("md"),c=i?e.jsx(To,{...o}):null,a=()=>t?u.isValidElement(t)?t:e.jsx(x.Box,{style:{display:"flex",flexDirection:l?"row":"column",gap:"8px",width:l?"auto":"100%",textWrap:"nowrap"},children:t.map(({title:d,icon:h,buttonProps:g,onClick:m},y)=>!d&&!h?null:e.jsx(H.Button,{fullWidth:!l,iconLeft:h?e.jsx(B.Icon,{name:h}):void 0,onClick:m,...g,children:d},`action-${y}`))}):null;return e.jsx(x.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:l?"row":"column-reverse",gap:"16px"},children:s?s({filter:c}):e.jsxs(e.Fragment,{children:[e.jsxs(x.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[c,n]}),e.jsxs(x.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[r,a()]})]})})},dl=({totalData:t,withMarginBottom:r=!0,withMarginTop:n=!0})=>e.jsxs(x.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:r?"16px":void 0,marginTop:n?"16px":void 0},children:[e.jsxs(Ye.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Ye.Body1,{children:t||0})]}),Go=({pagination:t,pageKey:r="page",perPageKey:n="perPage",defaultPerPage:s=10,showPagination:o=!0,totalData:i})=>{const{searchQueries:l,setSearchParams:c,searchParams:a}=_e(),d=a.get(n),h=S=>{c({...l,[r]:String(S)})},g=S=>{c({...l,[n]:S,[r]:"1"})},m=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:1),y=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsx(x.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:o?e.jsxs(e.Fragment,{children:[e.jsxs(x.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(w.Text,{children:"Rows Per Page: "}),e.jsx(St.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:S=>{g(S[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${s} per row`,value:`${s}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${s} per row`,value:`${s}`}]}),e.jsx(w.Text,{children:`${m}-${y} of ${(t==null?void 0:t.totalData)||0}`})]}),e.jsx(Rt.Pagination,{currentPage:t!=null&&t.currentPage?Number(t==null?void 0:t.currentPage):1,totalPages:t!=null&&t.totalPage?Number(t==null?void 0:t.totalPage):1,onPageChange:h})]}):e.jsx(dl,{totalData:i,withMarginBottom:!1,withMarginTop:!1})})},Qo=({filter:t,columnTitle:r})=>{const[n,s]=u.useState(!1),o=u.useRef(null),i=u.useRef(null),l=u.useRef(null),[c,a]=u.useState(""),[d,h]=u.useState({top:0,left:0}),g=t.selectedValues,m=u.useMemo(()=>c?t.options.filter(C=>C.label.toLowerCase().includes(c.toLowerCase())):t.options,[t.options,c]);u.useEffect(()=>{if(n&&i.current){const C=i.current.getBoundingClientRect(),L=280,M={top:C.bottom+8};t.position==="left"||C.left+L>window.innerWidth?M.right=window.innerWidth-C.right:M.left=C.left,h(M)}},[n,t.position]),u.useEffect(()=>{n&&l.current?setTimeout(()=>{var C;return(C=l.current)==null?void 0:C.focus()},50):a("")},[n]),u.useEffect(()=>{const C=L=>{o.current&&!o.current.contains(L.target)&&i.current&&!i.current.contains(L.target)&&s(!1)};return n&&document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[n]);const y=C=>{const L=g.includes(C)?g.filter(M=>M!==C):[...g,C];t.onFilterChange(L)},S=()=>t.onFilterChange([]);return e.jsxs(x.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(x.Box,{ref:i,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:C=>{var L;C.stopPropagation(),n||(L=t.onOpen)==null||L.call(t),s(M=>!M)},children:e.jsx(B.Icon,{name:n?"ChevronUp":"ChevronDown",size:"sm",style:{color:g.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),n&&e.jsxs(x.Box,{ref:o,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(x.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(w.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",r]}),g.length>0&&e.jsx(x.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(w.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:C=>{C.stopPropagation(),S()},children:"CLEAR"})})]}),!t.hideSearch&&e.jsx(x.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(ot.Input,{ref:l,placeholder:`Search ${r.toLowerCase()}...`,leftIcon:e.jsx(B.Icon,{name:"Search",size:"sm"}),value:c,onChange:C=>a(C.target.value),style:{fontSize:"14px"}})}),e.jsx(x.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:t.isLoadingOptions?e.jsxs(x.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(B.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):m.length>0?e.jsx(x.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:m.map(C=>e.jsxs(x.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:g.includes(C.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:L=>{L.stopPropagation(),y(C.value)},onMouseEnter:L=>{g.includes(C.value)||(L.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),L.currentTarget.style.transform="translateX(2px)"},onMouseLeave:L=>{L.currentTarget.style.backgroundColor=g.includes(C.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",L.currentTarget.style.transform="translateX(0)"},children:[e.jsx(nt.Checkbox,{checked:g.includes(C.value),onChange:()=>{}}),e.jsx(w.Text,{fontSize:"sm",fontWeight:g.includes(C.value)?"medium":"normal",color:g.includes(C.value)?"primary":"gray-700",children:C.label})]},C.value))}):e.jsxs(x.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(B.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),g.length>0&&e.jsx(x.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(x.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(x.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:g.length}),e.jsxs(w.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",g.length>1?"s":""," selected"]})]})})]})]})},ul=({direction:t})=>{const r="var(--sa-text-primary, #292a2e)",n="var(--sa-text-subtle, #8c8f97)",s=t==="asc"?r:n,o=t==="desc"?r:n,i=t==="asc"?1:.45,l=t==="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:s,opacity:i,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:o,opacity:l},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},xl=({frozen:t})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:t?"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:t?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),Tr="var(--sa-background-primary, #ffffff)",Xn="var(--sa-background-primary-inverse, #f8f8f8)",Uo=({columns:t,records:r,handleDetail:n,handleUpdate:s,handleDelete:o,isLoading:i,visibleHandleDelete:l,visibleHandleUpdate:c,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:h,frozenCount:g=0,onFrozenCountChange:m,customActions:y,actionsOrder:S=["detail","update","delete","custom"],customEmptyState:C,enableColumnResize:L=!1,defaultColumnWidths:M,onColumnWidthsChange:T,defaultMinColumnWidth:b=60,sort:j,defaultSort:I,onSortChange:F,showActionDivider:D=!1})=>{const O=j!==void 0,[A,Y]=u.useState(I??null),P=O?j??null:A,_=W=>{if(W.sortKey)return W.sortKey;if(typeof W.accessor=="string")return W.accessor},q=W=>{const J=_(W);if(!J)return;let U;!P||P.key!==J?U={key:J,direction:"asc"}:P.direction==="asc"?U={key:J,direction:"desc"}:U=null,O||Y(U),F==null||F(U)},K=[n,s,o].filter(W=>W!==void 0).length,Q=!!y,Z=!!n||!!s||!!o||Q,z="var(--sa-border-subtle, #0b120e24)",ie=`1px solid ${z}`,ue=`inset 1px 0 0 ${z}`,Ce=`inset -1px 0 0 ${z}`,ke=K===3?Q?"178px":"140px":K===2?Q?"140px":"102px":K===1?Q?"112px":"74px":Q?"74px":"",je=(W,J)=>{if(!J)return W;if(typeof J=="function")return J(W);if(typeof J=="string")return W[J]},[he,ae]=u.useState(!1);u.useEffect(()=>{if(!(h!=null&&h.current))return;const W=h.current;ae(W.scrollHeight>W.clientHeight)},[r,h]);const We=u.useRef(null),[Be,qe]=u.useState([]),[re,fe]=u.useState(()=>M??{}),Fe=u.useRef(null);u.useLayoutEffect(()=>{if(!g||!We.current){qe([]);return}const W=Array.from(We.current.querySelectorAll("thead tr th")),J=[];let U=0;W.forEach((le,De)=>{J[De]=U,De<g&&(U+=le.offsetWidth)}),qe(J)},[g,t,r,re]);const ve=W=>{m&&m(W<g?W:W+1)},we=(W,J)=>{const U=re[W];if(U!==void 0){const le=`${U}px`;return{width:le,minWidth:le,maxWidth:le}}return J?{width:J}:{}},et=W=>L&&(W.resizable??!0),tt=(W,J)=>{W.preventDefault(),W.stopPropagation();const U=W.currentTarget.closest("th");if(!U)return;const le=Math.round(U.getBoundingClientRect().width);Fe.current={colIndex:J,startX:W.clientX,startWidth:le};const De=document.body.style.userSelect,me=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Se=Ve=>{var ge;const ze=Fe.current;if(!ze)return;const it=((ge=t[ze.colIndex])==null?void 0:ge.minWidth)??b,lt=Math.max(it,ze.startWidth+(Ve.clientX-ze.startX));fe(He=>He[ze.colIndex]===lt?He:{...He,[ze.colIndex]:lt})},Xe=()=>{document.removeEventListener("mousemove",Se),document.removeEventListener("mouseup",Xe),document.body.style.userSelect=De,document.body.style.cursor=me,Fe.current=null,T&&fe(Ve=>(T(Ve),Ve))};document.addEventListener("mousemove",Se),document.addEventListener("mouseup",Xe)};return e.jsx("div",{ref:We,children:e.jsxs(G.Table,{fullWidth:!0,children:[e.jsx(G.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(G.Tr,{children:[t.map((W,J)=>{var pt,xt;const U=g>0&&J<g,le=Be[J]??0,De=et(W),Se=J===t.length-1&&Z&&D,Xe=_(W),Ve=!!W.sortable&&!!Xe,ze=Ve&&(P==null?void 0:P.key)===Xe?P.direction:null,it=W.title||((pt=W.accessor)==null?void 0:pt.toString())||"",lt=(xt=W.headerTooltip)!=null&&xt.showIcon?e.jsx(B.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,ge=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:it}),He=Ve?e.jsxs("button",{type:"button",onClick:()=>q(W),title:ze==="asc"?"Sorted ascending — click to sort descending":ze==="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:W.textAlign==="text-right"?"right":W.textAlign==="text-center"?"center":"left"},children:[ge,lt,e.jsx(ul,{direction:ze})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[ge,lt]});return e.jsxs(G.Th,{style:{position:"sticky",top:0,left:U?le:void 0,zIndex:U?4:2,paddingLeft:J===0?"12px":"",borderRight:d&&!Se&&!U?ie:void 0,borderBottom:d?ie:void 0,boxShadow:d&&U?Ce:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:W.textAlign==="text-right"?"right":W.textAlign==="text-center"?"center":"left",...we(J,W.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[W.headerTooltip?e.jsx(Ee.Tooltip,{label:W.headerTooltip.content,position:"bottom",children:He}):He,W.filter&&e.jsx(Qo,{filter:W.filter,columnTitle:W.title}),m&&e.jsx("button",{onClick:()=>ve(J),title:U?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:U?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:U?1:.45,transition:"opacity 0.15s"},children:e.jsx(xl,{frozen:U})})]}),De&&e.jsx("div",{onMouseDown:ht=>tt(ht,J),onClick:ht=>ht.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-${J}`)}),Z?e.jsx(G.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?ie:void 0,boxShadow:d&&D?ue:void 0}}):null]})}),e.jsx(G.Tbody,{children:i?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:t.length+1,children:e.jsxs(x.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Je.Skeleton,{variant:"list"}),e.jsx(Je.Skeleton,{variant:"list"}),e.jsx(Je.Skeleton,{variant:"list"}),e.jsx(Je.Skeleton,{variant:"list"}),e.jsx(Je.Skeleton,{variant:"list"})]})})}):!(r!=null&&r.length)&&C?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:t.length+1,children:C})}):r==null?void 0:r.map((W,J)=>e.jsxs(G.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:J===r.length-1&&he?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:U=>{const le=U.currentTarget;le.style.backgroundColor=Xn,Array.from(le.querySelectorAll("td")).forEach(De=>{De.style.position==="sticky"&&(De.style.backgroundColor=Xn)})},onMouseLeave:U=>{const le=U.currentTarget;le.style.backgroundColor="",Array.from(le.querySelectorAll("td")).forEach(De=>{De.style.position==="sticky"&&(De.style.backgroundColor=Tr)})},children:[t.map((U,le)=>{const De=U.render?U.render(W,J,r):je(W,U.accessor),me=g>0&&le<g,Se=Be[le]??0,Xe=re[le]!==void 0,Ve=me&&le===g-1;return e.jsx(G.Td,{style:{position:me?"sticky":void 0,left:me?Se:void 0,zIndex:me?1:void 0,backgroundColor:me?Tr:void 0,transition:me?"background-color 0.3s ease":void 0,paddingLeft:le===0?"12px":"",whiteSpace:"nowrap",overflow:Xe?"hidden":void 0,borderLeft:U.showBorderLeft?ie:void 0,borderRight:U.showBorderRight?ie:void 0,boxShadow:Ve?Ce:void 0,textAlign:U.textAlign==="text-right"?"right":U.textAlign==="text-center"?"center":"left",...we(le,U.width)},children:typeof De=="string"?e.jsx(w.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:U.textAlign==="text-right"?"right":U.textAlign==="text-center"?"center":"left"},children:De}):De},`row-${J}-col-${le}`)}),Z?e.jsx(G.Td,{style:{width:ke,position:"sticky",right:0,zIndex:1,backgroundColor:Tr,boxShadow:D?ue:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ce.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:S.map(U=>{const le=J===r.length-1?"top":"bottom";return U==="detail"&&n&&(a==null?void 0:a(W))!==!1?e.jsx(Ee.Tooltip,{label:"Detail",position:le,children:e.jsx(H.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(W.id,W),iconLeft:e.jsx(B.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):U==="update"&&s&&(c==null?void 0:c(W))!==!1?e.jsx(Ee.Tooltip,{label:"Update",position:le,children:e.jsx(H.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>s(W),iconLeft:e.jsx(B.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):U==="delete"&&o&&(l==null?void 0:l(W))!==!1?e.jsx(Ee.Tooltip,{label:"Delete",position:le,children:e.jsx(H.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(W.id,W),iconLeft:e.jsx(B.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):U==="custom"?e.jsx(u.Fragment,{children:y==null?void 0:y(W)},"custom"):null})})}):null]},`${W}${J}`))})]})})};let $n=!1;const hl=({wrapperProps:t,dataTableProps:r,headerProps:n,footerProps:s})=>{var g;process.env.NODE_ENV!=="production"&&!$n&&($n=!0,console.warn("[@starasia/admin] `TableSection` deprecated — pakai `<FilterBar>` + `<TableLayout>`. Lihat skill `starasia-list-page-pattern`. Akan dihapus di salah satu major berikutnya."));const o=u.useRef(null),[i,l]=u.useState((r==null?void 0:r.defaultFrozenCount)??0),c=(n==null?void 0:n.show)??!0,a=u.useRef(null),d=(g=r==null?void 0:r.pagination)==null?void 0:g.totalData;typeof d=="number"&&(a.current=d);const h=(s==null?void 0:s.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(qo,{...t,children:[c&&e.jsx(Zo,{...n}),e.jsx(x.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:r?e.jsx(Uo,{...r,scrollParentRef:o,frozenCount:r!=null&&r.enableFreezeColumns?i:0,onFrozenCountChange:r!=null&&r.enableFreezeColumns?l:void 0}):null}),h&&e.jsx(Go,{pagination:r==null?void 0:r.pagination,pageKey:r==null?void 0:r.pageKey,perPageKey:r==null?void 0:r.perPageKey,defaultPerPage:r==null?void 0:r.defaultPerPage,showPagination:r==null?void 0:r.showPagination,totalData:s==null?void 0:s.totalData})]})};function fl(t){return u.memo(t)}const ml=fl(hl),Jo="(any-pointer: coarse)",gl=t=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const r=window.matchMedia(Jo);return r.addEventListener("change",t),()=>r.removeEventListener("change",t)},pl=()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(Jo).matches,yl=()=>!1;function Yo(){return u.useSyncExternalStore(gl,pl,yl)}const Kn=200,Gt="1px solid var(--sa-border-subtle, #0b120e24)",jl=({sortDir:t,frozen:r,filterActive:n})=>t==="asc"?e.jsx(B.Icon,{name:"ChevronSmallUp"}):t==="desc"?e.jsx(B.Icon,{name:"ChevronSmallDown"}):r?e.jsx(B.Icon,{name:"LockOn",size:"xs"}):e.jsx(B.Icon,{name:"Filter",size:"xs",style:n?{color:"var(--sa-text-brand, #031f43)"}:void 0}),Qt=({icon:t,label:r,active:n,danger:s,onClick:o})=>{const i=s?"var(--sa-text-error, #a4133c)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:n?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:i,textAlign:"left"},onMouseEnter:l=>{n||(l.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:l=>{l.currentTarget.style.background=n?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(B.Icon,{name:t,size:"sm",style:{color:i,flexShrink:0}}),e.jsx(w.Text,{as:"span",style:{color:i},children:r})]})},bl=t=>{let r=(t==null?void 0:t.parentElement)??null;for(;r;){const n=getComputedStyle(r).overflowX;if((n==="auto"||n==="scroll")&&r.scrollWidth>r.clientWidth)return r;r=r.parentElement}return null},Xo=({active:t,canSort:r,canHide:n,sortDir:s,frozen:o,onSort:i,onClearSort:l,onToggleFreeze:c,onHide:a,filterSlot:d,filterActive:h})=>{const[g,m]=u.useState(!1),y=u.useRef(null),S=u.useRef(null),[C,L]=u.useState({top:0,left:0}),M=u.useCallback(()=>{var P;const b=y.current;if(!b)return;const j=b.getBoundingClientRect(),I=b.closest(".sa-tl-scroll")??bl(b),F=I==null?void 0:I.getBoundingClientRect();if(F&&(j.left<F.left||j.left>F.right)){m(!1);return}const D=Math.min(window.innerWidth-8,F?F.right:window.innerWidth),O=((P=S.current)==null?void 0:P.offsetWidth)||Kn,A=F?F.left:8,Y=Math.max(A,Math.min(j.left,D-O));L({top:j.bottom+6,left:Y})},[]);u.useEffect(()=>{if(!g)return;M();const b=()=>M();return window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),()=>{window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b)}},[g,M]),u.useEffect(()=>{if(!g)return;const b=j=>{S.current&&!S.current.contains(j.target)&&y.current&&!y.current.contains(j.target)&&m(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[g]);const T=b=>{b(),m(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:y,type:"button",className:"sa-tl-menu-trigger","data-active":t||g?"true":"false",onClick:b=>{b.stopPropagation(),m(j=>!j)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:Gt,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(jl,{sortDir:s,frozen:o,filterActive:h})}),g&&e.jsxs(x.Box,{ref:S,onClick:b=>b.stopPropagation(),style:{position:"fixed",top:`${C.top}px`,...C.left!==void 0?{left:`${C.left}px`}:{right:`${C.right}px`},minWidth:Kn,backgroundColor:"var(--sa-background-primary, #ffffff)",border:Gt,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-xl, 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[d!=null&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:"6px 12px 2px"},children:e.jsx(w.Text,{as:"span",style:{fontSize:12,fontWeight:500,color:"var(--sa-text-subtlest, #8c8f97)"},children:"Filter"})}),e.jsx("div",{style:{padding:"2px 8px 4px"},children:d}),e.jsx("div",{style:{borderTop:Gt,margin:"4px 0"}})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx(Qt,{icon:"ChevronUp",label:"Ascending",active:s==="asc",onClick:()=>T(()=>s==="asc"?l():i("asc"))}),e.jsx(Qt,{icon:"ChevronDown",label:"Descending",active:s==="desc",onClick:()=>T(()=>s==="desc"?l():i("desc"))}),e.jsx("div",{style:{borderTop:Gt,margin:"4px 0"}})]}),e.jsx(Qt,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>T(c)}),n&&e.jsx(Qt,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>T(a)})]})]})},vl=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Cl={background:"var(--sa-background-warning-subtlest, #fef2e6)",color:"inherit",padding:0,borderRadius:2},$o=({text:t,query:r,markStyle:n})=>{const s=r==null?void 0:r.trim();if(!s||!t)return e.jsx(e.Fragment,{children:t});const o=s.split(/\s+/).filter(Boolean);if(!o.length)return e.jsx(e.Fragment,{children:t});const i=new Set(o.map(a=>a.toLowerCase())),l=new RegExp(`(${o.map(vl).join("|")})`,"gi"),c=t.split(l);return e.jsx(e.Fragment,{children:c.map((a,d)=>a&&i.has(a.toLowerCase())?e.jsx("mark",{style:{...Cl,...n},children:a},d):e.jsx(u.Fragment,{children:a},d))})},Mt="1px solid var(--sa-border-subtle, #0b120e24)",wl="var(--sa-text-subtle, #8c8f97)",Ct="var(--sa-background-neutral, #f0f1f2)",eo="2px 0 4px -2px var(--sa-border-subtle, #0b120e24)",It=40,Lr=5,Dl=28,Rr=4,Ut=16,Or="var(--sa-background-brand-subtlest)",Jt={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},to="sa-table-layout-styles",Sl=()=>{if(typeof document>"u"||document.getElementById(to))return;const t=document.createElement("style");t.id=to,t.textContent=`
|
|
2
2
|
.sa-table-layout tbody td {
|
|
3
3
|
transition: background-color 0.15s ease;
|
|
4
4
|
background-color: var(--sa-tl-bg, transparent);
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
.sa-table-layout tfoot.sa-tl-sticky-foot > tr:first-child > th {
|
|
50
50
|
box-shadow: 0 -2px 4px -2px var(--sa-border-subtle, #0b120e24);
|
|
51
51
|
}
|
|
52
|
-
`,document.head.appendChild(t)},Lt=t=>t==="right"?"right":t==="center"?"center":"left",Sl=/^(#|rgb|hsl|var\()/,Yt=t=>t?Sl.test(t)?t:`var(--sa-background-${t})`:void 0,kl=(t,r)=>{if(r)return t[r]},Bl=(t,r)=>t==null&&r==null?0:t==null?-1:r==null?1:typeof t=="number"&&typeof r=="number"?t-r:String(t).localeCompare(String(r)),El=({columns:t,data:r,getRowKey:n,rowBg:s,size:o="md",resizable:i=!1,layout:l="auto",widthStorageKey:c,columnState:a,onColumnStateChange:d,columnMenu:h=!1,highlight:g,sort:m,defaultSort:y,onSortChange:S,height:C,mobileLayout:T="cards",mobileBreakpoint:M="md",groupSeparator:L,summary:b,footer:j,stickyFooter:I=!1,emptyState:F,loading:D=!1,loadingRows:O=8,rowActions:A,rowActionsMode:Y="auto",selectable:H=!1,selectedKeys:_,defaultSelectedKeys:q,onSelectionChange:X,isRowSelectable:K})=>{Dl();const Z=!be.useMediaQuery(M)&&T!=="scroll",z=!!(A!=null&&A.length),ie=Jo(),ue=z&&(Y==="column"||Y==="auto"&&ie),Ce=Math.min((A==null?void 0:A.length)??0,Tr+1),ke=Ce>Tr?1:Ce,je=Ut*2+ke*wl+Math.max(0,ke-1)*Rr,he=ue?je:1,[ae,Ae]=u.useState(null);u.useEffect(()=>{if(!ae)return;const p=()=>Ae(null),v=setTimeout(()=>document.addEventListener("click",p),0);return()=>{clearTimeout(v),document.removeEventListener("click",p)}},[ae]);const[Be,qe]=u.useState(()=>new Set),re=a!==void 0,[fe,Fe]=u.useState({}),ve=a??fe,we=p=>{d==null||d(p),re||Fe(p)},et=m!==void 0,[tt,W]=u.useState(y??null),J=et?m??null:tt,U=!S,le=p=>{S==null||S(p),et||W(p)},{headerGroups:De,leafColumns:me,hasGroups:Se}=u.useMemo(()=>{var oe;const p=new Set(ve.hidden??[]),v=(ne,pe)=>ne.key??(typeof ne.accessor=="string"?ne.accessor:`col-${pe}`),B=t.map((ne,pe)=>{var Ge;if((Ge=ne.children)!=null&&Ge.length){const Ft=ne.children.map(($e,vt)=>({col:$e,key:v($e,`${pe}-${vt}`)})).filter($e=>!p.has($e.key));return{col:ne,key:ne.key??`group-${pe}`,isGroup:!0,leaves:Ft}}const ye={col:ne,key:v(ne,`${pe}`)};return{col:ne,key:ye.key,isGroup:!1,leaves:p.has(ye.key)?[]:[ye]}}).filter(ne=>ne.leaves.length>0),N=B.some(ne=>ne.isGroup);let ee=B.flatMap(ne=>ne.leaves);if(!N&&((oe=ve.order)!=null&&oe.length)){const ne=new Map(ve.order.map((pe,ye)=>[pe,ye]));ee=[...ee].sort((pe,ye)=>(ne.get(pe.key)??1/0)-(ne.get(ye.key)??1/0))}return{headerGroups:B,leafColumns:ee,hasGroups:N}},[t,ve]),Xe=u.useMemo(()=>new Map(me.map((p,v)=>[p.key,v])),[me]),Pe=!Se&&me.some(p=>(p.col.headerColSpan??1)>1),We=me.map(p=>p.key).join("|"),it=(p,v)=>{const B=p.sortKey??(typeof p.accessor=="string"?p.accessor:void 0);return B?v[B]:void 0},lt=p=>p.sortable??(!!p.sortKey||typeof p.accessor=="string"),ge=u.useMemo(()=>{if(!U||!J)return r;const p=me.find(B=>B.key===J.key);if(!p)return r;const v=J.direction==="asc"?1:-1;return[...r].sort((B,N)=>Bl(it(p.col,B),it(p.col,N))*v)},[r,U,J,me]),ze=!Se&&!Pe,pt=!!c&&ze,[xt,ht]=G.useColumnWidths(c??""),ft=pt?xt:void 0,k=u.useRef(null),[V,$]=u.useState();u.useLayoutEffect(()=>{$(void 0)},[We]),u.useLayoutEffect(()=>{if(!ze||V||!k.current)return;const p=k.current.querySelectorAll("th.sa-tl-leaf");$(Array.from(p).map(v=>v.offsetWidth))},[V,ze]);const[Me,Re]=u.useState(),[Ie,Le]=u.useState(0);u.useLayoutEffect(()=>{if(!Se||!k.current)return;const p=k.current.querySelector(":scope > tr");p&&Le(p.offsetHeight)},[Se,We]);const Qe=(p,v)=>{if((ft==null?void 0:ft[v])!=null)return ft[v];if(p.width!=null)return p.width;if((V==null?void 0:V[v])!=null)return V[v]},Ve=(p,v)=>typeof p.width=="number"?p.width:V==null?void 0:V[v],Oe=ve.frozenKey&&!Se&&!Pe?me.findIndex(p=>p.key===ve.frozenKey):-1,mt=p=>p<=Oe,Ue=H?It:0,jt=p=>{const v=Me??V;if(!v)return Ue;let B=Ue;for(let N=0;N<p;N++)B+=v[N]??0;return B};u.useLayoutEffect(()=>{const p=k.current;if(!p||Oe<0){Re(void 0);return}let v=0;const B=()=>{v=0;const ee=p.querySelectorAll("th.sa-tl-leaf"),oe=Array.from(ee).map(ne=>ne.getBoundingClientRect().width);Re(ne=>ne&&ne.length===oe.length&&ne.every((pe,ye)=>Math.abs(pe-oe[ye])<.5)?ne:oe)},N=new ResizeObserver(()=>{v||(v=requestAnimationFrame(B))});return N.observe(p),p.querySelectorAll("th.sa-tl-leaf").forEach(ee=>N.observe(ee)),B(),()=>{v&&cancelAnimationFrame(v),N.disconnect()}},[We,Oe,H,V,ft]);const rt=u.useRef(null),[cs,as]=u.useState("100vh");u.useLayoutEffect(()=>{if(C!==void 0)return;const p=()=>{if(rt.current){const v=rt.current.getBoundingClientRect().top;as(`calc(100vh - ${v}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[C]);const ct=(p,v)=>n?n(p,v):v,hr=_!==void 0,[an,ds]=u.useState(()=>new Set(q??[])),at=u.useMemo(()=>hr?new Set(_):an,[hr,_,an]);u.useEffect(()=>{H&&!n&&process.env.NODE_ENV!=="production"&&console.warn("[@starasia/admin] TableLayout: `selectable` tanpa `getRowKey` — key default (index) membuat seleksi menempel ke POSISI baris, bukan datanya. Beri `getRowKey` yang stabil (mis. r => r.id).")},[H,!n]);const dn=p=>{if(hr||ds(p),X){const v=ge.filter((B,N)=>p.has(ct(B,N)));X(Array.from(p),v)}},fr=(p,v)=>H&&(K?K(p,v):!0),mr=p=>{const v=new Set(at);v.has(p)?v.delete(p):v.add(p),dn(v)},bt=u.useMemo(()=>H?ge.map((p,v)=>({row:p,i:v,key:ct(p,v)})).filter(({row:p,i:v})=>K?K(p,v):!0).map(({key:p})=>p):[],[H,ge,K,n]),un=bt.filter(p=>at.has(p)),gr=bt.length>0&&un.length===bt.length,xn=un.length>0&&!gr,us=()=>{const p=new Set(at);gr?bt.forEach(v=>p.delete(v)):bt.forEach(v=>p.add(v)),dn(p)},pr=(p,v,B)=>{const N=p.render?p.render(v,B,ge):kl(v,p.accessor);if(g&&!p.render&&typeof N=="string"){const ee=p.key??(typeof p.accessor=="string"?p.accessor:void 0),oe=ee?g[ee]:void 0;if(oe)return e.jsx(Xo,{text:N,query:oe})}return N},yr=me.length+(H?1:0)+(z?1:0),hn=["80%","55%","70%","45%","90%","60%"],xs=(p,v)=>hn[(p*7+v*3)%hn.length],hs=(p,v)=>e.jsx(Je.Skeleton,{height:14,width:xs(p,v),borderRadius:"rounded-sm"}),fs=Array.from({length:O},(p,v)=>e.jsxs(G.Tr,{children:[H&&e.jsx(G.Td,{style:{width:It,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(Je.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),me.map(({col:B,key:N},ee)=>e.jsx(G.Td,{style:{textAlign:Lt(B.align)},children:hs(v,ee)},`sa-tl-sk-${v}-${N}`)),z&&e.jsx(G.Td,{style:{width:he,padding:0,border:"none"}})]},`sa-tl-sk-${v}`)),ms=(p,v)=>{v||we({...ve,hidden:[...ve.hidden??[],p]})},gs=p=>we({...ve,frozenKey:ve.frozenKey===p?void 0:p}),Pt=p=>(A??[]).filter(v=>{var B;return!((B=v.hidden)!=null&&B.call(v,p))}),fn=ue?{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:Rr,paddingLeft:Ut,paddingRight:Ut,height:"100%"}:{position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:Rr,paddingRight:Ut,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},Vt=(p,v,B,N)=>{var Ge;const ee=(Ge=p.disabled)==null?void 0:Ge.call(p,v),oe=(N==null?void 0:N.showLabel)??p.showLabel,ne=(N==null?void 0:N.size)??"xs",pe=e.jsx(P.Button,{size:ne,variant:p.variant??"tertiary",tone:p.tone??"neutral",disabled:ee,onClick:()=>p.onClick(v,B),iconLeft:p.icon?e.jsx(E.Icon,{name:p.icon,size:"sm"}):void 0,children:oe&&p.label}),ye=p.tooltip;return ye?e.jsx(Ee.Tooltip,{label:ye,position:"top-end",children:pe}):pe},ps=(p,v)=>{const B=Pt(p);if(!B.length)return null;if(B.length>Tr){const ee=ct(p,v),oe=(ae==null?void 0:ae.rowKey)===ee;return e.jsx("div",{className:"sa-tl-row-actions","data-mode":ue?"column":"overlay",style:fn,onClick:ne=>ne.stopPropagation(),children:e.jsx(Ee.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(P.Button,{size:"xs",variant:"tertiary",onClick:ne=>{const pe=ne.currentTarget.getBoundingClientRect();Ae(oe?null:{rowKey:ee,top:pe.bottom+4,right:window.innerWidth-pe.right})},children:e.jsx(E.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions","data-mode":ue?"column":"overlay",style:fn,children:B.map(ee=>e.jsx(u.Fragment,{children:Vt(ee,p,v)},ee.key))})},ys=(p,v)=>{const B=Pt(p);return B.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:Mt},children:B.map(N=>e.jsx(u.Fragment,{children:Vt(N,p,v,{showLabel:!0,size:"sm"})},N.key))}):null},js=(p,v)=>{const B=Pt(p);return B.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:B.map(N=>e.jsx(u.Fragment,{children:Vt(N,p,v,{showLabel:!1})},N.key))}):null},jr=(p,v)=>{var vt;const{col:B,key:N}=p,ee=Xe.get(N)??0,oe=mt(ee),ne=oe&&ee===Oe,pe=(J==null?void 0:J.key)===N?J.direction:null,ye=h&&!B.disableMenu?e.jsx(Yo,{active:!!pe||oe||!!B.filterActive,canSort:lt(B),canHide:!B.locked,sortDir:pe,frozen:oe,onSort:_t=>le({key:N,direction:_t}),onClearSort:()=>le(null),onToggleFreeze:()=>gs(N),onHide:()=>ms(N,B.locked),filterSlot:(vt=B.renderFilter)==null?void 0:vt.call(B),filterActive:B.filterActive}):null,Ge=B.align==="right",Ft=B.align==="right"?"flex-end":B.align==="center"?"center":"flex-start",$e=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Ft,overflow:"hidden"},children:[B.icon&&e.jsx(E.Icon,{name:B.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Jt,children:B.title})]});return e.jsx(G.Th,{className:`sa-tl-leaf${oe?" sa-tl-frozen":""}`,rowSpan:v==null?void 0:v.rowSpan,colSpan:v==null?void 0:v.colSpan,minWidth:B.minWidth,numeric:B.numeric,resizable:ze?B.resizable:!1,defaultWidth:Ve(B,ee),style:{textAlign:Lt(B.align),width:Qe(B,ee),position:"sticky",top:(v==null?void 0:v.top)??0,left:oe?jt(ee):void 0,zIndex:oe?3:2,backgroundColor:Ct,boxShadow:ne?eo:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Ge?e.jsxs(e.Fragment,{children:[ye,$e]}):e.jsxs(e.Fragment,{children:[$e,ye]})})},`th-${N}`)},bs=()=>{const p=[];for(let v=0;v<me.length;){const B=me[v],N=B.col.headerColSpan??1,ee=Math.max(1,Math.min(N,me.length-v));p.push(jr(B,ee>1?{colSpan:ee}:void 0)),v+=ee}return p},mn=p=>e.jsx(G.Th,{rowSpan:p==null?void 0:p.rowSpan,style:{width:It,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:Ct,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:v=>v.stopPropagation(),children:e.jsx(nt.Checkbox,{size:"sm",variant:xn?"indeterminate":"select",checked:gr||xn,disabled:bt.length===0,onChange:us,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),vs=(p,v,B)=>{const N=ct(p,v);return e.jsx(G.Td,{className:"sa-tl-frozen",style:{width:It,padding:0,position:"sticky",left:0,zIndex:2,...B?{"--sa-tl-bg":B}:{}},children:fr(p,v)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:ee=>ee.stopPropagation(),children:e.jsx(nt.Checkbox,{size:"sm",checked:at.has(N),onChange:()=>mr(N),"aria-label":"Pilih baris"})})},`tl-select-${v}`)},br=me.filter(p=>!p.col.hideOnMobile),vr=br.find(p=>p.col.primary)??br[0],Cs=br.filter(p=>p!==vr),ws=p=>qe(v=>{const B=new Set(v);return B.has(p)?B.delete(p):B.add(p),B}),gn=(p,v)=>Cs.map(({col:B,key:N})=>{const ee=pr(B,p,v),oe={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right",...B.numeric?{fontVariantNumeric:"tabular-nums"}:{}},ne=typeof ee=="string"||typeof ee=="number"?e.jsx(w.Text,{style:oe,children:ee}):e.jsx("div",{style:oe,children:ee});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof B.title=="string"?e.jsx(w.Text,{color:"subtle",fontWeight:"medium",style:{color:Cl,flexShrink:0},children:B.title}):e.jsx("div",{style:{flexShrink:0},children:B.title}),ne]},N)}),Cr=(p,v)=>{const B=vr?pr(vr.col,p,v):null;return typeof B=="string"||typeof B=="number"?e.jsx(w.Text,{as:"span",style:Jt,children:B}):e.jsx("span",{style:Jt,children:B})},Ds=e.jsx(x.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:O},(p,v)=>e.jsxs(x.Box,{style:{border:Mt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Je.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(Je.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(Je.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${v}`))}),pn=e.jsx(x.Box,{fullWidth:!0,style:{minHeight:(F==null?void 0:F.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:F==null?void 0:F.content}),Ss=D?Ds:ge.length===0?pn:T==="expand"?e.jsx(x.Box,{style:{display:"flex",flexDirection:"column"},children:ge.map((p,v)=>{const B=ct(p,v),N=Be.has(B),oe=H&&at.has(B)?Or:Yt(s==null?void 0:s(p,v));return e.jsxs("div",{style:{borderBottom:Mt,backgroundColor:oe},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[fr(p,v)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(nt.Checkbox,{size:"sm",checked:at.has(B),onChange:()=>mr(B),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>ws(B),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:[Cr(p,v),e.jsx(E.Icon,{name:N?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),z&&js(p,v)]}),N&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:gn(p,v)})]},B)})}):e.jsx(x.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:ge.map((p,v)=>{const B=ct(p,v),N=H&&at.has(B);return e.jsxs(x.Box,{style:{border:Mt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:N?Or:Yt(s==null?void 0:s(p,v))},children:[fr(p,v)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(nt.Checkbox,{size:"sm",checked:at.has(B),onChange:()=>mr(B),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:Cr(p,v)})]}):Cr(p,v),gn(p,v),z&&ys(p,v)]},B)})}),ks=i&&ze&&V!==void 0,yn=l==="fixed"&&!i&&(ze?V!==void 0:!0),Bs=yn&&!ze,Nt=j&&j.length>0?j.map((p,v)=>e.jsx(G.Tr,{children:p.cells.map((B,N)=>e.jsx(G.Td,{colSpan:B.colSpan,rowSpan:B.rowSpan,numeric:B.numeric,style:{textAlign:Lt(B.align)},children:B.content},`tl-foot-${v}-${N}`))},`tl-foot-${v}`)):null,Es=e.jsxs(G.Table,{className:"sa-table-layout",fullWidth:!0,size:o,resizable:ks,style:yn?{tableLayout:"fixed"}:void 0,onWidthsChange:pt?ht:void 0,children:[Bs&&e.jsxs("colgroup",{children:[H&&e.jsx("col",{style:{width:It}}),me.map(({col:p,key:v},B)=>e.jsx("col",{style:{width:Qe(p,B)}},`col-${v}`)),z&&e.jsx("col",{style:{width:he}})]}),e.jsx(G.Thead,{ref:k,children:Se?e.jsxs(e.Fragment,{children:[e.jsxs(G.Tr,{children:[H&&mn({rowSpan:2}),De.map(p=>p.isGroup?e.jsx(G.Th,{colSpan:p.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:Ct},children:e.jsx("span",{style:Jt,children:p.col.title})},`grp-${p.key}`):jr(p.leaves[0],{rowSpan:2})),z&&e.jsx(G.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:he,padding:0,border:"none",backgroundColor:Ct}})]}),e.jsx(G.Tr,{children:De.flatMap(p=>p.isGroup?p.leaves.map(v=>jr(v,{top:Ie})):[])})]}):e.jsxs(G.Tr,{children:[H&&mn(),bs(),z&&e.jsx(G.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:he,padding:0,border:"none",backgroundColor:Ct}})]})}),e.jsx(G.Tbody,{children:D?fs:ge.length===0?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:yr,children:pn})}):e.jsxs(e.Fragment,{children:[ge.map((p,v)=>{const B=L==null?void 0:L(p,v,v>0?ge[v-1]:void 0),ee=H&&at.has(ct(p,v))?Or:Yt(s==null?void 0:s(p,v));return e.jsxs(u.Fragment,{children:[B!=null&&B!==!1&&e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:yr,style:{backgroundColor:Ct},children:B})}),e.jsxs(G.Tr,{children:[H&&vs(p,v,ee),me.map(({col:oe,key:ne},pe)=>{var jn;const ye=(jn=oe.cellProps)==null?void 0:jn.call(oe,p,v,ge);if(ye!=null&&ye.hidden)return null;const Ge=mt(pe),Ft=Ge&&pe===Oe,$e=pr(oe,p,v),vt=typeof oe.bg=="function"?oe.bg(p,v,ge):oe.bg,_t=Yt(vt)??ee;return e.jsx(G.Td,{className:Ge?"sa-tl-frozen":void 0,colSpan:ye==null?void 0:ye.colSpan,rowSpan:ye==null?void 0:ye.rowSpan,numeric:oe.numeric,style:{textAlign:Lt(oe.align),width:Qe(oe,pe),minWidth:oe.minWidth,position:Ge?"sticky":void 0,left:Ge?jt(pe):void 0,zIndex:Ge?1:void 0,boxShadow:Ft?eo:void 0,..._t?{"--sa-tl-bg":_t}:{}},children:typeof $e=="string"?e.jsx(w.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Lt(oe.align)},children:$e}):$e},`tl-cell-${v}-${ne}`)}),z&&e.jsx(G.Td,{className:ue?"sa-tl-frozen":void 0,style:{position:"sticky",right:0,width:he,padding:0,overflow:ue?void 0:"visible",zIndex:2,border:"none"},children:ps(p,v)})]})]},ct(p,v))}),b!=null&&e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:yr,children:b})})]})}),Nt&&e.jsx(G.Tfoot,{className:I?"sa-tl-sticky-foot":void 0,children:Nt})]}),wr=ae?ge.findIndex((p,v)=>ct(p,v)===ae.rowKey):-1,Dr=wr>=0?ge[wr]:null;return e.jsxs(e.Fragment,{children:[e.jsx(x.Box,{ref:rt,className:"sa-tl-scroll",fullWidth:!0,style:{overflow:"auto",height:C??cs},children:Z?e.jsxs(e.Fragment,{children:[Ss,Nt&&!D&&ge.length>0&&e.jsx(x.Box,{style:{borderTop:Mt},children:e.jsx(G.Table,{fullWidth:!0,size:o,className:"sa-table-layout",children:e.jsx(G.Tbody,{children:Nt})})})]}):Es}),ae&&Dr&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:ae.top,right:ae.right},onClick:p=>p.stopPropagation(),children:Pt(Dr).map(p=>e.jsx("div",{style:{padding:"2px 4px"},children:Vt(p,Dr,wr,{showLabel:!0,size:"sm"})},p.key))})]})},Ar=t=>t==="asc"||t==="desc",Fl=(t={})=>{const{sortKeyParam:r="sortBy",sortOrderParam:n="sortOrder",pageKey:s="page",defaultSort:o=null,paramKeys:i,scopeId:l,storage:c=ln}=t,{searchParams:a,setSearchParams:d,searchQueries:h}=_e(),g=a.toString(),m=l?Et.tableSort(l):void 0,y=u.useRef(!1);u.useEffect(()=>{if(y.current||(y.current=!0,!m)||a.has(r)||a.has(n))return;const b=c.get(m);!(b!=null&&b.key)||!Ar(b.direction)||d({...Object.fromEntries(a.entries()),[r]:b.key,[n]:b.direction},{replace:!0})},[]);const S=u.useMemo(()=>{const b=a.get(r),j=a.get(n);return b&&Ar(j)?{key:b,direction:j}:o},[g,r,n,o]);u.useEffect(()=>{if(!m)return;const b=a.get(r),j=a.get(n);b&&Ar(j)?c.set(m,{key:b,direction:j}):c.remove(m)},[g,m,r,n,c]);const C=(i==null?void 0:i.sortBy)??"sortBy",T=(i==null?void 0:i.sortOrder)??"sortOrder",M=u.useMemo(()=>S?{[C]:S.key,[T]:S.direction}:{},[S,C,T]),L=u.useCallback(b=>{const j={...h};b?(j[r]=b.key,j[n]=b.direction):(delete j[r],delete j[n]),delete j[s],d(j)},[h,r,n,s,d]);return{sort:S,setSort:L,params:M}},lr=({of:t,render:r})=>u.Children.toArray(t==null?void 0:t.map((n,s,o)=>r(n,s,o))),de=({condition:t,fallback:r,children:n,loading:s,isLoading:o})=>e.jsx(e.Fragment,{children:o?s:t?n:r}),xe=t=>e.jsx(w.Text,{...t,fontSize:t.fontSize||"md",fontWeight:t.fontWeight||"medium",color:t.color||"gray-700",children:t.children}),ut=t=>e.jsx(w.Text,{color:"red-600",fontSize:"sm",children:t.message}),Ml=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,d;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(de,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(xe,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:o.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ee.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(x.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(ot.Input,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!i&&o.errorMessage&&e.jsx(ut,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Il=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,d;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(de,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(xe,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:o.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ee.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(x.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(x.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(St.Dropdown,{size:t,...o.inputProps,error:!!o.errorMessage})}),!i&&o.errorMessage&&e.jsx(ut,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Ll=(t,r)=>typeof t=="string"&&t||r==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Tl=t=>{var c;const[r,n]=u.useState(!1),s=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&t.handleOnFileChange(a.dataTransfer.files.item(0))},i=a=>{a.preventDefault(),n(!0)},l=a=>{a.preventDefault(),n(!1)};return e.jsxs(x.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:t.handleOnClick,onDragOver:s,onDrop:o,onDragEnter:i,onDragLeave:l,paddingBlock:"md",borderRadius:"rounded-md",style:{border:r?"1px solid var(--sa-border-info)":`1px solid ${Ll(t.errorMessage,t.status)}`},children:[e.jsx(E.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",children:[e.jsx(w.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(w.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",children:(c=t.fileSupports)==null?void 0:c.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function Rl(t){return t.split(" ").map(r=>r[0]).join("").slice(0,2).toUpperCase()}const $o=t=>{const r={day:"2-digit",month:"short",year:"numeric"};return t.toLocaleDateString("id-ID",r)},Ol=t=>{const r={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},n=t.split(" ");if(n.length!==3)return null;const s=parseInt(n[0],10),o=r[n[1]],i=parseInt(n[2],10);return isNaN(s)||isNaN(o)||isNaN(i)?null:new Date(i,o,s)};function Al(t,r=!0){if(!t)return"Rp 0";const n=typeof t=="number"?t.toString():t;if(isNaN(Number(n)))return"Rp 0";const s=n.split("."),o=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),i=s.length===2?o+"."+s[1]:o;return r?"Rp"+i:i}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")};String.prototype.toNumber=function(){return Number(this)};const Wl=t=>{const r=t.split(" ");let n=r[0].charAt(0);return r.length>1&&(n+=""+r[1].charAt(0)),n.toUpperCase()};function zl(t){const r=typeof t=="string"?new Date(t):t;if(isNaN(r.getTime()))throw new Error("Invalid date format");const n=r.getFullYear(),s=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${n}-${s}-${o}`}const Hl="sa-admin",Ke=t=>`var(--${Hl}-${t})`,Pl={base:{borderColor:Ke("base-border-color"),textColor:Ke("base-text-color"),iconColor:Ke("base-icon-color"),placeholderColor:Ke("base-placeholder-color")},document:{bgColor:Ke("document-bg-color")},sidebar:{bgColor:Ke("sidebar-bg-color"),borderColor:Ke("sidebar-border-color"),maxWidth:Ke("sidebar-max-width"),width:Ke("sidebar-width"),collapseWidth:Ke("sidebar-collapse-width"),collapseV2Width:Ke("sidebar-v2-collapse-width")}},Vl=24*60*60*1e3,Nl=t=>{const r="14px poppins",s=document.createElement("canvas").getContext("2d");s.font=r;const o=s.measureText(t).width;return Number(Math.ceil(o))},_l=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,ql=/--+/,Zl=/-$/;function Gl(t,r){return JSON.stringify(t)!==JSON.stringify(r)}function Ql(t){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(t)}function Ul(t){return/^[A-Za-z\s]+$/.test(t)}const Jl=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&(t.key==="a"||t.key==="c"||t.key==="v")||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Yl=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Xl=t=>{const r=/^[0-9.]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},$l=t=>_l.test(t);function Kl(t){return!(ql.test(t)||Zl.test(t))}const ec=t=>{const r=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((t.ctrlKey||t.metaKey)&&["a","c","v","x"].includes(t.key.toLowerCase()))return;const n=t.currentTarget.value;/^[0-9]$/.test(t.key)||t.key==="."&&!n.includes(".")||t.key==="-"&&n.length===0&&!n.includes("-")||r.includes(t.key)||t.preventDefault()},tc=t=>{const r=document.getElementById(t);if(r){const n=r.getBoundingClientRect(),s=window.scrollY+n.top-80;window.scrollTo({top:s,behavior:"smooth"})}};function rc(t){const r=t.toLowerCase();if(["kb","mb","gb"].find(i=>r.endsWith(i)))return t;const o=Number(t);if(isNaN(o))throw new Error("Invalid size format");return o>=1e6?`${(o/1e6).toFixed(2)}MB`:o>=1e3?`${(o/1e3).toFixed(2)}KB`:`${o}B`}function nc(t){const r=t.split("/");return r[r.length-1]}const oc=t=>{var r,n;return e.jsxs(x.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:t.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(ce.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(E.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(ce.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(w.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:t.defaultFile?nc(t.defaultFile.url):(r=t.fileSelected)==null?void 0:r.name}),t.defaultFile?(t.defaultFile.size||t.defaultFile.date)&&e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[t.defaultFile.size&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",children:t.defaultFile.size}),t.defaultFile.size&&t.defaultFile.date&&e.jsx(E.Icon,{name:"Dot",size:"xs"}),t.defaultFile.date&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:t.defaultFile.date})]}):e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",children:rc(((n=t.fileSelected)==null?void 0:n.size.toString())||"100000")}),e.jsx(E.Icon,{name:"Dot",size:"xs"}),e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:$o(new Date)})]})]})]}),e.jsx(P.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:s=>{s.stopPropagation(),t.handleOnDeleteFile()},iconLeft:e.jsx(E.Icon,{name:"Trash1"})})]})},Ko=({status:t="default",labelPosition:r="outside-top",...n})=>{var m;const s=u.useRef(null),o=()=>{if(n.defaultFile){window.open(n.defaultFile.url);return}s.current&&s.current.click()},i=be.useMediaQuery("md"),l=t==="error"||typeof n.errorMessage=="string"&&!!n.errorMessage,c=n.label?e.jsxs(ce.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(w.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:n.label}),n.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"}),n.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=n.description?e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.description}):null,d=e.jsxs(e.Fragment,{children:[n.helperText&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.helperText}),n.errorText&&t==="error"&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorText}),n.errorMessage&&!n.errorText&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorMessage})]}),h=e.jsx("input",{type:"file",style:{display:"none"},ref:s,onChange:y=>{var S;return n.handleOnChangeFile(((S=y.target.files)==null?void 0:S.item(0))||null)},accept:(m=n.fileSupportOption)==null?void 0:m.map(y=>"."+(y==null?void 0:y.toLowerCase())).join(", ")}),g=e.jsxs(x.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...n.containerProps,children:[h,(n.fileSelected||n.defaultFile)&&e.jsx(oc,{fileSelected:n.fileSelected,defaultFile:n.defaultFile,handleOnDeleteFile:n.handleOnDeleteFile,handleOnClickFile:o}),!n.fileSelected&&!n.defaultFile&&e.jsx(Tl,{fileSupports:n.fileSupportOption,isDesktop:i,errorMessage:l?n.errorText||n.errorMessage||" ":void 0,status:l?"error":"default",handleOnClick:o,handleOnFileChange:n.handleOnChangeFile})]});return r==="outside-left"?e.jsxs(ce.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ce.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[c,a]}),e.jsxs(ce.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[g,d]})]}):e.jsxs(ce.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[c,a,g,d]})},sc=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,d;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(de,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(xe,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:o.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ee.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsx(Ko,{...o.inputProps,status:o.errorMessage?"error":"default"}),!i&&o.errorMessage&&e.jsx(ut,{message:o.errorMessage})]})]})},ic=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,required:o=!1,...i})=>{var a,d,h,g;const l=i.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"||r==="horizontal-inline"?"spacing-96":"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",...i.containerProps,children:[i.title&&e.jsx(de,{condition:!!o,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(xe,{children:i.title}),e.jsx(Ye.Body3,{props:{color:"gray-500"},children:i.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:i.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((a=i.tooltip)!=null&&a.label),children:e.jsx(Ee.Tooltip,{label:(d=i.tooltip)==null?void 0:d.label,arrowPosition:(h=i.tooltip)==null?void 0:h.arrowPosition,focusable:!0,...i.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!i.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.description})})]})}),e.jsx(x.Box,{gap:r==="horizontal-inline"?"xl":"md",direction:r==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(lr,{of:(g=i.checkBoxesList)==null?void 0:g.map(m=>({...m,isChecked:i.checkBoxesAreChecked.includes(m.id)})),render:m=>m.renderBadge?e.jsxs(x.Box,{direction:"row",justify:"space-between",gap:"lg",...i.badgeContainerProps,children:[e.jsx(nt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:y=>i.onChecked(y.target.value,m),label:m.name,description:m.description}),m.renderBadge]}):e.jsx(nt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:y=>i.onChecked(y.target.value,m),label:m.name,description:m.description})})}),!l&&i.errorMessage&&e.jsx(ut,{message:i.errorMessage})]})},lc=({position:t="vertical",size:r="md",fullWidth:n=!1,...s})=>{var i;const o=t==="horizontal-inline"||t==="horizontal-block"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:t==="horizontal-inline"||t==="horizontal-block"?"spacing-96":"sm",direction:t==="horizontal-inline"||t==="horizontal-block"?"row":"column",children:[e.jsx(de,{condition:!!s.description||!!s.title,children:e.jsxs(x.Box,{direction:"column",customMaxWidth:o,fullWidth:n,children:[s.title&&e.jsx(xe,{children:s.title}),e.jsx(de,{condition:!!s.description,children:e.jsx(w.Text,{color:"gray-500",children:s.description})})]})}),e.jsx(x.Box,{gap:"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(lr,{of:(i=s.radioList)==null?void 0:i.map(l=>({...l,isChecked:s.radioIsChecked===l.id})),render:({value:l,id:c,isChecked:a,subInput:d,label:h,description:g})=>e.jsxs(x.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(Vr.Radio,{id:`${c.toString()}-${l}`,name:s.groupName||h,label:h,value:l,checked:a,onChange:m=>s.onChecked({id:c,label:m.target.name,value:m.target.value}),disabled:s.disableAll},c),g&&e.jsx(w.Text,{color:"gray-500",style:{marginLeft:28},children:g}),d]})})}),s.errorMessage&&e.jsx(ut,{message:s.errorMessage})]})},cc=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,d;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(de,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(xe,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:o.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ee.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsx(Pr.Textarea,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default"}),!i&&o.errorMessage&&e.jsx(ut,{message:o.errorMessage})]})]})},ac=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",required:s=!1,fullWidth:o=!1,...i})=>{var c,a,d;const l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...i.containerProps,children:[i.title&&e.jsx(de,{condition:s,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[e.jsx(xe,{children:i.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.titleDescription})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:i.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((c=i.tooltip)!=null&&c.label),children:e.jsx(Ee.Tooltip,{label:(a=i.tooltip)==null?void 0:a.label,arrowPosition:(d=i.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...i.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!i.titleDescription,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.titleDescription})})]})}),e.jsx(Bt.Toggle,{checked:i.checked,onChange:i.onChange,label:i.label,description:i.description}),i.errorMessage&&e.jsx(ut,{message:i.errorMessage})]})},dc=({variant:t="primary",size:r="md",...n})=>{const s=Dt.useColor(),o=l=>{var a,d,h,g,m,y;if(!l)return;const c=n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary"?"var(--sa-text-subtle, #8c8f97)":t==="secondary-danger"?(d=(a=s==null?void 0:s.computed)==null?void 0:a.red)==null?void 0:d[600]:t==="secondary-primary"?(g=(h=s==null?void 0:s.computed)==null?void 0:h.blue)==null?void 0:g[700]:(y=(m=s==null?void 0:s.computed)==null?void 0:m.gray)==null?void 0:y[50];return e.jsx(E.Icon,{name:l,size:r,style:{color:c}})},i=()=>{var c,a,d,h;if(t!=="secondary-danger"&&t!=="secondary-primary")return n.title;const l={color:n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary-danger"?(a=(c=s==null?void 0:s.computed)==null?void 0:c.red)==null?void 0:a[600]:(h=(d=s==null?void 0:s.computed)==null?void 0:d.blue)==null?void 0:h[700]};switch(r){case"xs":return e.jsx(Ye.Body2,{props:{style:l},children:n.title});case"sm":case"md":return e.jsx(Ye.SubH3,{props:{style:l},children:n.title});case"lg":return e.jsx(Ye.SubH2,{props:{style:l},children:n.title});default:return n.title}};return e.jsx(P.Button,{fullWidth:!0,disabled:n.disabled,primary:t==="primary",secondary:t==="secondary"||t==="secondary-danger"||t==="secondary-primary",success:t==="success",onClick:n.onClick,type:n.type,iconLeft:o(n.iconLeft),iconRight:o(n.iconRight),size:r,children:i()})},uc=t=>e.jsx(Ye.H5,{props:{...t},children:t.title}),xc=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,d;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(de,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(xe,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:o.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ee.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsx(x.Box,{direction:"column",style:{width:r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(gt.StarasiaDate,{size:t,...o.inputProps,status:o.errorMessage?"error":void 0})}),!i&&o.errorMessage&&e.jsx(ut,{message:o.errorMessage})]})]})};async function hc(t,r){const n=new Image;n.src=t,await new Promise((i,l)=>{n.onload=i,n.onerror=l});const s=document.createElement("canvas");s.width=r.width,s.height=r.height;const o=s.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(n,r.x,r.y,r.width,r.height,0,0,r.width,r.height),new Promise((i,l)=>{s.toBlob(c=>{if(!c)return l("Canvas is empty");const a=new File([c],"cropped.png",{type:"image/png"});i(a)},"image/png")})}const ro={"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},es=u.forwardRef(({handleUpload:t,urlImage:r,isUploading:n,croppedImage:s,setCroppedImage:o,size:i="96",aspect:l="1:1",containerProps:c,maxFileSize:a=2,onError:d},h)=>{const g=be.useMediaQuery("md"),[m,y]=u.useState(!1),[S,C]=u.useState(null),[T,M]=u.useState(!1),[L,b]=u.useState({x:0,y:0}),[j,I]=u.useState(1),[F,D]=u.useState(null);u.useEffect(()=>{r===null&&o(null)},[r]);const O=u.useCallback((Z,z)=>{D(z)},[]),A=Z=>{var ue;const z=(ue=Z.target.files)==null?void 0:ue[0];if(!z)return;const ie=new FileReader;ie.onload=()=>{C(ie.result),M(!0)},ie.readAsDataURL(z)},Y=async()=>{if(!(!S||!F))try{const Z=await hc(S,F);if(a&&Z.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}t==null||t(Z);const z=URL.createObjectURL(Z);o(z,Z),M(!1)}catch{d==null||d("Gagal memproses gambar")}},H=u.useRef(null),_=()=>{H.current&&H.current.click()};u.useImperativeHandle(h,()=>({openFileDialog:()=>{var Z;(Z=H.current)==null||Z.click()}}));const q=parseInt(i,10),X=ro[l];let K,Q;return X>=1?(Q=q,K=q*X):(K=q,Q=q/X),e.jsxs(x.Box,{direction:"column",display:"flex",position:"relative",bg:(c==null?void 0:c.bg)||"gray-200",borderStyle:(c==null?void 0:c.borderStyle)||"border-none",borderColor:(c==null?void 0:c.borderColor)||"gray-200",borderWidth:(c==null?void 0:c.borderWidth)||"border-2",borderRadius:(c==null?void 0:c.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:c!=null&&c.fullWidth?"100%":`${K}px`,height:c!=null&&c.fullWidth?"auto":`${Q}px`,aspectRatio:X,flexShrink:0},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[s||r?e.jsx("img",{src:s||r||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(x.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(E.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(i)/2<40?Number(i)/2:40,height:Number(i)/2<40?Number(i)/2:40}})}),e.jsxs(x.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214c)",opacity:m?1:0,transition:"opacity 0.3s ease-in-out"},onClick:_,children:[e.jsx("input",{ref:H,type:"file",accept:"image/*",onChange:A,disabled:n,style:{display:"none"}}),e.jsxs(x.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(E.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(de,{condition:i.toNumber()>80,children:e.jsx(w.Text,{color:"gray-50",fontSize:i.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),n&&e.jsx(x.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f6cc)"},children:e.jsx(x.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),T&&sr.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:()=>M(!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:g?l==="1:1"?"min(90vw, 480px)":`min(90vw, ${K*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:Z=>Z.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:S&&e.jsx(Fs,{image:S,crop:L,zoom:j,aspect:l?ro[l]:void 0,onCropChange:b,onZoomChange:I,onCropComplete:O,objectFit:"contain",minZoom:.5,restrictPosition:!1})}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--sa-border-subtle)"},children:[e.jsx(P.Button,{size:"sm",secondary:!0,onClick:()=>M(!1),children:"Cancel"}),e.jsx(P.Button,{size:"sm",primary:!0,onClick:Y,children:"Crop"})]})]})}),document.body)]})}),fc=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,required:o=!1,...i})=>{var a,d,h;const l=i.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...i.containerProps,children:[i.title&&e.jsx(de,{condition:!!o,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(xe,{children:i.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:i.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((a=i.tooltip)!=null&&a.label),children:e.jsx(Ee.Tooltip,{label:(d=i.tooltip)==null?void 0:d.label,arrowPosition:(h=i.tooltip)==null?void 0:h.arrowPosition,focusable:!0,...i.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!i.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.description})})]})}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsx(es,{...i.inputProps}),!l&&i.errorMessage&&e.jsx(ut,{message:i.errorMessage})]})]})},mc=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,c,a;const i=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(de,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:i,fullWidth:s,children:[e.jsx(xe,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:i,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:o.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ee.Tooltip,{label:(c=o.tooltip)==null?void 0:c.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,focusable:!0,...o.tooltip,children:e.jsx(E.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},gc=({items:t,id:r,handleOnUpdate:n,width:s,toggleShow:o=!0,disabled:i=!1})=>{var h;const[l,c]=u.useState([]);u.useEffect(()=>{t&&c([...t.map(g=>({id:g.id,isActive:g.isActive}))])},[t]);const a=(h=l.find(g=>g.id===r))==null?void 0:h.isActive,d=u.useCallback(()=>{c(g=>g.map(m=>m.id===r?{...m,isActive:!m.isActive}:m)),n&&n(!a)},[r,n,a]);return e.jsx(x.Box,{direction:"row",gap:"md",style:{width:s},children:o&&e.jsx(Bt.Toggle,{disabled:i,checked:a,onChange:d,label:a?"Active":"Inactive"})})},pc={InputText:Ml,InputDropdown:Il,InputSingleFile:sc,CheckBoxOptions:ic,RadioOptions:lc,InputTextArea:cc,ToggleForm:ac,ActionButton:dc,FormTitle:uc,InputDate:xc,InputImgFile:fc,Custom:mc},ts=({customBottom:t})=>{const[r,n]=u.useState(!1),s=()=>{window.scrollY>window.screenY?n(!0):n(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return u.useEffect(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[]),e.jsx(x.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(x.Box,{direction:"column",position:"absolute",style:{bottom:t||"1.6rem",right:"2rem",transform:r?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(P.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(E.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Ze="sa-sidepanel-item",no="sa-sidepanel-item-styles",yc="inset 3.5px 0 0 0 var(--sa-border-focused, #1a4fa0)",jc="inset -3.5px 0 0 0 var(--sa-border-focused, #1a4fa0)",bc=`
|
|
52
|
+
`,document.head.appendChild(t)},Tt=t=>t==="right"?"right":t==="center"?"center":"left",kl=/^(#|rgb|hsl|var\()/,Yt=t=>t?kl.test(t)?t:`var(--sa-background-${t})`:void 0,Bl=(t,r)=>{if(r)return t[r]},El=(t,r)=>t==null&&r==null?0:t==null?-1:r==null?1:typeof t=="number"&&typeof r=="number"?t-r:String(t).localeCompare(String(r)),Fl=({columns:t,data:r,getRowKey:n,rowBg:s,size:o="md",resizable:i=!1,layout:l="auto",widthStorageKey:c,columnState:a,onColumnStateChange:d,columnMenu:h=!1,highlight:g,sort:m,defaultSort:y,onSortChange:S,height:C,mobileLayout:L="cards",mobileBreakpoint:M="md",groupSeparator:T,summary:b,footer:j,stickyFooter:I=!1,emptyState:F,loading:D=!1,loadingRows:O=8,rowActions:A,rowActionsMode:Y="auto",selectable:P=!1,selectedKeys:_,defaultSelectedKeys:q,onSelectionChange:X,isRowSelectable:K})=>{Sl();const Z=!be.useMediaQuery(M)&&L!=="scroll",z=!!(A!=null&&A.length),ie=Yo(),ue=z&&(Y==="column"||Y==="auto"&&ie),Ce=Math.min((A==null?void 0:A.length)??0,Lr+1),ke=Ce>Lr?1:Ce,je=Ut*2+ke*Dl+Math.max(0,ke-1)*Rr,he=ue?je:1,[ae,We]=u.useState(null);u.useEffect(()=>{if(!ae)return;const p=()=>We(null),v=setTimeout(()=>document.addEventListener("click",p),0);return()=>{clearTimeout(v),document.removeEventListener("click",p)}},[ae]);const[Be,qe]=u.useState(()=>new Set),re=a!==void 0,[fe,Fe]=u.useState({}),ve=a??fe,we=p=>{d==null||d(p),re||Fe(p)},et=m!==void 0,[tt,W]=u.useState(y??null),J=et?m??null:tt,U=!S,le=p=>{S==null||S(p),et||W(p)},{headerGroups:De,leafColumns:me,hasGroups:Se}=u.useMemo(()=>{var oe;const p=new Set(ve.hidden??[]),v=(ne,pe)=>ne.key??(typeof ne.accessor=="string"?ne.accessor:`col-${pe}`),E=t.map((ne,pe)=>{var Ge;if((Ge=ne.children)!=null&&Ge.length){const Ft=ne.children.map(($e,vt)=>({col:$e,key:v($e,`${pe}-${vt}`)})).filter($e=>!p.has($e.key));return{col:ne,key:ne.key??`group-${pe}`,isGroup:!0,leaves:Ft}}const ye={col:ne,key:v(ne,`${pe}`)};return{col:ne,key:ye.key,isGroup:!1,leaves:p.has(ye.key)?[]:[ye]}}).filter(ne=>ne.leaves.length>0),N=E.some(ne=>ne.isGroup);let ee=E.flatMap(ne=>ne.leaves);if(!N&&((oe=ve.order)!=null&&oe.length)){const ne=new Map(ve.order.map((pe,ye)=>[pe,ye]));ee=[...ee].sort((pe,ye)=>(ne.get(pe.key)??1/0)-(ne.get(ye.key)??1/0))}return{headerGroups:E,leafColumns:ee,hasGroups:N}},[t,ve]),Xe=u.useMemo(()=>new Map(me.map((p,v)=>[p.key,v])),[me]),Ve=!Se&&me.some(p=>(p.col.headerColSpan??1)>1),ze=me.map(p=>p.key).join("|"),it=(p,v)=>{const E=p.sortKey??(typeof p.accessor=="string"?p.accessor:void 0);return E?v[E]:void 0},lt=p=>p.sortable??(!!p.sortKey||typeof p.accessor=="string"),ge=u.useMemo(()=>{if(!U||!J)return r;const p=me.find(E=>E.key===J.key);if(!p)return r;const v=J.direction==="asc"?1:-1;return[...r].sort((E,N)=>El(it(p.col,E),it(p.col,N))*v)},[r,U,J,me]),He=!Se&&!Ve,pt=!!c&&He,[xt,ht]=G.useColumnWidths(c??""),ft=pt?xt:void 0,k=u.useRef(null),[V,$]=u.useState();u.useLayoutEffect(()=>{$(void 0)},[ze]),u.useLayoutEffect(()=>{if(!He||V||!k.current)return;const p=k.current.querySelectorAll("th.sa-tl-leaf");$(Array.from(p).map(v=>v.offsetWidth))},[V,He]);const[Me,Oe]=u.useState(),[Ie,Te]=u.useState(0);u.useLayoutEffect(()=>{if(!Se||!k.current)return;const p=k.current.querySelector(":scope > tr");p&&Te(p.offsetHeight)},[Se,ze]);const Qe=(p,v)=>{if((ft==null?void 0:ft[v])!=null)return ft[v];if(p.width!=null)return p.width;if((V==null?void 0:V[v])!=null)return V[v]},Ne=(p,v)=>typeof p.width=="number"?p.width:V==null?void 0:V[v],Ae=ve.frozenKey&&!Se&&!Ve?me.findIndex(p=>p.key===ve.frozenKey):-1,mt=p=>p<=Ae,Ue=P?It:0,jt=p=>{const v=Me??V;if(!v)return Ue;let E=Ue;for(let N=0;N<p;N++)E+=v[N]??0;return E};u.useLayoutEffect(()=>{const p=k.current;if(!p||Ae<0){Oe(void 0);return}let v=0;const E=()=>{v=0;const ee=p.querySelectorAll("th.sa-tl-leaf"),oe=Array.from(ee).map(ne=>ne.getBoundingClientRect().width);Oe(ne=>ne&&ne.length===oe.length&&ne.every((pe,ye)=>Math.abs(pe-oe[ye])<.5)?ne:oe)},N=new ResizeObserver(()=>{v||(v=requestAnimationFrame(E))});return N.observe(p),p.querySelectorAll("th.sa-tl-leaf").forEach(ee=>N.observe(ee)),E(),()=>{v&&cancelAnimationFrame(v),N.disconnect()}},[ze,Ae,P,V,ft]);const rt=u.useRef(null),[as,ds]=u.useState("100vh");u.useLayoutEffect(()=>{if(C!==void 0)return;const p=()=>{if(rt.current){const v=rt.current.getBoundingClientRect().top;ds(`calc(100vh - ${v}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[C]);const ct=(p,v)=>n?n(p,v):v,hr=_!==void 0,[an,us]=u.useState(()=>new Set(q??[])),at=u.useMemo(()=>hr?new Set(_):an,[hr,_,an]);u.useEffect(()=>{P&&!n&&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).")},[P,!n]);const dn=p=>{if(hr||us(p),X){const v=ge.filter((E,N)=>p.has(ct(E,N)));X(Array.from(p),v)}},fr=(p,v)=>P&&(K?K(p,v):!0),mr=p=>{const v=new Set(at);v.has(p)?v.delete(p):v.add(p),dn(v)},bt=u.useMemo(()=>P?ge.map((p,v)=>({row:p,i:v,key:ct(p,v)})).filter(({row:p,i:v})=>K?K(p,v):!0).map(({key:p})=>p):[],[P,ge,K,n]),un=bt.filter(p=>at.has(p)),gr=bt.length>0&&un.length===bt.length,xn=un.length>0&&!gr,xs=()=>{const p=new Set(at);gr?bt.forEach(v=>p.delete(v)):bt.forEach(v=>p.add(v)),dn(p)},pr=(p,v,E)=>{const N=p.render?p.render(v,E,ge):Bl(v,p.accessor);if(g&&!p.render&&typeof N=="string"){const ee=p.key??(typeof p.accessor=="string"?p.accessor:void 0),oe=ee?g[ee]:void 0;if(oe)return e.jsx($o,{text:N,query:oe})}return N},yr=me.length+(P?1:0)+(z?1:0),hn=["80%","55%","70%","45%","90%","60%"],hs=(p,v)=>hn[(p*7+v*3)%hn.length],fs=(p,v)=>e.jsx(Je.Skeleton,{height:14,width:hs(p,v),borderRadius:"rounded-sm"}),ms=Array.from({length:O},(p,v)=>e.jsxs(G.Tr,{children:[P&&e.jsx(G.Td,{style:{width:It,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(Je.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),me.map(({col:E,key:N},ee)=>e.jsx(G.Td,{style:{textAlign:Tt(E.align)},children:fs(v,ee)},`sa-tl-sk-${v}-${N}`)),z&&e.jsx(G.Td,{style:{width:he,padding:0,border:"none"}})]},`sa-tl-sk-${v}`)),gs=(p,v)=>{v||we({...ve,hidden:[...ve.hidden??[],p]})},ps=p=>we({...ve,frozenKey:ve.frozenKey===p?void 0:p}),Pt=p=>(A??[]).filter(v=>{var E;return!((E=v.hidden)!=null&&E.call(v,p))}),fn=ue?{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:Rr,paddingLeft:Ut,paddingRight:Ut,height:"100%"}:{position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:Rr,paddingRight:Ut,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},Vt=(p,v,E,N)=>{var Ge;const ee=(Ge=p.disabled)==null?void 0:Ge.call(p,v),oe=(N==null?void 0:N.showLabel)??p.showLabel,ne=(N==null?void 0:N.size)??"xs",pe=e.jsx(H.Button,{size:ne,variant:p.variant??"tertiary",tone:p.tone??"neutral",disabled:ee,onClick:()=>p.onClick(v,E),iconLeft:p.icon?e.jsx(B.Icon,{name:p.icon,size:"sm"}):void 0,children:oe&&p.label}),ye=p.tooltip;return ye?e.jsx(Ee.Tooltip,{label:ye,position:"top-end",children:pe}):pe},ys=(p,v)=>{const E=Pt(p);if(!E.length)return null;if(E.length>Lr){const ee=ct(p,v),oe=(ae==null?void 0:ae.rowKey)===ee;return e.jsx("div",{className:"sa-tl-row-actions","data-mode":ue?"column":"overlay",style:fn,onClick:ne=>ne.stopPropagation(),children:e.jsx(Ee.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(H.Button,{size:"xs",variant:"tertiary",onClick:ne=>{const pe=ne.currentTarget.getBoundingClientRect();We(oe?null:{rowKey:ee,top:pe.bottom+4,right:window.innerWidth-pe.right})},children:e.jsx(B.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions","data-mode":ue?"column":"overlay",style:fn,children:E.map(ee=>e.jsx(u.Fragment,{children:Vt(ee,p,v)},ee.key))})},js=(p,v)=>{const E=Pt(p);return E.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:Mt},children:E.map(N=>e.jsx(u.Fragment,{children:Vt(N,p,v,{showLabel:!0,size:"sm"})},N.key))}):null},bs=(p,v)=>{const E=Pt(p);return E.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:E.map(N=>e.jsx(u.Fragment,{children:Vt(N,p,v,{showLabel:!1})},N.key))}):null},jr=(p,v)=>{var vt;const{col:E,key:N}=p,ee=Xe.get(N)??0,oe=mt(ee),ne=oe&&ee===Ae,pe=(J==null?void 0:J.key)===N?J.direction:null,ye=h&&!E.disableMenu?e.jsx(Xo,{active:!!pe||oe||!!E.filterActive,canSort:lt(E),canHide:!E.locked,sortDir:pe,frozen:oe,onSort:_t=>le({key:N,direction:_t}),onClearSort:()=>le(null),onToggleFreeze:()=>ps(N),onHide:()=>gs(N,E.locked),filterSlot:(vt=E.renderFilter)==null?void 0:vt.call(E),filterActive:E.filterActive}):null,Ge=E.align==="right",Ft=E.align==="right"?"flex-end":E.align==="center"?"center":"flex-start",$e=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Ft,overflow:"hidden"},children:[E.icon&&e.jsx(B.Icon,{name:E.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Jt,children:E.title})]});return e.jsx(G.Th,{className:`sa-tl-leaf${oe?" sa-tl-frozen":""}`,rowSpan:v==null?void 0:v.rowSpan,colSpan:v==null?void 0:v.colSpan,minWidth:E.minWidth,numeric:E.numeric,resizable:He?E.resizable:!1,defaultWidth:Ne(E,ee),style:{textAlign:Tt(E.align),width:Qe(E,ee),position:"sticky",top:(v==null?void 0:v.top)??0,left:oe?jt(ee):void 0,zIndex:oe?3:2,backgroundColor:Ct,boxShadow:ne?eo:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Ge?e.jsxs(e.Fragment,{children:[ye,$e]}):e.jsxs(e.Fragment,{children:[$e,ye]})})},`th-${N}`)},vs=()=>{const p=[];for(let v=0;v<me.length;){const E=me[v],N=E.col.headerColSpan??1,ee=Math.max(1,Math.min(N,me.length-v));p.push(jr(E,ee>1?{colSpan:ee}:void 0)),v+=ee}return p},mn=p=>e.jsx(G.Th,{rowSpan:p==null?void 0:p.rowSpan,style:{width:It,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:Ct,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:v=>v.stopPropagation(),children:e.jsx(nt.Checkbox,{size:"sm",variant:xn?"indeterminate":"select",checked:gr||xn,disabled:bt.length===0,onChange:xs,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),Cs=(p,v,E)=>{const N=ct(p,v);return e.jsx(G.Td,{className:"sa-tl-frozen",style:{width:It,padding:0,position:"sticky",left:0,zIndex:2,...E?{"--sa-tl-bg":E}:{}},children:fr(p,v)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:ee=>ee.stopPropagation(),children:e.jsx(nt.Checkbox,{size:"sm",checked:at.has(N),onChange:()=>mr(N),"aria-label":"Pilih baris"})})},`tl-select-${v}`)},br=me.filter(p=>!p.col.hideOnMobile),vr=br.find(p=>p.col.primary)??br[0],ws=br.filter(p=>p!==vr),Ds=p=>qe(v=>{const E=new Set(v);return E.has(p)?E.delete(p):E.add(p),E}),gn=(p,v)=>ws.map(({col:E,key:N})=>{const ee=pr(E,p,v),oe={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right",...E.numeric?{fontVariantNumeric:"tabular-nums"}:{}},ne=typeof ee=="string"||typeof ee=="number"?e.jsx(w.Text,{style:oe,children:ee}):e.jsx("div",{style:oe,children:ee});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof E.title=="string"?e.jsx(w.Text,{color:"subtle",fontWeight:"medium",style:{color:wl,flexShrink:0},children:E.title}):e.jsx("div",{style:{flexShrink:0},children:E.title}),ne]},N)}),Cr=(p,v)=>{const E=vr?pr(vr.col,p,v):null;return typeof E=="string"||typeof E=="number"?e.jsx(w.Text,{as:"span",style:Jt,children:E}):e.jsx("span",{style:Jt,children:E})},Ss=e.jsx(x.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:O},(p,v)=>e.jsxs(x.Box,{style:{border:Mt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Je.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(Je.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(Je.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${v}`))}),pn=e.jsx(x.Box,{fullWidth:!0,style:{minHeight:(F==null?void 0:F.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:F==null?void 0:F.content}),ks=D?Ss:ge.length===0?pn:L==="expand"?e.jsx(x.Box,{style:{display:"flex",flexDirection:"column"},children:ge.map((p,v)=>{const E=ct(p,v),N=Be.has(E),oe=P&&at.has(E)?Or:Yt(s==null?void 0:s(p,v));return e.jsxs("div",{style:{borderBottom:Mt,backgroundColor:oe},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[fr(p,v)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(nt.Checkbox,{size:"sm",checked:at.has(E),onChange:()=>mr(E),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>Ds(E),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:[Cr(p,v),e.jsx(B.Icon,{name:N?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),z&&bs(p,v)]}),N&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:gn(p,v)})]},E)})}):e.jsx(x.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:ge.map((p,v)=>{const E=ct(p,v),N=P&&at.has(E);return e.jsxs(x.Box,{style:{border:Mt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:N?Or:Yt(s==null?void 0:s(p,v))},children:[fr(p,v)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(nt.Checkbox,{size:"sm",checked:at.has(E),onChange:()=>mr(E),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:Cr(p,v)})]}):Cr(p,v),gn(p,v),z&&js(p,v)]},E)})}),Bs=i&&He&&V!==void 0,yn=l==="fixed"&&!i&&(He?V!==void 0:!0),Es=yn&&!He,Nt=j&&j.length>0?j.map((p,v)=>e.jsx(G.Tr,{children:p.cells.map((E,N)=>e.jsx(G.Td,{colSpan:E.colSpan,rowSpan:E.rowSpan,numeric:E.numeric,style:{textAlign:Tt(E.align)},children:E.content},`tl-foot-${v}-${N}`))},`tl-foot-${v}`)):null,Fs=e.jsxs(G.Table,{className:"sa-table-layout",fullWidth:!0,size:o,resizable:Bs,style:yn?{tableLayout:"fixed"}:void 0,onWidthsChange:pt?ht:void 0,children:[Es&&e.jsxs("colgroup",{children:[P&&e.jsx("col",{style:{width:It}}),me.map(({col:p,key:v},E)=>e.jsx("col",{style:{width:Qe(p,E)}},`col-${v}`)),z&&e.jsx("col",{style:{width:he}})]}),e.jsx(G.Thead,{ref:k,children:Se?e.jsxs(e.Fragment,{children:[e.jsxs(G.Tr,{children:[P&&mn({rowSpan:2}),De.map(p=>p.isGroup?e.jsx(G.Th,{colSpan:p.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:Ct},children:e.jsx("span",{style:Jt,children:p.col.title})},`grp-${p.key}`):jr(p.leaves[0],{rowSpan:2})),z&&e.jsx(G.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:he,padding:0,border:"none",backgroundColor:Ct}})]}),e.jsx(G.Tr,{children:De.flatMap(p=>p.isGroup?p.leaves.map(v=>jr(v,{top:Ie})):[])})]}):e.jsxs(G.Tr,{children:[P&&mn(),vs(),z&&e.jsx(G.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:he,padding:0,border:"none",backgroundColor:Ct}})]})}),e.jsx(G.Tbody,{children:D?ms:ge.length===0?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:yr,children:pn})}):e.jsxs(e.Fragment,{children:[ge.map((p,v)=>{const E=T==null?void 0:T(p,v,v>0?ge[v-1]:void 0),ee=P&&at.has(ct(p,v))?Or:Yt(s==null?void 0:s(p,v));return e.jsxs(u.Fragment,{children:[E!=null&&E!==!1&&e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:yr,style:{backgroundColor:Ct},children:E})}),e.jsxs(G.Tr,{children:[P&&Cs(p,v,ee),me.map(({col:oe,key:ne},pe)=>{var jn;const ye=(jn=oe.cellProps)==null?void 0:jn.call(oe,p,v,ge);if(ye!=null&&ye.hidden)return null;const Ge=mt(pe),Ft=Ge&&pe===Ae,$e=pr(oe,p,v),vt=typeof oe.bg=="function"?oe.bg(p,v,ge):oe.bg,_t=Yt(vt)??ee;return e.jsx(G.Td,{className:Ge?"sa-tl-frozen":void 0,colSpan:ye==null?void 0:ye.colSpan,rowSpan:ye==null?void 0:ye.rowSpan,numeric:oe.numeric,style:{textAlign:Tt(oe.align),width:Qe(oe,pe),minWidth:oe.minWidth,position:Ge?"sticky":void 0,left:Ge?jt(pe):void 0,zIndex:Ge?1:void 0,boxShadow:Ft?eo:void 0,..._t?{"--sa-tl-bg":_t}:{}},children:typeof $e=="string"?e.jsx(w.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Tt(oe.align)},children:$e}):$e},`tl-cell-${v}-${ne}`)}),z&&e.jsx(G.Td,{className:ue?"sa-tl-frozen":void 0,style:{position:"sticky",right:0,width:he,padding:0,overflow:ue?void 0:"visible",zIndex:2,border:"none"},children:ys(p,v)})]})]},ct(p,v))}),b!=null&&e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:yr,children:b})})]})}),Nt&&e.jsx(G.Tfoot,{className:I?"sa-tl-sticky-foot":void 0,children:Nt})]}),wr=ae?ge.findIndex((p,v)=>ct(p,v)===ae.rowKey):-1,Dr=wr>=0?ge[wr]:null;return e.jsxs(e.Fragment,{children:[e.jsx(x.Box,{ref:rt,className:"sa-tl-scroll",fullWidth:!0,style:{overflow:"auto",height:C??as},children:Z?e.jsxs(e.Fragment,{children:[ks,Nt&&!D&&ge.length>0&&e.jsx(x.Box,{style:{borderTop:Mt},children:e.jsx(G.Table,{fullWidth:!0,size:o,className:"sa-table-layout",children:e.jsx(G.Tbody,{children:Nt})})})]}):Fs}),ae&&Dr&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:ae.top,right:ae.right},onClick:p=>p.stopPropagation(),children:Pt(Dr).map(p=>e.jsx("div",{style:{padding:"2px 4px"},children:Vt(p,Dr,wr,{showLabel:!0,size:"sm"})},p.key))})]})},Ar=t=>t==="asc"||t==="desc",Ml=(t={})=>{const{sortKeyParam:r="sortBy",sortOrderParam:n="sortOrder",pageKey:s="page",defaultSort:o=null,paramKeys:i,scopeId:l,storage:c=ln}=t,{searchParams:a,setSearchParams:d,searchQueries:h}=_e(),g=a.toString(),m=l?Et.tableSort(l):void 0,y=u.useRef(!1);u.useEffect(()=>{if(y.current||(y.current=!0,!m)||a.has(r)||a.has(n))return;const b=c.get(m);!(b!=null&&b.key)||!Ar(b.direction)||d({...Object.fromEntries(a.entries()),[r]:b.key,[n]:b.direction},{replace:!0})},[]);const S=u.useMemo(()=>{const b=a.get(r),j=a.get(n);return b&&Ar(j)?{key:b,direction:j}:o},[g,r,n,o]);u.useEffect(()=>{if(!m)return;const b=a.get(r),j=a.get(n);b&&Ar(j)?c.set(m,{key:b,direction:j}):c.remove(m)},[g,m,r,n,c]);const C=(i==null?void 0:i.sortBy)??"sortBy",L=(i==null?void 0:i.sortOrder)??"sortOrder",M=u.useMemo(()=>S?{[C]:S.key,[L]:S.direction}:{},[S,C,L]),T=u.useCallback(b=>{const j={...h};b?(j[r]=b.key,j[n]=b.direction):(delete j[r],delete j[n]),delete j[s],d(j)},[h,r,n,s,d]);return{sort:S,setSort:T,params:M}},lr=({of:t,render:r})=>u.Children.toArray(t==null?void 0:t.map((n,s,o)=>r(n,s,o))),de=({condition:t,fallback:r,children:n,loading:s,isLoading:o})=>e.jsx(e.Fragment,{children:o?s:t?n:r}),xe=t=>e.jsx(w.Text,{...t,fontSize:t.fontSize||"md",fontWeight:t.fontWeight||"medium",color:t.color||"gray-700",children:t.children}),ut=t=>e.jsx(w.Text,{color:"red-600",fontSize:"sm",children:t.message}),Il=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,d;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(de,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(xe,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:o.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ee.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(x.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(ot.Input,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!i&&o.errorMessage&&e.jsx(ut,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Tl=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,d;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(de,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(xe,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:o.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ee.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(x.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(x.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(St.Dropdown,{size:t,...o.inputProps,error:!!o.errorMessage})}),!i&&o.errorMessage&&e.jsx(ut,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Ll=(t,r)=>typeof t=="string"&&t||r==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Rl=t=>{var c;const[r,n]=u.useState(!1),s=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&t.handleOnFileChange(a.dataTransfer.files.item(0))},i=a=>{a.preventDefault(),n(!0)},l=a=>{a.preventDefault(),n(!1)};return e.jsxs(x.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:t.handleOnClick,onDragOver:s,onDrop:o,onDragEnter:i,onDragLeave:l,paddingBlock:"md",borderRadius:"rounded-md",style:{border:r?"1px solid var(--sa-border-info)":`1px solid ${Ll(t.errorMessage,t.status)}`},children:[e.jsx(B.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",children:[e.jsx(w.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(w.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",children:(c=t.fileSupports)==null?void 0:c.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function Ol(t){return t.split(" ").map(r=>r[0]).join("").slice(0,2).toUpperCase()}const Ko=t=>{const r={day:"2-digit",month:"short",year:"numeric"};return t.toLocaleDateString("id-ID",r)},Al=t=>{const r={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},n=t.split(" ");if(n.length!==3)return null;const s=parseInt(n[0],10),o=r[n[1]],i=parseInt(n[2],10);return isNaN(s)||isNaN(o)||isNaN(i)?null:new Date(i,o,s)};function Wl(t,r=!0){if(!t)return"Rp 0";const n=typeof t=="number"?t.toString():t;if(isNaN(Number(n)))return"Rp 0";const s=n.split("."),o=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),i=s.length===2?o+"."+s[1]:o;return r?"Rp"+i:i}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")};String.prototype.toNumber=function(){return Number(this)};const zl=t=>{const r=t.split(" ");let n=r[0].charAt(0);return r.length>1&&(n+=""+r[1].charAt(0)),n.toUpperCase()};function Hl(t){const r=typeof t=="string"?new Date(t):t;if(isNaN(r.getTime()))throw new Error("Invalid date format");const n=r.getFullYear(),s=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${n}-${s}-${o}`}const Pl="sa-admin",Ke=t=>`var(--${Pl}-${t})`,Vl={base:{borderColor:Ke("base-border-color"),textColor:Ke("base-text-color"),iconColor:Ke("base-icon-color"),placeholderColor:Ke("base-placeholder-color")},document:{bgColor:Ke("document-bg-color")},sidebar:{bgColor:Ke("sidebar-bg-color"),borderColor:Ke("sidebar-border-color"),maxWidth:Ke("sidebar-max-width"),width:Ke("sidebar-width"),collapseWidth:Ke("sidebar-collapse-width"),collapseV2Width:Ke("sidebar-v2-collapse-width")}},Nl=24*60*60*1e3,_l=t=>{const r="14px poppins",s=document.createElement("canvas").getContext("2d");s.font=r;const o=s.measureText(t).width;return Number(Math.ceil(o))},ql=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Zl=/--+/,Gl=/-$/;function Ql(t,r){return JSON.stringify(t)!==JSON.stringify(r)}function Ul(t){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(t)}function Jl(t){return/^[A-Za-z\s]+$/.test(t)}const Yl=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&(t.key==="a"||t.key==="c"||t.key==="v")||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Xl=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},$l=t=>{const r=/^[0-9.]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Kl=t=>ql.test(t);function ec(t){return!(Zl.test(t)||Gl.test(t))}const tc=t=>{const r=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((t.ctrlKey||t.metaKey)&&["a","c","v","x"].includes(t.key.toLowerCase()))return;const n=t.currentTarget.value;/^[0-9]$/.test(t.key)||t.key==="."&&!n.includes(".")||t.key==="-"&&n.length===0&&!n.includes("-")||r.includes(t.key)||t.preventDefault()},rc=t=>{const r=document.getElementById(t);if(r){const n=r.getBoundingClientRect(),s=window.scrollY+n.top-80;window.scrollTo({top:s,behavior:"smooth"})}};function nc(t){const r=t.toLowerCase();if(["kb","mb","gb"].find(i=>r.endsWith(i)))return t;const o=Number(t);if(isNaN(o))throw new Error("Invalid size format");return o>=1e6?`${(o/1e6).toFixed(2)}MB`:o>=1e3?`${(o/1e3).toFixed(2)}KB`:`${o}B`}function oc(t){const r=t.split("/");return r[r.length-1]}const sc=t=>{var r,n;return e.jsxs(x.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:t.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(ce.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(B.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(ce.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(w.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:t.defaultFile?oc(t.defaultFile.url):(r=t.fileSelected)==null?void 0:r.name}),t.defaultFile?(t.defaultFile.size||t.defaultFile.date)&&e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[t.defaultFile.size&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",children:t.defaultFile.size}),t.defaultFile.size&&t.defaultFile.date&&e.jsx(B.Icon,{name:"Dot",size:"xs"}),t.defaultFile.date&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:t.defaultFile.date})]}):e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",children:nc(((n=t.fileSelected)==null?void 0:n.size.toString())||"100000")}),e.jsx(B.Icon,{name:"Dot",size:"xs"}),e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:Ko(new Date)})]})]})]}),e.jsx(H.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:s=>{s.stopPropagation(),t.handleOnDeleteFile()},iconLeft:e.jsx(B.Icon,{name:"Trash1"})})]})},es=({status:t="default",labelPosition:r="outside-top",...n})=>{var m;const s=u.useRef(null),o=()=>{if(n.defaultFile){window.open(n.defaultFile.url);return}s.current&&s.current.click()},i=be.useMediaQuery("md"),l=t==="error"||typeof n.errorMessage=="string"&&!!n.errorMessage,c=n.label?e.jsxs(ce.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(w.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:n.label}),n.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"}),n.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=n.description?e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.description}):null,d=e.jsxs(e.Fragment,{children:[n.helperText&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.helperText}),n.errorText&&t==="error"&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorText}),n.errorMessage&&!n.errorText&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorMessage})]}),h=e.jsx("input",{type:"file",style:{display:"none"},ref:s,onChange:y=>{var S;return n.handleOnChangeFile(((S=y.target.files)==null?void 0:S.item(0))||null)},accept:(m=n.fileSupportOption)==null?void 0:m.map(y=>"."+(y==null?void 0:y.toLowerCase())).join(", ")}),g=e.jsxs(x.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...n.containerProps,children:[h,(n.fileSelected||n.defaultFile)&&e.jsx(sc,{fileSelected:n.fileSelected,defaultFile:n.defaultFile,handleOnDeleteFile:n.handleOnDeleteFile,handleOnClickFile:o}),!n.fileSelected&&!n.defaultFile&&e.jsx(Rl,{fileSupports:n.fileSupportOption,isDesktop:i,errorMessage:l?n.errorText||n.errorMessage||" ":void 0,status:l?"error":"default",handleOnClick:o,handleOnFileChange:n.handleOnChangeFile})]});return r==="outside-left"?e.jsxs(ce.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ce.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[c,a]}),e.jsxs(ce.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[g,d]})]}):e.jsxs(ce.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[c,a,g,d]})},ic=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,d;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(de,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(xe,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:o.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ee.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsx(es,{...o.inputProps,status:o.errorMessage?"error":"default"}),!i&&o.errorMessage&&e.jsx(ut,{message:o.errorMessage})]})]})},lc=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,required:o=!1,...i})=>{var a,d,h,g;const l=i.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"||r==="horizontal-inline"?"spacing-96":"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",...i.containerProps,children:[i.title&&e.jsx(de,{condition:!!o,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(xe,{children:i.title}),e.jsx(Ye.Body3,{props:{color:"gray-500"},children:i.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:i.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((a=i.tooltip)!=null&&a.label),children:e.jsx(Ee.Tooltip,{label:(d=i.tooltip)==null?void 0:d.label,arrowPosition:(h=i.tooltip)==null?void 0:h.arrowPosition,focusable:!0,...i.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!i.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.description})})]})}),e.jsx(x.Box,{gap:r==="horizontal-inline"?"xl":"md",direction:r==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(lr,{of:(g=i.checkBoxesList)==null?void 0:g.map(m=>({...m,isChecked:i.checkBoxesAreChecked.includes(m.id)})),render:m=>m.renderBadge?e.jsxs(x.Box,{direction:"row",justify:"space-between",gap:"lg",...i.badgeContainerProps,children:[e.jsx(nt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:y=>i.onChecked(y.target.value,m),label:m.name,description:m.description}),m.renderBadge]}):e.jsx(nt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:y=>i.onChecked(y.target.value,m),label:m.name,description:m.description})})}),!l&&i.errorMessage&&e.jsx(ut,{message:i.errorMessage})]})},cc=({position:t="vertical",size:r="md",fullWidth:n=!1,...s})=>{var i;const o=t==="horizontal-inline"||t==="horizontal-block"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:t==="horizontal-inline"||t==="horizontal-block"?"spacing-96":"sm",direction:t==="horizontal-inline"||t==="horizontal-block"?"row":"column",children:[e.jsx(de,{condition:!!s.description||!!s.title,children:e.jsxs(x.Box,{direction:"column",customMaxWidth:o,fullWidth:n,children:[s.title&&e.jsx(xe,{children:s.title}),e.jsx(de,{condition:!!s.description,children:e.jsx(w.Text,{color:"gray-500",children:s.description})})]})}),e.jsx(x.Box,{gap:"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(lr,{of:(i=s.radioList)==null?void 0:i.map(l=>({...l,isChecked:s.radioIsChecked===l.id})),render:({value:l,id:c,isChecked:a,subInput:d,label:h,description:g})=>e.jsxs(x.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(Vr.Radio,{id:`${c.toString()}-${l}`,name:s.groupName||h,label:h,value:l,checked:a,onChange:m=>s.onChecked({id:c,label:m.target.name,value:m.target.value}),disabled:s.disableAll},c),g&&e.jsx(w.Text,{color:"gray-500",style:{marginLeft:28},children:g}),d]})})}),s.errorMessage&&e.jsx(ut,{message:s.errorMessage})]})},ac=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,d;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(de,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(xe,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:o.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ee.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsx(Pr.Textarea,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default"}),!i&&o.errorMessage&&e.jsx(ut,{message:o.errorMessage})]})]})},dc=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",required:s=!1,fullWidth:o=!1,...i})=>{var c,a,d;const l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...i.containerProps,children:[i.title&&e.jsx(de,{condition:s,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[e.jsx(xe,{children:i.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.titleDescription})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:i.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((c=i.tooltip)!=null&&c.label),children:e.jsx(Ee.Tooltip,{label:(a=i.tooltip)==null?void 0:a.label,arrowPosition:(d=i.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...i.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!i.titleDescription,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.titleDescription})})]})}),e.jsx(Bt.Toggle,{checked:i.checked,onChange:i.onChange,label:i.label,description:i.description}),i.errorMessage&&e.jsx(ut,{message:i.errorMessage})]})},uc=({variant:t="primary",size:r="md",...n})=>{const s=Dt.useColor(),o=l=>{var a,d,h,g,m,y;if(!l)return;const c=n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary"?"var(--sa-text-subtle, #8c8f97)":t==="secondary-danger"?(d=(a=s==null?void 0:s.computed)==null?void 0:a.red)==null?void 0:d[600]:t==="secondary-primary"?(g=(h=s==null?void 0:s.computed)==null?void 0:h.blue)==null?void 0:g[700]:(y=(m=s==null?void 0:s.computed)==null?void 0:m.gray)==null?void 0:y[50];return e.jsx(B.Icon,{name:l,size:r,style:{color:c}})},i=()=>{var c,a,d,h;if(t!=="secondary-danger"&&t!=="secondary-primary")return n.title;const l={color:n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary-danger"?(a=(c=s==null?void 0:s.computed)==null?void 0:c.red)==null?void 0:a[600]:(h=(d=s==null?void 0:s.computed)==null?void 0:d.blue)==null?void 0:h[700]};switch(r){case"xs":return e.jsx(Ye.Body2,{props:{style:l},children:n.title});case"sm":case"md":return e.jsx(Ye.SubH3,{props:{style:l},children:n.title});case"lg":return e.jsx(Ye.SubH2,{props:{style:l},children:n.title});default:return n.title}};return e.jsx(H.Button,{fullWidth:!0,disabled:n.disabled,primary:t==="primary",secondary:t==="secondary"||t==="secondary-danger"||t==="secondary-primary",success:t==="success",onClick:n.onClick,type:n.type,iconLeft:o(n.iconLeft),iconRight:o(n.iconRight),size:r,children:i()})},xc=t=>e.jsx(Ye.H5,{props:{...t},children:t.title}),hc=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,a,d;const i=o.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(de,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(xe,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:o.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ee.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,focusable:!0,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsx(x.Box,{direction:"column",style:{width:r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(gt.StarasiaDate,{size:t,...o.inputProps,status:o.errorMessage?"error":void 0})}),!i&&o.errorMessage&&e.jsx(ut,{message:o.errorMessage})]})]})};async function fc(t,r){const n=new Image;n.src=t,await new Promise((i,l)=>{n.onload=i,n.onerror=l});const s=document.createElement("canvas");s.width=r.width,s.height=r.height;const o=s.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(n,r.x,r.y,r.width,r.height,0,0,r.width,r.height),new Promise((i,l)=>{s.toBlob(c=>{if(!c)return l("Canvas is empty");const a=new File([c],"cropped.png",{type:"image/png"});i(a)},"image/png")})}const ro={"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},ts=u.forwardRef(({handleUpload:t,urlImage:r,isUploading:n,croppedImage:s,setCroppedImage:o,size:i="96",aspect:l="1:1",containerProps:c,maxFileSize:a=2,onError:d},h)=>{const g=be.useMediaQuery("md"),[m,y]=u.useState(!1),[S,C]=u.useState(null),[L,M]=u.useState(!1),[T,b]=u.useState({x:0,y:0}),[j,I]=u.useState(1),[F,D]=u.useState(null);u.useEffect(()=>{r===null&&o(null)},[r]);const O=u.useCallback((Z,z)=>{D(z)},[]),A=Z=>{var ue;const z=(ue=Z.target.files)==null?void 0:ue[0];if(!z)return;const ie=new FileReader;ie.onload=()=>{C(ie.result),M(!0)},ie.readAsDataURL(z)},Y=async()=>{if(!(!S||!F))try{const Z=await fc(S,F);if(a&&Z.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}t==null||t(Z);const z=URL.createObjectURL(Z);o(z,Z),M(!1)}catch{d==null||d("Gagal memproses gambar")}},P=u.useRef(null),_=()=>{P.current&&P.current.click()};u.useImperativeHandle(h,()=>({openFileDialog:()=>{var Z;(Z=P.current)==null||Z.click()}}));const q=parseInt(i,10),X=ro[l];let K,Q;return X>=1?(Q=q,K=q*X):(K=q,Q=q/X),e.jsxs(x.Box,{direction:"column",display:"flex",position:"relative",bg:(c==null?void 0:c.bg)||"gray-200",borderStyle:(c==null?void 0:c.borderStyle)||"border-none",borderColor:(c==null?void 0:c.borderColor)||"gray-200",borderWidth:(c==null?void 0:c.borderWidth)||"border-2",borderRadius:(c==null?void 0:c.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:c!=null&&c.fullWidth?"100%":`${K}px`,height:c!=null&&c.fullWidth?"auto":`${Q}px`,aspectRatio:X,flexShrink:0},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[s||r?e.jsx("img",{src:s||r||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(x.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(B.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(i)/2<40?Number(i)/2:40,height:Number(i)/2<40?Number(i)/2:40}})}),e.jsxs(x.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214c)",opacity:m?1:0,transition:"opacity 0.3s ease-in-out"},onClick:_,children:[e.jsx("input",{ref:P,type:"file",accept:"image/*",onChange:A,disabled:n,style:{display:"none"}}),e.jsxs(x.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(B.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(de,{condition:i.toNumber()>80,children:e.jsx(w.Text,{color:"gray-50",fontSize:i.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),n&&e.jsx(x.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f6cc)"},children:e.jsx(x.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),L&&sr.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:()=>M(!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:g?l==="1:1"?"min(90vw, 480px)":`min(90vw, ${K*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:Z=>Z.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:S&&e.jsx(Ms,{image:S,crop:T,zoom:j,aspect:l?ro[l]:void 0,onCropChange:b,onZoomChange:I,onCropComplete:O,objectFit:"contain",minZoom:.5,restrictPosition:!1})}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--sa-border-subtle)"},children:[e.jsx(H.Button,{size:"sm",secondary:!0,onClick:()=>M(!1),children:"Cancel"}),e.jsx(H.Button,{size:"sm",primary:!0,onClick:Y,children:"Crop"})]})]})}),document.body)]})}),mc=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,required:o=!1,...i})=>{var a,d,h;const l=i.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...i.containerProps,children:[i.title&&e.jsx(de,{condition:!!o,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(xe,{children:i.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:i.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((a=i.tooltip)!=null&&a.label),children:e.jsx(Ee.Tooltip,{label:(d=i.tooltip)==null?void 0:d.label,arrowPosition:(h=i.tooltip)==null?void 0:h.arrowPosition,focusable:!0,...i.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!i.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.description})})]})}),e.jsxs(ce.Flex,{direction:"column",gap:"xs",children:[e.jsx(ts,{...i.inputProps}),!l&&i.errorMessage&&e.jsx(ut,{message:i.errorMessage})]})]})},gc=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,c,a;const i=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(x.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(de,{condition:!!o.inputProps.required,fallback:e.jsxs(x.Box,{direction:"column",customMaxWidth:i,fullWidth:s,children:[e.jsx(xe,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(x.Box,{direction:"column",customMaxWidth:i,fullWidth:s,children:[e.jsxs(ce.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(xe,{fontSize:t,children:o.title}),e.jsx(xe,{color:"error",fontSize:t,children:n}),e.jsx(de,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ee.Tooltip,{label:(c=o.tooltip)==null?void 0:c.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,focusable:!0,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(de,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},pc=({items:t,id:r,handleOnUpdate:n,width:s,toggleShow:o=!0,disabled:i=!1})=>{var h;const[l,c]=u.useState([]);u.useEffect(()=>{t&&c([...t.map(g=>({id:g.id,isActive:g.isActive}))])},[t]);const a=(h=l.find(g=>g.id===r))==null?void 0:h.isActive,d=u.useCallback(()=>{c(g=>g.map(m=>m.id===r?{...m,isActive:!m.isActive}:m)),n&&n(!a)},[r,n,a]);return e.jsx(x.Box,{direction:"row",gap:"md",style:{width:s},children:o&&e.jsx(Bt.Toggle,{disabled:i,checked:a,onChange:d,label:a?"Active":"Inactive"})})},yc={InputText:Il,InputDropdown:Tl,InputSingleFile:ic,CheckBoxOptions:lc,RadioOptions:cc,InputTextArea:ac,ToggleForm:dc,ActionButton:uc,FormTitle:xc,InputDate:hc,InputImgFile:mc,Custom:gc},rs=({customBottom:t})=>{const[r,n]=u.useState(!1),s=()=>{window.scrollY>window.screenY?n(!0):n(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return u.useEffect(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[]),e.jsx(x.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(x.Box,{direction:"column",position:"absolute",style:{bottom:t||"1.6rem",right:"2rem",transform:r?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(H.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(B.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Ze="sa-sidepanel-item",no="sa-sidepanel-item-styles",jc="inset 3.5px 0 0 0 var(--sa-border-focused, #1a4fa0)",bc="inset -3.5px 0 0 0 var(--sa-border-focused, #1a4fa0)",vc=`
|
|
53
53
|
.${Ze} {
|
|
54
54
|
display: block;
|
|
55
55
|
box-sizing: border-box;
|
|
@@ -87,11 +87,11 @@
|
|
|
87
87
|
/* Accent bar — sign of the offset picks the edge it hugs. */
|
|
88
88
|
.${Ze}[data-accent="left"]:focus-visible,
|
|
89
89
|
.${Ze}[data-accent="left"][data-active="true"] {
|
|
90
|
-
box-shadow: ${
|
|
90
|
+
box-shadow: ${jc};
|
|
91
91
|
}
|
|
92
92
|
.${Ze}[data-accent="right"]:focus-visible,
|
|
93
93
|
.${Ze}[data-accent="right"][data-active="true"] {
|
|
94
|
-
box-shadow: ${
|
|
94
|
+
box-shadow: ${bc};
|
|
95
95
|
}
|
|
96
96
|
.${Ze}[data-active="true"]:hover {
|
|
97
97
|
background: var(--sa-background-brand-subtlest, #e6edf6);
|
|
@@ -100,4 +100,4 @@
|
|
|
100
100
|
cursor: not-allowed;
|
|
101
101
|
opacity: 0.55;
|
|
102
102
|
}
|
|
103
|
-
`;function vc(){if(typeof document>"u"||document.getElementById(no))return;const t=document.createElement("style");t.id=no,t.textContent=bc,document.head.appendChild(t)}const Cc=({active:t=!1,accentSide:r="left",onClick:n,title:s,badge:o,heading:i,meta:l,children:c,divider:a=!0,disabled:d,className:h,style:g,"aria-label":m})=>(u.useEffect(vc,[]),e.jsx("button",{type:"button",className:[Ze,h].filter(Boolean).join(" "),"data-active":t?"true":"false","data-accent":r,"data-divider":a?"true":"false","aria-current":t?"true":void 0,"aria-label":m,disabled:d,onClick:n,style:g,children:c??e.jsxs(x.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(s||o)&&e.jsxs(ce.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[s?e.jsx(w.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:s}):e.jsx("span",{}),o?e.jsx(x.Box,{style:{flexShrink:0},children:o}):null]}),i?e.jsx(w.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:i}):null,l?e.jsx(w.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:l}):null]})})),Wr=18,wc=40,oo="280ms cubic-bezier(0.4, 0, 0.2, 1)",rs="var(--sa-border-subtle, #0b120e24)",Dc=`1px solid ${rs}`,so="var(--sa-background-white, #ffffff)",Sc=({children:t,header:r,collapsed:n,defaultCollapsed:s=!1,onToggle:o,width:i=337,side:l="left",offsetTop:c="var(--app-header-height, 4rem)",height:a,showToggle:d=!0,togglePosition:h="top",toggleOffset:g=40,toggleLabel:m,style:y,bodyStyle:S,className:C,pageLayout:T,overlay:M="mobile",wrapperProps:L,contentProps:b})=>{const j=be.useMediaQuery("md"),I=n!==void 0,[F,D]=u.useState(s),O=I?n:F,A=()=>{const ie=!O;I||D(ie),o==null||o(ie)},Y=l==="left",H=typeof c=="number"?`${c}px`:c,_=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${H})`,q=m??{collapse:"Collapse panel",expand:"Expand panel"},X=h==="center"?{top:"50%",transform:"translateY(-50%)"}:h==="bottom"?{bottom:g}:{top:g},K=O?Y?"ChevronRight":"ChevronLeft":Y?"ChevronLeft":"ChevronRight",Q=T!==void 0&&(M==="mobile"?!j:M),Z=Q?{position:"absolute",top:0,bottom:0,width:i,transform:`translateX(${O?Y?"-100%":"100%":"0"})`,transition:`transform ${oo}`,zIndex:50,...Y?{left:0}:{right:0},...y}:{position:"sticky",top:H,alignSelf:"flex-start",width:O?0:i,flexShrink:0,height:_,transition:`width ${oo}`,...y},z=e.jsxs(x.Box,{className:C,style:Z,children:[e.jsx(x.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:O?void 0:Y?"border-solid-r":"border-solid-l",borderWidth:O?void 0:Y?"border-r":"border-l",style:{backgroundColor:so,borderColor:rs},children:e.jsxs(x.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:i,customMinWidth:i,style:Y?void 0:{marginLeft:"auto"},children:[r?e.jsx(x.Box,{padding:"md",style:{flexShrink:0},children:r}):null,e.jsx(x.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...S},children:t})]})}),d&&e.jsx(Wt,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:A,"aria-label":O?q.expand:q.collapse,"aria-expanded":!O,"aria-pressed":O,customWidth:Wr,customHeight:wc,style:{...X,backgroundColor:so,border:Dc,zIndex:5,...Y?{right:-Wr,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-Wr,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(E.Icon,{name:K,size:"sm"})})]});return T===void 0?z:e.jsxs(x.Box,{direction:"row",position:"relative",...L,style:{height:`calc(100vh - ${H})`,overflow:"hidden",...(L==null?void 0:L.style)??{}},children:[!Q&&Y?z:null,e.jsx(x.Box,{display:"block",...b,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(b==null?void 0:b.style)??{}},children:T}),!Q&&!Y?z:null,Q&&e.jsxs(e.Fragment,{children:[!O&&e.jsx("div",{onClick:A,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),z]})]})},Qr="--app-aside-width",kc=t=>typeof t=="number"?`${t}px`:t,Bc=({pageLayout:t,children:r,wrapperProps:n,containerProps:s})=>{const o=be.useMediaQuery("md"),i=(s==null?void 0:s.customWidth)??264;return u.useLayoutEffect(()=>{const l=document.documentElement;return l.style.setProperty(Qr,o?kc(i):"0px"),()=>l.style.removeProperty(Qr)},[o,i]),e.jsxs(x.Box,{display:"block",direction:"row",...n,style:{marginRight:o?i:24,...(n==null?void 0:n.style)??{}},children:[t,e.jsx(x.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",...s,style:{marginTop:"var(--app-header-height, 4rem)",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(s==null?void 0:s.style)??{}},children:r})]})},Ur="--sa-floating-footer-height",Ec=t=>typeof t=="number"?`${t}px`:t,Fc=({children:t,withScrollToTopButton:r=!1,scrollToTopButtonProps:n,respectAside:s=!1,offsetRight:o,containerProps:i})=>{const l=u.useRef(null),c=o!=null?Ec(o):s?"var(--app-aside-width, 0px)":"0px";return u.useLayoutEffect(()=>{const a=document.documentElement,d=()=>{var m;const g=((m=l.current)==null?void 0:m.getBoundingClientRect().height)??0;a.style.setProperty(Ur,`${g}px`)};d();const h=new ResizeObserver(d);return l.current&&h.observe(l.current),()=>{h.disconnect(),a.style.removeProperty(Ur)}},[]),e.jsx(x.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(x.Box,{ref:l,position:"fixed",bottom:"bottom-0",bg:"white",direction:"row",align:"center",display:"flex",paddingBlock:"sm",paddingInline:"md",borderColor:"border-subtle",style:{left:"var(--app-sidebar-width, 0px)",right:c,transition:"left 0.3s ease-in-out, right 0.3s ease-in-out"},justify:(i==null?void 0:i.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[r&&e.jsx(ts,{...n,customBottom:(n==null?void 0:n.customBottom)||"5.7rem"}),t]})})},Mc=({fields:t})=>e.jsx(x.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(lr,{of:t,render:(r,n)=>e.jsx(Ic,{...r},n)})}),Ic=({title:t,value:r,icon:n})=>e.jsxs(x.Box,{display:"flex",direction:"column",gap:"sm",children:[n?e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(E.Icon,{name:n,color:"subtle"}),e.jsx(w.Text,{color:"gray-500",variant:"sub-h3",children:t})]}):e.jsx(w.Text,{color:"gray-500",variant:"sub-h3",children:t}),typeof r=="string"?e.jsx(w.Text,{variant:"sub-h3",children:r}):r]}),Te={silhouette:"#A7B0AC",accent:"#78867F"};function Lc({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t||"100",height:r||"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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.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:Te.accent,fillOpacity:"0.65"})]})})}const Tc=({title:t="create",children:r,onClickAction:n,variant:s="primary",variantTitle:o,leftIcon:i,showButton:l=!0,customHeight:c,childrenButton:a,customIcon:d})=>{const h=()=>{switch(s){case"primary":return e.jsx(e.Fragment,{children:i?e.jsx(P.Button,{primary:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(P.Button,{primary:!0,onClick:n,children:a||t})});case"secondary":return e.jsx(e.Fragment,{children:i?e.jsx(P.Button,{secondary:!0,iconLeft:i,onClick:n,children:o?e.jsx(w.Text,{fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||t}):t}):e.jsx(P.Button,{secondary:!0,onClick:n,children:a||t})});case"success":return e.jsx(e.Fragment,{children:i?e.jsx(P.Button,{success:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(P.Button,{success:!0,onClick:n,children:a||t})});default:return e.jsx(e.Fragment,{children:i?e.jsx(P.Button,{primary:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(P.Button,{primary:!0,onClick:n,children:a||t})})}};return e.jsxs(x.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:c,children:[d||e.jsx(Lc,{}),e.jsx(x.Box,{direction:"column",children:r.map((g,m)=>e.jsx(Ye.Body1,{props:{align:"center",textAlign:"center"},children:m>2?null:g},m))}),l?h():null]})},te={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function Rc({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:te.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("path",{d:"M233.438 165.217C233.438 132.764 239.035 107.198 250.231 88.5189C261.596 69.8396 279.832 60.5 304.938 60.5C330.043 60.5 348.194 69.8396 359.389 88.5189C370.755 107.198 376.438 132.764 376.438 165.217C376.438 198.047 370.755 223.802 359.389 242.481C348.194 261.16 330.043 270.5 304.938 270.5C279.832 270.5 261.596 261.16 250.231 242.481C239.035 223.802 233.438 198.047 233.438 165.217ZM333.69 165.217C333.69 146.16 331.824 131.538 328.092 121.349C324.36 110.972 316.642 105.783 304.938 105.783C293.233 105.783 285.515 110.972 281.783 121.349C278.051 131.538 276.185 146.16 276.185 165.217C276.185 178.047 276.863 188.708 278.22 197.198C279.577 205.5 282.292 212.292 286.363 217.575C290.604 222.67 296.795 225.217 304.938 225.217C313.08 225.217 319.187 222.67 323.258 217.575C327.499 212.292 330.298 205.5 331.655 197.198C333.012 188.708 333.69 178.047 333.69 165.217Z",fill:te.cD0E5F7}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.4375 235.124V194.28L138.96 60.5H192.466V191.32H215.438V235.124H192.466V249.5H144.563V235.124H50.4375ZM100.862 191.32L147.925 116.143V191.32H100.862Z",fill:te.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M394.438 235.124V194.28L482.96 60.5H536.466V191.32H559.438V235.124H536.466V249.5H488.563V235.124H394.438ZM444.862 191.32L491.925 116.143V191.32H444.862Z",fill:te.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:te.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:te.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:te.c98B4CB}),e.jsx("path",{d:"M244.719 200.89V264.5H363.574V200.89M244.719 200.89H233.438L244.719 186.396M244.719 200.89H363.574M363.574 200.89H372.437L363.574 186.396M244.719 186.396L261.64 171.5M244.719 186.396H261.64M363.574 186.396L349.472 171.5M363.574 186.396H349.472M261.64 171.5H349.472M261.64 171.5V186.396M349.472 171.5V186.396M349.472 186.396H261.64",stroke:te.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:te.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:te.cFFFFFF}),e.jsx("path",{d:"M332.438 129.846C332.438 141.175 329.183 152.403 323.949 160.772C318.699 169.168 311.592 174.5 303.938 174.5C296.283 174.5 289.176 169.168 283.926 160.772C278.692 152.403 275.438 141.175 275.438 129.846C275.438 118.458 277.838 109.628 282.543 103.663C287.216 97.7387 294.274 94.5 303.938 94.5C313.601 94.5 320.659 97.7387 325.332 103.663C330.037 109.628 332.438 118.458 332.438 129.846Z",fill:te.cFFFFFF,stroke:te.c000000,strokeWidth:"2"}),e.jsx("path",{d:"M281.438 145.5C284.032 154.136 285.762 158.682 290.951 164.591M292.681 166.409C293.624 167.647 295.708 169.591 297.438 170.5",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.438 175C299.54 176.339 297.208 177.876 293.938 182.5M304.438 175C301.183 178.041 299.537 178.883 299.438 182.5M304.438 175C308.173 177.107 309.635 178.834 311.438 182.5",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.936 175.5C303.438 180 302.529 181.628 304.936 186.5",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.178 120.981C289.969 120.93 290.921 121.313 292.167 122.754",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:te.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:te.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:te.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:te.c001A72,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M265.437 115.5L260.438 120.5M260.438 115.5L265.438 120.5",stroke:te.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.437 87.5L283.438 92.5M283.438 87.5L288.438 92.5",stroke:te.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M305.437 83.5L298.438 90.5M298.438 83.5L305.438 90.5",stroke:te.c001A72,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M342.437 145.5L337.438 150.5M337.438 145.5L342.438 150.5",stroke:te.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:te.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:te.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:te.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:te.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:te.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:te.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:te.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:te.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:te.c001A72})]})})}function Oc({onClick:t}){const r=be.useMediaQuery("md");return e.jsxs(x.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Rc,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(w.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),t&&e.jsx(P.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const se={c46F16B:"#46F16B",c48504C:"#48504C",c64B5F6:"#64B5F6",c67AEE6:"#67AEE6",c86512B:"#86512B",c956847:"#956847",cBBC3F5:"#BBC3F5",cBBDEFB:"#BBDEFB",cC0B2A2:"#C0B2A2",cC8CEF4:"#C8CEF4",cCABEB1:"#CABEB1",cD5C7BD:"#D5C7BD",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cE5EE80:"#E5EE80",cEE8080:"#EE8080",cEFF3F8:"#EFF3F8",cF4F4F4:"#F4F4F4",cFFFFFF:"#FFFFFF"};function Ac({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M75 238.124V197.28L163.523 63.5H217.029V194.32H240V238.124H217.029V252.5H169.126V238.124H75ZM125.424 194.32L172.487 119.143V194.32H125.424Z",fill:se.cBBDEFB,fillOpacity:"0.6"}),e.jsxs("g",{clipPath:"url(#clip0_2949_9690)",children:[e.jsx("path",{d:"M334.5 274.5C381.168 274.5 419 227.266 419 169C419 110.734 381.168 63.5 334.5 63.5C287.832 63.5 250 110.734 250 169C250 227.266 287.832 274.5 334.5 274.5Z",fill:se.cEFF3F8,stroke:se.c67AEE6,strokeWidth:"5"}),e.jsx("path",{d:"M413 197.5C411.397 211.835 402.919 230.898 389.361 246.49C375.596 262.32 356.651 274.5 334.496 274.5C311.331 274.5 292.389 261.672 278.878 245.52C265.592 229.638 257.606 210.603 256 197.5H413Z",fill:se.cD5C7BD}),e.jsx("path",{d:"M278.887 211.766H391.104L392.583 222.856C392.687 223.635 392.08 224.328 391.294 224.328H277.961C277.14 224.328 276.525 223.577 276.686 222.773L278.887 211.766Z",fill:se.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:se.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:se.c956847,stroke:se.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:se.c956847,stroke:se.c48504C}),e.jsx("path",{d:"M285.902 212.103L284.935 186.306H279.606C278.151 186.306 277.004 187.542 277.113 188.993L278.673 209.79C278.77 211.095 279.857 212.103 281.166 212.103H285.902Z",fill:se.cC8CEF4,stroke:se.c48504C}),e.jsx("path",{d:"M383.256 212.103L384.638 186.306H389.556C391.007 186.306 392.153 187.537 392.05 188.984L390.564 209.782C390.471 211.09 389.382 212.103 388.07 212.103H383.256Z",fill:se.cC8CEF4,stroke:se.c48504C}),e.jsx("path",{d:"M284.497 178.155C284.455 176.194 286.034 174.581 287.996 174.581H381.904C383.895 174.581 385.485 176.24 385.401 178.23L384.066 209.59C383.987 211.463 382.445 212.941 380.569 212.941H288.663C286.759 212.941 285.205 211.419 285.164 209.515L284.497 178.155Z",fill:se.cC8CEF4,stroke:se.c48504C}),e.jsx("path",{d:"M284.845 181.524C284.792 179.279 286.598 177.431 288.844 177.431H380.687C382.948 177.431 384.76 179.304 384.684 181.565L383.774 208.737C383.701 210.893 381.933 212.603 379.776 212.603H289.48C287.307 212.603 285.532 210.869 285.481 208.697L284.845 181.524Z",fill:se.cBBC3F5}),e.jsx("mask",{id:"mask0_2949_9690",maskUnits:"userSpaceOnUse",x:"301",y:"144",width:"68",height:"17",style:{maskType:"luminance"},children:e.jsx("path",{d:"M301 146.5C301 145.395 301.887 144.5 302.98 144.5H367.02C368.114 144.5 369 145.395 369 146.5V160.411H301V146.5Z",fill:se.cFFFFFF})}),e.jsxs("g",{mask:"url(#mask0_2949_9690)",children:[e.jsx("path",{d:"M301 146.191C301 145.257 301.748 144.5 302.671 144.5H356.701C357.624 144.5 358.372 145.257 358.372 146.191V157.949H301V146.191Z",fill:se.cFFFFFF}),e.jsx("path",{d:"M301.336 146.607C301.336 145.673 302.08 144.916 302.999 144.916H367.01C367.929 144.916 368.673 145.673 368.673 146.607V152.523H301.336V146.607Z",fill:se.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:se.cF4F4F4}),e.jsx("path",{d:"M307.685 150.417C308.607 150.417 309.356 149.66 309.356 148.726C309.356 147.793 308.607 147.036 307.685 147.036C306.762 147.036 306.014 147.793 306.014 148.726C306.014 149.66 306.762 150.417 307.685 150.417Z",fill:se.cEE8080}),e.jsx("path",{d:"M313.532 150.417C314.455 150.417 315.203 149.66 315.203 148.726C315.203 147.793 314.455 147.036 313.532 147.036C312.609 147.036 311.861 147.793 311.861 148.726C311.861 149.66 312.609 150.417 313.532 150.417Z",fill:se.cE5EE80}),e.jsx("path",{d:"M318.546 150.417C319.469 150.417 320.217 149.66 320.217 148.726C320.217 147.793 319.469 147.036 318.546 147.036C317.623 147.036 316.875 147.793 316.875 148.726C316.875 149.66 317.623 150.417 318.546 150.417Z",fill:se.c46F16B})]}),e.jsx("path",{d:"M301.16 146C301.16 145.172 301.832 144.5 302.66 144.5H367.33C368.159 144.5 368.83 145.172 368.83 146V174.419H301.16V146Z",stroke:se.c48504C}),e.jsx("path",{d:"M395.29 207.579H423.344M354.255 236.889H369.329M327.038 222.234H347.556M350.905 222.234H358.024M288.097 230.19H304.846M253.344 210.091H272.605M278.467 246.938H295.216M297.309 246.938H303.59M337.088 252.801H354.255",stroke:se.c86512B,strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("path",{d:"M430.241 125.78C430.987 105.807 437.521 90.4065 449.841 79.5799C462.161 68.7532 478.867 63.3398 499.961 63.3398C513.961 63.3398 525.907 65.7665 535.801 70.6199C545.881 75.4732 553.441 82.0998 558.481 90.4998C563.707 98.8998 566.321 108.327 566.321 118.78C566.321 131.1 563.241 141.18 557.081 149.02C550.921 156.673 543.734 161.9 535.521 164.7V165.82C546.161 169.367 554.561 175.247 560.721 183.46C566.881 191.673 569.961 202.22 569.961 215.1C569.961 226.673 567.254 236.94 561.841 245.9C560.436 248.258 558.849 250.481 557.081 252.569L443.5 252.662C432.5 241 427.721 230.5 427.721 207.82H474.201C474.387 216.033 476.721 222.567 481.201 227.42C485.681 232.087 492.214 234.42 500.801 234.42C508.081 234.42 513.681 232.367 517.601 228.26C521.707 223.967 523.761 218.367 523.761 211.46C523.761 202.5 520.867 196.06 515.081 192.14C509.481 188.033 500.427 185.98 487.921 185.98H478.961V147.06H487.921C497.441 147.06 505.094 145.473 510.881 142.3C516.854 138.94 519.841 133.06 519.841 124.66C519.841 117.94 517.974 112.713 514.241 108.98C510.507 105.247 505.374 103.38 498.841 103.38C491.747 103.38 486.427 105.527 482.881 109.82C479.521 114.113 477.561 119.433 477.001 125.78H430.241Z",fill:se.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:se.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_2949_9690",children:e.jsx("rect",{width:"179",height:"192",fill:se.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function Wc({onClick:t}){const r=be.useMediaQuery("md");return e.jsxs(x.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Ac,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",children:"We Are Sorry ..."}),t&&e.jsx(P.Button,{size:r?"md":"xs",onClick:t,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 zc({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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 Hc({onClick:t}){const r=be.useMediaQuery("md");return e.jsxs(x.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(zc,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(w.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),t&&e.jsx(P.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const Pc=t=>{var n,s,o,i,l;const r=be.useMediaQuery("md");return e.jsxs(Ne.Dialog,{isShow:t.isShow,onHide:t.onHide,style:{...r?{minWidth:t.customMinWidth||"458px"}:{maxWidth:t.customMinWidth||"458px"}},children:[e.jsx(Ne.DialogTitle,{...t.dialogTitleProps,children:typeof t.title=="string"?e.jsx(w.Text,{fontSize:"lg",fontWeight:"medium",children:t.title}):t.title}),e.jsx(Ne.DialogBody,{children:typeof t.description=="string"?e.jsx(w.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:t.description}):t.description}),e.jsx(Ne.DialogFooter,{children:e.jsx(x.Box,{display:"flex",direction:((n=t.containerConfirmBtnProps)==null?void 0:n.direction)||"row",justify:((s=t.containerConfirmBtnProps)==null?void 0:s.justify)||"flex-end",...t.containerConfirmBtnProps,children:e.jsxs(x.Box,{display:"flex",direction:((o=t.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((i=t.wrapperConfirmBtnProps)==null?void 0:i.justify)||"flex-end",gap:((l=t.wrapperConfirmBtnProps)==null?void 0:l.gap)||"sm",...t.wrapperConfirmBtnProps,children:[t.onCancel&&e.jsx(P.Button,{secondary:!0,onClick:t.onCancel,size:"md",fullWidth:!0,children:t.titleCancelBtn||"Cancel"}),e.jsx(x.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(P.Button,{...t.buttonConfirmProps,onClick:t.onConfirm,size:"md",fullWidth:!0,children:t.titleConfirmBtn||"Ok"})})]})})})]},t.key)},Vc=u.memo(({children:t,height:r,minHeight:n,customHeight:s,paddingInline:o="spacing-0",paddingBlock:i="spacing-0",header:l,footer:c,title:a,titleTag:d,action:h,actionContainer:g,containerProps:m,bodyProps:y,headerProps:S={borderBottom:!0},footerProps:C={borderTop:!0},variantTag:T="info"})=>{const M=u.useRef(null),[L,b]=u.useState("100vh");u.useEffect(()=>{const D=()=>{if(M.current){const O=M.current.getBoundingClientRect().top;b(`calc(100vh - ${O}px)`)}};return D(),window.addEventListener("resize",D),()=>window.removeEventListener("resize",D)},[]);const j=()=>d?e.jsxs(x.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(w.Text,{fontWeight:"medium",children:a}),e.jsx(dt.Badges,{border:!0,text:d,variant:T})]}):e.jsx(w.Text,{fontWeight:"medium",children:a}),I=()=>l||e.jsxs(x.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(x.Box,{direction:"column",children:a?j():null}),e.jsx(x.Box,{direction:"column",...g,children:h??null})]}),F=!!(l||a||h);return e.jsxs(x.Box,{ref:M,height:r,customMinHeight:n,customHeight:s,paddingBlock:i,paddingInline:o,bg:"white",direction:"column",...m,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:L,...(m==null?void 0:m.style)??{}},children:[l!==null&&F?e.jsx(nn,{...S,children:I()}):null,e.jsx(x.Box,{direction:"column",padding:"spacing-0",...y,style:{flex:1,overflow:"auto",...(y==null?void 0:y.style)??{}},children:t}),c?e.jsx(on,{...C,children:c}):null]})}),Nc=u.memo(({value:t,options:r=[],onChange:n,multiple:s})=>{const o=(t==null?void 0:t.map(c=>c.value))||[],i=(r==null?void 0:r.filter(c=>o.includes(c.value)))||[],l=c=>{const a=[...i];let d=[];s?d=o.includes(c.value)?a.filter(h=>h.value!==c.value):[...a,c]:d=[c],n==null||n(d)};return e.jsx(x.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:r==null?void 0:r.map((c,a)=>e.jsx(P.Button,{...o.includes(c.value)?{primary:!0}:{secondary:!0},onClick:()=>l(c),children:c.label},a))})});function cr(t){return null}cr.displayName="LayoutDialog.Header";function ar(t){return null}ar.displayName="LayoutDialog.Body";function dr(t){return null}dr.displayName="LayoutDialog.Aside";function ur(t){return null}ur.displayName="LayoutDialog.Footer";const He={"lyd-root":"_lyd-root_1g78i_1","lyd-backdrop":"_lyd-backdrop_1g78i_38","lyd-panel":"_lyd-panel_1g78i_47","lyd-modal":"_lyd-modal_1g78i_58","lyd-fullscreen":"_lyd-fullscreen_1g78i_72","lyd-sidebar":"_lyd-sidebar_1g78i_80","lyd-header":"_lyd-header_1g78i_110","lyd-header-content":"_lyd-header-content_1g78i_121","lyd-header-actions":"_lyd-header-actions_1g78i_129","lyd-main":"_lyd-main_1g78i_136","lyd-body":"_lyd-body_1g78i_143","lyd-aside":"_lyd-aside_1g78i_149","lyd-footer":"_lyd-footer_1g78i_165","lyd-vm-group":"_lyd-vm-group_1g78i_178","lyd-vm-btn":"_lyd-vm-btn_1g78i_186","lyd-close-btn":"_lyd-close-btn_1g78i_209"},_c=[{mode:"sidebar",label:"Sidebar",renderIcon:()=>e.jsx(Zc,{})},{mode:"modal",label:"Modal",renderIcon:()=>e.jsx(E.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",renderIcon:()=>e.jsx(E.Icon,{name:"Fullscreen",size:"sm"})}];function qc({value:t,onChange:r}){return e.jsx("div",{className:He["lyd-vm-group"],role:"group","aria-label":"View mode",children:_c.map(n=>e.jsx("button",{type:"button",className:He["lyd-vm-btn"],"data-active":t===n.mode,"aria-label":`Switch to ${n.label} view`,"aria-pressed":t===n.mode,onClick:()=>r(n.mode),children:n.renderIcon()},n.mode))})}function Zc(){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 zr={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Gc(t){return t?t in zr?zr[t]:t:zr.xl}function Xt(t,r){let n=null;return u.Children.forEach(t,s=>{u.isValidElement(s)&&s.type===r&&(n=s.props.children??null)}),n}function Qc(t){const{isOpen:r,onClose:n,viewMode:s,defaultViewMode:o="modal",onViewModeChange:i,showViewModeToggle:l=!0,showCloseButton:c=!0,size:a,asideWidth:d,disableEscapeClose:h=!1,disableBackdropClose:g=!1,lockBodyScroll:m=!0,children:y}=t,[S,C]=u.useState(o),T=s??S,L=be.useMediaQuery("md")?T:"fullscreen",b=u.useCallback(q=>{s===void 0&&C(q),i==null||i(q)},[s,i]),j=u.useRef(null);u.useEffect(()=>{if(!(!r||!m))return j.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=j.current??""}},[r,m]);const I=u.useRef(n);I.current=n,u.useEffect(()=>{if(r)return Ne.registerOverlay({onEscape:h?void 0:()=>I.current()})},[r,h]);const F=u.useMemo(()=>Xt(y,cr),[y]),D=u.useMemo(()=>Xt(y,ar),[y]),O=u.useMemo(()=>Xt(y,dr),[y]),A=u.useMemo(()=>Xt(y,ur),[y]);if(!r)return null;const Y=[He["lyd-panel"],L==="modal"&&He["lyd-modal"],L==="fullscreen"&&He["lyd-fullscreen"],L==="sidebar"&&He["lyd-sidebar"]].filter(Boolean).join(" "),H={"--lyd-max-w":Gc(a),...d!==void 0&&{"--lyd-aside-w":d}},_=()=>{g||n()};return typeof document>"u"?null:sr.createPortal(e.jsxs("div",{className:He["lyd-root"],style:H,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:He["lyd-backdrop"],onClick:_,"aria-hidden":"true"}),e.jsxs("div",{className:Y,children:[e.jsxs("div",{className:He["lyd-header"],children:[e.jsx("div",{className:He["lyd-header-content"],children:F}),e.jsxs("div",{className:He["lyd-header-actions"],children:[l&&e.jsx(qc,{value:T,onChange:b}),c&&e.jsx("button",{type:"button",className:He["lyd-close-btn"],onClick:n,"aria-label":"Close dialog",children:e.jsx(E.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:He["lyd-main"],children:[e.jsx("div",{className:He["lyd-body"],children:D}),O&&e.jsx("aside",{className:He["lyd-aside"],children:O})]}),A&&e.jsx("div",{className:He["lyd-footer"],children:A})]})]}),document.body)}const Ht=Qc;Ht.Header=cr;Ht.Body=ar;Ht.Aside=dr;Ht.Footer=ur;function Uc({url:t,filename:r,onClose:n}){const s=u.useRef(n);return s.current=n,u.useEffect(()=>Ne.registerOverlay({onEscape:()=>s.current()}),[]),e.jsxs("div",{onClick:n,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:o=>o.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:t,download:r,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:n,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:t,alt:r,onClick:o=>o.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:r})]})}const ns="var(--sa-border-subtle, #e5e7eb)",or=()=>e.jsx(x.Box,{style:{width:1,height:22,backgroundColor:ns}}),Jc=t=>typeof t=="number"?`${t}px`:t;function os({count:t,children:r,label:n,onClear:s,clearLabel:o="Clear selection",clearDisabled:i=!1,bottom:l=20,zIndex:c=50,style:a,className:d}){if(t===0)return null;const h=typeof n=="function"?n(t):n??`${t} selected`;return e.jsx(x.Box,{direction:"row",justify:"center",style:{position:"fixed",bottom:Jc(l),left:0,right:0,zIndex:c,pointerEvents:"none"},children:e.jsxs(x.Box,{direction:"row",align:"center",gap:"xs",bg:"white",padding:"spacing-8",className:d,style:{pointerEvents:"auto",borderRadius:10,border:`1px solid ${ns}`,boxShadow:"var(--sa-shadow-xl, 0 10px 25px -5px rgb(0 0 0/0.15))",...a},children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",whiteSpace:"nowrap",style:{paddingInline:6},children:h}),e.jsx(or,{}),r,s&&e.jsxs(e.Fragment,{children:[e.jsx(or,{}),e.jsx(Ee.Tooltip,{label:o,position:"top",children:e.jsx(P.Button,{variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(E.Icon,{name:"Cross",size:"xs"}),"aria-label":o,onClick:s,disabled:i})})]})]})})}os.Divider=or;const xr=t=>{const{variant:r="outlined",overflow:n="hidden",style:s,children:o,...i}=t;return e.jsx(Hr.Card,{variant:r,overflow:n,style:{display:"flex",flexDirection:"column",...s},...i,children:o})},Yc=t=>t==null?void 0:typeof t=="number"?`${t}px`:t,ss=({src:t,alt:r="",height:n=140,bg:s="var(--sa-background-neutral, #f0f1f2)",avatar:o,children:i})=>e.jsxs(x.Box,{style:{position:"relative",marginBottom:o?24:void 0},children:[e.jsx(x.Box,{style:{height:Yc(n),background:t?void 0:s,overflow:"hidden"},children:t?e.jsx("img",{src:t,alt:r,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null}),i?e.jsx(x.Box,{style:{position:"absolute",inset:0,pointerEvents:"none"},children:i}):null,o?e.jsx(x.Box,{style:{position:"absolute",left:16,bottom:0,transform:"translateY(50%)"},children:o}):null]}),is=({avatar:t,title:r,subtitle:n,action:s,divided:o=!1,children:i})=>e.jsx(x.Box,{padding:"md",style:{borderBottom:o?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:i??e.jsxs(ce.Flex,{direction:"row",align:"center",gap:"sm",children:[t,e.jsxs(x.Box,{flex:"1",style:{minWidth:0},children:[r!=null&&e.jsx(w.Text,{fontWeight:"semibold",truncate:!0,children:r}),n!=null&&e.jsx(w.Text,{fontSize:"sm",color:"subtlest",truncate:!0,children:n})]}),s!=null&&e.jsx(x.Box,{style:{flexShrink:0},children:s})]})}),ls=({left:t,right:r,divided:n=!0,children:s})=>e.jsx(x.Box,{padding:"md",style:{marginTop:"auto",borderTop:n?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:s??e.jsxs(ce.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",children:[e.jsx(x.Box,{style:{minWidth:0},children:t}),e.jsx(x.Box,{style:{flexShrink:0},children:r})]})});xr.Media=ss;xr.Header=is;xr.Footer=ls;const Xc=t=>{const{defaultTab:r=0,paramKey:n="tab"}=t||{},{useSearchParams:s}=st(),[o,i]=s(),l=kt.searchParamsToObject(o.toString());return{activeTab:l[n]?parseInt(l[n]):r,handleTabChange:d=>{i({...l,[n]:d.toString()})},searchQueries:l}};function $c({appName:t,menuConfig:r,formatTitle:n}){const{useLocation:s}=st(),o=s();u.useEffect(()=>{let i=null,l=null;for(const d of r){const h=d.items.find(g=>g.to?g.to==="/"?o.pathname==="/":!!(g.to===o.pathname||o.pathname.startsWith(g.to+"/")):!1);if(h){i=h,l=d;break}}const c=[];i!=null&&i.title&&c.push(i.title),l!=null&&l.name&&c.push(l.name.toTitleCase());const a=(d,h)=>d.length>0?`${d.join(" - ")} | ${h}`:h;document.title=(n||a)(c,t)},[o.pathname])}const Kc=()=>{const{useSearchParams:t,useParams:r,useLocation:n}=st(),[s,o]=t(),i=kt.searchParamsToObject(s.toString()),l=r(),c=n(),a=l.id;return{setSearchParams:o,searchParams:s,searchQueries:i,isHasQuery:(y,S)=>s.has(y)&&s.get(y)===S,getQueryParam:y=>s.get(y),getRouteParam:y=>l[y],params:l,location:c,id:a,hasId:!!a}};function ea(t){var s,o;const r=t.decodedAccessToken;return u.useMemo(()=>{var a,d;const i=((d=(a=r==null?void 0:r.access)==null?void 0:a.role)==null?void 0:d.code)??"",l=Object.keys(t.role).reduce((h,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,y=>y.replace("_","").toUpperCase())}`;return{...h,[m]:!1}},{});return{...Object.keys(t.role).reduce((h,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,y=>y.replace("_","").toUpperCase())}`;return{...h,[m]:i===t.role[g]}},l),hasRole:h=>i===t.role[h],getRoleKey:()=>i}},[(o=(s=r==null?void 0:r.access)==null?void 0:s.role)==null?void 0:o.code,t])}exports.ASIDE_WIDTH_VAR=Qr;exports.AdvanceFilterBar=Io;exports.App=Ts;exports.AppComponent=go;exports.AppContext=Jr;exports.AppLayout=Hs;exports.AsideBar=Bc;exports.BackButton=Vs;exports.ColumnFilterDropdown=Go;exports.ColumnHeaderFilter=ll;exports.ColumnMenu=Yo;exports.ConfirmationDialog=Pc;exports.DataTable=Qo;exports.DecisionWrapper=de;exports.EachUtils=lr;exports.EmptyStatePage=Tc;exports.EntityCard=xr;exports.EntityCardFooter=ls;exports.EntityCardHeader=is;exports.EntityCardMedia=ss;exports.FLOATING_FOOTER_HEIGHT_VAR=Ur;exports.FilterBar=Ui;exports.FilterDrawer=Mo;exports.FloatingFooter=Fc;exports.ForbiddenPage=Wc;exports.Form=pc;exports.FullSection=Vc;exports.HeaderLeftSlot=Rs;exports.HeaderLeftSlotOutlet=jo;exports.HeaderLeftSlotProvider=yo;exports.Highlight=Xo;exports.HorizontalField=Gs;exports.ImagePreview=Uc;exports.InputFile=Ko;exports.InputImage=es;exports.LayoutDialog=Ht;exports.LayoutDialogAside=dr;exports.LayoutDialogBody=ar;exports.LayoutDialogFooter=ur;exports.LayoutDialogHeader=cr;exports.ModuleSwitcher=Ns;exports.ModuleSwitcherModal=Co;exports.NotFoundPage=Oc;exports.PageLayout=Js;exports.Pressable=Wt;exports.RightDrawer=wo;exports.SIDEBAR_DEFAULT_WIDTH=Xr;exports.SIDEBAR_MAX_WIDTH=Kr;exports.SIDEBAR_MIN_WIDTH=$r;exports.ScrollToTopButton=ts;exports.Section=ei;exports.SectionFooter=on;exports.SectionHeader=nn;exports.SelectButton=Nc;exports.SelectionActionBar=os;exports.SelectionActionBarDivider=or;exports.ServerErrorPage=Hc;exports.SidePanel=Sc;exports.SidePanelItem=Cc;exports.SidebarBadgesProvider=co;exports.SidebarGroupSlot=Os;exports.SidebarGroupSlotOutlet=_r;exports.SidebarGroupSlotProvider=bo;exports.SidebarHeaderSlot=po;exports.SidebarProvider=xo;exports.StarasiaRouterProvider=mo;exports.TableFooter=Zo;exports.TableHeader=qo;exports.TableLayout=El;exports.TableSection=fl;exports.TableWrapper=_o;exports.ToggleStatus=gc;exports.Typography=Ye;exports.VerticalField=Mc;exports.clearModuleSelection=As;exports.createInitialFromUserName=Rl;exports.cssVars=Pl;exports.expandDateCompact=cl;exports.formHasChanged=Gl;exports.formatDate=zl;exports.formatDateToIndonesian=$o;exports.formatRupiah=Al;exports.getDateFilterValue=Fo;exports.getDateRangeFilterValue=gi;exports.getInitials=Wl;exports.getValueDropdownMultipleFilter=Eo;exports.getValueRadioFilter=mi;exports.getValueSearch=ir;exports.getValuesFilter=Kt;exports.handleChangeFilter=At;exports.handleOnScroll=tc;exports.isColumnFilterActive=No;exports.isEmail=$l;exports.isFilterActive=pi;exports.isOnlyLettersAndSpaces=Ul;exports.isPhoneNumber=Ql;exports.isSlug=Kl;exports.localStorageAdapter=ln;exports.oneDayInMs=Vl;exports.parseIndonesianDateToDate=Ol;exports.preventNonCoordinateInput=ec;exports.preventNonNumberAndDecimalInput=Xl;exports.preventNonNumberInput=Jl;exports.preventNumberInput=Yl;exports.resolveDateRangeValueToString=ko;exports.resolveDateValueToString=Bo;exports.resolveDropdownValueToString=Do;exports.resolveRadioValueToString=So;exports.resolveSidebarBadge=$t;exports.storageKeys=Et;exports.textWidth=Nl;exports.useApp=Yr;exports.useAppState=io;exports.useAuthRole=ea;exports.useCoarsePointer=Jo;exports.useDynamicTitle=$c;exports.useFilterBarApiParams=$i;exports.useFilterBarControls=el;exports.useModuleSelection=rn;exports.useRouteInfo=_e;exports.useRouteParams=Kc;exports.useRouterAdapter=st;exports.useSidebar=ho;exports.useSidebarBadges=ao;exports.useTabState=Xc;exports.useTableSortApiParams=Fl;Object.keys(bn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>bn[t]})});Object.keys(er).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>er[t]})});Object.keys(dt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>dt[t]})});Object.keys(x).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>x[t]})});Object.keys(wt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>wt[t]})});Object.keys(P).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>P[t]})});Object.keys(Hr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Hr[t]})});Object.keys(gt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>gt[t]})});Object.keys(Ne).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ne[t]})});Object.keys(tr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>tr[t]})});Object.keys(St).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>St[t]})});Object.keys(be).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>be[t]})});Object.keys(kt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>kt[t]})});Object.keys(ot).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ot[t]})});Object.keys(R).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>R[t]})});Object.keys(Rt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Rt[t]})});Object.keys(Tt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Tt[t]})});Object.keys(G).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>G[t]})});Object.keys(vn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>vn[t]})});Object.keys(Pr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Pr[t]})});Object.keys(Dt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Dt[t]})});Object.keys(Cn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Cn[t]})});Object.keys(Bt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Bt[t]})});Object.keys(Ee).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ee[t]})});Object.keys(nt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>nt[t]})});Object.keys(Vr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Vr[t]})});Object.keys(w).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>w[t]})});Object.keys(E).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>E[t]})});Object.keys(ce).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ce[t]})});Object.keys(wn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>wn[t]})});Object.keys(Dn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Dn[t]})});Object.keys(Sn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Sn[t]})});Object.keys(kn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>kn[t]})});Object.keys(Bn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Bn[t]})});Object.keys(Je).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Je[t]})});Object.keys(En).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>En[t]})});
|
|
103
|
+
`;function Cc(){if(typeof document>"u"||document.getElementById(no))return;const t=document.createElement("style");t.id=no,t.textContent=vc,document.head.appendChild(t)}const wc=({active:t=!1,accentSide:r="left",onClick:n,title:s,badge:o,heading:i,meta:l,children:c,divider:a=!0,disabled:d,className:h,style:g,"aria-label":m})=>(u.useEffect(Cc,[]),e.jsx("button",{type:"button",className:[Ze,h].filter(Boolean).join(" "),"data-active":t?"true":"false","data-accent":r,"data-divider":a?"true":"false","aria-current":t?"true":void 0,"aria-label":m,disabled:d,onClick:n,style:g,children:c??e.jsxs(x.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(s||o)&&e.jsxs(ce.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[s?e.jsx(w.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:s}):e.jsx("span",{}),o?e.jsx(x.Box,{style:{flexShrink:0},children:o}):null]}),i?e.jsx(w.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:i}):null,l?e.jsx(w.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:l}):null]})})),Wr=18,Dc=40,oo="280ms cubic-bezier(0.4, 0, 0.2, 1)",ns="var(--sa-border-subtle, #0b120e24)",Sc=`1px solid ${ns}`,so="var(--sa-background-white, #ffffff)",kc=({children:t,header:r,collapsed:n,defaultCollapsed:s=!1,onToggle:o,width:i=337,side:l="left",offsetTop:c="var(--app-header-height, 4rem)",height:a,showToggle:d=!0,togglePosition:h="top",toggleOffset:g=40,toggleLabel:m,style:y,bodyStyle:S,className:C,pageLayout:L,overlay:M="mobile",wrapperProps:T,contentProps:b})=>{const j=be.useMediaQuery("md"),I=n!==void 0,[F,D]=u.useState(s),O=I?n:F,A=()=>{const ie=!O;I||D(ie),o==null||o(ie)},Y=l==="left",P=typeof c=="number"?`${c}px`:c,_=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${P})`,q=m??{collapse:"Collapse panel",expand:"Expand panel"},X=h==="center"?{top:"50%",transform:"translateY(-50%)"}:h==="bottom"?{bottom:g}:{top:g},K=O?Y?"ChevronRight":"ChevronLeft":Y?"ChevronLeft":"ChevronRight",Q=L!==void 0&&(M==="mobile"?!j:M),Z=Q?{position:"absolute",top:0,bottom:0,width:i,transform:`translateX(${O?Y?"-100%":"100%":"0"})`,transition:`transform ${oo}`,zIndex:50,...Y?{left:0}:{right:0},...y}:{position:"sticky",top:P,alignSelf:"flex-start",width:O?0:i,flexShrink:0,height:_,transition:`width ${oo}`,...y},z=e.jsxs(x.Box,{className:C,style:Z,children:[e.jsx(x.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:O?void 0:Y?"border-solid-r":"border-solid-l",borderWidth:O?void 0:Y?"border-r":"border-l",style:{backgroundColor:so,borderColor:ns},children:e.jsxs(x.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:i,customMinWidth:i,style:Y?void 0:{marginLeft:"auto"},children:[r?e.jsx(x.Box,{padding:"md",style:{flexShrink:0},children:r}):null,e.jsx(x.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...S},children:t})]})}),d&&e.jsx(Wt,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:A,"aria-label":O?q.expand:q.collapse,"aria-expanded":!O,"aria-pressed":O,customWidth:Wr,customHeight:Dc,style:{...X,backgroundColor:so,border:Sc,zIndex:5,...Y?{right:-Wr,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-Wr,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(B.Icon,{name:K,size:"sm"})})]});return L===void 0?z:e.jsxs(x.Box,{direction:"row",position:"relative",...T,style:{height:`calc(100vh - ${P})`,overflow:"hidden",...(T==null?void 0:T.style)??{}},children:[!Q&&Y?z:null,e.jsx(x.Box,{display:"block",...b,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(b==null?void 0:b.style)??{}},children:L}),!Q&&!Y?z:null,Q&&e.jsxs(e.Fragment,{children:[!O&&e.jsx("div",{onClick:A,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),z]})]})},Qr="--app-aside-width",Bc=t=>typeof t=="number"?`${t}px`:t,Ec=({pageLayout:t,children:r,wrapperProps:n,containerProps:s})=>{const o=be.useMediaQuery("md"),i=(s==null?void 0:s.customWidth)??264;return u.useLayoutEffect(()=>{const l=document.documentElement;return l.style.setProperty(Qr,o?Bc(i):"0px"),()=>l.style.removeProperty(Qr)},[o,i]),e.jsxs(x.Box,{display:"block",direction:"row",...n,style:{marginRight:o?i:24,...(n==null?void 0:n.style)??{}},children:[t,e.jsx(x.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",...s,style:{marginTop:"var(--app-header-height, 4rem)",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(s==null?void 0:s.style)??{}},children:r})]})},Ur="--sa-floating-footer-height",Fc=t=>typeof t=="number"?`${t}px`:t,Mc=({children:t,withScrollToTopButton:r=!1,scrollToTopButtonProps:n,respectAside:s=!1,offsetRight:o,containerProps:i})=>{const l=u.useRef(null),c=o!=null?Fc(o):s?"var(--app-aside-width, 0px)":"0px";return u.useLayoutEffect(()=>{const a=document.documentElement,d=()=>{var m;const g=((m=l.current)==null?void 0:m.getBoundingClientRect().height)??0;a.style.setProperty(Ur,`${g}px`)};d();const h=new ResizeObserver(d);return l.current&&h.observe(l.current),()=>{h.disconnect(),a.style.removeProperty(Ur)}},[]),e.jsx(x.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(x.Box,{ref:l,position:"fixed",bottom:"bottom-0",bg:"white",direction:"row",align:"center",display:"flex",paddingBlock:"sm",paddingInline:"md",borderColor:"border-subtle",style:{left:"var(--app-sidebar-width, 0px)",right:c,transition:"left 0.3s ease-in-out, right 0.3s ease-in-out"},justify:(i==null?void 0:i.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[r&&e.jsx(rs,{...n,customBottom:(n==null?void 0:n.customBottom)||"5.7rem"}),t]})})},Ic=({fields:t})=>e.jsx(x.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(lr,{of:t,render:(r,n)=>e.jsx(Tc,{...r},n)})}),Tc=({title:t,value:r,icon:n})=>e.jsxs(x.Box,{display:"flex",direction:"column",gap:"sm",children:[n?e.jsxs(x.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(B.Icon,{name:n,color:"subtle"}),e.jsx(w.Text,{color:"gray-500",variant:"sub-h3",children:t})]}):e.jsx(w.Text,{color:"gray-500",variant:"sub-h3",children:t}),typeof r=="string"?e.jsx(w.Text,{variant:"sub-h3",children:r}):r]}),Le={silhouette:"#A7B0AC",accent:"#78867F"};function Lc({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t||"100",height:r||"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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.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:Le.accent,fillOpacity:"0.65"})]})})}const Rc=({title:t="create",children:r,onClickAction:n,variant:s="primary",variantTitle:o,leftIcon:i,showButton:l=!0,customHeight:c,childrenButton:a,customIcon:d})=>{const h=()=>{switch(s){case"primary":return e.jsx(e.Fragment,{children:i?e.jsx(H.Button,{primary:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(H.Button,{primary:!0,onClick:n,children:a||t})});case"secondary":return e.jsx(e.Fragment,{children:i?e.jsx(H.Button,{secondary:!0,iconLeft:i,onClick:n,children:o?e.jsx(w.Text,{fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||t}):t}):e.jsx(H.Button,{secondary:!0,onClick:n,children:a||t})});case"success":return e.jsx(e.Fragment,{children:i?e.jsx(H.Button,{success:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(H.Button,{success:!0,onClick:n,children:a||t})});default:return e.jsx(e.Fragment,{children:i?e.jsx(H.Button,{primary:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(H.Button,{primary:!0,onClick:n,children:a||t})})}};return e.jsxs(x.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:c,children:[d||e.jsx(Lc,{}),e.jsx(x.Box,{direction:"column",children:r.map((g,m)=>e.jsx(Ye.Body1,{props:{align:"center",textAlign:"center"},children:m>2?null:g},m))}),l?h():null]})},te={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function Oc({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:te.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("path",{d:"M233.438 165.217C233.438 132.764 239.035 107.198 250.231 88.5189C261.596 69.8396 279.832 60.5 304.938 60.5C330.043 60.5 348.194 69.8396 359.389 88.5189C370.755 107.198 376.438 132.764 376.438 165.217C376.438 198.047 370.755 223.802 359.389 242.481C348.194 261.16 330.043 270.5 304.938 270.5C279.832 270.5 261.596 261.16 250.231 242.481C239.035 223.802 233.438 198.047 233.438 165.217ZM333.69 165.217C333.69 146.16 331.824 131.538 328.092 121.349C324.36 110.972 316.642 105.783 304.938 105.783C293.233 105.783 285.515 110.972 281.783 121.349C278.051 131.538 276.185 146.16 276.185 165.217C276.185 178.047 276.863 188.708 278.22 197.198C279.577 205.5 282.292 212.292 286.363 217.575C290.604 222.67 296.795 225.217 304.938 225.217C313.08 225.217 319.187 222.67 323.258 217.575C327.499 212.292 330.298 205.5 331.655 197.198C333.012 188.708 333.69 178.047 333.69 165.217Z",fill:te.cD0E5F7}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.4375 235.124V194.28L138.96 60.5H192.466V191.32H215.438V235.124H192.466V249.5H144.563V235.124H50.4375ZM100.862 191.32L147.925 116.143V191.32H100.862Z",fill:te.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M394.438 235.124V194.28L482.96 60.5H536.466V191.32H559.438V235.124H536.466V249.5H488.563V235.124H394.438ZM444.862 191.32L491.925 116.143V191.32H444.862Z",fill:te.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:te.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:te.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:te.c98B4CB}),e.jsx("path",{d:"M244.719 200.89V264.5H363.574V200.89M244.719 200.89H233.438L244.719 186.396M244.719 200.89H363.574M363.574 200.89H372.437L363.574 186.396M244.719 186.396L261.64 171.5M244.719 186.396H261.64M363.574 186.396L349.472 171.5M363.574 186.396H349.472M261.64 171.5H349.472M261.64 171.5V186.396M349.472 171.5V186.396M349.472 186.396H261.64",stroke:te.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:te.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:te.cFFFFFF}),e.jsx("path",{d:"M332.438 129.846C332.438 141.175 329.183 152.403 323.949 160.772C318.699 169.168 311.592 174.5 303.938 174.5C296.283 174.5 289.176 169.168 283.926 160.772C278.692 152.403 275.438 141.175 275.438 129.846C275.438 118.458 277.838 109.628 282.543 103.663C287.216 97.7387 294.274 94.5 303.938 94.5C313.601 94.5 320.659 97.7387 325.332 103.663C330.037 109.628 332.438 118.458 332.438 129.846Z",fill:te.cFFFFFF,stroke:te.c000000,strokeWidth:"2"}),e.jsx("path",{d:"M281.438 145.5C284.032 154.136 285.762 158.682 290.951 164.591M292.681 166.409C293.624 167.647 295.708 169.591 297.438 170.5",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.438 175C299.54 176.339 297.208 177.876 293.938 182.5M304.438 175C301.183 178.041 299.537 178.883 299.438 182.5M304.438 175C308.173 177.107 309.635 178.834 311.438 182.5",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.936 175.5C303.438 180 302.529 181.628 304.936 186.5",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.178 120.981C289.969 120.93 290.921 121.313 292.167 122.754",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:te.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:te.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:te.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:te.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:te.c001A72,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M265.437 115.5L260.438 120.5M260.438 115.5L265.438 120.5",stroke:te.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.437 87.5L283.438 92.5M283.438 87.5L288.438 92.5",stroke:te.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M305.437 83.5L298.438 90.5M298.438 83.5L305.438 90.5",stroke:te.c001A72,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M342.437 145.5L337.438 150.5M337.438 145.5L342.438 150.5",stroke:te.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:te.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:te.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:te.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:te.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:te.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:te.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:te.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:te.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:te.c001A72})]})})}function Ac({onClick:t}){const r=be.useMediaQuery("md");return e.jsxs(x.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Oc,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(w.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),t&&e.jsx(H.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const se={c46F16B:"#46F16B",c48504C:"#48504C",c64B5F6:"#64B5F6",c67AEE6:"#67AEE6",c86512B:"#86512B",c956847:"#956847",cBBC3F5:"#BBC3F5",cBBDEFB:"#BBDEFB",cC0B2A2:"#C0B2A2",cC8CEF4:"#C8CEF4",cCABEB1:"#CABEB1",cD5C7BD:"#D5C7BD",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cE5EE80:"#E5EE80",cEE8080:"#EE8080",cEFF3F8:"#EFF3F8",cF4F4F4:"#F4F4F4",cFFFFFF:"#FFFFFF"};function Wc({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M75 238.124V197.28L163.523 63.5H217.029V194.32H240V238.124H217.029V252.5H169.126V238.124H75ZM125.424 194.32L172.487 119.143V194.32H125.424Z",fill:se.cBBDEFB,fillOpacity:"0.6"}),e.jsxs("g",{clipPath:"url(#clip0_2949_9690)",children:[e.jsx("path",{d:"M334.5 274.5C381.168 274.5 419 227.266 419 169C419 110.734 381.168 63.5 334.5 63.5C287.832 63.5 250 110.734 250 169C250 227.266 287.832 274.5 334.5 274.5Z",fill:se.cEFF3F8,stroke:se.c67AEE6,strokeWidth:"5"}),e.jsx("path",{d:"M413 197.5C411.397 211.835 402.919 230.898 389.361 246.49C375.596 262.32 356.651 274.5 334.496 274.5C311.331 274.5 292.389 261.672 278.878 245.52C265.592 229.638 257.606 210.603 256 197.5H413Z",fill:se.cD5C7BD}),e.jsx("path",{d:"M278.887 211.766H391.104L392.583 222.856C392.687 223.635 392.08 224.328 391.294 224.328H277.961C277.14 224.328 276.525 223.577 276.686 222.773L278.887 211.766Z",fill:se.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:se.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:se.c956847,stroke:se.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:se.c956847,stroke:se.c48504C}),e.jsx("path",{d:"M285.902 212.103L284.935 186.306H279.606C278.151 186.306 277.004 187.542 277.113 188.993L278.673 209.79C278.77 211.095 279.857 212.103 281.166 212.103H285.902Z",fill:se.cC8CEF4,stroke:se.c48504C}),e.jsx("path",{d:"M383.256 212.103L384.638 186.306H389.556C391.007 186.306 392.153 187.537 392.05 188.984L390.564 209.782C390.471 211.09 389.382 212.103 388.07 212.103H383.256Z",fill:se.cC8CEF4,stroke:se.c48504C}),e.jsx("path",{d:"M284.497 178.155C284.455 176.194 286.034 174.581 287.996 174.581H381.904C383.895 174.581 385.485 176.24 385.401 178.23L384.066 209.59C383.987 211.463 382.445 212.941 380.569 212.941H288.663C286.759 212.941 285.205 211.419 285.164 209.515L284.497 178.155Z",fill:se.cC8CEF4,stroke:se.c48504C}),e.jsx("path",{d:"M284.845 181.524C284.792 179.279 286.598 177.431 288.844 177.431H380.687C382.948 177.431 384.76 179.304 384.684 181.565L383.774 208.737C383.701 210.893 381.933 212.603 379.776 212.603H289.48C287.307 212.603 285.532 210.869 285.481 208.697L284.845 181.524Z",fill:se.cBBC3F5}),e.jsx("mask",{id:"mask0_2949_9690",maskUnits:"userSpaceOnUse",x:"301",y:"144",width:"68",height:"17",style:{maskType:"luminance"},children:e.jsx("path",{d:"M301 146.5C301 145.395 301.887 144.5 302.98 144.5H367.02C368.114 144.5 369 145.395 369 146.5V160.411H301V146.5Z",fill:se.cFFFFFF})}),e.jsxs("g",{mask:"url(#mask0_2949_9690)",children:[e.jsx("path",{d:"M301 146.191C301 145.257 301.748 144.5 302.671 144.5H356.701C357.624 144.5 358.372 145.257 358.372 146.191V157.949H301V146.191Z",fill:se.cFFFFFF}),e.jsx("path",{d:"M301.336 146.607C301.336 145.673 302.08 144.916 302.999 144.916H367.01C367.929 144.916 368.673 145.673 368.673 146.607V152.523H301.336V146.607Z",fill:se.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:se.cF4F4F4}),e.jsx("path",{d:"M307.685 150.417C308.607 150.417 309.356 149.66 309.356 148.726C309.356 147.793 308.607 147.036 307.685 147.036C306.762 147.036 306.014 147.793 306.014 148.726C306.014 149.66 306.762 150.417 307.685 150.417Z",fill:se.cEE8080}),e.jsx("path",{d:"M313.532 150.417C314.455 150.417 315.203 149.66 315.203 148.726C315.203 147.793 314.455 147.036 313.532 147.036C312.609 147.036 311.861 147.793 311.861 148.726C311.861 149.66 312.609 150.417 313.532 150.417Z",fill:se.cE5EE80}),e.jsx("path",{d:"M318.546 150.417C319.469 150.417 320.217 149.66 320.217 148.726C320.217 147.793 319.469 147.036 318.546 147.036C317.623 147.036 316.875 147.793 316.875 148.726C316.875 149.66 317.623 150.417 318.546 150.417Z",fill:se.c46F16B})]}),e.jsx("path",{d:"M301.16 146C301.16 145.172 301.832 144.5 302.66 144.5H367.33C368.159 144.5 368.83 145.172 368.83 146V174.419H301.16V146Z",stroke:se.c48504C}),e.jsx("path",{d:"M395.29 207.579H423.344M354.255 236.889H369.329M327.038 222.234H347.556M350.905 222.234H358.024M288.097 230.19H304.846M253.344 210.091H272.605M278.467 246.938H295.216M297.309 246.938H303.59M337.088 252.801H354.255",stroke:se.c86512B,strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("path",{d:"M430.241 125.78C430.987 105.807 437.521 90.4065 449.841 79.5799C462.161 68.7532 478.867 63.3398 499.961 63.3398C513.961 63.3398 525.907 65.7665 535.801 70.6199C545.881 75.4732 553.441 82.0998 558.481 90.4998C563.707 98.8998 566.321 108.327 566.321 118.78C566.321 131.1 563.241 141.18 557.081 149.02C550.921 156.673 543.734 161.9 535.521 164.7V165.82C546.161 169.367 554.561 175.247 560.721 183.46C566.881 191.673 569.961 202.22 569.961 215.1C569.961 226.673 567.254 236.94 561.841 245.9C560.436 248.258 558.849 250.481 557.081 252.569L443.5 252.662C432.5 241 427.721 230.5 427.721 207.82H474.201C474.387 216.033 476.721 222.567 481.201 227.42C485.681 232.087 492.214 234.42 500.801 234.42C508.081 234.42 513.681 232.367 517.601 228.26C521.707 223.967 523.761 218.367 523.761 211.46C523.761 202.5 520.867 196.06 515.081 192.14C509.481 188.033 500.427 185.98 487.921 185.98H478.961V147.06H487.921C497.441 147.06 505.094 145.473 510.881 142.3C516.854 138.94 519.841 133.06 519.841 124.66C519.841 117.94 517.974 112.713 514.241 108.98C510.507 105.247 505.374 103.38 498.841 103.38C491.747 103.38 486.427 105.527 482.881 109.82C479.521 114.113 477.561 119.433 477.001 125.78H430.241Z",fill:se.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:se.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:se.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_2949_9690",children:e.jsx("rect",{width:"179",height:"192",fill:se.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function zc({onClick:t}){const r=be.useMediaQuery("md");return e.jsxs(x.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Wc,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",children:"We Are Sorry ..."}),t&&e.jsx(H.Button,{size:r?"md":"xs",onClick:t,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 Hc({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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 Pc({onClick:t}){const r=be.useMediaQuery("md");return e.jsxs(x.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Hc,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(w.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),t&&e.jsx(H.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const Vc=t=>{var n,s,o,i,l;const r=be.useMediaQuery("md");return e.jsxs(Re.Dialog,{isShow:t.isShow,onHide:t.onHide,style:{...r?{minWidth:t.customMinWidth||"458px"}:{maxWidth:t.customMinWidth||"458px"}},children:[e.jsx(Re.DialogTitle,{...t.dialogTitleProps,children:typeof t.title=="string"?e.jsx(w.Text,{fontSize:"lg",fontWeight:"medium",children:t.title}):t.title}),e.jsx(Re.DialogBody,{children:typeof t.description=="string"?e.jsx(w.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:t.description}):t.description}),e.jsx(Re.DialogFooter,{children:e.jsx(x.Box,{display:"flex",direction:((n=t.containerConfirmBtnProps)==null?void 0:n.direction)||"row",justify:((s=t.containerConfirmBtnProps)==null?void 0:s.justify)||"flex-end",...t.containerConfirmBtnProps,children:e.jsxs(x.Box,{display:"flex",direction:((o=t.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((i=t.wrapperConfirmBtnProps)==null?void 0:i.justify)||"flex-end",gap:((l=t.wrapperConfirmBtnProps)==null?void 0:l.gap)||"sm",...t.wrapperConfirmBtnProps,children:[t.onCancel&&e.jsx(H.Button,{secondary:!0,onClick:t.onCancel,size:"md",fullWidth:!0,children:t.titleCancelBtn||"Cancel"}),e.jsx(x.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(H.Button,{...t.buttonConfirmProps,onClick:t.onConfirm,size:"md",fullWidth:!0,children:t.titleConfirmBtn||"Ok"})})]})})})]},t.key)},Nc=u.memo(({children:t,height:r,minHeight:n,customHeight:s,paddingInline:o="spacing-0",paddingBlock:i="spacing-0",header:l,footer:c,title:a,titleTag:d,action:h,actionContainer:g,containerProps:m,bodyProps:y,headerProps:S={borderBottom:!0},footerProps:C={borderTop:!0},variantTag:L="info"})=>{const M=u.useRef(null),[T,b]=u.useState("100vh");u.useEffect(()=>{const D=()=>{if(M.current){const O=M.current.getBoundingClientRect().top;b(`calc(100vh - ${O}px)`)}};return D(),window.addEventListener("resize",D),()=>window.removeEventListener("resize",D)},[]);const j=()=>d?e.jsxs(x.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(w.Text,{fontWeight:"medium",children:a}),e.jsx(dt.Badges,{border:!0,text:d,variant:L})]}):e.jsx(w.Text,{fontWeight:"medium",children:a}),I=()=>l||e.jsxs(x.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(x.Box,{direction:"column",children:a?j():null}),e.jsx(x.Box,{direction:"column",...g,children:h??null})]}),F=!!(l||a||h);return e.jsxs(x.Box,{ref:M,height:r,customMinHeight:n,customHeight:s,paddingBlock:i,paddingInline:o,bg:"white",direction:"column",...m,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:T,...(m==null?void 0:m.style)??{}},children:[l!==null&&F?e.jsx(nn,{...S,children:I()}):null,e.jsx(x.Box,{direction:"column",padding:"spacing-0",...y,style:{flex:1,overflow:"auto",...(y==null?void 0:y.style)??{}},children:t}),c?e.jsx(on,{...C,children:c}):null]})}),_c=u.memo(({value:t,options:r=[],onChange:n,multiple:s})=>{const o=(t==null?void 0:t.map(c=>c.value))||[],i=(r==null?void 0:r.filter(c=>o.includes(c.value)))||[],l=c=>{const a=[...i];let d=[];s?d=o.includes(c.value)?a.filter(h=>h.value!==c.value):[...a,c]:d=[c],n==null||n(d)};return e.jsx(x.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:r==null?void 0:r.map((c,a)=>e.jsx(H.Button,{...o.includes(c.value)?{primary:!0}:{secondary:!0},onClick:()=>l(c),children:c.label},a))})});function cr(t){return null}cr.displayName="LayoutDialog.Header";function ar(t){return null}ar.displayName="LayoutDialog.Body";function dr(t){return null}dr.displayName="LayoutDialog.Aside";function ur(t){return null}ur.displayName="LayoutDialog.Footer";const Pe={"lyd-root":"_lyd-root_1g78i_1","lyd-backdrop":"_lyd-backdrop_1g78i_38","lyd-panel":"_lyd-panel_1g78i_47","lyd-modal":"_lyd-modal_1g78i_58","lyd-fullscreen":"_lyd-fullscreen_1g78i_72","lyd-sidebar":"_lyd-sidebar_1g78i_80","lyd-header":"_lyd-header_1g78i_110","lyd-header-content":"_lyd-header-content_1g78i_121","lyd-header-actions":"_lyd-header-actions_1g78i_129","lyd-main":"_lyd-main_1g78i_136","lyd-body":"_lyd-body_1g78i_143","lyd-aside":"_lyd-aside_1g78i_149","lyd-footer":"_lyd-footer_1g78i_165","lyd-vm-group":"_lyd-vm-group_1g78i_178","lyd-vm-btn":"_lyd-vm-btn_1g78i_186","lyd-close-btn":"_lyd-close-btn_1g78i_209"},qc=[{mode:"sidebar",label:"Sidebar",renderIcon:()=>e.jsx(Gc,{})},{mode:"modal",label:"Modal",renderIcon:()=>e.jsx(B.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",renderIcon:()=>e.jsx(B.Icon,{name:"Fullscreen",size:"sm"})}];function Zc({value:t,onChange:r}){return e.jsx("div",{className:Pe["lyd-vm-group"],role:"group","aria-label":"View mode",children:qc.map(n=>e.jsx("button",{type:"button",className:Pe["lyd-vm-btn"],"data-active":t===n.mode,"aria-label":`Switch to ${n.label} view`,"aria-pressed":t===n.mode,onClick:()=>r(n.mode),children:n.renderIcon()},n.mode))})}function Gc(){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 zr={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Qc(t){return t?t in zr?zr[t]:t:zr.xl}function Xt(t,r){let n=null;return u.Children.forEach(t,s=>{u.isValidElement(s)&&s.type===r&&(n=s.props.children??null)}),n}function Uc(t){const{isOpen:r,onClose:n,viewMode:s,defaultViewMode:o="modal",onViewModeChange:i,showViewModeToggle:l=!0,showCloseButton:c=!0,size:a,asideWidth:d,disableEscapeClose:h=!1,disableBackdropClose:g=!1,lockBodyScroll:m=!0,children:y}=t,[S,C]=u.useState(o),L=s??S,T=be.useMediaQuery("md")?L:"fullscreen",b=u.useCallback(q=>{s===void 0&&C(q),i==null||i(q)},[s,i]),j=u.useRef(null);u.useEffect(()=>{if(!(!r||!m))return j.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=j.current??""}},[r,m]);const I=u.useRef(n);I.current=n,u.useEffect(()=>{if(r)return Re.registerOverlay({onEscape:h?void 0:()=>I.current()})},[r,h]);const F=u.useMemo(()=>Xt(y,cr),[y]),D=u.useMemo(()=>Xt(y,ar),[y]),O=u.useMemo(()=>Xt(y,dr),[y]),A=u.useMemo(()=>Xt(y,ur),[y]);if(!r)return null;const Y=[Pe["lyd-panel"],T==="modal"&&Pe["lyd-modal"],T==="fullscreen"&&Pe["lyd-fullscreen"],T==="sidebar"&&Pe["lyd-sidebar"]].filter(Boolean).join(" "),P={"--lyd-max-w":Qc(a),...d!==void 0&&{"--lyd-aside-w":d}},_=()=>{g||n()};return typeof document>"u"?null:sr.createPortal(e.jsxs("div",{className:Pe["lyd-root"],style:P,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:Pe["lyd-backdrop"],onClick:_,"aria-hidden":"true"}),e.jsxs("div",{className:Y,children:[e.jsxs("div",{className:Pe["lyd-header"],children:[e.jsx("div",{className:Pe["lyd-header-content"],children:F}),e.jsxs("div",{className:Pe["lyd-header-actions"],children:[l&&e.jsx(Zc,{value:L,onChange:b}),c&&e.jsx("button",{type:"button",className:Pe["lyd-close-btn"],onClick:n,"aria-label":"Close dialog",children:e.jsx(B.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:Pe["lyd-main"],children:[e.jsx("div",{className:Pe["lyd-body"],children:D}),O&&e.jsx("aside",{className:Pe["lyd-aside"],children:O})]}),A&&e.jsx("div",{className:Pe["lyd-footer"],children:A})]})]}),document.body)}const Ht=Uc;Ht.Header=cr;Ht.Body=ar;Ht.Aside=dr;Ht.Footer=ur;function Jc({url:t,filename:r,onClose:n}){const s=u.useRef(n);return s.current=n,u.useEffect(()=>Re.registerOverlay({onEscape:()=>s.current()}),[]),e.jsxs("div",{onClick:n,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:o=>o.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:t,download:r,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:n,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:t,alt:r,onClick:o=>o.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:r})]})}const Yc=/\.(jpe?g|png|gif|webp|bmp|svg|avif)(\?|#|$)/i,Xc=/\.pdf(\?|#|$)/i,$c=/\.(mp4|webm|ogv|mov|m4v)(\?|#|$)/i,Kc=/\.(mp3|wav|ogg|m4a|aac|flac)(\?|#|$)/i;function ea(t,r){if(r)return r;const n=t.mimeType??"",s=t.fileUrl??"";return n.startsWith("image/")||Yc.test(s)?"image":n==="application/pdf"||Xc.test(s)?"pdf":n.startsWith("video/")||$c.test(s)?"video":n.startsWith("audio/")||Kc.test(s)?"audio":"other"}const io={display:"block",maxWidth:"100%",maxHeight:"70vh",margin:"0 auto",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)"},ta={width:"100%",height:"75vh",border:"none",borderRadius:"var(--sa-radii-sm, 6px)"};function ra({kind:t,attachment:r,openLabel:n,unsupportedLabel:s}){const{fileUrl:o,fileName:i}=r;switch(t){case"image":return e.jsx("img",{src:o,alt:i,style:io});case"pdf":return e.jsx("iframe",{src:o,title:i,style:ta});case"video":return e.jsx("video",{src:o,controls:!0,style:{...io,width:"100%"}});case"audio":return e.jsx(x.Box,{padding:"lg",align:"center",justify:"center",fullWidth:!0,children:e.jsx("audio",{src:o,controls:!0,style:{width:"100%"}})});default:return e.jsxs(x.Box,{direction:"column",align:"center",justify:"center",gap:"md",padding:"3xl",fullWidth:!0,children:[e.jsx(B.Icon,{name:"DocumentDetail",size:"lg"}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",children:s}),e.jsx(H.Button,{type:"button",variant:"link",iconLeft:e.jsx(B.Icon,{name:"SquareArrowExpand"}),onClick:()=>window.open(o,"_blank","noopener"),children:n})]})}}const na=({attachment:t,onClose:r,onDownload:n,isDownloading:s,kind:o,maxWidth:i,labels:l})=>{if(!t)return null;const c=ea(t,o),a=i??(c==="pdf"?"min(80vw, 1100px)":"min(90vw, 900px)"),d={download:(l==null?void 0:l.download)??"Download",close:(l==null?void 0:l.close)??"Close",openInNewTab:(l==null?void 0:l.openInNewTab)??"Open in new tab",unsupported:(l==null?void 0:l.unsupported)??"This file type cannot be previewed."};return e.jsxs(Re.Dialog,{isShow:!0,onHide:r,maxWidth:a,children:[e.jsx(Re.DialogTitle,{children:e.jsxs(x.Box,{direction:"row",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[e.jsx(w.Text,{fontWeight:"semibold",truncate:!0,children:t.fileName}),e.jsxs(x.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[n?e.jsx(H.Button,{type:"button",variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Download"}),disabled:s,isLoading:s,onClick:n,children:d.download}):null,e.jsx(H.Button,{type:"button",variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Cross"}),"aria-label":d.close,onClick:r})]})]})}),e.jsx(Re.DialogBody,{children:e.jsx(ra,{kind:c,attachment:t,openLabel:d.openInNewTab,unsupportedLabel:d.unsupported})})]})},os="var(--sa-border-subtle, #e5e7eb)",or=()=>e.jsx(x.Box,{style:{width:1,height:22,backgroundColor:os}}),oa=t=>typeof t=="number"?`${t}px`:t;function ss({count:t,children:r,label:n,onClear:s,clearLabel:o="Clear selection",clearDisabled:i=!1,bottom:l=20,zIndex:c=50,style:a,className:d}){if(t===0)return null;const h=typeof n=="function"?n(t):n??`${t} selected`;return e.jsx(x.Box,{direction:"row",justify:"center",style:{position:"fixed",bottom:oa(l),left:0,right:0,zIndex:c,pointerEvents:"none"},children:e.jsxs(x.Box,{direction:"row",align:"center",gap:"xs",bg:"white",padding:"spacing-8",className:d,style:{pointerEvents:"auto",borderRadius:10,border:`1px solid ${os}`,boxShadow:"var(--sa-shadow-xl, 0 10px 25px -5px rgb(0 0 0/0.15))",...a},children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",whiteSpace:"nowrap",style:{paddingInline:6},children:h}),e.jsx(or,{}),r,s&&e.jsxs(e.Fragment,{children:[e.jsx(or,{}),e.jsx(Ee.Tooltip,{label:o,position:"top",children:e.jsx(H.Button,{variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Cross",size:"xs"}),"aria-label":o,onClick:s,disabled:i})})]})]})})}ss.Divider=or;const xr=t=>{const{variant:r="outlined",overflow:n="hidden",style:s,children:o,...i}=t;return e.jsx(Hr.Card,{variant:r,overflow:n,style:{display:"flex",flexDirection:"column",...s},...i,children:o})},sa=t=>t==null?void 0:typeof t=="number"?`${t}px`:t,is=({src:t,alt:r="",height:n=140,bg:s="var(--sa-background-neutral, #f0f1f2)",avatar:o,children:i})=>e.jsxs(x.Box,{style:{position:"relative",marginBottom:o?24:void 0},children:[e.jsx(x.Box,{style:{height:sa(n),background:t?void 0:s,overflow:"hidden"},children:t?e.jsx("img",{src:t,alt:r,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null}),i?e.jsx(x.Box,{style:{position:"absolute",inset:0,pointerEvents:"none"},children:i}):null,o?e.jsx(x.Box,{style:{position:"absolute",left:16,bottom:0,transform:"translateY(50%)"},children:o}):null]}),ls=({avatar:t,title:r,subtitle:n,action:s,divided:o=!1,children:i})=>e.jsx(x.Box,{padding:"md",style:{borderBottom:o?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:i??e.jsxs(ce.Flex,{direction:"row",align:"center",gap:"sm",children:[t,e.jsxs(x.Box,{flex:"1",style:{minWidth:0},children:[r!=null&&e.jsx(w.Text,{fontWeight:"semibold",truncate:!0,children:r}),n!=null&&e.jsx(w.Text,{fontSize:"sm",color:"subtlest",truncate:!0,children:n})]}),s!=null&&e.jsx(x.Box,{style:{flexShrink:0},children:s})]})}),cs=({left:t,right:r,divided:n=!0,children:s})=>e.jsx(x.Box,{padding:"md",style:{marginTop:"auto",borderTop:n?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:s??e.jsxs(ce.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",children:[e.jsx(x.Box,{style:{minWidth:0},children:t}),e.jsx(x.Box,{style:{flexShrink:0},children:r})]})});xr.Media=is;xr.Header=ls;xr.Footer=cs;const ia=t=>{const{defaultTab:r=0,paramKey:n="tab"}=t||{},{useSearchParams:s}=st(),[o,i]=s(),l=kt.searchParamsToObject(o.toString());return{activeTab:l[n]?parseInt(l[n]):r,handleTabChange:d=>{i({...l,[n]:d.toString()})},searchQueries:l}};function la({appName:t,menuConfig:r,formatTitle:n}){const{useLocation:s}=st(),o=s();u.useEffect(()=>{let i=null,l=null;for(const d of r){const h=d.items.find(g=>g.to?g.to==="/"?o.pathname==="/":!!(g.to===o.pathname||o.pathname.startsWith(g.to+"/")):!1);if(h){i=h,l=d;break}}const c=[];i!=null&&i.title&&c.push(i.title),l!=null&&l.name&&c.push(l.name.toTitleCase());const a=(d,h)=>d.length>0?`${d.join(" - ")} | ${h}`:h;document.title=(n||a)(c,t)},[o.pathname])}const ca=()=>{const{useSearchParams:t,useParams:r,useLocation:n}=st(),[s,o]=t(),i=kt.searchParamsToObject(s.toString()),l=r(),c=n(),a=l.id;return{setSearchParams:o,searchParams:s,searchQueries:i,isHasQuery:(y,S)=>s.has(y)&&s.get(y)===S,getQueryParam:y=>s.get(y),getRouteParam:y=>l[y],params:l,location:c,id:a,hasId:!!a}};function aa(t){var s,o;const r=t.decodedAccessToken;return u.useMemo(()=>{var a,d;const i=((d=(a=r==null?void 0:r.access)==null?void 0:a.role)==null?void 0:d.code)??"",l=Object.keys(t.role).reduce((h,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,y=>y.replace("_","").toUpperCase())}`;return{...h,[m]:!1}},{});return{...Object.keys(t.role).reduce((h,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,y=>y.replace("_","").toUpperCase())}`;return{...h,[m]:i===t.role[g]}},l),hasRole:h=>i===t.role[h],getRoleKey:()=>i}},[(o=(s=r==null?void 0:r.access)==null?void 0:s.role)==null?void 0:o.code,t])}exports.ASIDE_WIDTH_VAR=Qr;exports.AdvanceFilterBar=To;exports.App=Rs;exports.AppComponent=po;exports.AppContext=Jr;exports.AppLayout=Ps;exports.AsideBar=Ec;exports.AttachmentPreview=na;exports.BackButton=Ns;exports.ColumnFilterDropdown=Qo;exports.ColumnHeaderFilter=cl;exports.ColumnMenu=Xo;exports.ConfirmationDialog=Vc;exports.DataTable=Uo;exports.DecisionWrapper=de;exports.EachUtils=lr;exports.EmptyStatePage=Rc;exports.EntityCard=xr;exports.EntityCardFooter=cs;exports.EntityCardHeader=ls;exports.EntityCardMedia=is;exports.FLOATING_FOOTER_HEIGHT_VAR=Ur;exports.FilterBar=Ji;exports.FilterDrawer=Io;exports.FloatingFooter=Mc;exports.ForbiddenPage=zc;exports.Form=yc;exports.FullSection=Nc;exports.HeaderLeftSlot=Os;exports.HeaderLeftSlotOutlet=bo;exports.HeaderLeftSlotProvider=jo;exports.Highlight=$o;exports.HorizontalField=Qs;exports.ImagePreview=Jc;exports.InputFile=es;exports.InputImage=ts;exports.LayoutDialog=Ht;exports.LayoutDialogAside=dr;exports.LayoutDialogBody=ar;exports.LayoutDialogFooter=ur;exports.LayoutDialogHeader=cr;exports.ModuleSwitcher=_s;exports.ModuleSwitcherModal=wo;exports.NotFoundPage=Ac;exports.PageLayout=Ys;exports.Pressable=Wt;exports.RightDrawer=Do;exports.SIDEBAR_DEFAULT_WIDTH=Xr;exports.SIDEBAR_MAX_WIDTH=Kr;exports.SIDEBAR_MIN_WIDTH=$r;exports.ScrollToTopButton=rs;exports.Section=ti;exports.SectionFooter=on;exports.SectionHeader=nn;exports.SelectButton=_c;exports.SelectionActionBar=ss;exports.SelectionActionBarDivider=or;exports.ServerErrorPage=Pc;exports.SidePanel=kc;exports.SidePanelItem=wc;exports.SidebarBadgesProvider=ao;exports.SidebarGroupSlot=As;exports.SidebarGroupSlotOutlet=_r;exports.SidebarGroupSlotProvider=vo;exports.SidebarHeaderSlot=yo;exports.SidebarProvider=ho;exports.StarasiaRouterProvider=go;exports.TableFooter=Go;exports.TableHeader=Zo;exports.TableLayout=Fl;exports.TableSection=ml;exports.TableWrapper=qo;exports.ToggleStatus=pc;exports.Typography=Ye;exports.VerticalField=Ic;exports.clearModuleSelection=Ws;exports.createInitialFromUserName=Ol;exports.cssVars=Vl;exports.expandDateCompact=al;exports.formHasChanged=Ql;exports.formatDate=Hl;exports.formatDateToIndonesian=Ko;exports.formatRupiah=Wl;exports.getDateFilterValue=Mo;exports.getDateRangeFilterValue=pi;exports.getInitials=zl;exports.getValueDropdownMultipleFilter=Fo;exports.getValueRadioFilter=gi;exports.getValueSearch=ir;exports.getValuesFilter=Kt;exports.handleChangeFilter=At;exports.handleOnScroll=rc;exports.isColumnFilterActive=_o;exports.isEmail=Kl;exports.isFilterActive=yi;exports.isOnlyLettersAndSpaces=Jl;exports.isPhoneNumber=Ul;exports.isSlug=ec;exports.localStorageAdapter=ln;exports.oneDayInMs=Nl;exports.parseIndonesianDateToDate=Al;exports.preventNonCoordinateInput=tc;exports.preventNonNumberAndDecimalInput=$l;exports.preventNonNumberInput=Yl;exports.preventNumberInput=Xl;exports.resolveDateRangeValueToString=Bo;exports.resolveDateValueToString=Eo;exports.resolveDropdownValueToString=So;exports.resolveRadioValueToString=ko;exports.resolveSidebarBadge=$t;exports.storageKeys=Et;exports.textWidth=_l;exports.useApp=Yr;exports.useAppState=lo;exports.useAuthRole=aa;exports.useCoarsePointer=Yo;exports.useDynamicTitle=la;exports.useFilterBarApiParams=Ki;exports.useFilterBarControls=tl;exports.useModuleSelection=rn;exports.useRouteInfo=_e;exports.useRouteParams=ca;exports.useRouterAdapter=st;exports.useSidebar=fo;exports.useSidebarBadges=uo;exports.useTabState=ia;exports.useTableSortApiParams=Ml;Object.keys(bn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>bn[t]})});Object.keys(er).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>er[t]})});Object.keys(dt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>dt[t]})});Object.keys(x).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>x[t]})});Object.keys(wt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>wt[t]})});Object.keys(H).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>H[t]})});Object.keys(Hr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Hr[t]})});Object.keys(gt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>gt[t]})});Object.keys(Re).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Re[t]})});Object.keys(tr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>tr[t]})});Object.keys(St).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>St[t]})});Object.keys(be).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>be[t]})});Object.keys(kt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>kt[t]})});Object.keys(ot).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ot[t]})});Object.keys(R).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>R[t]})});Object.keys(Rt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Rt[t]})});Object.keys(Lt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Lt[t]})});Object.keys(G).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>G[t]})});Object.keys(vn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>vn[t]})});Object.keys(Pr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Pr[t]})});Object.keys(Dt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Dt[t]})});Object.keys(Cn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Cn[t]})});Object.keys(Bt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Bt[t]})});Object.keys(Ee).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ee[t]})});Object.keys(nt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>nt[t]})});Object.keys(Vr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Vr[t]})});Object.keys(w).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>w[t]})});Object.keys(B).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>B[t]})});Object.keys(ce).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ce[t]})});Object.keys(wn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>wn[t]})});Object.keys(Dn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Dn[t]})});Object.keys(Sn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Sn[t]})});Object.keys(kn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>kn[t]})});Object.keys(Bn).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Bn[t]})});Object.keys(Je).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Je[t]})});Object.keys(En).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>En[t]})});
|