@starasia/admin 8.2.7 → 8.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/FilterBar/components/MobileFilterBar.d.ts +51 -0
- package/dist/components/FilterBar/components/MobileFilterDrawer.d.ts +25 -0
- package/dist/components/FilterBar/components/MobileMoreMenu.d.ts +16 -0
- package/dist/components/FilterBar/hooks/useColumnPrefs.d.ts +3 -1
- package/dist/components/FilterBar/hooks/useFilterBarApiParams.d.ts +52 -0
- package/dist/components/FilterBar/index.d.ts +2 -0
- package/dist/components/FilterBar/types.d.ts +6 -0
- package/dist/components/FilterBar/utils/expand-date-compact.d.ts +33 -0
- package/dist/components/FilterBar/utils/relative-date.d.ts +17 -0
- package/dist/components/FilterBar/utils/storage-adapter.d.ts +1 -0
- package/dist/components/TableLayout/ColumnMenu.d.ts +15 -0
- package/dist/components/TableLayout/TableLayout.d.ts +4 -0
- package/dist/components/TableLayout/hooks/useTableSortApiParams.d.ts +64 -0
- package/dist/components/TableLayout/index.d.ts +4 -0
- package/dist/components/TableLayout/types.d.ts +149 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/index.cjs.js +20 -1
- package/dist/index.es.js +3840 -2635
- package/dist/index.umd.js +20 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/components/DataGrid/DataGrid.d.ts +0 -4
- package/dist/components/DataGrid/index.d.ts +0 -2
- package/dist/components/DataGrid/types.d.ts +0 -29
package/dist/index.umd.js
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
-
(function(f,Me){typeof exports=="object"&&typeof module<"u"?Me(exports,require("@starasia/alert"),require("@starasia/badges"),require("@starasia/box"),require("@starasia/breadcrumb"),require("@starasia/button"),require("@starasia/card"),require("@starasia/date"),require("@starasia/dialog"),require("@starasia/drawer"),require("@starasia/dropdown"),require("@starasia/hooks"),require("@starasia/http"),require("@starasia/input"),require("@starasia/menu"),require("@starasia/pagination"),require("@starasia/storage"),require("@starasia/table"),require("@starasia/tabs"),require("@starasia/textarea"),require("@starasia/theme"),require("@starasia/toast"),require("@starasia/toggle"),require("@starasia/tooltip"),require("@starasia/checkbox"),require("@starasia/radio"),require("@starasia/text"),require("@starasia/icon"),require("@starasia/flex"),require("@starasia/grid"),require("@starasia/progress"),require("@starasia/stepper"),require("@starasia/accordion"),require("@starasia/story-record"),require("@starasia/skeleton"),require("@starasia/progress-stepper"),require("react/jsx-runtime"),require("react"),require("react-router"),require("react-dom"),require("react-easy-crop")):typeof define=="function"&&define.amd?define(["exports","@starasia/alert","@starasia/badges","@starasia/box","@starasia/breadcrumb","@starasia/button","@starasia/card","@starasia/date","@starasia/dialog","@starasia/drawer","@starasia/dropdown","@starasia/hooks","@starasia/http","@starasia/input","@starasia/menu","@starasia/pagination","@starasia/storage","@starasia/table","@starasia/tabs","@starasia/textarea","@starasia/theme","@starasia/toast","@starasia/toggle","@starasia/tooltip","@starasia/checkbox","@starasia/radio","@starasia/text","@starasia/icon","@starasia/flex","@starasia/grid","@starasia/progress","@starasia/stepper","@starasia/accordion","@starasia/story-record","@starasia/skeleton","@starasia/progress-stepper","react/jsx-runtime","react","react-router","react-dom","react-easy-crop"],Me):(f=typeof globalThis<"u"?globalThis:f||self,Me(f["@starasia/admin"]={},f.alert,f.badges,f.box,f.breadcrumb,f.button,f.card,f.date,f.dialog,f.drawer,f.dropdown,f.hooks,f.http,f.input,f.menu,f.pagination,f.storage,f.table,f.tabs,f.textarea,f.theme,f.toast,f.toggle,f.tooltip,f.checkbox,f.radio,f.text,f.icon,f.flex,f.grid,f.progress,f.stepper,f.accordion,f.storyRecord,f.skeleton,f.progressStepper,f.jsxRuntime,f.React,f.ReactRouter,f.ReactDOM,f.ReactEasyCrop))})(this,function(f,Me,we,u,me,W,Or,ke,ge,fr,Le,oe,Ie,Se,F,Ge,He,Y,Wr,gr,Te,Ar,je,de,Oe,yr,D,k,U,zr,Hr,jr,Vr,Nr,Fe,Pr,e,g,te,ur,Pt){"use strict";const _t={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},pr=g.createContext(_t),Cr=()=>g.useContext(pr),_r=r=>{const[t,l]=g.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:l}},Zr=g.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),qr=({children:r})=>{const[t,l]=g.useState({}),c=g.useCallback(i=>{l(h=>typeof i=="function"?i(h):i)},[]),o=g.useCallback((i,h)=>{l(s=>{const y=typeof h=="function"?h(s[i]):h;return{...s,[i]:y}})},[]),n=g.useCallback(i=>{l(h=>{if(!(i in h))return h;const s={...h};return delete s[i],s})},[]),a=g.useMemo(()=>({badges:t,setBadge:o,setBadges:c,clearBadge:n}),[t,o,c,n]);return e.jsx(Zr.Provider,{value:a,children:r})},Qr=()=>g.useContext(Zr),Je=(r,t)=>{const l=t!==void 0?t:r;return l==null?null:typeof l=="string"||typeof l=="number"?{value:l}:l},Gr=({router:r,menus:t=[],menuBottom:l,logo:c,appName:o="Workspace",initialUserData:n,theme:a})=>{const i=_r({initialUserData:n}),{theme:h}=Te.useTheme();return e.jsx(pr.Provider,{value:{logo:c,appName:o,menus:t,userData:i.userData,setUserData:i.setUserData,menuBottom:l},children:e.jsx(qr,{children:a?e.jsx(Te.ThemeProvider,{value:a,children:r}):h?e.jsx(Te.ThemeProvider,{value:h,children:r}):r})})},Zt=g.memo(Gr);function Jr({collapsed:r=!1,children:t}){if(!t)return null;const l=typeof t=="function",c=l?t({collapsed:r}):t;return c==null||c===!1?null:e.jsx("div",{style:{position:"sticky",top:"4rem",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:"0.5rem",paddingRight:"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:l?c:e.jsx("div",{style:{opacity:r?0:1,transition:"opacity 0.3s",visibility:r?"hidden":"visible"},children:c})})}const xr=g.createContext(null);function Ur({children:r}){const[t,l]=g.useState(null),[c,o]=g.useState(null),[n,a]=g.useState(null),[i,h]=g.useState(0),s=g.useCallback(()=>(h(y=>y+1),()=>h(y=>y-1)),[]);return e.jsx(xr.Provider,{value:{prependNode:t,appendNode:c,replaceNode:n,setPrependNode:l,setAppendNode:o,setReplaceNode:a,replaceCount:i,registerReplace:s},children:r})}function Yr({children:r}){const t=g.useContext(xr);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t.setPrependNode,style:{display:"contents"}}),t.replaceCount>0?e.jsx("div",{ref:t.setReplaceNode,style:{display:"contents"}}):r,e.jsx("div",{ref:t.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:r})}function qt({children:r,mode:t="append"}){const l=g.useContext(xr);if(g.useEffect(()=>{if(!(t!=="replace"||!l))return l.registerReplace()},[t,l]),!l)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const c=t==="prepend"?l.prependNode:t==="replace"?l.replaceNode:l.appendNode;return c?ur.createPortal(r,c):null}const br=g.createContext(null);function Xr({children:r}){const[t,l]=g.useState({}),[c,o]=g.useState({}),n=g.useCallback((h,s)=>{l(y=>y[h]===s?y:{...y,[h]:s})},[]),a=g.useCallback(h=>(o(s=>({...s,[h]:(s[h]??0)+1})),()=>o(s=>({...s,[h]:Math.max(0,(s[h]??0)-1)}))),[]),i=g.useMemo(()=>({outletNodes:t,setOutletNode:n,slotCounts:c,registerSlot:a}),[t,n,c,a]);return e.jsx(br.Provider,{value:i,children:r})}function Kr({slotKey:r,fallback:t}){const l=g.useContext(br),c=l?(l.slotCounts[r]??0)>0:!1,o=g.useRef(l==null?void 0:l.setOutletNode);o.current=l==null?void 0:l.setOutletNode;const n=g.useCallback(a=>{var i;return(i=o.current)==null?void 0:i.call(o,r,a)},[r]);return e.jsx(e.Fragment,{children:c?e.jsx("div",{ref:n,style:{display:"contents"}}):t})}function Qt({slotKey:r,children:t}){const l=g.useContext(br),c=g.useRef(l==null?void 0:l.registerSlot);if(c.current=l==null?void 0:l.registerSlot,g.useEffect(()=>{var n;return(n=c.current)==null?void 0:n.call(c,r)},[r]),!l)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=l.outletNodes[r];return o?ur.createPortal(t,o):null}const Ue="moduleSwitcherGroupId",Dr="sa-module-switcher-change";function $r(){if(typeof window>"u")return null;const r=window.localStorage.getItem(Ue);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function Rr(r){typeof window>"u"||(r===null?window.localStorage.removeItem(Ue):window.localStorage.setItem(Ue,String(r)),window.dispatchEvent(new CustomEvent(Dr,{detail:r})))}function Gt(){Rr(null)}function vr(){const[r,t]=g.useState(()=>$r());return g.useEffect(()=>{const c=()=>{t($r())},o=n=>{n.key===Ue&&c()};return window.addEventListener(Dr,c),window.addEventListener("storage",o),()=>{window.removeEventListener(Dr,c),window.removeEventListener("storage",o)}},[]),{selectedGroupId:r,setSelectedGroupId:c=>{Rr(c),t(c)}}}let Ye=0,Ee=!1,et=new Set;const rt=()=>e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"1.667",y:"1.667",width:"12.667",height:"12.667",rx:"2"}),e.jsx("line",{x1:"6",y1:"1.667",x2:"6",y2:"14.333"})]}),tt={width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",fontSize:"0.875rem",color:"var(--sa-text-subtle, #8c8f97)",background:"transparent",border:"none",borderRadius:"0.375rem",cursor:"pointer",textAlign:"left"};function Jt({children:r,headerLeftSlot:t,profile:l,isLoadingProfile:c,onLogout:o,isLoggingOut:n,loadingComponent:a,sidebarHeaderContent:i,headerActions:h,profileRole:s,profileMenuButtons:y,profileMenuItems:p,logoutButton:C}){var Ae,hr;const[b]=te.useSearchParams(),L=b.get("embed")==="true",x=Cr(),{badges:B}=Qr(),m=te.useNavigate(),M=te.useLocation(),v=!oe.useMediaQuery("md"),[I,T]=g.useState(!1),[E,Z]=g.useState(!1),[K,$]=g.useState(!1),[G,R]=g.useState(!1),[ne,re]=g.useState(()=>new Set(et)),[ee,le]=g.useState(null),{selectedGroupId:Q,setSelectedGroupId:q}=vr();g.useEffect(()=>{et=ne},[ne]);const ie=g.useRef(null),ue=g.useRef(null);g.useEffect(()=>{const w=ie.current;if(!w)return;const H=()=>{Ee||(Ye=w.scrollTop)};return w.addEventListener("scroll",H),()=>w.removeEventListener("scroll",H)},[]);const pe=()=>{const w=ie.current;w&&Ye>0&&(Ee=!0,w.scrollTop=Ye,requestAnimationFrame(()=>{Ee=!1}))};g.useLayoutEffect(()=>{Ee=!0,pe();const w=setTimeout(()=>{Ee=!1},300);return()=>clearTimeout(w)},[]),g.useLayoutEffect(()=>{x.menus.length>0&&(Ye>0?pe():requestAnimationFrame(()=>{var H;const w=(H=ie.current)==null?void 0:H.querySelector("[data-menu-active='true']");w&&w.scrollIntoView({block:"center",behavior:"instant"})}))},[x.menus]),g.useEffect(()=>{Ee=!0,pe();const w=setTimeout(pe,0),H=setTimeout(pe,50),N=setTimeout(pe,100),S=setTimeout(pe,200),A=setTimeout(()=>{Ee=!1},300),O=setTimeout(()=>{const z=ie.current,P=z==null?void 0:z.querySelector("[data-menu-active='true']");if(z&&P){const se=z.getBoundingClientRect(),fe=P.getBoundingClientRect();fe.top>=se.top&&fe.bottom<=se.bottom||P.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(w),clearTimeout(H),clearTimeout(N),clearTimeout(S),clearTimeout(A),clearTimeout(O)}},[M.pathname]),g.useEffect(()=>{ue.current&&(ue.current.scrollTop=0)},[M.pathname]),g.useEffect(()=>{v&&$(!1)},[M.pathname,v]),g.useEffect(()=>{v&&Z(!0)},[v]);const Pe=()=>{T(!0)},ar=()=>{T(!1)},Lr=()=>{T(!1),o()},sr=w=>{const H=[w.to];return w.children&&H.push(...w.children.map(N=>N.to)),H},_e=[...x.menus.flatMap(w=>w.items.flatMap(sr)),...((Ae=x.menuBottom)==null?void 0:Ae.flatMap(sr))??[]],he=w=>{if(!M.pathname.startsWith(w))return!1;const H=_e.filter(N=>M.pathname.startsWith(N)).sort((N,S)=>S.length-N.length)[0];return w===H};g.useEffect(()=>{var H;const w=N=>{var S;(S=N.children)!=null&&S.some(A=>M.pathname.startsWith(A.to))&&re(A=>{const O=new Set(A);return O.add(N.id),O})};x.menus.forEach(N=>{N.items.forEach(w)}),(H=x.menuBottom)==null||H.forEach(w)},[M.pathname,x.menus,x.menuBottom]);const dr=w=>{re(H=>{const N=new Set(H);return N.has(w)?N.delete(w):N.add(w),N})};g.useEffect(()=>{x.menus.length!==0&&Q!==null&&!x.menus.some(w=>w.id===Q)&&q(null)},[x.menus,Q,q]);const Ze=g.useMemo(()=>{if(Q!==null)return x.menus.filter(N=>N.id===Q||N.parentGroupId===Q);const w=x.menus.filter(N=>N.parentGroupId===void 0),H=x.menus.filter(N=>N.parentGroupId!==void 0).flatMap(N=>N.items);return H.length===0?w:[...w,{id:18,name:"Pengaturan",items:H,parentGroupId:void 0}]},[x.menus,Q]);if(L)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:r||e.jsx(te.Outlet,{})});const We=w=>{const H=w.children&&w.children.length>0,N=ne.has(w.id),S=H?w.children.some(z=>he(z.to)):he(w.to),A=Je(w.badge,B[w.id]),O=!!A&&E&&!v;return e.jsxs("div",{"data-menu-active":S||void 0,children:[e.jsxs("button",{onClick:z=>{if(H)if(E&&!v){const P=z.currentTarget.getBoundingClientRect();le({item:w,top:P.top,left:P.right+8})}else dr(w.id);else m(w.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:E&&!v?"center":void 0,gap:"0.5rem",paddingLeft:E&&!v?"0":"0.5rem",paddingRight:E&&!v?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:S?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:S?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:S?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:E&&!v?w.title:void 0,onMouseEnter:z=>{S||(z.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:z=>{S||(z.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(k.Icon,{name:w.icon,size:"sm",style:{flexShrink:0}}),O&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"-2px",right:"-2px",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-error-500, #ff4d6d)",border:"1px solid var(--sa-background-primary, #ffffff)"}})]}),(!E||v)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",transition:"opacity 0.3s",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:w.title}),A&&e.jsx(we.Badges,{text:String(A.value),variant:A.variant??"info",size:"xs",border:!0}),H&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:N?"rotate(180deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),H&&(!E||v)&&(()=>{const z=w.children.findIndex(P=>he(P.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:N?`${w.children.length*36}px`:"0px",opacity:N?1:0,marginTop:N?"0.25rem":"0px"},children:[e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"1.5px",height:"100%",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),z>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${z*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),w.children.map(P=>{const se=Je(P.badge,B[P.id]);return e.jsxs("button",{onClick:()=>m(P.to),style:{width:"100%",display:"flex",alignItems:"center",gap:"0.5rem",paddingLeft:"0.75rem",paddingRight:"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:he(P.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:he(P.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:he(P.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:he(P.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:fe=>{he(P.to)||(fe.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:fe=>{he(P.to)||(fe.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(k.Icon,{name:P.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:P.title}),se&&e.jsx(we.Badges,{text:String(se.value),variant:se.variant??"info",size:"xs",border:!0})]},P.id)})]})})()]},w.id)};return e.jsx(Xr,{children:e.jsxs(Ur,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":v?"0px":E?"4.375rem":"16.375rem","--app-footer-zindex":v&&K?"40":"999"},children:[v&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:K?.5:0,pointerEvents:K?"auto":"none",transition:"opacity 0.3s"},onClick:()=>$(!1)}),e.jsxs("aside",{style:{width:v?"16.375rem":E?"4.375rem":"16.375rem",position:v?"fixed":"relative",...v&&{inset:0,zIndex:50,transform:K?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:"all 0.3s ease-in-out",flexShrink:v?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),style:{height:"4rem",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",position:"relative"},children:(()=>{const w=!v&&E&&!K,H=w&&G;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:w?1:void 0,justifyContent:w?"center":void 0,transition:"opacity 0.2s",opacity:H?0:1,pointerEvents:H?"none":"auto"},children:[e.jsx("img",{src:x.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!E||K)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:x.appName})]}),!v&&!E&&e.jsx("button",{type:"button",onClick:()=>Z(!0),"aria-label":"Collapse sidebar",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1rem",height:"1rem",padding:0,background:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer",flexShrink:0},children:e.jsx(rt,{})}),w&&e.jsx("button",{type:"button",onClick:()=>Z(!1),"aria-label":"Expand sidebar",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",padding:0,background:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-sm, 0.375rem)",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer",opacity:H?1:0,pointerEvents:H?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(rt,{})})}),v&&e.jsx("button",{onClick:()=>$(!1),"aria-label":"Close menu",style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.25rem",height:"1.25rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})()}),i&&e.jsx(Jr,{collapsed:v?!1:E,children:i}),e.jsx("div",{ref:ie,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:Ze.map(w=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!E||v?w.name&&e.jsx("div",{style:{paddingLeft:"1.5rem",paddingRight:"1rem",paddingTop:"0rem",paddingBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"400",color:"var(--sa-text-subtlest, #6b6e76)",transition:"opacity 0.3s",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:w.name}):w.name&&e.jsx("div",{"aria-label":w.name,style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"0.75rem",paddingBottom:"0.75rem"},children:e.jsx("span",{style:{display:"block",width:"1rem",height:"2px",borderRadius:"1px",backgroundColor:w.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx("div",{style:{paddingLeft:"1rem",paddingRight:"1rem",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)"},children:w.slotKey?e.jsx(Kr,{slotKey:w.slotKey,fallback:w.items.map(H=>We(H))}):w.items.map(H=>We(H))})]},w.id))}),x.menuBottom&&x.menuBottom.length>0&&e.jsx("div",{style:{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",paddingTop:"0.75rem",paddingBottom:"0.75rem",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)",flexShrink:0},children:x.menuBottom.map(w=>We(w))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{height:"4rem",backgroundColor:"var(--sa-background-primary, #ffffff)",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[v&&e.jsx("button",{onClick:()=>$(!0),style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.5rem",height:"1.5rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),e.jsx(Yr,{children:t})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[h,e.jsxs(F.Menu,{position:"bottom-right",children:[e.jsx(F.MenuButton,{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsxs("div",{style:{textAlign:"right",maxWidth:"12.5rem"},children:[e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:500,color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:c?"Loading...":(l==null?void 0:l.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:c?"":(l==null?void 0:l.email)||"unknown"})]}),e.jsx("div",{style:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"0.875rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",flexShrink:0,backgroundColor:"var(--sa-background-brand, #04254f)"},children:((l==null?void 0:l.name)||"U")[0].toUpperCase()}),e.jsx(k.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(F.MenuLists,{style:{width:"280px",paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(F.MenuHeading,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",paddingBlock:"0.5rem"},children:[e.jsx("div",{style:{width:"4rem",height:"4rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"1.25rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",marginBottom:"0.75rem",backgroundColor:"var(--sa-background-brand, #04254f)"},children:((l==null?void 0:l.name)||"U")[0].toUpperCase()}),e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:600,color:"var(--sa-text-primary, #292a2e)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(l==null?void 0:l.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(l==null?void 0:l.email)||"unknown"}),s&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s})]})}),(y&&y.length>0||p)&&e.jsxs(F.MenuBody,{children:[y==null?void 0:y.map((w,H)=>e.jsx(F.MenuButton,{children:e.jsxs("button",{type:"button",onClick:w.onClick,style:tt,onMouseEnter:N=>{N.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:N=>{N.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(k.Icon,{name:w.icon,size:"md"}),e.jsx("span",{children:w.label})]})},`${w.label}-${H}`)),p]}),C??e.jsx(F.MenuFooter,{children:e.jsx(F.MenuButton,{children:e.jsxs("button",{type:"button",onClick:Pe,style:{...tt,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:w=>{w.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:w=>{w.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(k.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:ue,style:{flex:1,overflowY:"auto"},children:r||e.jsx(te.Outlet,{})})]})]}),n&&a&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--sa-color-black-alpha-a70, #181a19b8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:a}),e.jsxs(ge.Dialog,{isShow:I,onHide:ar,children:[e.jsx(ge.DialogTitle,{children:"Confirmation Logout"}),e.jsx(ge.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(ge.DialogFooter,{children:e.jsx(u.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(U.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(u.Box,{direction:"column",children:e.jsx(W.Button,{secondary:!0,onClick:ar,children:"Cancel"})}),e.jsx(u.Box,{direction:"column",children:e.jsx(W.Button,{primary:!0,onClick:Lr,children:"Yes, Sure"})})]})})})]}),ee&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>le(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":ee.item.title,style:{position:"fixed",top:ee.top,left:ee.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem",backgroundColor:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-md, 0.5rem)",boxShadow:"var(--sa-shadow-lg, 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a)",padding:"0.5rem",display:"flex",flexDirection:"column",gap:"0.125rem"},children:[e.jsx("div",{style:{fontSize:"0.75rem",fontWeight:600,color:"var(--sa-color-gray-500, #8c8f97)",padding:"0.25rem 0.5rem 0.5rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:ee.item.title}),(hr=ee.item.children)==null?void 0:hr.map(w=>{const H=he(w.to),N=Je(w.badge,B[w.id]);return e.jsxs("button",{onClick:()=>{m(w.to),le(null)},style:{width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.5rem 0.75rem",borderRadius:"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:H?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:H?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:S=>{H||(S.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:S=>{H||(S.currentTarget.style.backgroundColor="transparent")},children:[w.icon&&e.jsx(k.Icon,{name:w.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:w.title}),N&&e.jsx(we.Badges,{text:String(N.value),variant:N.variant??"info",size:"xs",border:!0})]},w.id)})]})]})]})})}const Xe=g.forwardRef(({children:r,...t},l)=>e.jsx(u.Box,{ref:l,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),lt=({title:r,iconName:t,textColor:l,iconColor:c,hoverTextColor:o,hoverIconColor:n})=>{const[a,i]=g.useState(!1),h=c??"var(--sa-text-subtle, #8c8f97)",s=l??"var(--sa-text-subtle, #8c8f97)",y=n??"var(--sa-text-subtle, #8c8f97)",p=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{cursor:"pointer"},children:[e.jsx(k.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:a?y:h,transition:"color 0.15s ease"}}),e.jsx(D.Text,{variant:"sub-h3",style:{color:a?p:s,transition:"color 0.15s ease"},children:r||"Back"})]})},Ut=({items:r,separator:t="/",iconName:l,iconColor:c,hoverIconColor:o})=>{const[n,a]=g.useState(!1),i=c??"var(--sa-text-subtle, #8c8f97)",h=o??"var(--sa-text-subtle, #8c8f97)",s=r.length>1?r[0]:void 0,y=!!(s!=null&&s.to||s!=null&&s.onClick),p=e.jsx(k.Icon,{name:l||"ChevronLeft",size:"xs",onMouseEnter:y?()=>a(!0):void 0,onMouseLeave:y?()=>a(!1):void 0,style:{color:y&&n?h:i,transition:"color 0.15s ease",cursor:y?"pointer":void 0}}),C=s!=null&&s.to?e.jsx(te.Link,{to:s.to,replace:!0,style:{textDecoration:"none"},children:p}):s!=null&&s.onClick?e.jsx(Xe,{onClick:s.onClick,children:p}):p;return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",children:[C,e.jsx(me.Breadcrumb,{separator:t,size:"md",children:r.map((b,L)=>{const x=L===r.length-1;return b.to&&!x?e.jsx(me.BreadcrumbItem,{children:e.jsx(te.Link,{to:b.to,children:b.label})},L):e.jsx(me.BreadcrumbItem,{currentPage:x,children:e.jsx(me.BreadcrumbLink,{onClick:x?void 0:b.onClick,children:b.label})},L)})})]})},Yt=r=>{const{items:t,separator:l,onClick:c,navigateTo:o,...n}=r;return t&&t.length>0?e.jsx(Ut,{items:t,separator:l,iconName:n.iconName,iconColor:n.iconColor,hoverIconColor:n.hoverIconColor}):o?e.jsx(u.Box,{direction:"row",children:e.jsx(te.Link,{to:o,replace:!0,style:{textDecoration:"none"},children:e.jsx(lt,{...n})})}):e.jsx(u.Box,{direction:"row",children:e.jsx(Xe,{onClick:c,children:e.jsx(lt,{...n})})})},wr=[{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 ot(r,t,l){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:r?`2px solid ${l.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:r?l.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:r?t?`0 8px 20px ${l.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${l.activeShadow}`:t?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:t?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const ct={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},nt={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function it({isShow:r,onHide:t,menus:l,selectedGroupId:c,onSelect:o}){const[n,a]=g.useState(void 0),i=s=>{o(s),t()},h=wr[0];return e.jsx(ge.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(ge.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>i(null),onMouseEnter:()=>a("all"),onMouseLeave:()=>a(void 0),style:nt,children:[e.jsx("div",{style:ot(c===null,n==="all",h),children:e.jsx("div",{style:{color:h.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(k.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:ct,children:"Semua"})]}),l.map((s,y)=>{var x;const p=c===s.id,C=n===s.id,b=((x=s.items[0])==null?void 0:x.icon)??"Grid",L=wr[(y+1)%wr.length];return e.jsxs("button",{onClick:()=>i(s.id),onMouseEnter:()=>a(s.id),onMouseLeave:()=>a(void 0),style:nt,children:[e.jsx("div",{style:ot(p,C,L),children:e.jsx("div",{style:{color:L.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(k.Icon,{name:b,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:ct,children:s.name})]},s.id)})]})})})}function Xt({onSelect:r,"aria-label":t="Pilih module"}={}){const l=Cr(),c=te.useNavigate(),{selectedGroupId:o,setSelectedGroupId:n}=vr(),[a,i]=g.useState(!1),h=s=>{var y;if(n(s),s!==null){const p=l.menus.find(b=>b.id===s),C=(y=p==null?void 0:p.items[0])==null?void 0:y.to;C&&c(C)}r==null||r(s)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>i(!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2.25rem",height:"2.25rem",borderRadius:"var(--sa-radii-sm, 0.25rem)",border:"1px solid var(--sa-border-subtle, #0b120e24)",color:"var(--sa-text-subtle, #8c8f97)",backgroundColor:"transparent",cursor:"pointer"},"aria-label":t,onMouseEnter:s=>{s.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:e.jsx(k.Icon,{name:"GridApplication",size:"sm"})}),o!==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(it,{isShow:a,onHide:()=>i(!1),menus:l.menus.filter(s=>s.parentGroupId===void 0),selectedGroupId:o,onSelect:h})]})}const Kt=(r,t)=>{const l=[];if(t===0)return l.push(r),l;for(let c=0;c<r.length;c+=t){const o=r.slice(c,c+t);l.push(o)}return l},$t=g.memo(({value:r,label:t,separator:l,labelWidth:c,lastIndex:o,labelAlign:n="top"})=>{const a=g.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:n}),[o,n]),i=g.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:n}),[o,n]),h=()=>typeof t=="string"?e.jsx(D.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,s=()=>typeof r=="string"||typeof r=="number"?e.jsx(D.Text,{color:"primary",fontWeight:"medium",children:r}):r,y=()=>typeof l=="string"||typeof l=="number"?e.jsx(D.Text,{fontWeight:"medium",color:"subtlest",children:l}):l;return e.jsxs(Y.Tr,{children:[e.jsx(Y.Td,{style:a,width:c,children:h()}),l?e.jsx(Y.Td,{style:i,width:24,children:y()}):null,e.jsx(Y.Td,{style:a,children:s()})]})}),Rt=g.memo(({fields:r,separator:t,labelWidth:l})=>e.jsx(Y.Table,{children:r.map((c,o)=>e.jsx($t,{separator:t,labelWidth:l,lastIndex:o===r.length-1,...c},`field-group-field-${o}`))})),el=g.memo(({maxRow:r=0,maxColumn:t=2,separator:l=":",fields:c=[],labelWidth:o=150,bordered:n=!1})=>{const a=g.useMemo(()=>Kt(c,r),[c,r]),i=a.length>2,h=()=>{switch(t){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(u.Box,{gap:i?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:i?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:n?"border":void 0,borderStyle:n?"border-solid":void 0,borderColor:n?"border-subtle":void 0,children:a.map((s,y)=>e.jsx(u.Box,{direction:"column",flex:i?void 0:"1",width:i?h():void 0,marginBottom:i?"lg":void 0,children:e.jsx(Rt,{labelWidth:o,fields:s,separator:l})},y))})}),rl=({backButton:r})=>{const[t,l]=g.useState(!1),c=(r==null?void 0:r.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(r==null?void 0:r.textColor)??"var(--sa-text-subtle, #8c8f97)",n=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",a=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{cursor:"pointer"},children:[e.jsx(k.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?n:c,transition:"color 0.15s ease"}}),e.jsx(D.Text,{variant:"sub-h3",style:{color:t?a:o,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},tl=({backButton:r,title:t,titleIcon:l,titleTag:c,children:o,header:n=!0,headerBorder:a=!1,subHeaders:i,action:h,titleTagProps:s,containerProps:y,headerProps:p})=>{const C=oe.useMediaQuery("lg"),b=te.useNavigate(),L=te.useLocation(),x=r==null?void 0:r.show,B=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}b(-1,{replace:!0})},m=()=>h?g.isValidElement(h)?h:e.jsx(u.Box,{direction:"row",gap:"lg",children:h.map(({title:E,icon:Z,buttonProps:K,onClick:$},G)=>!E&&!Z?null:e.jsx(W.Button,{fullWidth:!C,iconLeft:Z?e.jsx(k.Icon,{name:Z,size:"md"}):void 0,onClick:$,...K,children:E},`action-${G}`))}):null,M=()=>{const E=e.jsx(rl,{backButton:r});return r!=null&&r.navigateTo?e.jsx(u.Box,{direction:"row",children:e.jsx(te.Link,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:E})}):e.jsx(u.Box,{direction:"row",children:e.jsx(Xe,{onClick:B,children:E})})},V=()=>{const E=!!t,Z=g.isValidElement(h)?!0:Array.isArray(h)&&h.length>0;return!E&&!Z&&!x?null:e.jsxs(u.Box,{direction:"column",gap:"xs",paddingBlock:(p==null?void 0:p.paddingBlock)??"sm",paddingInline:(p==null?void 0:p.paddingInline)??"md",...p,style:{...a?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...p==null?void 0:p.style},children:[x&&M(),(E||Z)&&e.jsxs(u.Box,{direction:C?"row":"column",gap:"lg",justify:"space-between",align:"center",children:[E?typeof t=="string"?e.jsxs(u.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[l&&e.jsx(k.Icon,{name:l,size:"md",color:"primary"}),e.jsx(D.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:t})]}),c&&e.jsx(we.Badge,{border:!0,size:"lg",text:c,...s})]}):t:null,m()]})]})},v=()=>{if(!i||i.length===0)return null;let E=0,Z=-1/0;return i.forEach((K,$)=>{const G=K.order??0;G>=Z&&(Z=G,E=$)}),i.map(({content:K,order:$,borderBottom:G=!0},R)=>e.jsx(u.Box,{direction:"column",paddingTop:"sm",paddingBottom:G||R===E?"sm":"spacing-0",paddingInline:"md",style:{...G?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...$!==void 0?{order:$}:{}},children:K},`sub-header-${R}`))},I=()=>{const E=n?V():null,Z=v();return!E&&!Z?null:e.jsxs(u.Box,{direction:"column",style:{marginBottom:i&&i.length>0?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[E,Z]})},T=()=>o;return e.jsxs(u.Box,{direction:"column",as:"main",...y,style:{...(y==null?void 0:y.style)??{},animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"},children:[I(),T()]},L.pathname)},ll=g.memo(tl),ol={icon:"Cross",title:""},cl="calc(100vw - 16px)",at=r=>r==null?void 0:`min(${typeof r=="number"?`${r}px`:r}, ${cl})`,st=g.forwardRef(({onHide:r,show:t,withBlur:l=!1,style:c,children:o,closeButton:n=ol,width:a,minWidth:i="357px",maxWidth:h="357px"},s)=>{const y=at(a??i),p=at(a??h);return e.jsx(fr.Drawer,{blur:l,isShow:t,position:"right",onHide:r,ref:s,style:{minWidth:y,maxWidth:p,...c},children:e.jsxs(u.Box,{direction:"column",padding:"lg",children:[n?e.jsxs(u.Box,{direction:"row",align:"center",gap:"sm",onClick:r,marginBottom:"lg",cursor:"pointer",children:[e.jsx(k.Icon,{name:n.icon,size:"md",color:"subtle",cursor:"pointer"}),n.title?e.jsx(D.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:n.title}):null]}):null,o]})})}),Sr=g.memo(({children:r,borderBottom:t=!0,padding:l=!0})=>{const c=oe.useMediaQuery("lg");return e.jsx(u.Box,{direction:"column",padding:l?"md":"spacing-0",paddingLeft:l?"md":"spacing-0",paddingRight:l?"md":"spacing-0",style:t?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),Br=g.memo(({children:r,borderTop:t=!0,padding:l=!0})=>{const c=oe.useMediaQuery("lg");return e.jsx(u.Box,{direction:"column",padding:l?"md":"spacing-0",paddingLeft:l?"md":"spacing-0",paddingRight:l?"md":"spacing-0",style:t?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),nl=g.memo(({children:r,...t})=>e.jsx(u.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),il=g.memo(({children:r,title:t,titleTag:l,action:c,header:o,footer:n,actionContainer:a,containerProps:i,bodyProps:h,headerProps:s={borderBottom:!0},footerProps:y={borderTop:!0},variantTag:p="info"})=>{const C=oe.useMediaQuery("lg"),b=()=>l?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(D.Text,{fontWeight:"medium",children:t}),e.jsx(we.Badges,{border:!0,text:l,variant:p})]}):e.jsx(D.Text,{fontWeight:"medium",children:t}),L=()=>o||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:t?b():null}),e.jsx(u.Box,{direction:"column",style:C?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...a,children:c??null})]}),x=!!(o||t||c);return e.jsxs(u.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...i,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(i==null?void 0:i.style)??{}},children:[o!==null&&x?e.jsx(Sr,{...s,children:L()}):null,e.jsx(nl,{...h,children:r}),n?e.jsx(Br,{...y,children:n}):null]})}),ye={H1:r=>e.jsx(D.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(D.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(D.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(D.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(D.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(D.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(D.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(D.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(D.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(D.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(D.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(D.Text,{variant:"body-3",children:r.children,...r.props})},be=()=>{const[r,t]=te.useSearchParams(),l=Ie.searchParamsToObject(r.toString()),c=te.useParams(),o=te.useLocation(),n=c.id;return{setSearchParams:t,searchParams:r,searchQueries:l,isHasQuery:(y,p)=>r.has(y)&&r.get(y)===p,getQueryParam:y=>r.get(y),getRouteParam:y=>c[y],params:c,location:o,id:n,hasId:!!n}},dt=r=>JSON.stringify(r),ht=r=>JSON.stringify(r),ft=r=>JSON.stringify(r),gt=r=>JSON.stringify(r),al=r=>r,sl=r=>JSON.stringify(r),Ve=({value:r,name:t,type:l,withSearchParam:c=!0,setSearchParams:o,searchQueries:n,dropdownSearchKey:a,filterKey:i="filter",pageKey:h="page"})=>{if(c){let s;switch(l){case"search":s=al(r);break;case"dropdown":case"dropdown-multiple":s=dt(r);break;case"radio":s=ht(r);break;case"date-range":s=ft(r);break;case"advanced-date-range":s=sl(r);break;case"date":s=gt(r);break;default:s=r;break}if(typeof s<"u"){const p={...n[i]&&typeof n[i]=="string"?JSON.parse(n[i]):void 0,[t]:s},C={...n};a&&typeof a=="string"&&delete C[a],delete C[h];const b={...C,[i]:JSON.stringify(p)},L=new URLSearchParams(n).toString(),x=new URLSearchParams(b).toString();if(L===x)return;o(b)}}},Ke=({name:r,filterKey:t="filter",searchParams:l,get:c})=>{const o=l.get(t)||void 0,n=o&&typeof o=="string"?JSON.parse(o):void 0,a=n?n[r]:void 0;return c==="label"&&a?JSON.parse(a)[0].label:c==="value"&&a?JSON.parse(a)[0].value:a},yt=({name:r,filterKey:t="filter",searchParams:l,get:c})=>{const o=l.get(t)||void 0,n=o&&typeof o=="string"?JSON.parse(o):void 0,a=n?n[r]:void 0;return c==="label"&&a?JSON.parse(a).map(i=>i.label):c==="value"&&a?JSON.parse(a).map(i=>i.value):c==="array"&&a?JSON.parse(a):a},dl=({name:r,filterKey:t="filter",searchParams:l,get:c})=>{const o=l.get(t)||void 0,n=o&&typeof o=="string"?JSON.parse(o):void 0,a=n?n[r]:void 0;return c==="id"&&a?JSON.parse(a).id:c==="label"&&a?JSON.parse(a).label:c==="value"&&a?JSON.parse(a).value:a},kr=(r,t,l)=>{const c=t.get(l||"filter")||void 0,o=c&&typeof c=="string"?JSON.parse(c):void 0;return o?o[r]:void 0},hl=({name:r,filterKey:t="filter",searchParams:l})=>{const c=l.get(t||"filter")||void 0,o=c&&typeof c=="string"?JSON.parse(c):void 0,n=o?o[r]:void 0;return{start:n?JSON.parse(n).from:void 0,end:n?JSON.parse(n).to:void 0}},ut=({name:r,filterKey:t="filter",searchParams:l})=>{const c=l.get(t||"filter")||void 0,o=c&&typeof c=="string"?JSON.parse(c):void 0,n=o?o[r]:void 0;return n?JSON.parse(n):void 0},fl=(r,{filterKey:t="filter",perPageKey:l="perPage",pageKey:c="page"})=>{const o=r.get(t)||void 0,n=r.get(l)||void 0,a=r.get(c)||void 0;return!!o||!!n||!!a},pt=({isOpen:r,onClose:t,filterKey:l,pageKey:c,filters:o})=>{const{searchParams:n,setSearchParams:a,searchQueries:i}=be(),[h,s]=g.useState({}),y=()=>{n.delete(l||"filter"),a(n)},p=(C,b)=>{switch(C.type){case"radio":{const{show:L=!0}=C;return L&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:C.title})},b)}case"dropdown":{const{show:L=!0}=C;return L&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:C.title})},b)}case"date-range":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:C.title})},b);case"date":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:C.title})},b);case"dropdown-multiple":{const{show:L=!0}=C;return L&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:C.title})},b)}default:return null}};return e.jsx(st,{onHide:t,show:r||!1,children:e.jsxs(u.Box,{direction:"column",gap:"md",children:[e.jsxs(U.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(u.Box,{direction:"column",children:"Filter"}),e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},onClick:y,children:"Reset"})]}),o==null?void 0:o.map((C,b)=>p(C,b))]})})},Ct=({searchKey:r="q",statusKey:t="status",searchPlaceholder:l="Search",searchHighlightPlaceholder:c,extendedFilter:o,showSearchFilter:n=!0,showStatusFilter:a=!0,filterKey:i="filter",pageKey:h="page",customWidthSearch:s,handleOnReset:y,filterConfigs:p,buttonToggleProps:C,position:b="right",titleSearchLabel:L="Work Order",withTitleLabels:x=!1})=>{const m=(C==null?void 0:C.isShowLabel)??!0,[M,V]=g.useState(!1),[v,I]=g.useState(0),T=()=>{I(q=>q+1)},{searchParams:E,setSearchParams:Z,getQueryParam:K}=be(),$=Ie.searchParamsToObject(E.toString()),G=kr(r,E,i)||"",[R,ne]=g.useState(G),re=K(i),le=!!(re&&!(()=>{if(re)try{const q=JSON.parse(re);return Object.keys(q).length===1&&q[r]===""}catch(q){console.error("Filter parameter is not a valid JSON:",q)}return!1})()),Q=oe.useMediaQuery("md");return g.useEffect(()=>{ne(G)},[G]),g.useEffect(()=>{if(R===G)return;const q=window.setTimeout(()=>{Ve({value:R,name:r,type:"search",searchQueries:$,setSearchParams:Z,filterKey:i,pageKey:h})},350);return()=>{window.clearTimeout(q)}},[R,G,r,$,Z,i,h]),e.jsxs(U.Flex,{gap:"md",style:{flexDirection:Q&&b==="left"?"row":Q&&b==="right"?"row-reverse":"column"},align:"flex-end",children:[le&&e.jsx(u.Box,{direction:"column",justify:"flex-end",children:e.jsx(W.Button,{onClick:()=>{const q=new URLSearchParams(E);q.delete(i),Z(q),ne(""),T(),y&&y()},variant:"outline",tone:"neutral",children:e.jsx(D.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:q,content:ie,title:ue,onClickContainer:pe},Pe)=>e.jsxs(u.Box,{direction:"column",gap:"sm",onClick:pe,style:{minWidth:q},children:[ue&&e.jsx(ye.SubH3,{children:ue}),ie]},`extended-filter-${Pe}-${v}`)),!!(p!=null&&p.length)&&e.jsx(W.Button,{primary:le,secondary:!le,iconLeft:e.jsx(k.Icon,{size:"sm",name:(C==null?void 0:C.icon)||"FilterHorizontal",style:{color:re?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!Q,onClick:()=>V(!0),children:m?"Filter":void 0}),a&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[x&&e.jsx(ye.SubH3,{children:"Status"}),e.jsx(Le.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Ke({get:"value",name:t,searchParams:E,filterKey:i})?[{label:Ke({get:"value",name:t,searchParams:E,filterKey:i})==="active"?"Active":"InActive",value:Ke({get:"value",name:t,searchParams:E,filterKey:i})}]:[],onChange:q=>Ve({value:q,name:t,type:"dropdown",searchQueries:$,setSearchParams:Z,filterKey:i}),placeholder:x?"All":"All Status"},v)]}),n&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{width:s&&Q?s:Q?"310px":""},children:[x&&e.jsxs(ye.SubH3,{children:["Search for ",L]}),e.jsx(Se.Input,{placeholder:l,leftIcon:e.jsx(k.Icon,{name:"Search",width:20,height:20}),onChange:q=>ne(q.target.value),value:R,fullWidth:!0},v+1+i)]}),e.jsx(pt,{isOpen:M,onClose:()=>V(!1),filterKey:i,filters:p,pageKey:h})]})},gl=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r;function yl({configs:r,filterKey:t="filter",activeFilterKey:l="filters",pageKey:c="page",searchKey:o="q"}){const{searchParams:n,setSearchParams:a,searchQueries:i}=be(),h=g.useMemo(()=>Object.fromEntries(r.map(v=>[v.key,v])),[r]),s=g.useMemo(()=>{const v=(n.get(l)||"").split(",").map(T=>T.trim()).filter(Boolean);let I=[];try{const T=n.get(t);T&&(I=Object.keys(JSON.parse(T)).filter(E=>E!==o))}catch{}return r.map(T=>T.key).filter(T=>{const E=h[T];return(E==null?void 0:E.locked)||v.includes(T)||I.includes(T)})},[n,l,t,o,r,h]),y=g.useCallback(v=>{try{return v[t]?JSON.parse(v[t]):{}}catch{return{}}},[t]),p=g.useCallback(v=>{const I={...i};v.length?I[l]=v.join(","):delete I[l],a(I)},[i,l,a]),C=g.useCallback(v=>{s.includes(v)||p([...s,v])},[s,p]),b=g.useCallback(v=>{var Z;if((Z=h[v])!=null&&Z.locked)return;const I={...i},T=s.filter(K=>K!==v);T.length?I[l]=T.join(","):delete I[l];const E=y(I);v in E&&(delete E[v],Object.keys(E).length?I[t]=JSON.stringify(E):delete I[t]),delete I[c],a(I)},[i,s,l,t,c,y,a,h]),L=g.useCallback(v=>s.includes(v)?b(v):C(v),[s,C,b]),x=g.useCallback(v=>{switch(v.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return yt({name:v.key,get:"array",searchParams:n,filterKey:t})||[];case"date":{const I=ut({name:v.key,searchParams:n,filterKey:t});return I?new Date(I):void 0}case"date-compact":{const T=y(Object.fromEntries(n.entries()))[v.key];return T&&typeof T=="object"?T:void 0}default:return}},[n,t,y]),B=g.useCallback((v,I)=>{if(v.type==="date-compact"){const T={...i},E=y(T);I==null?delete E[v.key]:E[v.key]=I,Object.keys(E).length?T[t]=JSON.stringify(E):delete T[t],delete T[c],a(T);return}Ve({value:I,name:v.key,type:gl(v.type),searchQueries:i,setSearchParams:a,filterKey:t,pageKey:c})},[i,a,t,c,y]),m=g.useCallback(v=>{const I={...i},T=y(I);v in T&&(delete T[v],Object.keys(T).length?I[t]=JSON.stringify(T):delete I[t]),delete I[c],a(I)},[i,t,c,y,a]),M=g.useCallback(()=>{const v={...i};delete v[t],delete v[l],delete v[c],a(v)},[i,t,l,c,a]),V=s.length>0;return{activeKeys:s,configByKey:h,hasActiveFilter:V,addFilter:C,removeFilter:b,toggleFilter:L,getValue:x,setValue:B,clearValue:m,clearAll:M}}const xt={get(r){return He.storage.get(r)??null},set(r,t){He.storage.save(r,t)},remove(r){He.storage.delete(r)}},$e={columns:r=>`filterbar:colprefs:${r}`,savedViews:r=>`filterbar:views:${r}`,lastState:r=>`filterbar:last:${r}`},Fr=(r,t)=>{const l=new Set(t.map(n=>n.key)),c=r.order.filter(n=>l.has(n));for(const n of t)c.includes(n.key)||c.push(n.key);const o=r.hidden.filter(n=>l.has(n));return{order:c,hidden:o}};function ul({columns:r,scopeId:t,storage:l,onColumnsChange:c}){const o=g.useMemo(()=>({order:r.map(M=>M.key),hidden:[]}),[r]),n=t?$e.columns(t):void 0,[a,i]=g.useState(()=>{if(n){const M=l.get(n);if(M&&Array.isArray(M.order))return Fr(M,r)}return o}),h=r.map(M=>M.key).join("|");g.useEffect(()=>i(M=>Fr(M,r)),[h]);const s=g.useRef(!1);g.useEffect(()=>{s.current||(s.current=!0,c==null||c(a))},[]);const y=g.useCallback(M=>{i(M),n&&l.set(n,M),c==null||c(M)},[n,l,c]),p=g.useMemo(()=>{const M=new Map(r.map(V=>[V.key,V]));return a.order.filter(V=>M.has(V)).map(V=>({...M.get(V),visible:!a.hidden.includes(V)}))},[a,r]),C=g.useCallback(M=>{const V=a.hidden.includes(M)?a.hidden.filter(v=>v!==M):[...a.hidden,M];y({...a,hidden:V})},[a,y]),b=g.useCallback((M,V)=>{if(M===V)return;const v=[...a.order],[I]=v.splice(M,1);v.splice(V,0,I),y({...a,order:v})},[a,y]),L=g.useCallback(M=>{y({...a,hidden:M?r.filter(V=>!V.locked).map(V=>V.key):[]})},[a,r,y]),x=g.useCallback(()=>y(o),[y,o]),B=g.useCallback(M=>y(Fr(M,r)),[y,r]),m=a.hidden.length===0;return{state:a,orderedColumns:p,allVisible:m,toggleVisibility:C,reorder:b,setAllHidden:L,reset:x,applyState:B}}function pl({scopeId:r,storage:t,snapshotKeys:l,pageKey:c="page",getColumns:o,applyColumns:n}){const{searchParams:a,setSearchParams:i}=be(),h=r?$e.savedViews(r):void 0,[s,y]=g.useState(()=>h?t.get(h)||[]:[]),p=g.useCallback(x=>{y(x),h&&t.set(h,x)},[h]),C=g.useCallback(x=>{const B=x.trim();if(!B)return;const m={};l.forEach(V=>{const v=a.get(V);v!=null&&(m[V]=v)});const M={id:`${Date.now()}`,name:B,query:m,columns:o==null?void 0:o(),createdAt:Date.now()};p([...s,M])},[l,a,o,p,s]),b=g.useCallback(x=>p(s.filter(B=>B.id!==x)),[p,s]),L=g.useCallback(x=>{const B=Object.fromEntries(a.entries());l.forEach(m=>delete B[m]),Object.assign(B,x.query),delete B[c],i(B),x.columns&&(n==null||n(x.columns))},[a,l,c,i,n]);return{enabled:!!h,views:s,saveView:C,deleteView:b,applyView:L}}function Cl({scopeId:r,storage:t,snapshotKeys:l,enabled:c=!0}){const{searchParams:o,setSearchParams:n}=be(),a=r&&c?$e.lastState(r):void 0,i=g.useRef(!1);g.useEffect(()=>{if(i.current||(i.current=!0,!a)||l.some(p=>o.has(p)))return;const y=t.get(a);!y||Object.keys(y).length===0||n({...Object.fromEntries(o.entries()),...y})},[]),g.useEffect(()=>{if(!a)return;const s={};l.forEach(y=>{const p=o.get(y);p!=null&&(s[y]=p)}),t.set(a,s)},[o,a,l,t]);const h=g.useCallback(()=>{a&&t.remove(a)},[a,t]);return{enabled:!!a,clear:h}}const xl=({configs:r,activeKeys:t,onToggle:l,hasActiveFilter:c,onReset:o})=>r.length?e.jsxs(F.Menu,{position:"bottom-left",children:[e.jsx(F.MenuButton,{children:e.jsx(W.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(k.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(F.MenuLists,{children:e.jsx(F.MenuBody,{style:{minWidth:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),c&&o&&e.jsx(W.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:r.map(n=>e.jsx(F.MenuItem,{selected:n.locked||t.includes(n.key),disabled:n.locked,closeOnSelect:!1,startIcon:n.icon??void 0,onClick:()=>{n.locked||l(n.key)},children:n.label},n.key))})})]}):null,Re=({onClear:r,onRemove:t})=>e.jsxs(F.Menu,{position:"bottom-right",children:[e.jsx(F.MenuButton,{children:e.jsx(W.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(k.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(F.MenuLists,{children:e.jsxs(F.MenuBody,{style:{width:180},children:[e.jsx(F.MenuItem,{startIcon:e.jsx(k.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(F.MenuItem,{intent:"danger",startIcon:e.jsx(k.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),bt=24,Dt=r=>r.length>bt?`${r.slice(0,bt)}...`:r,er=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),rr={is:"Is","is-before":"Is before","is-after":"Is after","is-on-or-before":"Is on or before","is-on-or-after":"Is on or after","is-between":"Is between","is-relative-to-today":"Is relative to today","is-empty":"Is empty","is-not-empty":"Is not empty"},bl=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],Er={past:"Past",next:"Next",this:"This"},Dl=["day","week","month","year"],vl=["past","next","this"],wl=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},vt=(r,t,l)=>{const c=new Date(r);return l==="day"?c.setDate(c.getDate()+t):l==="week"?c.setDate(c.getDate()+t*7):l==="month"?c.setMonth(c.getMonth()+t):c.setFullYear(c.getFullYear()+t),c},Sl=r=>{const t=wl(new Date);if(r.direction==="this"){const c=new Date(t),o=new Date(t);return r.period==="week"?(c.setDate(t.getDate()-t.getDay()),o.setDate(c.getDate()+6)):r.period==="month"?(c.setDate(1),o.setMonth(o.getMonth()+1,0)):r.period==="year"&&(c.setMonth(0,1),o.setMonth(11,31)),{from:c,to:o}}const l=r.count??1;return r.direction==="past"?{from:vt(t,-l,r.period),to:t}:{from:t,to:vt(t,l,r.period)}},Bl=r=>r.field.type==="date-compact"?e.jsx(El,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(kl,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),kl=({field:r,value:t,onChange:l,onClear:c,onRemove:o})=>{const n=t?er(new Date(t)):null,a=!!n,i=a?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Dt(n)})]}):r.label;return e.jsxs(F.Menu,{position:"bottom-left",children:[e.jsx(F.MenuButton,{children:e.jsx(W.Button,{variant:a?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:a?e.jsx(k.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:i})}),e.jsx(F.MenuLists,{children:e.jsx(F.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Re,{onClear:c,onRemove:o})]}),children:e.jsx(ke.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:h=>h==null?c():l(h),withPadding:!1})})})]})},Fl=r=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${rr[r.op]} ${er(new Date(r.date))}`:null;case"is-between":return r.from&&r.to?`${er(new Date(r.from))} - ${er(new Date(r.to))}`:null;case"is-relative-to-today":{const t=r.relative;if(!t)return null;if(t.direction==="this")return`This ${t.period}`;const l=t.count??1,c=l===1?t.period:`${t.period}s`;return`${Er[t.direction]} ${l} ${c}`}case"is-empty":case"is-not-empty":return rr[r.op];default:return null}},El=({field:r,value:t,onChange:l,onClear:c,onRemove:o})=>{const n=(t==null?void 0:t.op)??"is",a=t?Fl(t):null,i=!!a,h=i?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Dt(a)})]}):r.label,s=y=>{if(y!==n){if(y==="is-empty"||y==="is-not-empty"){l({op:y});return}if(y==="is-relative-to-today"){l({op:y,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(y==="is-between"){l({op:y,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}l({op:y,date:t==null?void 0:t.date})}};return e.jsxs(F.Menu,{position:"bottom-left",children:[e.jsx(F.MenuButton,{children:e.jsx(W.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i?e.jsx(k.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:h})}),e.jsxs(F.MenuLists,{children:[e.jsx(F.MenuBody,{style:{width:320},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Ml,{op:n,onChange:s})]}),e.jsx(Re,{onClear:c,onRemove:o})]}),children:e.jsx(ml,{value:t,op:n,onChange:l})}),n==="is-relative-to-today"&&e.jsx(F.MenuFooter,{children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},Ml=({op:r,onChange:t})=>e.jsxs(F.Menu,{position:"bottom-left",children:[e.jsx(F.MenuButton,{children:e.jsx(W.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:rr[r]})}),e.jsx(F.MenuLists,{children:e.jsx(F.MenuBody,{style:{width:200},children:bl.map(l=>e.jsx(F.MenuItem,{selected:r===l,onClick:()=>t(l),endIcon:r===l?e.jsx(k.Icon,{name:"Check"}):void 0,children:rr[l]},l))})})]}),ml=({value:r,op:t,onChange:l})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const c=r!=null&&r.from||r!=null&&r.to?{from:r!=null&&r.from?new Date(r.from):null,to:r!=null&&r.to?new Date(r.to):null}:void 0;return e.jsx(ke.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:c,onChange:o=>{if(o==null){l({op:t});return}if(typeof o=="object"&&o!==null&&"from"in o&&"to"in o){let{from:n,to:a}=o;if(!n&&a&&(n=a,a=null),!n&&!a){l({op:t});return}l({op:t,from:n?n.toISOString():void 0,to:a?a.toISOString():void 0})}},withPadding:!1},"range")}return t==="is-relative-to-today"?e.jsx(Ll,{value:r==null?void 0:r.relative,onChange:c=>l({op:t,relative:c})}):e.jsx(ke.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:r!=null&&r.date?new Date(r.date):void 0,onChange:c=>{if(c==null){l({op:t});return}c instanceof Date&&l({op:t,date:c.toISOString()})},withPadding:!1},"single")},Ll=({value:r,onChange:t})=>{const l=(r==null?void 0:r.direction)??"past",c=(r==null?void 0:r.count)??1,o=(r==null?void 0:r.period)??"week",n=l!=="this",a=Sl({direction:l,count:c,period:o});return e.jsxs(u.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(F.Menu,{position:"bottom-left",children:[e.jsx(F.MenuButton,{children:e.jsx(W.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:Er[l]})}),e.jsx(F.MenuLists,{children:e.jsx(F.MenuBody,{style:{width:140},children:vl.map(i=>e.jsx(F.MenuItem,{selected:l===i,endIcon:l===i?e.jsx(k.Icon,{name:"Check"}):void 0,onClick:()=>t(i==="this"?{direction:i,period:o}:{direction:i,count:c,period:o}),children:Er[i]},i))})})]}),n&&e.jsx(Se.Input,{type:"number",size:"sm",min:1,clearable:!1,value:c,onChange:i=>{const h=Number(i.target.value);t({direction:l,count:Number.isFinite(h)&&h>0?h:1,period:o})},style:{width:72}}),e.jsxs(F.Menu,{position:"bottom-left",children:[e.jsx(F.MenuButton,{children:e.jsx(W.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(F.MenuLists,{children:e.jsx(F.MenuBody,{style:{width:140},children:Dl.map(i=>e.jsx(F.MenuItem,{selected:o===i,endIcon:o===i?e.jsx(k.Icon,{name:"Check"}):void 0,onClick:()=>t(l==="this"?{direction:l,period:i}:{direction:l,count:c,period:i}),children:i},i))})})]})]}),e.jsx(ke.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:a,onChange:()=>{},withPadding:!1},"relative-preview")]})},wt=18,Il=r=>r.length>wt?`${r.slice(0,wt)}...`:r,Tl=({field:r,value:t,onChange:l,onClear:c,onRemove:o})=>{const n=r.type==="dropdown-multiple",a=t.length,[i,h]=g.useState(""),s=r.options,y=typeof r.onSearch=="function",p=(()=>{if(y)return s;const B=i.trim().toLowerCase();return B?s.filter(m=>m.label.toLowerCase().includes(B)):s})(),C=B=>t.some(m=>m.value===B.value),b=B=>{if(!n){l([{label:B.label,value:B.value}]),h("");return}l(C(B)?t.filter(m=>m.value!==B.value):[...t,{label:B.label,value:B.value}])},L=B=>{var m;h(B),(m=r.onSearch)==null||m.call(r,B)},x=a===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:a===1?Il(t[0].label):`${a} Selected`})]});return e.jsxs(F.Menu,{position:"bottom-left",children:[e.jsx(F.MenuButton,{children:e.jsx(W.Button,{variant:a>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:a>0?e.jsx(k.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:x})}),e.jsx(F.MenuLists,{children:e.jsx(F.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Re,{onClear:c,onRemove:o})]}),children:e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(Le.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:n,searchAble:!0,searchValue:i,onSearch:L,value:t,onChange:l,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(B=>e.jsx(F.MenuItem,{closeOnSelect:!n,selected:C(B),startIcon:B.avatar,endIcon:C(B)?e.jsx(k.Icon,{name:"Check"}):void 0,description:B.description,onClick:()=>b(B),children:B.label},B.value))})]})})})]})},St=18,Ol=r=>r.length>St?`${r.slice(0,St)}...`:r,Bt=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(Oe.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),Wl=({field:r,value:t,onChange:l,onClear:c,onRemove:o})=>{const n=new Set(t.map(C=>C.value)),a=t.length,i=r.options.length>0&&r.options.every(C=>n.has(C.value)),h=a>0&&!i,s=C=>{l(n.has(C.value)?t.filter(b=>b.value!==C.value):[...t,{label:C.label,value:C.value}])},y=()=>{l(i?[]:r.options.map(C=>({label:C.label,value:C.value})))},p=a===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(D.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(D.Text,{as:"span",children:a===1?Ol(t[0].label):`${a} Selected`})]});return e.jsxs(F.Menu,{position:"bottom-left",children:[e.jsx(F.MenuButton,{children:e.jsx(W.Button,{variant:a>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:a>0?e.jsx(k.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:p})}),e.jsx(F.MenuLists,{children:e.jsxs(F.MenuBody,{style:{width:240},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Re,{onClear:c,onRemove:o})]}),children:[e.jsx(F.MenuItem,{closeOnSelect:!1,selected:i,onClick:y,startIcon:e.jsx(Bt,{checked:i||h,indeterminate:h}),children:"Select All"}),r.options.map(C=>e.jsx(F.MenuItem,{closeOnSelect:!1,selected:n.has(C.value),onClick:()=>s(C),startIcon:e.jsx(Bt,{checked:n.has(C.value)}),children:C.label},C.value))]})})]})},Al=({activeKeys:r,configByKey:t,getValue:l,setValue:c,clearValue:o,removeFilter:n})=>e.jsx(e.Fragment,{children:r.map(a=>{const i=t[a];if(!i)return null;const h=l(i),s=i.locked?void 0:()=>n(a);return i.type==="date"||i.type==="date-compact"?e.jsx(Bl,{field:i,value:h,onChange:y=>c(i,y),onClear:()=>o(a),onRemove:s},a):i.type==="checkbox-multiple"?e.jsx(Wl,{field:i,value:h||[],onChange:y=>c(i,y),onClear:()=>o(a),onRemove:s},a):e.jsx(Tl,{field:i,value:h||[],onChange:y=>c(i,y),onClear:()=>o(a),onRemove:s},a)})}),kt=r=>`${r} Rows`,zl=({pagination:r,pageKey:t="page",perPageKey:l="perPage",pageSizeOptions:c=[10,25,50,100],defaultPerPage:o=10,showResultCount:n=!0,showPageSize:a=!0,showPagination:i=!0})=>{var m;const{searchQueries:h,setSearchParams:s,searchParams:y}=be(),p=y.get(l),C=p?Number(p):o,b=M=>{s({...h,[t]:String(M)})},L=M=>{s({...h,[l]:M,[t]:"1"})},x=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),B=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[n&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${x}-${B} of ${((m=r==null?void 0:r.totalData)==null?void 0:m.toLocaleString())||0}`}),a&&e.jsxs(F.Menu,{position:"bottom-left",children:[e.jsx(F.MenuButton,{children:e.jsx(W.Button,{variant:"outline",tone:"neutral",size:"xs",iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:kt(C)})}),e.jsx(F.MenuLists,{children:e.jsx(F.MenuBody,{children:c.map(M=>e.jsx(F.MenuItem,{selected:M===C,onClick:()=>L(String(M)),children:kt(M)},M))})})]}),i&&!!(r!=null&&r.totalPage)&&e.jsx(u.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"lg",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(Ge.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:r!=null&&r.currentPage?Number(r.currentPage):1,totalPages:Number(r.totalPage),onPageChange:b})})]})};function Hl(r,t,l=!0){g.useEffect(()=>{if(!l)return;const c=o=>{var i;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==r)return;const n=o.target,a=(i=n==null?void 0:n.tagName)==null?void 0:i.toLowerCase();a==="input"||a==="textarea"||n!=null&&n.isContentEditable||(o.preventDefault(),t())};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[r,t,l])}const jl=240,Vl=({searchKey:r="q",filterKey:t="filter",pageKey:l="page",placeholder:c="Search",shortcut:o="/"})=>{const{searchParams:n,setSearchParams:a,searchQueries:i}=be(),h=kr(r,n,t)||"",[s,y]=g.useState(!!h),[p,C]=g.useState(!h),[b,L]=g.useState(h),x=oe.useDebounce(b,350),B=g.useRef(null);g.useEffect(()=>{L(h),h&&y(!0)},[h]),g.useEffect(()=>{s&&C(!1)},[s]),g.useEffect(()=>{x!==h&&Ve({value:x,name:r,type:"search",searchQueries:i,setSearchParams:a,filterKey:t,pageKey:l})},[x]);const m=g.useCallback(()=>{y(!0),requestAnimationFrame(()=>{var I;return(I=B.current)==null?void 0:I.focus()})},[]);Hl(o,m);const M=()=>{b||y(!1)},V=I=>{var T;I.key==="Escape"&&!b&&(y(!1),(T=B.current)==null||T.blur())},v=()=>{s||C(!0)};return e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(W.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(k.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:m}),e.jsxs(u.Box,{onTransitionEnd:v,style:{position:"relative",width:s?jl:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(Se.Input,{ref:B,size:"sm",fullWidth:!0,value:b,placeholder:c,leftIcon:e.jsx(k.Icon,{name:"Search",width:16,height:16}),onChange:I=>L(I.target.value),onKeyDown:V,onBlur:M,tabIndex:s?0:-1}),s&&!b&&e.jsx(u.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-surface-hover, #f1f2f4)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(D.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},Nl=({columns:r,allVisible:t,onToggle:l,onReorder:c,onSetAllHidden:o})=>{const[n,a]=g.useState(null),[i,h]=g.useState(null),s=()=>{n!==null&&i!==null&&n!==i&&c(n,i),a(null),h(null)},y=(p,C)=>{const b=p+C;b<0||b>=r.length||c(p,b)};return e.jsxs(F.Menu,{position:"bottom-right",children:[e.jsx(F.MenuButton,{children:e.jsx(W.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(k.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(F.MenuLists,{children:e.jsx(F.MenuBody,{children:e.jsxs(u.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(W.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(t),children:t?"Hide All":"Show All"})]}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((p,C)=>{const b=!p.locked,L=i===C&&n!==null&&n!==C;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:b,onDragStart:()=>b&&a(C),onDragOver:x=>{x.preventDefault(),h(C)},onDrop:s,onDragEnd:s,style:{minHeight:32,boxShadow:L?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(u.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:b?0:-1,"aria-label":`Reorder ${p.title}`,"aria-disabled":!b||void 0,color:"icon-subtlest",onKeyDown:x=>{b&&(x.key==="ArrowUp"?(x.preventDefault(),y(C,-1)):x.key==="ArrowDown"&&(x.preventDefault(),y(C,1)))},style:{display:"inline-flex",cursor:b?"grab":"default",opacity:b?1:.4},children:e.jsx(k.Icon,{name:"DragVertical",width:16,height:16})}),p.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:p.icon}),e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:p.title}),e.jsx(u.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(je.Toggle,{size:"sm",checked:p.visible,disabled:p.locked,onChange:()=>l(p.key),"aria-label":`Toggle ${p.title} column`})})]},p.key)})})]})})})]})},Pl=({views:r,onApply:t,onDelete:l,onSave:c})=>{const[o,n]=g.useState(""),a=()=>{const i=o.trim();i&&(c(i),n(""))};return e.jsxs(F.Menu,{position:"bottom-right",children:[e.jsx(F.MenuButton,{children:e.jsx(W.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(k.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(F.MenuLists,{style:{width:"260px"},children:[e.jsx(F.MenuBody,{children:e.jsxs(u.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(u.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(D.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(i=>e.jsx(F.MenuItem,{startIcon:e.jsx(k.Icon,{name:"Bookmark"}),onClick:()=>t(i),endIcon:e.jsx(W.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(k.Icon,{name:"Trash2"}),"aria-label":`Delete ${i.name}`,onClick:h=>{h.stopPropagation(),l(i.id)}}),children:i.name},i.id))})]})}),e.jsx(F.MenuFooter,{children:e.jsxs(u.Box,{direction:"row",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(Se.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:i=>n(i.target.value),onKeyDown:i=>{i.key==="Enter"&&a()}})}),e.jsx(W.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:a,children:"Save"})]})})]})]})},_l=({withPadding:r=!1,filterConfigs:t=[],filterKey:l="filter",activeFilterKey:c="filters",pageKey:o="page",perPageKey:n="perPage",pageSizeOptions:a=[10,25,50,100],showPagination:i=!0,showResultCount:h=!0,showPageSize:s=!0,searchable:y=!1,searchKey:p="q",searchPlaceholder:C="Search",searchShortcut:b="/",pagination:L,columns:x=[],onColumnsChange:B,savedViews:m,persistLastState:M=!0,storage:V=xt,onReset:v})=>{const{activeKeys:I,configByKey:T,hasActiveFilter:E,toggleFilter:Z,removeFilter:K,getValue:$,setValue:G,clearValue:R,clearAll:ne}=yl({configs:t,filterKey:l,activeFilterKey:c,pageKey:o,searchKey:p}),re=ul({columns:x,scopeId:m==null?void 0:m.scopeId,storage:V,onColumnsChange:B}),ee=pl({scopeId:m==null?void 0:m.scopeId,storage:V,snapshotKeys:[c,l,n],pageKey:o,getColumns:()=>re.state,applyColumns:re.applyState}),le=Cl({scopeId:m==null?void 0:m.scopeId,storage:V,snapshotKeys:[c,l,n,o],enabled:M}),Q=!!(m!=null&&m.enabled)&&ee.enabled,q=()=>{ne(),le.clear(),v==null||v()};return e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(xl,{configs:t,activeKeys:I,onToggle:Z,hasActiveFilter:E,onReset:q}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Al,{activeKeys:I,configByKey:T,getValue:$,setValue:G,clearValue:R,removeFilter:K}),E&&e.jsx(W.Button,{variant:"link",tone:"brand",size:"sm",onClick:q,children:"Reset"})]})]}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[e.jsx(zl,{pagination:L,pageKey:o,perPageKey:n,pageSizeOptions:a,showPagination:i,showResultCount:h,showPageSize:s}),y&&e.jsx(Vl,{searchKey:p,filterKey:l,pageKey:o,placeholder:C,shortcut:b}),Q&&e.jsx(Pl,{views:ee.views,onApply:ee.applyView,onDelete:ee.deleteView,onSave:ee.saveView}),x.length>0&&e.jsx(Nl,{columns:re.orderedColumns,allVisible:re.allVisible,onToggle:re.toggleVisibility,onReorder:re.reorder,onSetAllHidden:re.setAllHidden})]})]})},Ft=({children:r,borderRadius:t,height:l})=>{const c=g.useRef(null),[o,n]=g.useState("100vh");return g.useEffect(()=>{if(l)return;const a=()=>{if(c.current){const i=c.current.getBoundingClientRect().top;n(`calc(100vh - ${i}px)`)}};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[l]),e.jsx(u.Box,{ref:c,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:t||"rounded-xs",style:{height:l??o,display:"flex",flexDirection:"column"},children:r})},Et=({action:r,rightContent:t,leftContent:l,headerSlot:c,advanceFilter:o,showFilter:n=!0})=>{const a=oe.useMediaQuery("md"),i=n?e.jsx(Ct,{...o}):null,h=()=>r?g.isValidElement(r)?r:e.jsx(u.Box,{style:{display:"flex",flexDirection:a?"row":"column",gap:"8px",width:a?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:s,icon:y,buttonProps:p,onClick:C},b)=>!s&&!y?null:e.jsx(W.Button,{fullWidth:!a,iconLeft:y?e.jsx(k.Icon,{name:y}):void 0,onClick:C,...p,children:s},`action-${b}`))}):null;return e.jsx(u.Box,{style:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center",paddingLeft:"8px",paddingRight:"8px",paddingTop:"8px",paddingBottom:"8px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0,position:"relative",zIndex:10,flexDirection:a?"row":"column-reverse",gap:"16px"},children:c?c({filter:i}):e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[i,l]}),e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,h()]})]})})},Zl=({totalData:r,withMarginBottom:t=!0,withMarginTop:l=!0})=>e.jsxs(u.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:l?"16px":void 0},children:[e.jsxs(ye.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(ye.Body1,{children:r||0})]}),Mt=({pagination:r,pageKey:t="page",perPageKey:l="perPage",defaultPerPage:c=10,showPagination:o=!0,totalData:n})=>{const{searchQueries:a,setSearchParams:i,searchParams:h}=be(),s=h.get(l),y=L=>{i({...a,[t]:String(L)})},p=L=>{i({...a,[l]:L,[t]:"1"})},C=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),b=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsx(u.Box,{style:{display:"flex",width:"100%",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0},children:o?e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(D.Text,{children:"Rows Per Page: "}),e.jsx(Le.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:L=>{p(L[0].value)},value:s?[{label:`${s} per row`,value:s}]:[{label:`${c} per row`,value:`${c}`}],defaultValue:s?[{label:`${s} per row`,value:s}]:[{label:`${c} per row`,value:`${c}`}]}),e.jsx(D.Text,{children:`${C}-${b} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(Ge.Pagination,{currentPage:r!=null&&r.currentPage?Number(r==null?void 0:r.currentPage):1,totalPages:r!=null&&r.totalPage?Number(r==null?void 0:r.totalPage):1,onPageChange:y})]}):e.jsx(Zl,{totalData:n,withMarginBottom:!1,withMarginTop:!1})})},mt=({filter:r,columnTitle:t})=>{const[l,c]=g.useState(!1),o=g.useRef(null),n=g.useRef(null),a=g.useRef(null),[i,h]=g.useState(""),[s,y]=g.useState({top:0,left:0}),p=r.selectedValues,C=g.useMemo(()=>i?r.options.filter(x=>x.label.toLowerCase().includes(i.toLowerCase())):r.options,[r.options,i]);g.useEffect(()=>{if(l&&n.current){const x=n.current.getBoundingClientRect(),B=280,m={top:x.bottom+8};r.position==="left"||x.left+B>window.innerWidth?m.right=window.innerWidth-x.right:m.left=x.left,y(m)}},[l,r.position]),g.useEffect(()=>{l&&a.current?setTimeout(()=>{var x;return(x=a.current)==null?void 0:x.focus()},50):h("")},[l]),g.useEffect(()=>{const x=B=>{o.current&&!o.current.contains(B.target)&&n.current&&!n.current.contains(B.target)&&c(!1)};return l&&document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[l]);const b=x=>{const B=p.includes(x)?p.filter(m=>m!==x):[...p,x];r.onFilterChange(B)},L=()=>r.onFilterChange([]);return e.jsxs(u.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(u.Box,{ref:n,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:x=>{var B;x.stopPropagation(),l||(B=r.onOpen)==null||B.call(r),c(m=>!m)},children:e.jsx(k.Icon,{name:l?"ChevronUp":"ChevronDown",size:"sm",style:{color:p.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),l&&e.jsxs(u.Box,{ref:o,style:{position:"fixed",top:`${s.top}px`,...s.left!==void 0?{left:`${s.left}px`}:{right:`${s.right}px`},backgroundColor:"white",borderRadius:"4px",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(D.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),p.length>0&&e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(D.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:x=>{x.stopPropagation(),L()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(u.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(Se.Input,{ref:a,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(k.Icon,{name:"Search",size:"sm"}),value:i,onChange:x=>h(x.target.value),style:{fontSize:"14px"}})}),e.jsx(u.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:r.isLoadingOptions?e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(k.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):C.length>0?e.jsx(u.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:C.map(x=>e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:p.includes(x.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:B=>{B.stopPropagation(),b(x.value)},onMouseEnter:B=>{p.includes(x.value)||(B.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),B.currentTarget.style.transform="translateX(2px)"},onMouseLeave:B=>{B.currentTarget.style.backgroundColor=p.includes(x.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",B.currentTarget.style.transform="translateX(0)"},children:[e.jsx(Oe.Checkbox,{checked:p.includes(x.value),onChange:()=>{}}),e.jsx(D.Text,{fontSize:"sm",fontWeight:p.includes(x.value)?"medium":"normal",color:p.includes(x.value)?"primary":"gray-700",children:x.label})]},x.value))}):e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(k.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),p.length>0&&e.jsx(u.Box,{direction:"column",style:{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",backgroundColor:"var(--sa-color-brand-50, #e6edf6)",marginTop:"auto"},children:e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(u.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:p.length}),e.jsxs(D.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",p.length>1?"s":""," selected"]})]})})]})]})},ql=({direction:r})=>{const t="var(--sa-text-primary, #292a2e)",l="var(--sa-text-subtle, #8c8f97)",c=r==="asc"?t:l,o=r==="desc"?t:l,n=r==="asc"?1:.45,a=r==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:c,opacity:n,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:a},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},Ql=({frozen:r})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:r?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),Mr="var(--sa-background-primary, #ffffff)",Lt="var(--sa-background-primary-inverse, #f8f8f8)",It=({columns:r,records:t,handleDetail:l,handleUpdate:c,handleDelete:o,isLoading:n,visibleHandleDelete:a,visibleHandleUpdate:i,visibleHandleDetail:h,showHeadBorder:s=!1,scrollParentRef:y,frozenCount:p=0,onFrozenCountChange:C,customActions:b,actionsOrder:L=["detail","update","delete","custom"],customEmptyState:x,enableColumnResize:B=!1,defaultColumnWidths:m,onColumnWidthsChange:M,defaultMinColumnWidth:V=60,sort:v,defaultSort:I,onSortChange:T,showActionDivider:E=!1})=>{const Z=v!==void 0,[K,$]=g.useState(I??null),G=Z?v??null:K,R=S=>{if(S.sortKey)return S.sortKey;if(typeof S.accessor=="string")return S.accessor},ne=S=>{const A=R(S);if(!A)return;let O;!G||G.key!==A?O={key:A,direction:"asc"}:G.direction==="asc"?O={key:A,direction:"desc"}:O=null,Z||$(O),T==null||T(O)},ee=[l,c,o].filter(S=>S!==void 0).length,le=!!b,Q=!!l||!!c||!!o||le,q="var(--sa-border-subtle, #0b120e24)",ie=`1px solid ${q}`,ue=`inset 1px 0 0 ${q}`,pe=`inset -1px 0 0 ${q}`,Pe=ee===3?le?"178px":"140px":ee===2?le?"140px":"102px":ee===1?le?"112px":"74px":le?"74px":"",ar=(S,A)=>{if(!A)return S;if(typeof A=="function")return A(S);if(typeof A=="string")return S[A]},[Lr,sr]=g.useState(!1);g.useEffect(()=>{if(!(y!=null&&y.current))return;const S=y.current;sr(S.scrollHeight>S.clientHeight)},[t,y]);const _e=g.useRef(null),[he,dr]=g.useState([]),[Ze,We]=g.useState(()=>m??{}),Ae=g.useRef(null);g.useLayoutEffect(()=>{if(!p||!_e.current){dr([]);return}const S=Array.from(_e.current.querySelectorAll("thead tr th")),A=[];let O=0;S.forEach((z,P)=>{A[P]=O,P<p&&(O+=z.offsetWidth)}),dr(A)},[p,r,t,Ze]);const hr=S=>{C&&C(S<p?S:S+1)},w=(S,A)=>{const O=Ze[S];if(O!==void 0){const z=`${O}px`;return{width:z,minWidth:z,maxWidth:z}}return A?{width:A}:{}},H=S=>B&&(S.resizable??!0),N=(S,A)=>{S.preventDefault(),S.stopPropagation();const O=S.currentTarget.closest("th");if(!O)return;const z=Math.round(O.getBoundingClientRect().width);Ae.current={colIndex:A,startX:S.clientX,startWidth:z};const P=document.body.style.userSelect,se=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const fe=ve=>{var Qe;const xe=Ae.current;if(!xe)return;const Ir=((Qe=r[xe.colIndex])==null?void 0:Qe.minWidth)??V,qe=Math.max(Ir,xe.startWidth+(ve.clientX-xe.startX));We(ze=>ze[xe.colIndex]===qe?ze:{...ze,[xe.colIndex]:qe})},Be=()=>{document.removeEventListener("mousemove",fe),document.removeEventListener("mouseup",Be),document.body.style.userSelect=P,document.body.style.cursor=se,Ae.current=null,M&&We(ve=>(M(ve),ve))};document.addEventListener("mousemove",fe),document.addEventListener("mouseup",Be)};return e.jsx("div",{ref:_e,children:e.jsxs(Y.Table,{fullWidth:!0,children:[e.jsx(Y.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(Y.Tr,{children:[r.map((S,A)=>{var Vt,Nt;const O=p>0&&A<p,z=he[A]??0,P=H(S),fe=A===r.length-1&&Q&&E,Be=R(S),ve=!!S.sortable&&!!Be,xe=ve&&(G==null?void 0:G.key)===Be?G.direction:null,Ir=S.title||((Vt=S.accessor)==null?void 0:Vt.toString())||"",qe=(Nt=S.headerTooltip)!=null&&Nt.showIcon?e.jsx(k.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Qe=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ir}),ze=ve?e.jsxs("button",{type:"button",onClick:()=>ne(S),title:xe==="asc"?"Sorted ascending — click to sort descending":xe==="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:S.textAlign==="text-right"?"right":S.textAlign==="text-center"?"center":"left"},children:[Qe,qe,e.jsx(ql,{direction:xe})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Qe,qe]});return e.jsxs(Y.Th,{style:{position:"sticky",top:0,left:O?z:void 0,zIndex:O?4:2,paddingLeft:A===0?"12px":"",borderRight:s&&!fe&&!O?ie:void 0,borderBottom:s?ie:void 0,boxShadow:s&&O?pe:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:S.textAlign==="text-right"?"right":S.textAlign==="text-center"?"center":"left",...w(A,S.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[S.headerTooltip?e.jsx(de.Tooltip,{label:S.headerTooltip.content,position:"bottom",children:ze}):ze,S.filter&&e.jsx(mt,{filter:S.filter,columnTitle:S.title}),C&&e.jsx("button",{onClick:()=>hr(A),title:O?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:O?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:O?1:.45,transition:"opacity 0.15s"},children:e.jsx(Ql,{frozen:O})})]}),P&&e.jsx("div",{onMouseDown:Tr=>N(Tr,A),onClick:Tr=>Tr.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-${A}`)}),Q?e.jsx(Y.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:s?ie:void 0,boxShadow:s&&E?ue:void 0}}):null]})}),e.jsx(Y.Tbody,{children:n?e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:r.length+1,children:e.jsxs(u.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Fe.Skeleton,{variant:"list"}),e.jsx(Fe.Skeleton,{variant:"list"}),e.jsx(Fe.Skeleton,{variant:"list"}),e.jsx(Fe.Skeleton,{variant:"list"}),e.jsx(Fe.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&x?e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:r.length+1,children:x})}):t==null?void 0:t.map((S,A)=>e.jsxs(Y.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:A===t.length-1&&Lr?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:O=>{const z=O.currentTarget;z.style.backgroundColor=Lt,Array.from(z.querySelectorAll("td")).forEach(P=>{P.style.position==="sticky"&&(P.style.backgroundColor=Lt)})},onMouseLeave:O=>{const z=O.currentTarget;z.style.backgroundColor="",Array.from(z.querySelectorAll("td")).forEach(P=>{P.style.position==="sticky"&&(P.style.backgroundColor=Mr)})},children:[r.map((O,z)=>{const P=O.render?O.render(S,A,t):ar(S,O.accessor),se=p>0&&z<p,fe=he[z]??0,Be=Ze[z]!==void 0,ve=se&&z===p-1;return e.jsx(Y.Td,{style:{position:se?"sticky":void 0,left:se?fe:void 0,zIndex:se?1:void 0,backgroundColor:se?Mr:void 0,transition:se?"background-color 0.3s ease":void 0,paddingLeft:z===0?"12px":"",whiteSpace:"nowrap",overflow:Be?"hidden":void 0,borderLeft:O.showBorderLeft?ie:void 0,borderRight:O.showBorderRight?ie:void 0,boxShadow:ve?pe:void 0,textAlign:O.textAlign==="text-right"?"right":O.textAlign==="text-center"?"center":"left",...w(z,O.width)},children:typeof P=="string"?e.jsx(D.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:O.textAlign==="text-right"?"right":O.textAlign==="text-center"?"center":"left"},children:P}):P},`row-${A}-col-${z}`)}),Q?e.jsx(Y.Td,{style:{width:Pe,position:"sticky",right:0,zIndex:1,backgroundColor:Mr,boxShadow:E?ue:void 0,transition:"background-color 0.3s ease"},children:e.jsx(U.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:L.map(O=>{const z=A===t.length-1?"top":"bottom";return O==="detail"&&l&&(h==null?void 0:h(S))!==!1?e.jsx(de.Tooltip,{label:"Detail",position:z,children:e.jsx(W.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(S.id,S),iconLeft:e.jsx(k.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):O==="update"&&c&&(i==null?void 0:i(S))!==!1?e.jsx(de.Tooltip,{label:"Update",position:z,children:e.jsx(W.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>c(S),iconLeft:e.jsx(k.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):O==="delete"&&o&&(a==null?void 0:a(S))!==!1?e.jsx(de.Tooltip,{label:"Delete",position:z,children:e.jsx(W.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(S.id,S),iconLeft:e.jsx(k.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):O==="custom"?e.jsx(g.Fragment,{children:b==null?void 0:b(S)},"custom"):null})})}):null]},`${S}${A}`))})]})})},Gl=({wrapperProps:r,dataTableProps:t,headerProps:l,footerProps:c})=>{var p;const o=g.useRef(null),[n,a]=g.useState((t==null?void 0:t.defaultFrozenCount)??0),i=(l==null?void 0:l.show)??!0,h=g.useRef(null),s=(p=t==null?void 0:t.pagination)==null?void 0:p.totalData;typeof s=="number"&&(h.current=s);const y=(c==null?void 0:c.showFooter)??(s===void 0?h.current!==0:s!==0);return e.jsxs(Ft,{...r,children:[i&&e.jsx(Et,{...l}),e.jsx(u.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(It,{...t,scrollParentRef:o,frozenCount:t!=null&&t.enableFreezeColumns?n:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?a:void 0}):null}),y&&e.jsx(Mt,{pagination:t==null?void 0:t.pagination,pageKey:t==null?void 0:t.pageKey,perPageKey:t==null?void 0:t.perPageKey,defaultPerPage:t==null?void 0:t.defaultPerPage,showPagination:t==null?void 0:t.showPagination,totalData:c==null?void 0:c.totalData})]})};function Jl(r){return g.memo(r)}const Ul=Jl(Gl),Tt=r=>r==="right"?"right":r==="center"?"center":"left",Yl=(r,t)=>{if(t)return r[t]},Ot=r=>({textAlign:Tt(r.align),width:r.width,minWidth:r.minWidth}),Xl=({columns:r,data:t,getRowKey:l,size:c="md",emptyState:o})=>e.jsxs(Y.Table,{fullWidth:!0,size:c,resizable:!0,children:[e.jsx(Y.Thead,{children:e.jsx(Y.Tr,{children:r.map((n,a)=>e.jsx(Y.Th,{style:Ot(n),children:n.title},`dg-head-${a}`))})}),e.jsx(Y.Tbody,{children:t.length===0?e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:r.length,children:o})}):t.map((n,a)=>e.jsx(Y.Tr,{children:r.map((i,h)=>{const s=i.render?i.render(n,a,t):Yl(n,i.accessor);return e.jsx(Y.Td,{style:Ot(i),children:typeof s=="string"?e.jsx(D.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Tt(i.align)},children:s}):s},`dg-cell-${a}-${h}`)})},l?l(n,a):a))})]}),tr=({of:r,render:t})=>g.Children.toArray(r==null?void 0:r.map((l,c,o)=>t(l,c,o))),J=({condition:r,fallback:t,children:l,loading:c,isLoading:o})=>e.jsx(e.Fragment,{children:o?c:r?l:t}),X=r=>e.jsx(D.Text,{...r,fontFamily:"Poppins",fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),De=r=>e.jsx(D.Text,{color:"red-600",fontSize:"sm",children:r.message}),Kl=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:c=!1,...o})=>{var i,h,s;const n=o.hideMessageError||!1,a=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(J,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:a,fullWidth:c,children:[e.jsx(X,{children:o.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:a,fullWidth:c,children:[e.jsxs(U.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(X,{fontSize:r,children:o.title}),e.jsx(X,{color:"error",fontSize:r,children:l}),e.jsx(J,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(de.Tooltip,{label:(h=o.tooltip)==null?void 0:h.label,arrowPosition:(s=o.tooltip)==null?void 0:s.arrowPosition,...o.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(J,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(Se.Input,{ref:o.inputRef,size:r,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!n&&o.errorMessage&&e.jsx(De,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},$l=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:c=!1,...o})=>{var i,h,s;const n=o.hideMessageError||!1,a=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(J,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:a,fullWidth:c,children:[e.jsx(X,{children:o.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:a,fullWidth:c,children:[e.jsxs(U.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(X,{fontSize:r,children:o.title}),e.jsx(X,{color:"error",fontSize:r,children:l}),e.jsx(J,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(de.Tooltip,{label:(h=o.tooltip)==null?void 0:h.label,arrowPosition:(s=o.tooltip)==null?void 0:s.arrowPosition,...o.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(J,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(u.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":t==="horizontal"&&o.customWidth?o.customWidth:t==="horizontal"?"343px":""},children:e.jsx(Le.Dropdown,{size:r,...o.inputProps,error:!!o.errorMessage})}),!n&&o.errorMessage&&e.jsx(De,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Rl=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",eo=r=>{var i;const[t,l]=g.useState(!1),c=h=>{h.preventDefault(),h.stopPropagation()},o=h=>{h.preventDefault(),h.stopPropagation(),h.dataTransfer&&r.handleOnFileChange(h.dataTransfer.files.item(0))},n=h=>{h.preventDefault(),l(!0)},a=h=>{h.preventDefault(),l(!1)};return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:c,onDrop:o,onDragEnter:n,onDragLeave:a,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${Rl(r.errorMessage,r.status)}`},children:[e.jsx(k.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(U.Flex,{direction:"column",gap:"xs",children:[e.jsxs(U.Flex,{direction:"row",gap:"xs",children:[e.jsx(D.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(D.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",children:(i=r.fileSupports)==null?void 0:i.map(h=>h.toLocaleUpperCase()).join(", ")})]})]})};function ro(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const Wt=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},to=r=>{const t={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},l=r.split(" ");if(l.length!==3)return null;const c=parseInt(l[0],10),o=t[l[1]],n=parseInt(l[2],10);return isNaN(c)||isNaN(o)||isNaN(n)?null:new Date(n,o,c)};function lo(r,t=!0){if(!r)return"Rp 0";const l=typeof r=="number"?r.toString():r;if(isNaN(Number(l)))return"Rp 0";const c=l.split("."),o=c[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),n=c.length===2?o+"."+c[1]:o;return t?"Rp"+n:n}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},String.prototype.toNumber=function(){return Number(this)};const oo=r=>{const t=r.split(" ");let l=t[0].charAt(0);return t.length>1&&(l+=""+t[1].charAt(0)),l.toUpperCase()};function co(r){const t=typeof r=="string"?new Date(r):r;if(isNaN(t.getTime()))throw new Error("Invalid date format");const l=t.getFullYear(),c=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${l}-${c}-${o}`}const no="sa-admin",Ce=r=>`var(--${no}-${r})`,io={base:{borderColor:Ce("base-border-color"),textColor:Ce("base-text-color"),iconColor:Ce("base-icon-color"),placeholderColor:Ce("base-placeholder-color")},document:{bgColor:Ce("document-bg-color")},sidebar:{bgColor:Ce("sidebar-bg-color"),borderColor:Ce("sidebar-border-color"),maxWidth:Ce("sidebar-max-width"),width:Ce("sidebar-width"),collapseWidth:Ce("sidebar-collapse-width"),collapseV2Width:Ce("sidebar-v2-collapse-width")}},ao=24*60*60*1e3,so=r=>{const t="14px poppins",c=document.createElement("canvas").getContext("2d");c.font=t;const o=c.measureText(r).width;return Number(Math.ceil(o))},ho=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,fo=/--+/,go=/-$/;function yo(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function uo(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function po(r){return/^[A-Za-z\s]+$/.test(r)}const Co=r=>{const t=/^[0-9]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&(r.key==="a"||r.key==="c"||r.key==="v")||!t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},xo=r=>{const t=/^[0-9]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},bo=r=>{const t=/^[0-9.]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||!t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},Do=r=>ho.test(r);function vo(r){return!(fo.test(r)||go.test(r))}const wo=r=>{const t=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((r.ctrlKey||r.metaKey)&&["a","c","v","x"].includes(r.key.toLowerCase()))return;const l=r.currentTarget.value;/^[0-9]$/.test(r.key)||r.key==="."&&!l.includes(".")||r.key==="-"&&l.length===0&&!l.includes("-")||t.includes(r.key)||r.preventDefault()},So=r=>{const t=document.getElementById(r);if(t){const l=t.getBoundingClientRect(),c=window.scrollY+l.top-80;window.scrollTo({top:c,behavior:"smooth"})}};function Bo(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(n=>t.endsWith(n)))return r;const o=Number(r);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 ko(r){const t=r.split("/");return t[t.length-1]}const Fo=r=>{var t,l;return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:r.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(U.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(k.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(U.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(D.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?ko(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(U.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(k.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(U.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",children:Bo(((l=r.fileSelected)==null?void 0:l.size.toString())||"100000")}),e.jsx(k.Icon,{name:"Dot",size:"xs"}),e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:Wt(new Date)})]})]})]}),e.jsx(W.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:c=>{c.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(k.Icon,{name:"Trash1"})})]})},At=({status:r="default",labelPosition:t="outside-top",...l})=>{var C;const c=g.useRef(null),o=()=>{if(l.defaultFile){window.open(l.defaultFile.url);return}c.current&&c.current.click()},n=oe.useMediaQuery("md"),a=r==="error"||typeof l.errorMessage=="string"&&!!l.errorMessage,i=l.label?e.jsxs(U.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(D.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:l.label}),l.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"}),l.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,h=l.description?e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:l.description}):null,s=e.jsxs(e.Fragment,{children:[l.helperText&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:l.helperText}),l.errorText&&r==="error"&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:l.errorText}),l.errorMessage&&!l.errorText&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:l.errorMessage})]}),y=e.jsx("input",{type:"file",style:{display:"none"},ref:c,onChange:b=>{var L;return l.handleOnChangeFile(((L=b.target.files)==null?void 0:L.item(0))||null)},accept:(C=l.fileSupportOption)==null?void 0:C.map(b=>"."+(b==null?void 0:b.toLowerCase())).join(", ")}),p=e.jsxs(u.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...l.containerProps,children:[y,(l.fileSelected||l.defaultFile)&&e.jsx(Fo,{fileSelected:l.fileSelected,defaultFile:l.defaultFile,handleOnDeleteFile:l.handleOnDeleteFile,handleOnClickFile:o}),!l.fileSelected&&!l.defaultFile&&e.jsx(eo,{fileSupports:l.fileSupportOption,isDesktop:n,errorMessage:a?l.errorText||l.errorMessage||" ":void 0,status:a?"error":"default",handleOnClick:o,handleOnFileChange:l.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(U.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(U.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[i,h]}),e.jsxs(U.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[p,s]})]}):e.jsxs(U.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[i,h,p,s]})},Eo=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:c=!1,...o})=>{var i,h,s;const n=o.hideMessageError||!1,a=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(J,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:a,fullWidth:c,children:[e.jsx(X,{children:o.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:a,fullWidth:c,children:[e.jsxs(U.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(X,{fontSize:r,children:o.title}),e.jsx(X,{color:"error",fontSize:r,children:l}),e.jsx(J,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(de.Tooltip,{label:(h=o.tooltip)==null?void 0:h.label,arrowPosition:(s=o.tooltip)==null?void 0:s.arrowPosition,...o.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(J,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(U.Flex,{direction:"column",gap:"xs",children:[e.jsx(At,{...o.inputProps,status:o.errorMessage?"error":"default"}),!n&&o.errorMessage&&e.jsx(De,{message:o.errorMessage})]})]})},Mo=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:c=!1,required:o=!1,...n})=>{var h,s,y,p;const a=n.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...n.containerProps,children:[n.title&&e.jsx(J,{condition:!!o,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:c,children:[e.jsx(X,{children:n.title}),e.jsx(ye.Body3,{props:{color:"gray-500"},children:n.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:c,children:[e.jsxs(U.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(X,{fontSize:r,children:n.title}),e.jsx(X,{color:"error",fontSize:r,children:l}),e.jsx(J,{condition:!!((h=n.tooltip)!=null&&h.label),children:e.jsx(de.Tooltip,{label:(s=n.tooltip)==null?void 0:s.label,arrowPosition:(y=n.tooltip)==null?void 0:y.arrowPosition,...n.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(J,{condition:!!n.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:n.description})})]})}),e.jsx(u.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(tr,{of:(p=n.checkBoxesList)==null?void 0:p.map(C=>({...C,isChecked:n.checkBoxesAreChecked.includes(C.id)})),render:C=>C.renderBadge?e.jsxs(u.Box,{direction:"row",justify:"space-between",gap:"lg",...n.badgeContainerProps,children:[e.jsx(Oe.Checkbox,{name:C.name,value:C.id,checked:C.isChecked,onChange:b=>n.onChecked(b.target.value,C),label:C.name,description:C.description}),C.renderBadge]}):e.jsx(Oe.Checkbox,{name:C.name,value:C.id,checked:C.isChecked,onChange:b=>n.onChecked(b.target.value,C),label:C.name,description:C.description})})}),!a&&n.errorMessage&&e.jsx(De,{message:n.errorMessage})]})},mo=({position:r="vertical",size:t="md",fullWidth:l=!1,...c})=>{var n;const o=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(J,{condition:!!c.description||!!c.title,children:e.jsxs(u.Box,{direction:"column",customMaxWidth:o,fullWidth:l,children:[c.title&&e.jsx(X,{children:c.title}),e.jsx(J,{condition:!!c.description,children:e.jsx(D.Text,{color:"gray-500",children:c.description})})]})}),e.jsx(u.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(tr,{of:(n=c.radioList)==null?void 0:n.map(a=>({...a,isChecked:c.radioIsChecked===a.id})),render:({value:a,id:i,isChecked:h,subInput:s,label:y,description:p})=>e.jsxs(u.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(yr.Radio,{id:`${i.toString()}-${a}`,name:c.groupName||y,label:y,value:a,checked:h,onChange:C=>c.onChecked({id:i,label:C.target.name,value:C.target.value}),disabled:c.disableAll},i),p&&e.jsx(D.Text,{color:"gray-500",style:{marginLeft:28},children:p}),s]})})}),c.errorMessage&&e.jsx(De,{message:c.errorMessage})]})},Lo=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:c=!1,...o})=>{var i,h,s;const n=o.hideMessageError||!1,a=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(J,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:a,fullWidth:c,children:[e.jsx(X,{children:o.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:a,fullWidth:c,children:[e.jsxs(U.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(X,{fontSize:r,children:o.title}),e.jsx(X,{color:"error",fontSize:r,children:l}),e.jsx(J,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(de.Tooltip,{label:(h=o.tooltip)==null?void 0:h.label,arrowPosition:(s=o.tooltip)==null?void 0:s.arrowPosition,...o.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(J,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(U.Flex,{direction:"column",gap:"xs",children:[e.jsx(gr.Textarea,{ref:o.inputRef,size:r,...o.inputProps,status:o.errorMessage?"error":"default"}),!n&&o.errorMessage&&e.jsx(De,{message:o.errorMessage})]})]})},Io=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",required:c=!1,fullWidth:o=!1,...n})=>{var i,h,s;const a=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...n.containerProps,children:[n.title&&e.jsx(J,{condition:c,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:a,fullWidth:o,children:[e.jsx(X,{children:n.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:n.titleDescription})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:a,fullWidth:o,children:[e.jsxs(U.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(X,{fontSize:r,children:n.title}),e.jsx(X,{color:"error",fontSize:r,children:l}),e.jsx(J,{condition:!!((i=n.tooltip)!=null&&i.label),children:e.jsx(de.Tooltip,{label:(h=n.tooltip)==null?void 0:h.label,arrowPosition:(s=n.tooltip)==null?void 0:s.arrowPosition,...n.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(J,{condition:!!n.titleDescription,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:n.titleDescription})})]})}),e.jsx(je.Toggle,{checked:n.checked,onChange:n.onChange,label:n.label,description:n.description}),n.errorMessage&&e.jsx(De,{message:n.errorMessage})]})},To=({variant:r="primary",size:t="md",...l})=>{const c=Te.useColor(),o=a=>{var h,s,y,p,C,b;if(!a)return;const i=l.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary"?"var(--sa-text-subtle, #8c8f97)":r==="secondary-danger"?(s=(h=c==null?void 0:c.computed)==null?void 0:h.red)==null?void 0:s[600]:r==="secondary-primary"?(p=(y=c==null?void 0:c.computed)==null?void 0:y.blue)==null?void 0:p[700]:(b=(C=c==null?void 0:c.computed)==null?void 0:C.gray)==null?void 0:b[50];return e.jsx(k.Icon,{name:a,size:t,style:{color:i}})},n=()=>{var i,h,s,y;if(r!=="secondary-danger"&&r!=="secondary-primary")return l.title;const a={color:l.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(h=(i=c==null?void 0:c.computed)==null?void 0:i.red)==null?void 0:h[600]:(y=(s=c==null?void 0:c.computed)==null?void 0:s.blue)==null?void 0:y[700]};switch(t){case"xs":return e.jsx(ye.Body2,{props:{style:a},children:l.title});case"sm":case"md":return e.jsx(ye.SubH3,{props:{style:a},children:l.title});case"lg":return e.jsx(ye.SubH2,{props:{style:a},children:l.title});default:return l.title}};return e.jsx(W.Button,{fullWidth:!0,disabled:l.disabled,primary:r==="primary",secondary:r==="secondary"||r==="secondary-danger"||r==="secondary-primary",success:r==="success",onClick:l.onClick,type:l.type,iconLeft:o(l.iconLeft),iconRight:o(l.iconRight),size:t,children:n()})},Oo=r=>e.jsx(ye.H5,{props:{...r},children:r.title}),Wo=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:c=!1,...o})=>{var i,h,s;const n=o.hideMessageError||!1,a=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(J,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:a,fullWidth:c,children:[e.jsx(X,{children:o.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:a,fullWidth:c,children:[e.jsxs(U.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(X,{fontSize:r,children:o.title}),e.jsx(X,{color:"error",fontSize:r,children:l}),e.jsx(J,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(de.Tooltip,{label:(h=o.tooltip)==null?void 0:h.label,arrowPosition:(s=o.tooltip)==null?void 0:s.arrowPosition,...o.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(J,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(U.Flex,{direction:"column",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{width:t==="horizontal"&&o.customWidth?o.customWidth:t==="horizontal"?"343px":""},children:e.jsx(ke.StarasiaDate,{size:r,...o.inputProps,status:o.errorMessage?"error":void 0})}),!n&&o.errorMessage&&e.jsx(De,{message:o.errorMessage})]})]})};async function Ao(r,t){const l=new Image;l.src=r,await new Promise((n,a)=>{l.onload=n,l.onerror=a});const c=document.createElement("canvas");c.width=t.width,c.height=t.height;const o=c.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(l,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((n,a)=>{c.toBlob(i=>{if(!i)return a("Canvas is empty");const h=new File([i],"cropped.png",{type:"image/png"});n(h)},"image/png")})}const zt={"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},Ht=g.forwardRef(({handleUpload:r,urlImage:t,isUploading:l,croppedImage:c,setCroppedImage:o,size:n="96",aspect:a="1:1",containerProps:i,maxFileSize:h=2,onError:s},y)=>{const p=oe.useMediaQuery("md"),[C,b]=g.useState(!1),[L,x]=g.useState(null),[B,m]=g.useState(!1),[M,V]=g.useState({x:0,y:0}),[v,I]=g.useState(1),[T,E]=g.useState(null);g.useEffect(()=>{t===null&&o(null)},[t]);const Z=g.useCallback((Q,q)=>{E(q)},[]),K=Q=>{var ue;const q=(ue=Q.target.files)==null?void 0:ue[0];if(!q)return;const ie=new FileReader;ie.onload=()=>{x(ie.result),m(!0)},ie.readAsDataURL(q)},$=async()=>{if(!(!L||!T))try{const Q=await Ao(L,T);if(h&&Q.size>h*1024*1024){s==null||s(`Ukuran file maksimal ${h}MB`);return}r==null||r(Q);const q=URL.createObjectURL(Q);o(q,Q),m(!1)}catch{s==null||s("Gagal memproses gambar")}},G=g.useRef(null),R=()=>{G.current&&G.current.click()};g.useImperativeHandle(y,()=>({openFileDialog:()=>{var Q;(Q=G.current)==null||Q.click()}}));const ne=parseInt(n,10),re=zt[a];let ee,le;return re>=1?(le=ne,ee=ne*re):(ee=ne,le=ne/re),e.jsxs(u.Box,{direction:"column",display:"flex",position:"relative",bg:(i==null?void 0:i.bg)||"gray-200",borderStyle:(i==null?void 0:i.borderStyle)||"border-none",borderColor:(i==null?void 0:i.borderColor)||"gray-200",borderWidth:(i==null?void 0:i.borderWidth)||"border-2",borderRadius:(i==null?void 0:i.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:i!=null&&i.fullWidth?"100%":`${ee}px`,height:i!=null&&i.fullWidth?"auto":`${le}px`,aspectRatio:re,flexShrink:0},onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:[c||t?e.jsx("img",{src:c||t||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(u.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(k.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(n)/2<40?Number(n)/2:40,height:Number(n)/2<40?Number(n)/2:40}})}),e.jsxs(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214a)",opacity:C?1:0,transition:"opacity 0.3s ease-in-out"},onClick:R,children:[e.jsx("input",{ref:G,type:"file",accept:"image/*",onChange:K,disabled:l,style:{display:"none"}}),e.jsxs(u.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(k.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(J,{condition:n.toNumber()>80,children:e.jsx(D.Text,{color:"gray-50",fontSize:n.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),l&&e.jsx(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f640)"},children:e.jsx(u.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),B&&ur.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:p?a==="1:1"?"min(90vw, 480px)":`min(90vw, ${ee*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:Q=>Q.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:L&&e.jsx(Pt,{image:L,crop:M,zoom:v,aspect:a?zt[a]:void 0,onCropChange:V,onZoomChange:I,onCropComplete:Z,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(W.Button,{size:"sm",secondary:!0,onClick:()=>m(!1),children:"Cancel"}),e.jsx(W.Button,{size:"sm",primary:!0,onClick:$,children:"Crop"})]})]})}),document.body)]})}),zo=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:c=!1,required:o=!1,...n})=>{var h,s,y;const a=n.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...n.containerProps,children:[n.title&&e.jsx(J,{condition:!!o,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:c,children:[e.jsx(X,{children:n.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:n.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:c,children:[e.jsxs(U.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(X,{fontSize:r,children:n.title}),e.jsx(X,{color:"error",fontSize:r,children:l}),e.jsx(J,{condition:!!((h=n.tooltip)!=null&&h.label),children:e.jsx(de.Tooltip,{label:(s=n.tooltip)==null?void 0:s.label,arrowPosition:(y=n.tooltip)==null?void 0:y.arrowPosition,...n.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(J,{condition:!!n.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:n.description})})]})}),e.jsxs(U.Flex,{direction:"column",gap:"xs",children:[e.jsx(Ht,{...n.inputProps}),!a&&n.errorMessage&&e.jsx(De,{message:n.errorMessage})]})]})},Ho=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:c=!1,...o})=>{var a,i,h;const n=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(J,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:n,fullWidth:c,children:[e.jsx(X,{children:o.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:n,fullWidth:c,children:[e.jsxs(U.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(X,{fontSize:r,children:o.title}),e.jsx(X,{color:"error",fontSize:r,children:l}),e.jsx(J,{condition:!!((a=o.tooltip)!=null&&a.label),children:e.jsx(de.Tooltip,{label:(i=o.tooltip)==null?void 0:i.label,arrowPosition:(h=o.tooltip)==null?void 0:h.arrowPosition,...o.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(J,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},jo=({items:r,id:t,handleOnUpdate:l,width:c,toggleShow:o=!0,disabled:n=!1})=>{var y;const[a,i]=g.useState([]);g.useEffect(()=>{r&&i([...r.map(p=>({id:p.id,isActive:p.isActive}))])},[r]);const h=(y=a.find(p=>p.id===t))==null?void 0:y.isActive,s=g.useCallback(()=>{i(p=>p.map(C=>C.id===t?{...C,isActive:!C.isActive}:C)),l&&l(!h)},[t,l,h]);return e.jsx(u.Box,{direction:"row",gap:"md",style:{width:c},children:o&&e.jsx(je.Toggle,{disabled:n,checked:h,onChange:s,label:h?"Active":"Inactive"})})},Vo={InputText:Kl,InputDropdown:$l,InputSingleFile:Eo,CheckBoxOptions:Mo,RadioOptions:mo,InputTextArea:Lo,ToggleForm:Io,ActionButton:To,FormTitle:Oo,InputDate:Wo,InputImgFile:zo,Custom:Ho},jt=({customBottom:r})=>{const[t,l]=g.useState(!1),c=()=>{window.scrollY>window.screenY?l(!0):l(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return g.useEffect(()=>(window.addEventListener("scroll",c),()=>{window.removeEventListener("scroll",c)}),[]),e.jsx(u.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(u.Box,{direction:"column",position:"absolute",style:{bottom:r||"1.6rem",right:"2rem",transform:t?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(W.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(k.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},No=({pageLayout:r,children:t,wrapperProps:l,containerProps:c})=>{const o=oe.useMediaQuery("md"),n=(c==null?void 0:c.customWidth)??264;return e.jsxs(u.Box,{display:"block",direction:"row",...l,style:{marginRight:o?n:24,...(l==null?void 0:l.style)??{}},children:[r,e.jsx(u.Box,{direction:"column",show:"desktop",as:"aside",position:"fixed",top:"top-0",bottom:"bottom-0",right:"right-0",customWidth:264,borderStyle:"border-solid-l",borderWidth:"border-l",...c,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(c==null?void 0:c.style)??{}},children:t})]})},Po=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:l,containerProps:c})=>e.jsx(u.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 999)"},children:e.jsxs(u.Box,{position:"fixed",bottom:"bottom-0",right:"right-0",padding:"spacing-32",height:"height-24",bg:"gray-50",direction:"row",align:"center",display:"flex",style:{left:"var(--app-sidebar-width, 0px)",transition:"left 0.3s ease-in-out",borderColor:"var(--sa-border-subtle, #0b120e24)"},justify:(c==null?void 0:c.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx(jt,{...l,customBottom:(l==null?void 0:l.customBottom)||"5.7rem"}),r]})}),_o=({fields:r})=>e.jsx(u.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(tr,{of:r,render:(t,l)=>e.jsx(Zo,{...t},l)})}),Zo=({title:r,value:t,icon:l})=>e.jsxs(u.Box,{display:"flex",direction:"column",gap:"sm",children:[l?e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(k.Icon,{name:l,color:"subtle"}),e.jsx(D.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(D.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(D.Text,{variant:"sub-h3",children:t}):t]}),ce={silhouette:"#A7B0AC",accent:"#78867F"};function qo({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r||"100",height:t||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:ce.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:ce.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:ce.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:ce.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:ce.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:ce.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:ce.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:ce.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:ce.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:ce.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:ce.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:ce.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:ce.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:ce.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:ce.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:ce.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:ce.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:ce.accent,fillOpacity:"0.65"})]})})}const Qo=({title:r="create",children:t,onClickAction:l,variant:c="primary",variantTitle:o,leftIcon:n,showButton:a=!0,customHeight:i,childrenButton:h,customIcon:s})=>{const y=()=>{switch(c){case"primary":return e.jsx(e.Fragment,{children:n?e.jsx(W.Button,{primary:!0,iconLeft:n,onClick:l,children:h||r}):e.jsx(W.Button,{primary:!0,onClick:l,children:h||r})});case"secondary":return e.jsx(e.Fragment,{children:n?e.jsx(W.Button,{secondary:!0,iconLeft:n,onClick:l,children:o?e.jsx(D.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:h||r}):r}):e.jsx(W.Button,{secondary:!0,onClick:l,children:h||r})});case"success":return e.jsx(e.Fragment,{children:n?e.jsx(W.Button,{success:!0,iconLeft:n,onClick:l,children:h||r}):e.jsx(W.Button,{success:!0,onClick:l,children:h||r})});default:return e.jsx(e.Fragment,{children:n?e.jsx(W.Button,{primary:!0,iconLeft:n,onClick:l,children:h||r}):e.jsx(W.Button,{primary:!0,onClick:l,children:h||r})})}};return e.jsxs(u.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:i,children:[s||e.jsx(qo,{}),e.jsx(u.Box,{direction:"column",children:t.map((p,C)=>e.jsx(ye.Body1,{props:{align:"center",textAlign:"center"},children:C>2?null:p},C))}),a?y():null]})},j={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function Go({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:j.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:j.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:j.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:j.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:j.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:j.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:j.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:j.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:j.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:j.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:j.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:j.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:j.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:j.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:j.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:j.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:j.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:j.cFFFFFF,stroke:j.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:j.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:j.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:j.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:j.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:j.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:j.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:j.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:j.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:j.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:j.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:j.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:j.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:j.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:j.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:j.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:j.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:j.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:j.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:j.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:j.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:j.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:j.c001A72})]})})}function Jo({onClick:r}){const t=oe.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Go,{width:t?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(D.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(W.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const _={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 Uo({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:_.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:_.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:_.cEFF3F8,stroke:_.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:_.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:_.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:_.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:_.c956847,stroke:_.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:_.c956847,stroke:_.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:_.cC8CEF4,stroke:_.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:_.cC8CEF4,stroke:_.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:_.cC8CEF4,stroke:_.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:_.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:_.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:_.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:_.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:_.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:_.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:_.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:_.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:_.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:_.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:_.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:_.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:_.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:_.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:_.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:_.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:_.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:_.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:_.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function Yo({onClick:r}){const t=oe.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Uo,{width:t?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(W.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const d={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 Xo({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:d.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:d.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:d.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:d.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:d.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:d.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:d.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:d.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:d.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:d.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:d.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:d.cFFFFFF,stroke:d.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:d.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:d.cFFFFFF,stroke:d.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:d.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:d.cFFFFFF,stroke:d.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:d.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:d.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:d.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:d.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:d.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:d.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:d.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:d.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:d.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:d.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:d.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:d.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:d.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:d.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:d.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:d.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:d.c000D58,stroke:d.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:d.c000D58,stroke:d.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:d.cFFFFFF,stroke:d.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:d.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:d.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:d.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:d.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:d.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:d.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:d.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:d.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:d.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:d.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:d.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:d.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:d.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Ko({onClick:r}){const t=oe.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Xo,{width:t?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(D.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(W.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const $o=r=>{var l,c,o,n,a;const t=oe.useMediaQuery("md");return e.jsxs(ge.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(ge.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(D.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(ge.DialogBody,{children:typeof r.description=="string"?e.jsx(D.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(ge.DialogFooter,{children:e.jsx(u.Box,{display:"flex",direction:((l=r.containerConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((c=r.containerConfirmBtnProps)==null?void 0:c.justify)||"flex-end",...r.containerConfirmBtnProps,children:e.jsxs(u.Box,{display:"flex",direction:((o=r.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((n=r.wrapperConfirmBtnProps)==null?void 0:n.justify)||"flex-end",gap:((a=r.wrapperConfirmBtnProps)==null?void 0:a.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(W.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(u.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(W.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},Ro=g.memo(({children:r,height:t,minHeight:l,customHeight:c,paddingInline:o="spacing-0",paddingBlock:n="spacing-0",header:a,footer:i,title:h,titleTag:s,action:y,actionContainer:p,containerProps:C,bodyProps:b,headerProps:L={borderBottom:!0},footerProps:x={borderTop:!0},variantTag:B="info"})=>{const m=g.useRef(null),[M,V]=g.useState("100vh");g.useEffect(()=>{const E=()=>{if(m.current){const Z=m.current.getBoundingClientRect().top;V(`calc(100vh - ${Z}px)`)}};return E(),window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[]);const v=()=>s?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(D.Text,{fontWeight:"medium",children:h}),e.jsx(we.Badges,{border:!0,text:s,variant:B})]}):e.jsx(D.Text,{fontWeight:"medium",children:h}),I=()=>a||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:h?v():null}),e.jsx(u.Box,{direction:"column",...p,children:y??null})]}),T=!!(a||h||y);return e.jsxs(u.Box,{ref:m,height:t,customMinHeight:l,customHeight:c,paddingBlock:n,paddingInline:o,bg:"white",direction:"column",...C,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:M,...(C==null?void 0:C.style)??{}},children:[a!==null&&T?e.jsx(Sr,{...L,children:I()}):null,e.jsx(u.Box,{direction:"column",padding:"spacing-0",...b,style:{flex:1,overflow:"auto",...(b==null?void 0:b.style)??{}},children:r}),i?e.jsx(Br,{...x,children:i}):null]})}),ec=g.memo(({value:r,options:t=[],onChange:l,multiple:c})=>{const o=(r==null?void 0:r.map(i=>i.value))||[],n=(t==null?void 0:t.filter(i=>o.includes(i.value)))||[],a=i=>{const h=[...n];let s=[];c?s=o.includes(i.value)?h.filter(y=>y.value!==i.value):[...h,i]:s=[i],l==null||l(s)};return e.jsx(u.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((i,h)=>e.jsx(W.Button,{...o.includes(i.value)?{primary:!0}:{secondary:!0},onClick:()=>a(i),children:i.label},h))})});function lr(r){return null}lr.displayName="LayoutDialog.Header";function or(r){return null}or.displayName="LayoutDialog.Body";function cr(r){return null}cr.displayName="LayoutDialog.Aside";function nr(r){return null}nr.displayName="LayoutDialog.Footer";const ae={"lyd-root":"_lyd-root_1e92c_1","lyd-backdrop":"_lyd-backdrop_1e92c_28","lyd-panel":"_lyd-panel_1e92c_37","lyd-modal":"_lyd-modal_1e92c_48","lyd-fullscreen":"_lyd-fullscreen_1e92c_58","lyd-sidebar":"_lyd-sidebar_1e92c_66","lyd-header":"_lyd-header_1e92c_94","lyd-header-content":"_lyd-header-content_1e92c_105","lyd-header-actions":"_lyd-header-actions_1e92c_113","lyd-main":"_lyd-main_1e92c_120","lyd-body":"_lyd-body_1e92c_127","lyd-aside":"_lyd-aside_1e92c_133","lyd-footer":"_lyd-footer_1e92c_149","lyd-vm-group":"_lyd-vm-group_1e92c_162","lyd-vm-btn":"_lyd-vm-btn_1e92c_170","lyd-close-btn":"_lyd-close-btn_1e92c_193"},rc=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(lc,{})},{mode:"modal",label:"Modal",icon:e.jsx(k.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(k.Icon,{name:"Fullscreen",size:"sm"})}];function tc({value:r,onChange:t}){return e.jsx("div",{className:ae["lyd-vm-group"],role:"group","aria-label":"View mode",children:rc.map(l=>e.jsx("button",{type:"button",className:ae["lyd-vm-btn"],"data-active":r===l.mode,"aria-label":`Switch to ${l.label} view`,"aria-pressed":r===l.mode,onClick:()=>t(l.mode),children:l.icon},l.mode))})}function lc(){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 mr={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function oc(r){return r?r in mr?mr[r]:r:mr.xl}function ir(r,t){let l=null;return g.Children.forEach(r,c=>{g.isValidElement(c)&&c.type===t&&(l=c.props.children??null)}),l}function cc(r){const{isOpen:t,onClose:l,viewMode:c,defaultViewMode:o="modal",onViewModeChange:n,showViewModeToggle:a=!0,showCloseButton:i=!0,size:h,asideWidth:s,disableEscapeClose:y=!1,disableBackdropClose:p=!1,lockBodyScroll:C=!0,children:b}=r,[L,x]=g.useState(o),B=c??L,M=oe.useMediaQuery("md")?B:"fullscreen",V=g.useCallback(R=>{c===void 0&&x(R),n==null||n(R)},[c,n]),v=g.useRef(null);g.useEffect(()=>{if(!(!t||!C))return v.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=v.current??""}},[t,C]),g.useEffect(()=>{if(!t||y)return;const R=ne=>{ne.key==="Escape"&&l()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[t,y,l]);const I=g.useMemo(()=>ir(b,lr),[b]),T=g.useMemo(()=>ir(b,or),[b]),E=g.useMemo(()=>ir(b,cr),[b]),Z=g.useMemo(()=>ir(b,nr),[b]);if(!t)return null;const K=[ae["lyd-panel"],M==="modal"&&ae["lyd-modal"],M==="fullscreen"&&ae["lyd-fullscreen"],M==="sidebar"&&ae["lyd-sidebar"]].filter(Boolean).join(" "),$={"--lyd-max-w":oc(h),...s!==void 0&&{"--lyd-aside-w":s}},G=()=>{p||l()};return e.jsxs("div",{className:ae["lyd-root"],style:$,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:ae["lyd-backdrop"],onClick:G,"aria-hidden":"true"}),e.jsxs("div",{className:K,children:[e.jsxs("div",{className:ae["lyd-header"],children:[e.jsx("div",{className:ae["lyd-header-content"],children:I}),e.jsxs("div",{className:ae["lyd-header-actions"],children:[a&&e.jsx(tc,{value:B,onChange:V}),i&&e.jsx("button",{type:"button",className:ae["lyd-close-btn"],onClick:l,"aria-label":"Close dialog",children:e.jsx(k.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:ae["lyd-main"],children:[e.jsx("div",{className:ae["lyd-body"],children:T}),E&&e.jsx("aside",{className:ae["lyd-aside"],children:E})]}),Z&&e.jsx("div",{className:ae["lyd-footer"],children:Z})]})]})}const Ne=cc;Ne.Header=lr,Ne.Body=or,Ne.Aside=cr,Ne.Footer=nr;function nc({url:r,filename:t,onClose:l}){return g.useEffect(()=>{const c=o=>{o.key==="Escape"&&l()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[l]),e.jsxs("div",{onClick:l,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:c=>c.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:r,download:t,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:r,alt:t,onClick:c=>c.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:t})]})}const ic=r=>{const{defaultTab:t=0,paramKey:l="tab"}=r||{},[c,o]=te.useSearchParams(),n=Ie.searchParamsToObject(c.toString());return{activeTab:n[l]?parseInt(n[l]):t,handleTabChange:h=>{o({...n,[l]:h.toString()})},searchQueries:n}};function ac({appName:r,menuConfig:t,formatTitle:l}){const c=te.useLocation();g.useEffect(()=>{let o=null,n=null;for(const h of t){const s=h.items.find(y=>y.to?y.to==="/"?c.pathname==="/":!!(y.to===c.pathname||c.pathname.startsWith(y.to+"/")):!1);if(s){o=s,n=h;break}}const a=[];o!=null&&o.title&&a.push(o.title),n!=null&&n.name&&a.push(n.name.toTitleCase());const i=(h,s)=>h.length>0?`${h.join(" - ")} | ${s}`:s;document.title=(l||i)(a,r)},[c.pathname])}const sc=()=>{const[r,t]=te.useSearchParams(),l=Ie.searchParamsToObject(r.toString()),c=te.useParams(),o=te.useLocation(),n=c.id;return{setSearchParams:t,searchParams:r,searchQueries:l,isHasQuery:(y,p)=>r.has(y)&&r.get(y)===p,getQueryParam:y=>r.get(y),getRouteParam:y=>c[y],params:c,location:o,id:n,hasId:!!n}};function dc(r){var c,o;const t=r.decodedAccessToken;return g.useMemo(()=>{var h,s;const n=((s=(h=t==null?void 0:t.access)==null?void 0:h.role)==null?void 0:s.code)??"",a=Object.keys(r.role).reduce((y,p)=>{const C=`is${p.toLowerCase().replace(/(^\w|_\w)/g,b=>b.replace("_","").toUpperCase())}`;return{...y,[C]:!1}},{});return{...Object.keys(r.role).reduce((y,p)=>{const C=`is${p.toLowerCase().replace(/(^\w|_\w)/g,b=>b.replace("_","").toUpperCase())}`;return{...y,[C]:n===r.role[p]}},a),hasRole:y=>n===r.role[y],getRoleKey:()=>n}},[(o=(c=t==null?void 0:t.access)==null?void 0:c.role)==null?void 0:o.code,r])}f.AdvanceFilterBar=Ct,f.App=Zt,f.AppComponent=Gr,f.AppContext=pr,f.AppLayout=Jt,f.AsideBar=No,f.BackButton=Yt,f.ColumnFilterDropdown=mt,f.ConfirmationDialog=$o,f.DataGrid=Xl,f.DataTable=It,f.DecisionWrapper=J,f.EachUtils=tr,f.EmptyStatePage=Qo,f.FilterBar=_l,f.FilterDrawer=pt,f.FloatingFooter=Po,f.ForbiddenPage=Yo,f.Form=Vo,f.FullSection=Ro,f.HeaderLeftSlot=qt,f.HeaderLeftSlotOutlet=Yr,f.HeaderLeftSlotProvider=Ur,f.HorizontalField=el,f.ImagePreview=nc,f.InputFile=At,f.InputImage=Ht,f.LayoutDialog=Ne,f.LayoutDialogAside=cr,f.LayoutDialogBody=or,f.LayoutDialogFooter=nr,f.LayoutDialogHeader=lr,f.ModuleSwitcher=Xt,f.ModuleSwitcherModal=it,f.NotFoundPage=Jo,f.PageLayout=ll,f.Pressable=Xe,f.RightDrawer=st,f.ScrollToTopButton=jt,f.Section=il,f.SectionFooter=Br,f.SectionHeader=Sr,f.SelectButton=ec,f.ServerErrorPage=Ko,f.SidebarBadgesProvider=qr,f.SidebarGroupSlot=Qt,f.SidebarGroupSlotOutlet=Kr,f.SidebarGroupSlotProvider=Xr,f.SidebarHeaderSlot=Jr,f.TableFooter=Mt,f.TableHeader=Et,f.TableSection=Ul,f.TableWrapper=Ft,f.ToggleStatus=jo,f.Typography=ye,f.VerticalField=_o,f.clearModuleSelection=Gt,f.createInitialFromUserName=ro,f.cssVars=io,f.formHasChanged=yo,f.formatDate=co,f.formatDateToIndonesian=Wt,f.formatRupiah=lo,f.getDateFilterValue=ut,f.getDateRangeFilterValue=hl,f.getInitials=oo,f.getValueDropdownMultipleFilter=yt,f.getValueRadioFilter=dl,f.getValueSearch=kr,f.getValuesFilter=Ke,f.handleChangeFilter=Ve,f.handleOnScroll=So,f.isEmail=Do,f.isFilterActive=fl,f.isOnlyLettersAndSpaces=po,f.isPhoneNumber=uo,f.isSlug=vo,f.localStorageAdapter=xt,f.oneDayInMs=ao,f.parseIndonesianDateToDate=to,f.preventNonCoordinateInput=wo,f.preventNonNumberAndDecimalInput=bo,f.preventNonNumberInput=Co,f.preventNumberInput=xo,f.resolveDateRangeValueToString=ft,f.resolveDateValueToString=gt,f.resolveDropdownValueToString=dt,f.resolveRadioValueToString=ht,f.resolveSidebarBadge=Je,f.storageKeys=$e,f.textWidth=so,f.useApp=Cr,f.useAppState=_r,f.useAuthRole=dc,f.useDynamicTitle=ac,f.useModuleSelection=vr,f.useRouteInfo=be,f.useRouteParams=sc,f.useSidebarBadges=Qr,f.useTabState=ic,Object.keys(Me).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Me[r]})}),Object.keys(we).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>we[r]})}),Object.keys(u).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>u[r]})}),Object.keys(me).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>me[r]})}),Object.keys(W).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>W[r]})}),Object.keys(Or).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Or[r]})}),Object.keys(ke).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>ke[r]})}),Object.keys(ge).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>ge[r]})}),Object.keys(fr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>fr[r]})}),Object.keys(Le).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Le[r]})}),Object.keys(oe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>oe[r]})}),Object.keys(Ie).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Ie[r]})}),Object.keys(Se).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Se[r]})}),Object.keys(F).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>F[r]})}),Object.keys(Ge).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Ge[r]})}),Object.keys(He).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>He[r]})}),Object.keys(Y).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Y[r]})}),Object.keys(Wr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Wr[r]})}),Object.keys(gr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>gr[r]})}),Object.keys(Te).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Te[r]})}),Object.keys(Ar).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Ar[r]})}),Object.keys(je).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>je[r]})}),Object.keys(de).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>de[r]})}),Object.keys(Oe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Oe[r]})}),Object.keys(yr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>yr[r]})}),Object.keys(D).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>D[r]})}),Object.keys(k).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>k[r]})}),Object.keys(U).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>U[r]})}),Object.keys(zr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>zr[r]})}),Object.keys(Hr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Hr[r]})}),Object.keys(jr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>jr[r]})}),Object.keys(Vr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Vr[r]})}),Object.keys(Nr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Nr[r]})}),Object.keys(Fe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Fe[r]})}),Object.keys(Pr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Pr[r]})}),Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(g,$e){typeof exports=="object"&&typeof module<"u"?$e(exports,require("@starasia/alert"),require("@starasia/badges"),require("@starasia/box"),require("@starasia/breadcrumb"),require("@starasia/button"),require("@starasia/card"),require("@starasia/date"),require("@starasia/dialog"),require("@starasia/drawer"),require("@starasia/dropdown"),require("@starasia/hooks"),require("@starasia/http"),require("@starasia/input"),require("@starasia/menu"),require("@starasia/pagination"),require("@starasia/storage"),require("@starasia/table"),require("@starasia/tabs"),require("@starasia/textarea"),require("@starasia/theme"),require("@starasia/toast"),require("@starasia/toggle"),require("@starasia/tooltip"),require("@starasia/checkbox"),require("@starasia/radio"),require("@starasia/text"),require("@starasia/icon"),require("@starasia/flex"),require("@starasia/grid"),require("@starasia/progress"),require("@starasia/stepper"),require("@starasia/accordion"),require("@starasia/story-record"),require("@starasia/skeleton"),require("@starasia/progress-stepper"),require("react/jsx-runtime"),require("react"),require("react-router"),require("react-dom"),require("react-easy-crop")):typeof define=="function"&&define.amd?define(["exports","@starasia/alert","@starasia/badges","@starasia/box","@starasia/breadcrumb","@starasia/button","@starasia/card","@starasia/date","@starasia/dialog","@starasia/drawer","@starasia/dropdown","@starasia/hooks","@starasia/http","@starasia/input","@starasia/menu","@starasia/pagination","@starasia/storage","@starasia/table","@starasia/tabs","@starasia/textarea","@starasia/theme","@starasia/toast","@starasia/toggle","@starasia/tooltip","@starasia/checkbox","@starasia/radio","@starasia/text","@starasia/icon","@starasia/flex","@starasia/grid","@starasia/progress","@starasia/stepper","@starasia/accordion","@starasia/story-record","@starasia/skeleton","@starasia/progress-stepper","react/jsx-runtime","react","react-router","react-dom","react-easy-crop"],$e):(g=typeof globalThis<"u"?globalThis:g||self,$e(g["@starasia/admin"]={},g.alert,g.badges,g.box,g.breadcrumb,g.button,g.card,g.date,g.dialog,g.drawer,g.dropdown,g.hooks,g.http,g.input,g.menu,g.pagination,g.storage,g.table,g.tabs,g.textarea,g.theme,g.toast,g.toggle,g.tooltip,g.checkbox,g.radio,g.text,g.icon,g.flex,g.grid,g.progress,g.stepper,g.accordion,g.storyRecord,g.skeleton,g.progressStepper,g.jsxRuntime,g.React,g.ReactRouter,g.ReactDOM,g.ReactEasyCrop))})(this,function(g,$e,_e,u,Re,V,rt,Qe,Me,ur,er,de,rr,qe,M,ir,sr,$,tt,Wr,tr,ot,or,we,lr,zr,D,m,le,lt,nt,ct,it,st,Ue,at,e,f,he,Ar,bo){"use strict";const xo={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Hr=f.createContext(xo),Vr=()=>f.useContext(Hr),dt=r=>{const[t,o]=f.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:o}},ht=f.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),ft=({children:r})=>{const[t,o]=f.useState({}),n=f.useCallback(i=>{o(a=>typeof i=="function"?i(a):i)},[]),l=f.useCallback((i,a)=>{o(d=>{const y=typeof a=="function"?a(d[i]):a;return{...d,[i]:y}})},[]),c=f.useCallback(i=>{o(a=>{if(!(i in a))return a;const d={...a};return delete d[i],d})},[]),s=f.useMemo(()=>({badges:t,setBadge:l,setBadges:n,clearBadge:c}),[t,l,n,c]);return e.jsx(ht.Provider,{value:s,children:r})},gt=()=>f.useContext(ht),yr=(r,t)=>{const o=t!==void 0?t:r;return o==null?null:typeof o=="string"||typeof o=="number"?{value:o}:o},ut=({router:r,menus:t=[],menuBottom:o,logo:n,appName:l="Workspace",initialUserData:c,theme:s})=>{const i=dt({initialUserData:c}),{theme:a}=tr.useTheme();return e.jsx(Hr.Provider,{value:{logo:n,appName:l,menus:t,userData:i.userData,setUserData:i.setUserData,menuBottom:o},children:e.jsx(ft,{children:s?e.jsx(tr.ThemeProvider,{value:s,children:r}):a?e.jsx(tr.ThemeProvider,{value:a,children:r}):r})})},wo=f.memo(ut);function yt({collapsed:r=!1,children:t}){if(!t)return null;const o=typeof t=="function",n=o?t({collapsed:r}):t;return n==null||n===!1?null:e.jsx("div",{style:{position:"sticky",top:"4rem",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:"0.5rem",paddingRight:"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:o?n:e.jsx("div",{style:{opacity:r?0:1,transition:"opacity 0.3s",visibility:r?"hidden":"visible"},children:n})})}const jr=f.createContext(null);function pt({children:r}){const[t,o]=f.useState(null),[n,l]=f.useState(null),[c,s]=f.useState(null),[i,a]=f.useState(0),d=f.useCallback(()=>(a(y=>y+1),()=>a(y=>y-1)),[]);return e.jsx(jr.Provider,{value:{prependNode:t,appendNode:n,replaceNode:c,setPrependNode:o,setAppendNode:l,setReplaceNode:s,replaceCount:i,registerReplace:d},children:r})}function Ct({children:r}){const t=f.useContext(jr);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t.setPrependNode,style:{display:"contents"}}),t.replaceCount>0?e.jsx("div",{ref:t.setReplaceNode,style:{display:"contents"}}):r,e.jsx("div",{ref:t.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:r})}function Do({children:r,mode:t="append"}){const o=f.useContext(jr);if(f.useEffect(()=>{if(!(t!=="replace"||!o))return o.registerReplace()},[t,o]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const n=t==="prepend"?o.prependNode:t==="replace"?o.replaceNode:o.appendNode;return n?Ar.createPortal(r,n):null}const Pr=f.createContext(null);function vt({children:r}){const[t,o]=f.useState({}),[n,l]=f.useState({}),c=f.useCallback((a,d)=>{o(y=>y[a]===d?y:{...y,[a]:d})},[]),s=f.useCallback(a=>(l(d=>({...d,[a]:(d[a]??0)+1})),()=>l(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),i=f.useMemo(()=>({outletNodes:t,setOutletNode:c,slotCounts:n,registerSlot:s}),[t,c,n,s]);return e.jsx(Pr.Provider,{value:i,children:r})}function bt({slotKey:r,fallback:t}){const o=f.useContext(Pr),n=o?(o.slotCounts[r]??0)>0:!1,l=f.useRef(o==null?void 0:o.setOutletNode);l.current=o==null?void 0:o.setOutletNode;const c=f.useCallback(s=>{var i;return(i=l.current)==null?void 0:i.call(l,r,s)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:c,style:{display:"contents"}}):t})}function So({slotKey:r,children:t}){const o=f.useContext(Pr),n=f.useRef(o==null?void 0:o.registerSlot);if(n.current=o==null?void 0:o.registerSlot,f.useEffect(()=>{var c;return(c=n.current)==null?void 0:c.call(n,r)},[r]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const l=o.outletNodes[r];return l?Ar.createPortal(t,l):null}const pr="moduleSwitcherGroupId",Nr="sa-module-switcher-change";function xt(){if(typeof window>"u")return null;const r=window.localStorage.getItem(pr);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function wt(r){typeof window>"u"||(r===null?window.localStorage.removeItem(pr):window.localStorage.setItem(pr,String(r)),window.dispatchEvent(new CustomEvent(Nr,{detail:r})))}function Bo(){wt(null)}function _r(){const[r,t]=f.useState(()=>xt());return f.useEffect(()=>{const n=()=>{t(xt())},l=c=>{c.key===pr&&n()};return window.addEventListener(Nr,n),window.addEventListener("storage",l),()=>{window.removeEventListener(Nr,n),window.removeEventListener("storage",l)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{wt(n),t(n)}}}let Cr=0,Je=!1,Dt=new Set;const St=()=>e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"1.667",y:"1.667",width:"12.667",height:"12.667",rx:"2"}),e.jsx("line",{x1:"6",y1:"1.667",x2:"6",y2:"14.333"})]}),Bt={width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",fontSize:"0.875rem",color:"var(--sa-text-subtle, #8c8f97)",background:"transparent",border:"none",borderRadius:"0.375rem",cursor:"pointer",textAlign:"left"};function ko({children:r,headerLeftSlot:t,profile:o,isLoadingProfile:n,onLogout:l,isLoggingOut:c,loadingComponent:s,sidebarHeaderContent:i,headerActions:a,profileRole:d,profileMenuButtons:y,profileMenuItems:p,logoutButton:C}){var De,Ye;const[b]=he.useSearchParams(),L=b.get("embed")==="true",v=Vr(),{badges:B}=gt(),T=he.useNavigate(),S=he.useLocation(),w=!de.useMediaQuery("md"),[W,O]=f.useState(!1),[x,I]=f.useState(!1),[A,Z]=f.useState(!1),[G,X]=f.useState(!1),[ie,se]=f.useState(()=>new Set(Dt)),[ee,re]=f.useState(null),{selectedGroupId:K,setSelectedGroupId:_}=_r();f.useEffect(()=>{Dt=ie},[ie]);const ne=f.useRef(null),fe=f.useRef(null);f.useEffect(()=>{const F=ne.current;if(!F)return;const Q=()=>{Je||(Cr=F.scrollTop)};return F.addEventListener("scroll",Q),()=>F.removeEventListener("scroll",Q)},[]);const pe=()=>{const F=ne.current;F&&Cr>0&&(Je=!0,F.scrollTop=Cr,requestAnimationFrame(()=>{Je=!1}))};f.useLayoutEffect(()=>{Je=!0,pe();const F=setTimeout(()=>{Je=!1},300);return()=>clearTimeout(F)},[]),f.useLayoutEffect(()=>{v.menus.length>0&&(Cr>0?pe():requestAnimationFrame(()=>{var Q;const F=(Q=ne.current)==null?void 0:Q.querySelector("[data-menu-active='true']");F&&F.scrollIntoView({block:"center",behavior:"instant"})}))},[v.menus]),f.useEffect(()=>{Je=!0,pe();const F=setTimeout(pe,0),Q=setTimeout(pe,50),U=setTimeout(pe,100),E=setTimeout(pe,200),N=setTimeout(()=>{Je=!1},300),j=setTimeout(()=>{const q=ne.current,J=q==null?void 0:q.querySelector("[data-menu-active='true']");if(q&&J){const ue=q.getBoundingClientRect(),Se=J.getBoundingClientRect();Se.top>=ue.top&&Se.bottom<=ue.bottom||J.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(F),clearTimeout(Q),clearTimeout(U),clearTimeout(E),clearTimeout(N),clearTimeout(j)}},[S.pathname]),f.useEffect(()=>{fe.current&&(fe.current.scrollTop=0)},[S.pathname]),f.useEffect(()=>{w&&Z(!1)},[S.pathname,w]),f.useEffect(()=>{w&&I(!0)},[w]);const Ae=()=>{O(!0)},Ze=()=>{O(!1)},Be=()=>{O(!1),l()},Le=F=>{const Q=[F.to];return F.children&&Q.push(...F.children.map(U=>U.to)),Q},He=[...v.menus.flatMap(F=>F.items.flatMap(Le)),...((De=v.menuBottom)==null?void 0:De.flatMap(Le))??[]],Ce=F=>{if(!S.pathname.startsWith(F))return!1;const Q=He.filter(U=>S.pathname.startsWith(U)).sort((U,E)=>E.length-U.length)[0];return F===Q};f.useEffect(()=>{var Q;const F=U=>{var E;(E=U.children)!=null&&E.some(N=>S.pathname.startsWith(N.to))&&se(N=>{const j=new Set(N);return j.add(U.id),j})};v.menus.forEach(U=>{U.items.forEach(F)}),(Q=v.menuBottom)==null||Q.forEach(F)},[S.pathname,v.menus,v.menuBottom]);const Pe=F=>{se(Q=>{const U=new Set(Q);return U.has(F)?U.delete(F):U.add(F),U})};f.useEffect(()=>{v.menus.length!==0&&K!==null&&!v.menus.some(F=>F.id===K)&&_(null)},[v.menus,K,_]);const ze=f.useMemo(()=>{if(K!==null)return v.menus.filter(U=>U.id===K||U.parentGroupId===K);const F=v.menus.filter(U=>U.parentGroupId===void 0),Q=v.menus.filter(U=>U.parentGroupId!==void 0).flatMap(U=>U.items);return Q.length===0?F:[...F,{id:18,name:"Pengaturan",items:Q,parentGroupId:void 0}]},[v.menus,K]);if(L)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:r||e.jsx(he.Outlet,{})});const Ie=F=>{const Q=F.children&&F.children.length>0,U=ie.has(F.id),E=Q?F.children.some(q=>Ce(q.to)):Ce(F.to),N=yr(F.badge,B[F.id]),j=!!N&&x&&!w;return e.jsxs("div",{"data-menu-active":E||void 0,children:[e.jsxs("button",{onClick:q=>{if(Q)if(x&&!w){const J=q.currentTarget.getBoundingClientRect();re({item:F,top:J.top,left:J.right+8})}else Pe(F.id);else T(F.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:x&&!w?"center":void 0,gap:"0.5rem",paddingLeft:x&&!w?"0":"0.5rem",paddingRight:x&&!w?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:E?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:E?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:E?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:x&&!w?F.title:void 0,onMouseEnter:q=>{E||(q.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:q=>{E||(q.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(m.Icon,{name:F.icon,size:"sm",style:{flexShrink:0}}),j&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"-2px",right:"-2px",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-error-500, #ff4d6d)",border:"1px solid var(--sa-background-primary, #ffffff)"}})]}),(!x||w)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",transition:"opacity 0.3s",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:F.title}),N&&e.jsx(_e.Badges,{text:String(N.value),variant:N.variant??"info",size:"xs",border:!0}),Q&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:U?"rotate(180deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),Q&&(!x||w)&&(()=>{const q=F.children.findIndex(J=>Ce(J.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:U?`${F.children.length*36}px`:"0px",opacity:U?1:0,marginTop:U?"0.25rem":"0px"},children:[e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"1.5px",height:"100%",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),q>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${q*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),F.children.map(J=>{const ue=yr(J.badge,B[J.id]);return e.jsxs("button",{onClick:()=>T(J.to),style:{width:"100%",display:"flex",alignItems:"center",gap:"0.5rem",paddingLeft:"0.75rem",paddingRight:"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:Ce(J.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:Ce(J.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:Ce(J.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:Ce(J.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:Se=>{Ce(J.to)||(Se.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:Se=>{Ce(J.to)||(Se.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(m.Icon,{name:J.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:J.title}),ue&&e.jsx(_e.Badges,{text:String(ue.value),variant:ue.variant??"info",size:"xs",border:!0})]},J.id)})]})})()]},F.id)};return e.jsx(vt,{children:e.jsxs(pt,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":w?"0px":x?"4.375rem":"16.375rem","--app-footer-zindex":w&&A?"40":"999"},children:[w&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:A?.5:0,pointerEvents:A?"auto":"none",transition:"opacity 0.3s"},onClick:()=>Z(!1)}),e.jsxs("aside",{style:{width:w?"16.375rem":x?"4.375rem":"16.375rem",position:w?"fixed":"relative",...w&&{inset:0,zIndex:50,transform:A?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:"all 0.3s ease-in-out",flexShrink:w?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1),style:{height:"4rem",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",position:"relative"},children:(()=>{const F=!w&&x&&!A,Q=F&&G;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:F?1:void 0,justifyContent:F?"center":void 0,transition:"opacity 0.2s",opacity:Q?0:1,pointerEvents:Q?"none":"auto"},children:[e.jsx("img",{src:v.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!x||A)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:v.appName})]}),!w&&!x&&e.jsx("button",{type:"button",onClick:()=>I(!0),"aria-label":"Collapse sidebar",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1rem",height:"1rem",padding:0,background:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer",flexShrink:0},children:e.jsx(St,{})}),F&&e.jsx("button",{type:"button",onClick:()=>I(!1),"aria-label":"Expand sidebar",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",padding:0,background:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-sm, 0.375rem)",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer",opacity:Q?1:0,pointerEvents:Q?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(St,{})})}),w&&e.jsx("button",{onClick:()=>Z(!1),"aria-label":"Close menu",style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.25rem",height:"1.25rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})()}),i&&e.jsx(yt,{collapsed:w?!1:x,children:i}),e.jsx("div",{ref:ne,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:ze.map(F=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!x||w?F.name&&e.jsx("div",{style:{paddingLeft:"1.5rem",paddingRight:"1rem",paddingTop:"0rem",paddingBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"400",color:"var(--sa-text-subtlest, #6b6e76)",transition:"opacity 0.3s",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:F.name}):F.name&&e.jsx("div",{"aria-label":F.name,style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"0.75rem",paddingBottom:"0.75rem"},children:e.jsx("span",{style:{display:"block",width:"1rem",height:"2px",borderRadius:"1px",backgroundColor:F.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx("div",{style:{paddingLeft:"1rem",paddingRight:"1rem",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)"},children:F.slotKey?e.jsx(bt,{slotKey:F.slotKey,fallback:F.items.map(Q=>Ie(Q))}):F.items.map(Q=>Ie(Q))})]},F.id))}),v.menuBottom&&v.menuBottom.length>0&&e.jsx("div",{style:{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",paddingTop:"0.75rem",paddingBottom:"0.75rem",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)",flexShrink:0},children:v.menuBottom.map(F=>Ie(F))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{height:"4rem",backgroundColor:"var(--sa-background-primary, #ffffff)",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[w&&e.jsx("button",{onClick:()=>Z(!0),style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.5rem",height:"1.5rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),e.jsx(Ct,{children:t})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(M.Menu,{position:"bottom-right",children:[e.jsx(M.MenuButton,{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsxs("div",{style:{textAlign:"right",maxWidth:"12.5rem"},children:[e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:500,color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"Loading...":(o==null?void 0:o.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"":(o==null?void 0:o.email)||"unknown"})]}),e.jsx("div",{style:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"0.875rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",flexShrink:0,backgroundColor:"var(--sa-background-brand, #04254f)"},children:((o==null?void 0:o.name)||"U")[0].toUpperCase()}),e.jsx(m.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(M.MenuLists,{style:{width:"280px",paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(M.MenuHeading,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",paddingBlock:"0.5rem"},children:[e.jsx("div",{style:{width:"4rem",height:"4rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"1.25rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",marginBottom:"0.75rem",backgroundColor:"var(--sa-background-brand, #04254f)"},children:((o==null?void 0:o.name)||"U")[0].toUpperCase()}),e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:600,color:"var(--sa-text-primary, #292a2e)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(o==null?void 0:o.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(o==null?void 0:o.email)||"unknown"}),d&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d})]})}),(y&&y.length>0||p)&&e.jsxs(M.MenuBody,{children:[y==null?void 0:y.map((F,Q)=>e.jsx(M.MenuButton,{children:e.jsxs("button",{type:"button",onClick:F.onClick,style:Bt,onMouseEnter:U=>{U.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:U=>{U.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(m.Icon,{name:F.icon,size:"md"}),e.jsx("span",{children:F.label})]})},`${F.label}-${Q}`)),p]}),C??e.jsx(M.MenuFooter,{children:e.jsx(M.MenuButton,{children:e.jsxs("button",{type:"button",onClick:Ae,style:{...Bt,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:F=>{F.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:F=>{F.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(m.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:fe,style:{flex:1,overflowY:"auto"},children:r||e.jsx(he.Outlet,{})})]})]}),c&&s&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--sa-color-black-alpha-a70, #181a19b8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:s}),e.jsxs(Me.Dialog,{isShow:W,onHide:Ze,children:[e.jsx(Me.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Me.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Me.DialogFooter,{children:e.jsx(u.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(le.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(u.Box,{direction:"column",children:e.jsx(V.Button,{secondary:!0,onClick:Ze,children:"Cancel"})}),e.jsx(u.Box,{direction:"column",children:e.jsx(V.Button,{primary:!0,onClick:Be,children:"Yes, Sure"})})]})})})]}),ee&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>re(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":ee.item.title,style:{position:"fixed",top:ee.top,left:ee.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem",backgroundColor:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-md, 0.5rem)",boxShadow:"var(--sa-shadow-lg, 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a)",padding:"0.5rem",display:"flex",flexDirection:"column",gap:"0.125rem"},children:[e.jsx("div",{style:{fontSize:"0.75rem",fontWeight:600,color:"var(--sa-color-gray-500, #8c8f97)",padding:"0.25rem 0.5rem 0.5rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:ee.item.title}),(Ye=ee.item.children)==null?void 0:Ye.map(F=>{const Q=Ce(F.to),U=yr(F.badge,B[F.id]);return e.jsxs("button",{onClick:()=>{T(F.to),re(null)},style:{width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.5rem 0.75rem",borderRadius:"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:Q?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:Q?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:E=>{Q||(E.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:E=>{Q||(E.currentTarget.style.backgroundColor="transparent")},children:[F.icon&&e.jsx(m.Icon,{name:F.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:F.title}),U&&e.jsx(_e.Badges,{text:String(U.value),variant:U.variant??"info",size:"xs",border:!0})]},F.id)})]})]})]})})}const vr=f.forwardRef(({children:r,...t},o)=>e.jsx(u.Box,{ref:o,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),kt=({title:r,iconName:t,textColor:o,iconColor:n,hoverTextColor:l,hoverIconColor:c})=>{const[s,i]=f.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=o??"var(--sa-text-subtle, #8c8f97)",y=c??"var(--sa-text-subtle, #8c8f97)",p=l??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{cursor:"pointer"},children:[e.jsx(m.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:s?y:a,transition:"color 0.15s ease"}}),e.jsx(D.Text,{variant:"sub-h3",style:{color:s?p:d,transition:"color 0.15s ease"},children:r||"Back"})]})},Fo=({items:r,separator:t="/",iconName:o,iconColor:n,hoverIconColor:l})=>{const[c,s]=f.useState(!1),i=n??"var(--sa-text-subtle, #8c8f97)",a=l??"var(--sa-text-subtle, #8c8f97)",d=r.length>1?r[0]:void 0,y=!!(d!=null&&d.to||d!=null&&d.onClick),p=e.jsx(m.Icon,{name:o||"ChevronLeft",size:"xs",onMouseEnter:y?()=>s(!0):void 0,onMouseLeave:y?()=>s(!1):void 0,style:{color:y&&c?a:i,transition:"color 0.15s ease",cursor:y?"pointer":void 0}}),C=d!=null&&d.to?e.jsx(he.Link,{to:d.to,replace:!0,style:{textDecoration:"none"},children:p}):d!=null&&d.onClick?e.jsx(vr,{onClick:d.onClick,children:p}):p;return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",children:[C,e.jsx(Re.Breadcrumb,{separator:t,size:"md",children:r.map((b,L)=>{const v=L===r.length-1;return b.to&&!v?e.jsx(Re.BreadcrumbItem,{children:e.jsx(he.Link,{to:b.to,children:b.label})},L):e.jsx(Re.BreadcrumbItem,{currentPage:v,children:e.jsx(Re.BreadcrumbLink,{onClick:v?void 0:b.onClick,children:b.label})},L)})})]})},mo=r=>{const{items:t,separator:o,onClick:n,navigateTo:l,...c}=r;return t&&t.length>0?e.jsx(Fo,{items:t,separator:o,iconName:c.iconName,iconColor:c.iconColor,hoverIconColor:c.hoverIconColor}):l?e.jsx(u.Box,{direction:"row",children:e.jsx(he.Link,{to:l,replace:!0,style:{textDecoration:"none"},children:e.jsx(kt,{...c})})}):e.jsx(u.Box,{direction:"row",children:e.jsx(vr,{onClick:n,children:e.jsx(kt,{...c})})})},qr=[{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 Ft(r,t,o){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:r?`2px solid ${o.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:r?o.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:r?t?`0 8px 20px ${o.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${o.activeShadow}`:t?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:t?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const mt={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Mt={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function Et({isShow:r,onHide:t,menus:o,selectedGroupId:n,onSelect:l}){const[c,s]=f.useState(void 0),i=d=>{l(d),t()},a=qr[0];return e.jsx(Me.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Me.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>i(null),onMouseEnter:()=>s("all"),onMouseLeave:()=>s(void 0),style:Mt,children:[e.jsx("div",{style:Ft(n===null,c==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(m.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:mt,children:"Semua"})]}),o.map((d,y)=>{var v;const p=n===d.id,C=c===d.id,b=((v=d.items[0])==null?void 0:v.icon)??"Grid",L=qr[(y+1)%qr.length];return e.jsxs("button",{onClick:()=>i(d.id),onMouseEnter:()=>s(d.id),onMouseLeave:()=>s(void 0),style:Mt,children:[e.jsx("div",{style:Ft(p,C,L),children:e.jsx("div",{style:{color:L.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(m.Icon,{name:b,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:mt,children:d.name})]},d.id)})]})})})}function Mo({onSelect:r,"aria-label":t="Pilih module"}={}){const o=Vr(),n=he.useNavigate(),{selectedGroupId:l,setSelectedGroupId:c}=_r(),[s,i]=f.useState(!1),a=d=>{var y;if(c(d),d!==null){const p=o.menus.find(b=>b.id===d),C=(y=p==null?void 0:p.items[0])==null?void 0:y.to;C&&n(C)}r==null||r(d)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>i(!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2.25rem",height:"2.25rem",borderRadius:"var(--sa-radii-sm, 0.25rem)",border:"1px solid var(--sa-border-subtle, #0b120e24)",color:"var(--sa-text-subtle, #8c8f97)",backgroundColor:"transparent",cursor:"pointer"},"aria-label":t,onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:e.jsx(m.Icon,{name:"GridApplication",size:"sm"})}),l!==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(Et,{isShow:s,onHide:()=>i(!1),menus:o.menus.filter(d=>d.parentGroupId===void 0),selectedGroupId:l,onSelect:a})]})}const Eo=(r,t)=>{const o=[];if(t===0)return o.push(r),o;for(let n=0;n<r.length;n+=t){const l=r.slice(n,n+t);o.push(l)}return o},Lo=f.memo(({value:r,label:t,separator:o,labelWidth:n,lastIndex:l,labelAlign:c="top"})=>{const s=f.useMemo(()=>({padding:0,paddingBottom:l?0:12,verticalAlign:c}),[l,c]),i=f.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:l?0:12,verticalAlign:c}),[l,c]),a=()=>typeof t=="string"?e.jsx(D.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(D.Text,{color:"primary",fontWeight:"medium",children:r}):r,y=()=>typeof o=="string"||typeof o=="number"?e.jsx(D.Text,{fontWeight:"medium",color:"subtlest",children:o}):o;return e.jsxs($.Tr,{children:[e.jsx($.Td,{style:s,width:n,children:a()}),o?e.jsx($.Td,{style:i,width:24,children:y()}):null,e.jsx($.Td,{style:s,children:d()})]})}),Io=f.memo(({fields:r,separator:t,labelWidth:o})=>e.jsx($.Table,{children:r.map((n,l)=>e.jsx(Lo,{separator:t,labelWidth:o,lastIndex:l===r.length-1,...n},`field-group-field-${l}`))})),To=f.memo(({maxRow:r=0,maxColumn:t=2,separator:o=":",fields:n=[],labelWidth:l=150,bordered:c=!1})=>{const s=f.useMemo(()=>Eo(n,r),[n,r]),i=s.length>2,a=()=>{switch(t){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(u.Box,{gap:i?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:i?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:c?"border":void 0,borderStyle:c?"border-solid":void 0,borderColor:c?"border-subtle":void 0,children:s.map((d,y)=>e.jsx(u.Box,{direction:"column",flex:i?void 0:"1",width:i?a():void 0,marginBottom:i?"lg":void 0,children:e.jsx(Io,{labelWidth:l,fields:d,separator:o})},y))})}),Oo=({backButton:r})=>{const[t,o]=f.useState(!1),n=(r==null?void 0:r.iconColor)??"var(--sa-text-subtle, #8c8f97)",l=(r==null?void 0:r.textColor)??"var(--sa-text-subtle, #8c8f97)",c=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",s=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{cursor:"pointer"},children:[e.jsx(m.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?c:n,transition:"color 0.15s ease"}}),e.jsx(D.Text,{variant:"sub-h3",style:{color:t?s:l,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},Wo=({backButton:r,title:t,titleIcon:o,titleTag:n,children:l,header:c=!0,headerBorder:s=!1,subHeaders:i,action:a,titleTagProps:d,containerProps:y,headerProps:p})=>{const C=de.useMediaQuery("md"),b=he.useNavigate(),L=he.useLocation(),v=r==null?void 0:r.show,B=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}b(-1,{replace:!0})},T=()=>{if(!a)return null;if(f.isValidElement(a))return a;const x=a.filter(I=>I&&(I.title||I.icon));return x.length===0?null:C?e.jsx(u.Box,{direction:"row",gap:"md",children:x.map(({title:I,icon:A,buttonProps:Z,onClick:G},X)=>e.jsx(V.Button,{iconLeft:A?e.jsx(m.Icon,{name:A,size:"md"}):void 0,onClick:G,...Z,children:I},`action-${X}`))}):e.jsxs(M.Menu,{position:"bottom-right",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(m.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(M.MenuLists,{children:e.jsx(M.MenuBody,{style:{minWidth:200},children:x.map(({title:I,icon:A,buttonProps:Z,onClick:G},X)=>{const ie=(Z==null?void 0:Z.tone)==="error"||(Z==null?void 0:Z.danger)===!0;return e.jsx(M.MenuItem,{intent:ie?"danger":void 0,disabled:Z==null?void 0:Z.disabled,startIcon:A?e.jsx(m.Icon,{name:A}):void 0,onClick:G,children:I},`action-${X}`)})})})]})},S=()=>{const x=e.jsx(Oo,{backButton:r});return r!=null&&r.navigateTo?e.jsx(u.Box,{direction:"row",children:e.jsx(he.Link,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:x})}):e.jsx(u.Box,{direction:"row",children:e.jsx(vr,{onClick:B,children:x})})},P=()=>{const x=!!t,I=Array.isArray(a)&&a.length>0,A=f.isValidElement(a)?!0:I;if(!x&&!A&&!v)return null;const G=C||!C&&I;return e.jsxs(u.Box,{direction:"column",gap:"xs",paddingBlock:(p==null?void 0:p.paddingBlock)??"sm",paddingInline:(p==null?void 0:p.paddingInline)??"md",...p,style:{...s?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...p==null?void 0:p.style},children:[v&&S(),(x||A)&&e.jsxs(u.Box,{direction:G?"row":"column",gap:"sm",justify:"space-between",align:G?"center":"flex-start",children:[x?typeof t=="string"?e.jsxs(u.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[o&&e.jsx(m.Icon,{name:o,size:"md",color:"primary"}),e.jsx(D.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:t})]}),n&&e.jsx(_e.Badge,{border:!0,size:"lg",text:n,...d})]}):t:null,T()]})]})},w=()=>{if(!i||i.length===0)return null;let x=0,I=-1/0;return i.forEach((A,Z)=>{const G=A.order??0;G>=I&&(I=G,x=Z)}),i.map(({content:A,order:Z,borderBottom:G=!0},X)=>e.jsx(u.Box,{direction:"column",paddingTop:"sm",paddingBottom:G||X===x?"sm":"spacing-0",paddingInline:"md",style:{...G?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...Z!==void 0?{order:Z}:{}},children:A},`sub-header-${X}`))},W=()=>{const x=c?P():null,I=w();return!x&&!I?null:e.jsxs(u.Box,{direction:"column",style:{marginBottom:i&&i.length>0?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[x,I]})},O=()=>l;return e.jsxs(u.Box,{direction:"column",as:"main",...y,style:{...(y==null?void 0:y.style)??{},animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"},children:[W(),O()]},L.pathname)},zo=f.memo(Wo),Ao={icon:"Cross",title:""},Ho="calc(100vw - 16px)",Lt=r=>r==null?void 0:`min(${typeof r=="number"?`${r}px`:r}, ${Ho})`,It=f.forwardRef(({onHide:r,show:t,withBlur:o=!1,style:n,children:l,closeButton:c=Ao,width:s,minWidth:i="357px",maxWidth:a="357px"},d)=>{const y=Lt(s??i),p=Lt(s??a);return e.jsx(ur.Drawer,{blur:o,isShow:t,position:"right",onHide:r,ref:d,style:{minWidth:y,maxWidth:p,...n},children:e.jsxs(u.Box,{direction:"column",padding:"lg",children:[c?e.jsxs(u.Box,{direction:"row",align:"center",gap:"sm",onClick:r,marginBottom:"lg",cursor:"pointer",children:[e.jsx(m.Icon,{name:c.icon,size:"md",color:"subtle",cursor:"pointer"}),c.title?e.jsx(D.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:c.title}):null]}):null,l]})})}),Zr=f.memo(({children:r,borderBottom:t=!0,padding:o=!0})=>{const n=de.useMediaQuery("lg");return e.jsx(u.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),Gr=f.memo(({children:r,borderTop:t=!0,padding:o=!0})=>{const n=de.useMediaQuery("lg");return e.jsx(u.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),Vo=f.memo(({children:r,...t})=>e.jsx(u.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),jo=f.memo(({children:r,title:t,titleTag:o,action:n,header:l,footer:c,actionContainer:s,containerProps:i,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:y={borderTop:!0},variantTag:p="info"})=>{const C=de.useMediaQuery("lg"),b=()=>o?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(D.Text,{fontWeight:"medium",children:t}),e.jsx(_e.Badges,{border:!0,text:o,variant:p})]}):e.jsx(D.Text,{fontWeight:"medium",children:t}),L=()=>l||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:t?b():null}),e.jsx(u.Box,{direction:"column",style:C?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...s,children:n??null})]}),v=!!(l||t||n);return e.jsxs(u.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...i,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(i==null?void 0:i.style)??{}},children:[l!==null&&v?e.jsx(Zr,{...d,children:L()}):null,e.jsx(Vo,{...a,children:r}),c?e.jsx(Gr,{...y,children:c}):null]})}),Ee={H1:r=>e.jsx(D.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(D.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(D.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(D.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(D.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(D.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(D.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(D.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(D.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(D.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(D.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(D.Text,{variant:"body-3",children:r.children,...r.props})},Fe=()=>{const[r,t]=he.useSearchParams(),o=rr.searchParamsToObject(r.toString()),n=he.useParams(),l=he.useLocation(),c=n.id;return{setSearchParams:t,searchParams:r,searchQueries:o,isHasQuery:(y,p)=>r.has(y)&&r.get(y)===p,getQueryParam:y=>r.get(y),getRouteParam:y=>n[y],params:n,location:l,id:c,hasId:!!c}},Tt=r=>JSON.stringify(r),Ot=r=>JSON.stringify(r),Wt=r=>JSON.stringify(r),zt=r=>JSON.stringify(r),Po=r=>r,No=r=>JSON.stringify(r),ar=({value:r,name:t,type:o,withSearchParam:n=!0,setSearchParams:l,searchQueries:c,dropdownSearchKey:s,filterKey:i="filter",pageKey:a="page"})=>{if(n){let d;switch(o){case"search":d=Po(r);break;case"dropdown":case"dropdown-multiple":d=Tt(r);break;case"radio":d=Ot(r);break;case"date-range":d=Wt(r);break;case"advanced-date-range":d=No(r);break;case"date":d=zt(r);break;default:d=r;break}if(typeof d<"u"){const p={...c[i]&&typeof c[i]=="string"?JSON.parse(c[i]):void 0,[t]:d},C={...c};s&&typeof s=="string"&&delete C[s],delete C[a];const b={...C,[i]:JSON.stringify(p)},L=new URLSearchParams(c).toString(),v=new URLSearchParams(b).toString();if(L===v)return;l(b)}}},br=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,c=l&&typeof l=="string"?JSON.parse(l):void 0,s=c?c[r]:void 0;return n==="label"&&s?JSON.parse(s)[0].label:n==="value"&&s?JSON.parse(s)[0].value:s},At=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,c=l&&typeof l=="string"?JSON.parse(l):void 0,s=c?c[r]:void 0;return n==="label"&&s?JSON.parse(s).map(i=>i.label):n==="value"&&s?JSON.parse(s).map(i=>i.value):n==="array"&&s?JSON.parse(s):s},_o=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,c=l&&typeof l=="string"?JSON.parse(l):void 0,s=c?c[r]:void 0;return n==="id"&&s?JSON.parse(s).id:n==="label"&&s?JSON.parse(s).label:n==="value"&&s?JSON.parse(s).value:s},xr=(r,t,o)=>{const n=t.get(o||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0;return l?l[r]:void 0},qo=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,c=l?l[r]:void 0;return{start:c?JSON.parse(c).from:void 0,end:c?JSON.parse(c).to:void 0}},Ht=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,c=l?l[r]:void 0;return c?JSON.parse(c):void 0},Zo=(r,{filterKey:t="filter",perPageKey:o="perPage",pageKey:n="page"})=>{const l=r.get(t)||void 0,c=r.get(o)||void 0,s=r.get(n)||void 0;return!!l||!!c||!!s},Vt=({isOpen:r,onClose:t,filterKey:o,pageKey:n,filters:l})=>{const{searchParams:c,setSearchParams:s,searchQueries:i}=Fe(),[a,d]=f.useState({}),y=()=>{c.delete(o||"filter"),s(c)},p=(C,b)=>{switch(C.type){case"radio":{const{show:L=!0}=C;return L&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:C.title})},b)}case"dropdown":{const{show:L=!0}=C;return L&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:C.title})},b)}case"date-range":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:C.title})},b);case"date":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:C.title})},b);case"dropdown-multiple":{const{show:L=!0}=C;return L&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:C.title})},b)}default:return null}};return e.jsx(It,{onHide:t,show:r||!1,children:e.jsxs(u.Box,{direction:"column",gap:"md",children:[e.jsxs(le.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(u.Box,{direction:"column",children:"Filter"}),e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},onClick:y,children:"Reset"})]}),l==null?void 0:l.map((C,b)=>p(C,b))]})})},jt=({searchKey:r="q",statusKey:t="status",searchPlaceholder:o="Search",searchHighlightPlaceholder:n,extendedFilter:l,showSearchFilter:c=!0,showStatusFilter:s=!0,filterKey:i="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:y,filterConfigs:p,buttonToggleProps:C,position:b="right",titleSearchLabel:L="Work Order",withTitleLabels:v=!1})=>{const T=(C==null?void 0:C.isShowLabel)??!0,[S,P]=f.useState(!1),[w,W]=f.useState(0),O=()=>{W(_=>_+1)},{searchParams:x,setSearchParams:I,getQueryParam:A}=Fe(),Z=rr.searchParamsToObject(x.toString()),G=xr(r,x,i)||"",[X,ie]=f.useState(G),se=A(i),re=!!(se&&!(()=>{if(se)try{const _=JSON.parse(se);return Object.keys(_).length===1&&_[r]===""}catch(_){console.error("Filter parameter is not a valid JSON:",_)}return!1})()),K=de.useMediaQuery("md");return f.useEffect(()=>{ie(G)},[G]),f.useEffect(()=>{if(X===G)return;const _=window.setTimeout(()=>{ar({value:X,name:r,type:"search",searchQueries:Z,setSearchParams:I,filterKey:i,pageKey:a})},350);return()=>{window.clearTimeout(_)}},[X,G,r,Z,I,i,a]),e.jsxs(le.Flex,{gap:"md",style:{flexDirection:K&&b==="left"?"row":K&&b==="right"?"row-reverse":"column"},align:"flex-end",children:[re&&e.jsx(u.Box,{direction:"column",justify:"flex-end",children:e.jsx(V.Button,{onClick:()=>{const _=new URLSearchParams(x);_.delete(i),I(_),ie(""),O(),y&&y()},variant:"outline",tone:"neutral",children:e.jsx(D.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),l==null?void 0:l.map(({minWidth:_,content:ne,title:fe,onClickContainer:pe},Ae)=>e.jsxs(u.Box,{direction:"column",gap:"sm",onClick:pe,style:{minWidth:_},children:[fe&&e.jsx(Ee.SubH3,{children:fe}),ne]},`extended-filter-${Ae}-${w}`)),!!(p!=null&&p.length)&&e.jsx(V.Button,{primary:re,secondary:!re,iconLeft:e.jsx(m.Icon,{size:"sm",name:(C==null?void 0:C.icon)||"FilterHorizontal",style:{color:se?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!K,onClick:()=>P(!0),children:T?"Filter":void 0}),s&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[v&&e.jsx(Ee.SubH3,{children:"Status"}),e.jsx(er.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:br({get:"value",name:t,searchParams:x,filterKey:i})?[{label:br({get:"value",name:t,searchParams:x,filterKey:i})==="active"?"Active":"InActive",value:br({get:"value",name:t,searchParams:x,filterKey:i})}]:[],onChange:_=>ar({value:_,name:t,type:"dropdown",searchQueries:Z,setSearchParams:I,filterKey:i}),placeholder:v?"All":"All Status"},w)]}),c&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{width:d&&K?d:K?"310px":""},children:[v&&e.jsxs(Ee.SubH3,{children:["Search for ",L]}),e.jsx(qe.Input,{placeholder:o,leftIcon:e.jsx(m.Icon,{name:"Search",width:20,height:20}),onChange:_=>ie(_.target.value),value:X,fullWidth:!0},w+1+i)]}),e.jsx(Vt,{isOpen:S,onClose:()=>P(!1),filterKey:i,filters:p,pageKey:a})]})},Go=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r;function Pt({configs:r,filterKey:t="filter",activeFilterKey:o="filters",pageKey:n="page",searchKey:l="q"}){const{searchParams:c,setSearchParams:s,searchQueries:i}=Fe(),a=f.useMemo(()=>Object.fromEntries(r.map(w=>[w.key,w])),[r]),d=f.useMemo(()=>{const w=(c.get(o)||"").split(",").map(O=>O.trim()).filter(Boolean);let W=[];try{const O=c.get(t);O&&(W=Object.keys(JSON.parse(O)).filter(x=>x!==l))}catch{}return r.map(O=>O.key).filter(O=>{const x=a[O];return(x==null?void 0:x.locked)||w.includes(O)||W.includes(O)})},[c,o,t,l,r,a]),y=f.useCallback(w=>{try{return w[t]?JSON.parse(w[t]):{}}catch{return{}}},[t]),p=f.useCallback(w=>{const W={...i};w.length?W[o]=w.join(","):delete W[o],s(W)},[i,o,s]),C=f.useCallback(w=>{d.includes(w)||p([...d,w])},[d,p]),b=f.useCallback(w=>{var I;if((I=a[w])!=null&&I.locked)return;const W={...i},O=d.filter(A=>A!==w);O.length?W[o]=O.join(","):delete W[o];const x=y(W);w in x&&(delete x[w],Object.keys(x).length?W[t]=JSON.stringify(x):delete W[t]),delete W[n],s(W)},[i,d,o,t,n,y,s,a]),L=f.useCallback(w=>d.includes(w)?b(w):C(w),[d,C,b]),v=f.useCallback(w=>{switch(w.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return At({name:w.key,get:"array",searchParams:c,filterKey:t})||[];case"date":{const W=Ht({name:w.key,searchParams:c,filterKey:t});return W?new Date(W):void 0}case"date-compact":{const O=y(Object.fromEntries(c.entries()))[w.key];return O&&typeof O=="object"?O:void 0}default:return}},[c,t,y]),B=f.useCallback((w,W)=>{if(w.type==="date-compact"){const O={...i},x=y(O);W==null?delete x[w.key]:x[w.key]=W,Object.keys(x).length?O[t]=JSON.stringify(x):delete O[t],delete O[n],s(O);return}ar({value:W,name:w.key,type:Go(w.type),searchQueries:i,setSearchParams:s,filterKey:t,pageKey:n})},[i,s,t,n,y]),T=f.useCallback(w=>{const W={...i},O=y(W);w in O&&(delete O[w],Object.keys(O).length?W[t]=JSON.stringify(O):delete W[t]),delete W[n],s(W)},[i,t,n,y,s]),S=f.useCallback(()=>{const w={...i};delete w[t],delete w[o],delete w[n],s(w)},[i,t,o,n,s]),P=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:P,addFilter:C,removeFilter:b,toggleFilter:L,getValue:v,setValue:B,clearValue:T,clearAll:S}}const Qr={get(r){return sr.storage.get(r)??null},set(r,t){sr.storage.save(r,t)},remove(r){sr.storage.delete(r)}},dr={columns:r=>`filterbar:colprefs:${r}`,savedViews:r=>`filterbar:views:${r}`,lastState:r=>`filterbar:last:${r}`,tableSort:r=>`tablelayout:sort:${r}`},wr=(r,t)=>{const o=new Set(t.map(c=>c.key)),n=r.order.filter(c=>o.has(c));for(const c of t)n.includes(c.key)||n.push(c.key);const l=r.hidden.filter(c=>o.has(c));return{order:n,hidden:l}};function Qo({columns:r,scopeId:t,storage:o,onColumnsChange:n,value:l}){const c=f.useMemo(()=>({order:r.map(x=>x.key),hidden:[]}),[r]),s=t?dr.columns(t):void 0,i=(x,I)=>wr({order:x.order??I,hidden:x.hidden??[]},r),[a,d]=f.useState(()=>{if(l&&(l.order||l.hidden))return i(l,r.map(x=>x.key));if(s){const x=o.get(s);if(x&&Array.isArray(x.order))return wr(x,r)}return c}),y=r.map(x=>x.key).join("|");f.useEffect(()=>d(x=>wr(x,r)),[y]);const p=f.useRef(a);p.current=a;const C=l?`${(l.order??[]).join("|")}~${(l.hidden??[]).join("|")}`:null,b=f.useRef(C);f.useEffect(()=>{if(C==null||b.current===C)return;b.current=C;const x=p.current,I=i(l,x.order);I.order.join("|")===x.order.join("|")&&I.hidden.join("|")===x.hidden.join("|")||(d(I),s&&o.set(s,I))},[C,y]);const L=f.useRef(!1);f.useEffect(()=>{L.current||(L.current=!0,n==null||n(a))},[]);const v=f.useCallback(x=>{d(x),s&&o.set(s,x),n==null||n(x)},[s,o,n]),B=f.useMemo(()=>{const x=new Map(r.map(I=>[I.key,I]));return a.order.filter(I=>x.has(I)).map(I=>({...x.get(I),visible:!a.hidden.includes(I)}))},[a,r]),T=f.useCallback(x=>{const I=a.hidden.includes(x)?a.hidden.filter(A=>A!==x):[...a.hidden,x];v({...a,hidden:I})},[a,v]),S=f.useCallback((x,I)=>{if(x===I)return;const A=[...a.order],[Z]=A.splice(x,1);A.splice(I,0,Z),v({...a,order:A})},[a,v]),P=f.useCallback(x=>{v({...a,hidden:x?r.filter(I=>!I.locked).map(I=>I.key):[]})},[a,r,v]),w=f.useCallback(()=>v(c),[v,c]),W=f.useCallback(x=>v(wr(x,r)),[v,r]),O=a.hidden.length===0;return{state:a,orderedColumns:B,allVisible:O,toggleVisibility:T,reorder:S,setAllHidden:P,reset:w,applyState:W}}function Uo({scopeId:r,storage:t,snapshotKeys:o,pageKey:n="page",getColumns:l,applyColumns:c}){const{searchParams:s,setSearchParams:i}=Fe(),a=r?dr.savedViews(r):void 0,[d,y]=f.useState(()=>a?t.get(a)||[]:[]),p=f.useCallback(v=>{y(v),a&&t.set(a,v)},[a]),C=f.useCallback(v=>{const B=v.trim();if(!B)return;const T={};o.forEach(P=>{const w=s.get(P);w!=null&&(T[P]=w)});const S={id:`${Date.now()}`,name:B,query:T,columns:l==null?void 0:l(),createdAt:Date.now()};p([...d,S])},[o,s,l,p,d]),b=f.useCallback(v=>p(d.filter(B=>B.id!==v)),[p,d]),L=f.useCallback(v=>{const B=Object.fromEntries(s.entries());o.forEach(T=>delete B[T]),Object.assign(B,v.query),delete B[n],i(B),v.columns&&(c==null||c(v.columns))},[s,o,n,i,c]);return{enabled:!!a,views:d,saveView:C,deleteView:b,applyView:L}}function Jo({scopeId:r,storage:t,snapshotKeys:o,enabled:n=!0}){const{searchParams:l,setSearchParams:c}=Fe(),s=r&&n?dr.lastState(r):void 0,i=f.useRef(!1);f.useEffect(()=>{if(i.current||(i.current=!0,!s)||o.some(p=>l.has(p)))return;const y=t.get(s);!y||Object.keys(y).length===0||c({...Object.fromEntries(l.entries()),...y})},[]),f.useEffect(()=>{if(!s)return;const d={};o.forEach(y=>{const p=l.get(y);p!=null&&(d[y]=p)}),t.set(s,d)},[l,s,o,t]);const a=f.useCallback(()=>{s&&t.remove(s)},[s,t]);return{enabled:!!s,clear:a}}const Yo=({configs:r,activeKeys:t,onToggle:o,hasActiveFilter:n,onReset:l})=>r.length?e.jsxs(M.Menu,{position:"bottom-left",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(m.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(M.MenuLists,{children:e.jsx(M.MenuBody,{style:{minWidth:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&l&&e.jsx(V.Button,{variant:"link",tone:"brand",size:"xs",onClick:l,children:"Reset"})]}),children:r.map(c=>e.jsx(M.MenuItem,{selected:c.locked||t.includes(c.key),disabled:c.locked,closeOnSelect:!1,startIcon:c.icon??void 0,onClick:()=>{c.locked||o(c.key)},children:c.label},c.key))})})]}):null,Dr=({onClear:r,onRemove:t})=>e.jsxs(M.Menu,{position:"bottom-right",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(m.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(M.MenuLists,{children:e.jsxs(M.MenuBody,{style:{width:180},children:[e.jsx(M.MenuItem,{startIcon:e.jsx(m.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(M.MenuItem,{intent:"danger",startIcon:e.jsx(m.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),Xo=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},Nt=(r,t,o)=>{const n=new Date(r);return o==="day"?n.setDate(n.getDate()+t):o==="week"?n.setDate(n.getDate()+t*7):o==="month"?n.setMonth(n.getMonth()+t):n.setFullYear(n.getFullYear()+t),n},_t=r=>{const t=Xo(new Date);if(r.direction==="this"){const n=new Date(t),l=new Date(t);return r.period==="week"?(n.setDate(t.getDate()-t.getDay()),l.setDate(n.getDate()+6)):r.period==="month"?(n.setDate(1),l.setMonth(l.getMonth()+1,0)):r.period==="year"&&(n.setMonth(0,1),l.setMonth(11,31)),{from:n,to:l}}const o=r.count??1;return r.direction==="past"?{from:Nt(t,-o,r.period),to:t}:{from:t,to:Nt(t,o,r.period)}},qt=24,Zt=r=>r.length>qt?`${r.slice(0,qt)}...`:r,Sr=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Br={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"},Ko=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],Ur={past:"Past",next:"Next",this:"This"},$o=["day","week","month","year"],Ro=["past","next","this"],el=r=>r.field.type==="date-compact"?e.jsx(ol,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(rl,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),rl=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const c=t?Sr(new Date(t)):null,s=!!c,i=s?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Zt(c)})]}):r.label;return e.jsxs(M.Menu,{position:"bottom-left",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s?e.jsx(m.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(m.Icon,{name:"ChevronSmallDown"}),children:i})}),e.jsx(M.MenuLists,{children:e.jsx(M.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Dr,{onClear:n,onRemove:l})]}),children:e.jsx(Qe.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():o(a),withPadding:!1})})})]})},tl=r=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${Br[r.op]} ${Sr(new Date(r.date))}`:null;case"is-between":return r.from&&r.to?`${Sr(new Date(r.from))} - ${Sr(new Date(r.to))}`:null;case"is-relative-to-today":{const t=r.relative;if(!t)return null;if(t.direction==="this")return`This ${t.period}`;const o=t.count??1,n=o===1?t.period:`${t.period}s`;return`${Ur[t.direction]} ${o} ${n}`}case"is-empty":case"is-not-empty":return Br[r.op];default:return null}},ol=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const c=(t==null?void 0:t.op)??"is",s=t?tl(t):null,i=!!s,a=i?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Zt(s)})]}):r.label,d=y=>{if(y!==c){if(y==="is-empty"||y==="is-not-empty"){o({op:y});return}if(y==="is-relative-to-today"){o({op:y,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(y==="is-between"){o({op:y,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}o({op:y,date:t==null?void 0:t.date})}};return e.jsxs(M.Menu,{position:"bottom-left",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i?e.jsx(m.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(m.Icon,{name:"ChevronSmallDown"}),children:a})}),e.jsxs(M.MenuLists,{children:[e.jsx(M.MenuBody,{style:{width:320},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(ll,{op:c,onChange:d})]}),e.jsx(Dr,{onClear:n,onRemove:l})]}),children:e.jsx(nl,{value:t,op:c,onChange:o})}),c==="is-relative-to-today"&&e.jsx(M.MenuFooter,{children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},ll=({op:r,onChange:t})=>e.jsxs(M.Menu,{position:"bottom-left",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(m.Icon,{name:"ChevronSmallDown"}),children:Br[r]})}),e.jsx(M.MenuLists,{children:e.jsx(M.MenuBody,{style:{width:200},children:Ko.map(o=>e.jsx(M.MenuItem,{selected:r===o,onClick:()=>t(o),endIcon:r===o?e.jsx(m.Icon,{name:"Check"}):void 0,children:Br[o]},o))})})]}),nl=({value:r,op:t,onChange:o})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const n=r!=null&&r.from||r!=null&&r.to?{from:r!=null&&r.from?new Date(r.from):null,to:r!=null&&r.to?new Date(r.to):null}:void 0;return e.jsx(Qe.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:n,onChange:l=>{if(l==null){o({op:t});return}if(typeof l=="object"&&l!==null&&"from"in l&&"to"in l){let{from:c,to:s}=l;if(!c&&s&&(c=s,s=null),!c&&!s){o({op:t});return}o({op:t,from:c?c.toISOString():void 0,to:s?s.toISOString():void 0})}},withPadding:!1},"range")}return t==="is-relative-to-today"?e.jsx(cl,{value:r==null?void 0:r.relative,onChange:n=>o({op:t,relative:n})}):e.jsx(Qe.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:r!=null&&r.date?new Date(r.date):void 0,onChange:n=>{if(n==null){o({op:t});return}n instanceof Date&&o({op:t,date:n.toISOString()})},withPadding:!1},"single")},cl=({value:r,onChange:t})=>{const o=(r==null?void 0:r.direction)??"past",n=(r==null?void 0:r.count)??1,l=(r==null?void 0:r.period)??"week",c=o!=="this",s=_t({direction:o,count:n,period:l});return e.jsxs(u.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(M.Menu,{position:"bottom-left",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(m.Icon,{name:"ChevronSmallDown"}),children:Ur[o]})}),e.jsx(M.MenuLists,{children:e.jsx(M.MenuBody,{style:{width:140},children:Ro.map(i=>e.jsx(M.MenuItem,{selected:o===i,endIcon:o===i?e.jsx(m.Icon,{name:"Check"}):void 0,onClick:()=>t(i==="this"?{direction:i,period:l}:{direction:i,count:n,period:l}),children:Ur[i]},i))})})]}),c&&e.jsx(qe.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:i=>{const a=Number(i.target.value);t({direction:o,count:Number.isFinite(a)&&a>0?a:1,period:l})},style:{width:72}}),e.jsxs(M.Menu,{position:"bottom-left",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(m.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(M.MenuLists,{children:e.jsx(M.MenuBody,{style:{width:140},children:$o.map(i=>e.jsx(M.MenuItem,{selected:l===i,endIcon:l===i?e.jsx(m.Icon,{name:"Check"}):void 0,onClick:()=>t(o==="this"?{direction:o,period:i}:{direction:o,count:n,period:i}),children:i},i))})})]})]}),e.jsx(Qe.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:s,onChange:()=>{},withPadding:!1},"relative-preview")]})},Gt=18,il=r=>r.length>Gt?`${r.slice(0,Gt)}...`:r,sl=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const c=r.type==="dropdown-multiple",s=t.length,[i,a]=f.useState(""),d=r.options,y=typeof r.onSearch=="function",p=(()=>{if(y)return d;const B=i.trim().toLowerCase();return B?d.filter(T=>T.label.toLowerCase().includes(B)):d})(),C=B=>t.some(T=>T.value===B.value),b=B=>{if(!c){o([{label:B.label,value:B.value}]),a("");return}o(C(B)?t.filter(T=>T.value!==B.value):[...t,{label:B.label,value:B.value}])},L=B=>{var T;a(B),(T=r.onSearch)==null||T.call(r,B)},v=s===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:s===1?il(t[0].label):`${s} Selected`})]});return e.jsxs(M.Menu,{position:"bottom-left",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:s>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s>0?e.jsx(m.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(m.Icon,{name:"ChevronSmallDown"}),children:v})}),e.jsx(M.MenuLists,{children:e.jsx(M.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Dr,{onClear:n,onRemove:l})]}),children:e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(er.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:c,searchAble:!0,searchValue:i,onSearch:L,value:t,onChange:o,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(B=>e.jsx(M.MenuItem,{closeOnSelect:!c,selected:C(B),startIcon:B.avatar,endIcon:C(B)?e.jsx(m.Icon,{name:"Check"}):void 0,description:B.description,onClick:()=>b(B),children:B.label},B.value))})]})})})]})},Qt=18,al=r=>r.length>Qt?`${r.slice(0,Qt)}...`:r,Ut=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(lr.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),dl=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const c=new Set(t.map(C=>C.value)),s=t.length,i=r.options.length>0&&r.options.every(C=>c.has(C.value)),a=s>0&&!i,d=C=>{o(c.has(C.value)?t.filter(b=>b.value!==C.value):[...t,{label:C.label,value:C.value}])},y=()=>{o(i?[]:r.options.map(C=>({label:C.label,value:C.value})))},p=s===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(D.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(D.Text,{as:"span",children:s===1?al(t[0].label):`${s} Selected`})]});return e.jsxs(M.Menu,{position:"bottom-left",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:s>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s>0?e.jsx(m.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(m.Icon,{name:"ChevronSmallDown"}),children:p})}),e.jsx(M.MenuLists,{children:e.jsxs(M.MenuBody,{style:{width:240},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Dr,{onClear:n,onRemove:l})]}),children:[e.jsx(M.MenuItem,{closeOnSelect:!1,selected:i,onClick:y,startIcon:e.jsx(Ut,{checked:i||a,indeterminate:a}),children:"Select All"}),r.options.map(C=>e.jsx(M.MenuItem,{closeOnSelect:!1,selected:c.has(C.value),onClick:()=>d(C),startIcon:e.jsx(Ut,{checked:c.has(C.value)}),children:C.label},C.value))]})})]})},Jt=({activeKeys:r,configByKey:t,getValue:o,setValue:n,clearValue:l,removeFilter:c})=>e.jsx(e.Fragment,{children:r.map(s=>{const i=t[s];if(!i)return null;const a=o(i),d=i.locked?void 0:()=>c(s);return i.type==="date"||i.type==="date-compact"?e.jsx(el,{field:i,value:a,onChange:y=>n(i,y),onClear:()=>l(s),onRemove:d},s):i.type==="checkbox-multiple"?e.jsx(dl,{field:i,value:a||[],onChange:y=>n(i,y),onClear:()=>l(s),onRemove:d},s):e.jsx(sl,{field:i,value:a||[],onChange:y=>n(i,y),onClear:()=>l(s),onRemove:d},s)})}),Yt=r=>`${r} Rows`,hl=({pagination:r,pageKey:t="page",perPageKey:o="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:l=10,showResultCount:c=!0,showPageSize:s=!0,showPagination:i=!0})=>{var T;const{searchQueries:a,setSearchParams:d,searchParams:y}=Fe(),p=y.get(o),C=p?Number(p):l,b=S=>{d({...a,[t]:String(S)})},L=S=>{d({...a,[o]:S,[t]:"1"})},v=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),B=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[c&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${v}-${B} of ${((T=r==null?void 0:r.totalData)==null?void 0:T.toLocaleString())||0}`}),s&&e.jsxs(M.Menu,{position:"bottom-left",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"xs",iconRight:e.jsx(m.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Yt(C)})}),e.jsx(M.MenuLists,{children:e.jsx(M.MenuBody,{children:n.map(S=>e.jsx(M.MenuItem,{selected:S===C,onClick:()=>L(String(S)),children:Yt(S)},S))})})]}),i&&!!(r!=null&&r.totalPage)&&e.jsx(u.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"lg",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(ir.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:r!=null&&r.currentPage?Number(r.currentPage):1,totalPages:Number(r.totalPage),onPageChange:b})})]})};function fl(r,t,o=!0){f.useEffect(()=>{if(!o)return;const n=l=>{var i;if(l.metaKey||l.ctrlKey||l.altKey||l.key!==r)return;const c=l.target,s=(i=c==null?void 0:c.tagName)==null?void 0:i.toLowerCase();s==="input"||s==="textarea"||c!=null&&c.isContentEditable||(l.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,o])}const gl=240,Xt=({searchKey:r="q",filterKey:t="filter",pageKey:o="page",placeholder:n="Search",shortcut:l="/"})=>{const{searchParams:c,setSearchParams:s,searchQueries:i}=Fe(),a=xr(r,c,t)||"",[d,y]=f.useState(!!a),[p,C]=f.useState(!a),[b,L]=f.useState(a),v=de.useDebounce(b,350),B=f.useRef(null);f.useEffect(()=>{L(a),a&&y(!0)},[a]),f.useEffect(()=>{d&&C(!1)},[d]),f.useEffect(()=>{v!==a&&ar({value:v,name:r,type:"search",searchQueries:i,setSearchParams:s,filterKey:t,pageKey:o})},[v]);const T=f.useCallback(()=>{y(!0),requestAnimationFrame(()=>{var W;return(W=B.current)==null?void 0:W.focus()})},[]);fl(l,T);const S=()=>{b||y(!1)},P=W=>{var O;W.key==="Escape"&&!b&&(y(!1),(O=B.current)==null||O.blur())},w=()=>{d||C(!0)};return e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(m.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:T}),e.jsxs(u.Box,{onTransitionEnd:w,style:{position:"relative",width:d?gl:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(qe.Input,{ref:B,size:"sm",fullWidth:!0,value:b,placeholder:n,leftIcon:e.jsx(m.Icon,{name:"Search",width:16,height:16}),onChange:W=>L(W.target.value),onKeyDown:P,onBlur:S,tabIndex:d?0:-1}),d&&!b&&e.jsx(u.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-surface-hover, #f1f2f4)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(D.Text,{fontSize:"xs",color:"subtle",children:l})})]})]})},Kt=({columns:r,allVisible:t,onToggle:o,onReorder:n,onSetAllHidden:l})=>{const[c,s]=f.useState(null),[i,a]=f.useState(null),d=()=>{c!==null&&i!==null&&c!==i&&n(c,i),s(null),a(null)},y=(p,C)=>{const b=p+C;b<0||b>=r.length||n(p,b)};return e.jsxs(M.Menu,{position:"bottom-right",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(m.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(M.MenuLists,{children:e.jsx(M.MenuBody,{children:e.jsxs(u.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(V.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>l(t),children:t?"Hide All":"Show All"})]}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((p,C)=>{const b=!p.locked,L=i===C&&c!==null&&c!==C;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:b,onDragStart:()=>b&&s(C),onDragOver:v=>{v.preventDefault(),a(C)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:L?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(u.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:b?0:-1,"aria-label":`Reorder ${p.title}`,"aria-disabled":!b||void 0,color:"icon-subtlest",onKeyDown:v=>{b&&(v.key==="ArrowUp"?(v.preventDefault(),y(C,-1)):v.key==="ArrowDown"&&(v.preventDefault(),y(C,1)))},style:{display:"inline-flex",cursor:b?"grab":"default",opacity:b?1:.4},children:e.jsx(m.Icon,{name:"DragVertical",width:16,height:16})}),p.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:p.icon}),e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:p.title}),e.jsx(u.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(or.Toggle,{size:"sm",checked:p.visible,disabled:p.locked,onChange:()=>o(p.key),"aria-label":`Toggle ${p.title} column`})})]},p.key)})})]})})})]})},$t=({views:r,onApply:t,onDelete:o,onSave:n})=>{const[l,c]=f.useState(""),s=()=>{const i=l.trim();i&&(n(i),c(""))};return e.jsxs(M.Menu,{position:"bottom-right",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(m.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(M.MenuLists,{style:{width:"260px"},children:[e.jsx(M.MenuBody,{children:e.jsxs(u.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(u.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(D.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(i=>e.jsx(M.MenuItem,{startIcon:e.jsx(m.Icon,{name:"Bookmark"}),onClick:()=>t(i),endIcon:e.jsx(V.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(m.Icon,{name:"Trash2"}),"aria-label":`Delete ${i.name}`,onClick:a=>{a.stopPropagation(),o(i.id)}}),children:i.name},i.id))})]})}),e.jsx(M.MenuFooter,{children:e.jsxs(u.Box,{direction:"row",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(qe.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:l,onChange:i=>c(i.target.value),onKeyDown:i=>{i.key==="Enter"&&s()}})}),e.jsx(V.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!l.trim(),onClick:s,children:"Save"})]})})]})]})},ul=({isOpen:r,onClose:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:c,onToggle:s,onReset:i,getValue:a,setValue:d,clearValue:y,removeFilter:p})=>{const C=n.length;return e.jsx(ur.Drawer,{position:"bottom",isShow:r,onHide:t,children:e.jsxs(u.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingInline:"md",paddingBlock:"sm",style:{borderBottom:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),C>0&&e.jsxs(D.Text,{fontSize:"sm",color:"subtle",children:["(",C,")"]})]}),e.jsx(V.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(m.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(u.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[C>0&&e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(u.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(Jt,{activeKeys:n,configByKey:l,getValue:a,setValue:d,clearValue:y,removeFilter:p})})]}),o.length>0&&e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(u.Box,{direction:"column",children:o.map(b=>{const L=n.includes(b.key),v=!!b.locked;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:v?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[b.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:b.icon}),e.jsx(D.Text,{fontSize:"sm",color:"primary",truncate:!0,children:b.label})]}),e.jsx(or.Toggle,{size:"sm",checked:L||v,disabled:v,onChange:()=>s(b.key),"aria-label":`Toggle ${b.label}`})]},b.key)})})]})]}),e.jsxs(u.Box,{direction:"row",display:"flex",gap:"sm",paddingInline:"md",paddingBlock:"sm",style:{borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsx(u.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!c,onClick:i,children:"Reset"})}),e.jsx(u.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(V.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},yl=r=>`${r} Rows`,pl=({perPageKey:r,pageKey:t,pageSizeOptions:o,defaultPerPage:n=10,showPageSize:l})=>{const{searchQueries:c,setSearchParams:s,searchParams:i}=Fe(),a=i.get(r),d=a?Number(a):n,y=p=>{s({...c,[r]:p,[t]:"1"})};return l?e.jsxs(M.Menu,{position:"bottom-right",children:[e.jsx(M.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(m.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(M.MenuLists,{children:e.jsxs(M.MenuBody,{style:{minWidth:200},children:[e.jsx(u.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),o.map(p=>e.jsx(M.MenuItem,{selected:p===d,endIcon:p===d?e.jsx(m.Icon,{name:"Check"}):void 0,onClick:()=>y(String(p)),children:yl(p)},p))]})})]}):null},Cl=r=>{var Pe;const{withPadding:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:c,toggleFilter:s,removeFilter:i,getValue:a,setValue:d,clearValue:y,onReset:p,searchable:C,searchKey:b,filterKey:L,pageKey:v,searchPlaceholder:B,searchShortcut:T,pagination:S,perPageKey:P,pageSizeOptions:w,showPagination:W,showResultCount:O,showPageSize:x,hasColumns:I,orderedColumns:A,allVisible:Z,onToggleVisibility:G,onReorder:X,onSetAllHidden:ie,showSavedViews:se,savedViews:ee,onApplyView:re,onDeleteView:K,onSaveView:_}=r,[ne,fe]=f.useState(!1),{searchQueries:pe,setSearchParams:Ae}=Fe(),Ze=(S==null?void 0:S.rangeStart)??(((S==null?void 0:S.currentPage)||0)>1?(((S==null?void 0:S.currentPage)||0)-1)*((S==null?void 0:S.perPage)||0)+1:1),Be=(S==null?void 0:S.rangeEnd)??((S==null?void 0:S.totalCurrentPage)!==(S==null?void 0:S.perPage)?S==null?void 0:S.totalData:((S==null?void 0:S.currentPage)||1)*((S==null?void 0:S.totalCurrentPage)||0)),Le=ze=>{Ae({...pe,[v]:String(ze)})},He=O||W&&!!(S!=null&&S.totalPage),Ce=()=>{p(),fe(!1)};return e.jsxs(u.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[C&&e.jsx(Xt,{searchKey:b,filterKey:L,pageKey:v,placeholder:B,shortcut:T}),e.jsx(V.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(m.Icon,{name:"FilterHorizontal"}),onClick:()=>fe(!0),"aria-label":"Open filters",children:c?`Filter: ${n.length}`:null}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[se&&e.jsx($t,{views:ee,onApply:re,onDelete:K,onSave:_}),I&&e.jsx(Kt,{columns:A,allVisible:Z,onToggle:G,onReorder:X,onSetAllHidden:ie}),e.jsx(pl,{perPageKey:P,pageKey:v,pageSizeOptions:w,showPageSize:x})]})]}),He&&e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[O?e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Ze}-${Be} of ${((Pe=S==null?void 0:S.totalData)==null?void 0:Pe.toLocaleString())||0}`}):e.jsx(u.Box,{direction:"column"}),W&&!!(S!=null&&S.totalPage)&&e.jsx(ir.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:S!=null&&S.currentPage?Number(S.currentPage):1,totalPages:Number(S.totalPage),onPageChange:Le})]}),e.jsx(ul,{isOpen:ne,onClose:()=>fe(!1),configs:o,activeKeys:n,configByKey:l,hasActiveFilter:c,onToggle:s,onReset:Ce,getValue:a,setValue:d,clearValue:y,removeFilter:i})]})},vl=({withPadding:r=!1,filterConfigs:t=[],filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:c="perPage",pageSizeOptions:s=[10,25,50,100],showPagination:i=!0,showResultCount:a=!0,showPageSize:d=!0,searchable:y=!1,searchKey:p="q",searchPlaceholder:C="Search",searchShortcut:b="/",pagination:L,columns:v=[],onColumnsChange:B,columnsState:T,savedViews:S,persistLastState:P=!0,storage:w=Qr,onReset:W})=>{const{activeKeys:O,configByKey:x,hasActiveFilter:I,toggleFilter:A,removeFilter:Z,getValue:G,setValue:X,clearValue:ie,clearAll:se}=Pt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:p}),ee=Qo({columns:v,scopeId:S==null?void 0:S.scopeId,storage:w,onColumnsChange:B,value:T}),re=Uo({scopeId:S==null?void 0:S.scopeId,storage:w,snapshotKeys:[n,o,c],pageKey:l,getColumns:()=>ee.state,applyColumns:ee.applyState}),K=Jo({scopeId:S==null?void 0:S.scopeId,storage:w,snapshotKeys:[n,o,c,l],enabled:P}),_=!!(S!=null&&S.enabled)&&re.enabled,ne=()=>{se(),K.clear(),W==null||W()};return de.useMediaQuery("md")?e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Yo,{configs:t,activeKeys:O,onToggle:A,hasActiveFilter:I,onReset:ne}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Jt,{activeKeys:O,configByKey:x,getValue:G,setValue:X,clearValue:ie,removeFilter:Z}),I&&e.jsx(V.Button,{variant:"link",tone:"brand",size:"sm",onClick:ne,children:"Reset"})]})]}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[e.jsx(hl,{pagination:L,pageKey:l,perPageKey:c,pageSizeOptions:s,showPagination:i,showResultCount:a,showPageSize:d}),y&&e.jsx(Xt,{searchKey:p,filterKey:o,pageKey:l,placeholder:C,shortcut:b}),_&&e.jsx($t,{views:re.views,onApply:re.applyView,onDelete:re.deleteView,onSave:re.saveView}),v.length>0&&e.jsx(Kt,{columns:ee.orderedColumns,allVisible:ee.allVisible,onToggle:ee.toggleVisibility,onReorder:ee.reorder,onSetAllHidden:ee.setAllHidden})]})]}):e.jsx(Cl,{withPadding:r,configs:t,activeKeys:O,configByKey:x,hasActiveFilter:I,toggleFilter:A,removeFilter:Z,getValue:G,setValue:X,clearValue:ie,onReset:ne,searchable:y,searchKey:p,filterKey:o,pageKey:l,searchPlaceholder:C,searchShortcut:b,pagination:L,perPageKey:c,pageSizeOptions:s,showPagination:i,showResultCount:a,showPageSize:d,hasColumns:v.length>0,orderedColumns:ee.orderedColumns,allVisible:ee.allVisible,onToggleVisibility:ee.toggleVisibility,onReorder:ee.reorder,onSetAllHidden:ee.setAllHidden,showSavedViews:_,savedViews:re.views,onApplyView:re.applyView,onDeleteView:re.deleteView,onSaveView:re.saveView})},bl=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r[0];return(t==null?void 0:t.value)!=null?String(t.value):void 0},xl=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r.map(o=>(o==null?void 0:o.value)!=null?String(o.value):null).filter(o=>o!=null);return t.length?t:void 0},wl=(r,t)=>{switch(r.type){case"dropdown":case"radio":return bl(t);case"dropdown-multiple":case"checkbox-multiple":return xl(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;default:return}},Rt=(r,t)=>{if(r==null||r==="")return t;const o=Number(r);return Number.isFinite(o)&&o>0?o:t},Dl=r=>{const{filterConfigs:t,filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:c="perPage",searchKey:s="q",defaultPage:i=1,defaultPerPage:a=10,paramKeys:d,serialize:y}=r,{activeKeys:p,configByKey:C,hasActiveFilter:b,getValue:L}=Pt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:s}),{searchParams:v}=Fe(),B=v.toString();return f.useMemo(()=>{const S={},P={},w=Rt(v.get(l),i),W=Rt(v.get(c),a);S[(d==null?void 0:d.page)??"page"]=w,S[(d==null?void 0:d.perPage)??"perPage"]=W;const O=xr(s,v,o)||"";O&&(S[(d==null?void 0:d.search)??"search"]=O);let x=!1;for(const I of p){const A=C[I];if(!A)continue;const Z=L(A);P[I]=Z;const G=y==null?void 0:y[I],X=G?G(Z):wl(A,Z);if(X==null||Array.isArray(X)&&X.length===0)continue;const ie=(d==null?void 0:d[I])??I;S[ie]=X,x=!0}return{params:S,raw:P,hasActiveFilter:b||!!O||x}},[B,p.join("|"),o,n,l,c,s,i,a,d,y,C])},Sl=(r,t)=>{if(!r)return{};const{fromKey:o,toKey:n,opKey:l}=t,c={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(c[o]=new Date(r.date).toISOString()),l&&(c[l]=r.op),c;case"is-between":return r.from&&(c[o]=new Date(r.from).toISOString()),r.to&&(c[n]=new Date(r.to).toISOString()),c;case"is-relative-to-today":{if(!r.relative)return c;const{from:s,to:i}=_t(r.relative);return c[o]=s.toISOString(),c[n]=i.toISOString(),c}case"is-empty":case"is-not-empty":return l&&(c[l]=r.op==="is-empty"?"empty":"not-empty"),c;default:return c}},eo=({children:r,borderRadius:t,height:o})=>{const n=f.useRef(null),[l,c]=f.useState("100vh");return f.useEffect(()=>{if(o)return;const s=()=>{if(n.current){const i=n.current.getBoundingClientRect().top;c(`calc(100vh - ${i}px)`)}};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[o]),e.jsx(u.Box,{ref:n,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:t||"rounded-xs",style:{height:o??l,display:"flex",flexDirection:"column"},children:r})},ro=({action:r,rightContent:t,leftContent:o,headerSlot:n,advanceFilter:l,showFilter:c=!0})=>{const s=de.useMediaQuery("md"),i=c?e.jsx(jt,{...l}):null,a=()=>r?f.isValidElement(r)?r:e.jsx(u.Box,{style:{display:"flex",flexDirection:s?"row":"column",gap:"8px",width:s?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:d,icon:y,buttonProps:p,onClick:C},b)=>!d&&!y?null:e.jsx(V.Button,{fullWidth:!s,iconLeft:y?e.jsx(m.Icon,{name:y}):void 0,onClick:C,...p,children:d},`action-${b}`))}):null;return e.jsx(u.Box,{style:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center",paddingLeft:"8px",paddingRight:"8px",paddingTop:"8px",paddingBottom:"8px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0,position:"relative",zIndex:10,flexDirection:s?"row":"column-reverse",gap:"16px"},children:n?n({filter:i}):e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[i,o]}),e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},Bl=({totalData:r,withMarginBottom:t=!0,withMarginTop:o=!0})=>e.jsxs(u.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:o?"16px":void 0},children:[e.jsxs(Ee.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Ee.Body1,{children:r||0})]}),to=({pagination:r,pageKey:t="page",perPageKey:o="perPage",defaultPerPage:n=10,showPagination:l=!0,totalData:c})=>{const{searchQueries:s,setSearchParams:i,searchParams:a}=Fe(),d=a.get(o),y=L=>{i({...s,[t]:String(L)})},p=L=>{i({...s,[o]:L,[t]:"1"})},C=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),b=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsx(u.Box,{style:{display:"flex",width:"100%",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0},children:l?e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(D.Text,{children:"Rows Per Page: "}),e.jsx(er.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:L=>{p(L[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(D.Text,{children:`${C}-${b} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(ir.Pagination,{currentPage:r!=null&&r.currentPage?Number(r==null?void 0:r.currentPage):1,totalPages:r!=null&&r.totalPage?Number(r==null?void 0:r.totalPage):1,onPageChange:y})]}):e.jsx(Bl,{totalData:c,withMarginBottom:!1,withMarginTop:!1})})},oo=({filter:r,columnTitle:t})=>{const[o,n]=f.useState(!1),l=f.useRef(null),c=f.useRef(null),s=f.useRef(null),[i,a]=f.useState(""),[d,y]=f.useState({top:0,left:0}),p=r.selectedValues,C=f.useMemo(()=>i?r.options.filter(v=>v.label.toLowerCase().includes(i.toLowerCase())):r.options,[r.options,i]);f.useEffect(()=>{if(o&&c.current){const v=c.current.getBoundingClientRect(),B=280,T={top:v.bottom+8};r.position==="left"||v.left+B>window.innerWidth?T.right=window.innerWidth-v.right:T.left=v.left,y(T)}},[o,r.position]),f.useEffect(()=>{o&&s.current?setTimeout(()=>{var v;return(v=s.current)==null?void 0:v.focus()},50):a("")},[o]),f.useEffect(()=>{const v=B=>{l.current&&!l.current.contains(B.target)&&c.current&&!c.current.contains(B.target)&&n(!1)};return o&&document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[o]);const b=v=>{const B=p.includes(v)?p.filter(T=>T!==v):[...p,v];r.onFilterChange(B)},L=()=>r.onFilterChange([]);return e.jsxs(u.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(u.Box,{ref:c,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:v=>{var B;v.stopPropagation(),o||(B=r.onOpen)==null||B.call(r),n(T=>!T)},children:e.jsx(m.Icon,{name:o?"ChevronUp":"ChevronDown",size:"sm",style:{color:p.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),o&&e.jsxs(u.Box,{ref:l,style:{position:"fixed",top:`${d.top}px`,...d.left!==void 0?{left:`${d.left}px`}:{right:`${d.right}px`},backgroundColor:"white",borderRadius:"4px",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(D.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),p.length>0&&e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(D.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:v=>{v.stopPropagation(),L()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(u.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(qe.Input,{ref:s,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(m.Icon,{name:"Search",size:"sm"}),value:i,onChange:v=>a(v.target.value),style:{fontSize:"14px"}})}),e.jsx(u.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:r.isLoadingOptions?e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(m.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):C.length>0?e.jsx(u.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:C.map(v=>e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:p.includes(v.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:B=>{B.stopPropagation(),b(v.value)},onMouseEnter:B=>{p.includes(v.value)||(B.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),B.currentTarget.style.transform="translateX(2px)"},onMouseLeave:B=>{B.currentTarget.style.backgroundColor=p.includes(v.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",B.currentTarget.style.transform="translateX(0)"},children:[e.jsx(lr.Checkbox,{checked:p.includes(v.value),onChange:()=>{}}),e.jsx(D.Text,{fontSize:"sm",fontWeight:p.includes(v.value)?"medium":"normal",color:p.includes(v.value)?"primary":"gray-700",children:v.label})]},v.value))}):e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(m.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),p.length>0&&e.jsx(u.Box,{direction:"column",style:{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",backgroundColor:"var(--sa-color-brand-50, #e6edf6)",marginTop:"auto"},children:e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(u.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:p.length}),e.jsxs(D.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",p.length>1?"s":""," selected"]})]})})]})]})},kl=({direction:r})=>{const t="var(--sa-text-primary, #292a2e)",o="var(--sa-text-subtle, #8c8f97)",n=r==="asc"?t:o,l=r==="desc"?t:o,c=r==="asc"?1:.45,s=r==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:n,opacity:c,marginBottom:1},children:e.jsx("path",{d:"M4 0 L8 5 L0 5 Z",fill:"currentColor"})}),e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:l,opacity:s},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},Fl=({frozen:r})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:r?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),Jr="var(--sa-background-primary, #ffffff)",lo="var(--sa-background-primary-inverse, #f8f8f8)",no=({columns:r,records:t,handleDetail:o,handleUpdate:n,handleDelete:l,isLoading:c,visibleHandleDelete:s,visibleHandleUpdate:i,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:y,frozenCount:p=0,onFrozenCountChange:C,customActions:b,actionsOrder:L=["detail","update","delete","custom"],customEmptyState:v,enableColumnResize:B=!1,defaultColumnWidths:T,onColumnWidthsChange:S,defaultMinColumnWidth:P=60,sort:w,defaultSort:W,onSortChange:O,showActionDivider:x=!1})=>{const I=w!==void 0,[A,Z]=f.useState(W??null),G=I?w??null:A,X=E=>{if(E.sortKey)return E.sortKey;if(typeof E.accessor=="string")return E.accessor},ie=E=>{const N=X(E);if(!N)return;let j;!G||G.key!==N?j={key:N,direction:"asc"}:G.direction==="asc"?j={key:N,direction:"desc"}:j=null,I||Z(j),O==null||O(j)},ee=[o,n,l].filter(E=>E!==void 0).length,re=!!b,K=!!o||!!n||!!l||re,_="var(--sa-border-subtle, #0b120e24)",ne=`1px solid ${_}`,fe=`inset 1px 0 0 ${_}`,pe=`inset -1px 0 0 ${_}`,Ae=ee===3?re?"178px":"140px":ee===2?re?"140px":"102px":ee===1?re?"112px":"74px":re?"74px":"",Ze=(E,N)=>{if(!N)return E;if(typeof N=="function")return N(E);if(typeof N=="string")return E[N]},[Be,Le]=f.useState(!1);f.useEffect(()=>{if(!(y!=null&&y.current))return;const E=y.current;Le(E.scrollHeight>E.clientHeight)},[t,y]);const He=f.useRef(null),[Ce,Pe]=f.useState([]),[ze,Ie]=f.useState(()=>T??{}),De=f.useRef(null);f.useLayoutEffect(()=>{if(!p||!He.current){Pe([]);return}const E=Array.from(He.current.querySelectorAll("thead tr th")),N=[];let j=0;E.forEach((q,J)=>{N[J]=j,J<p&&(j+=q.offsetWidth)}),Pe(N)},[p,r,t,ze]);const Ye=E=>{C&&C(E<p?E:E+1)},F=(E,N)=>{const j=ze[E];if(j!==void 0){const q=`${j}px`;return{width:q,minWidth:q,maxWidth:q}}return N?{width:N}:{}},Q=E=>B&&(E.resizable??!0),U=(E,N)=>{E.preventDefault(),E.stopPropagation();const j=E.currentTarget.closest("th");if(!j)return;const q=Math.round(j.getBoundingClientRect().width);De.current={colIndex:N,startX:E.clientX,startWidth:q};const J=document.body.style.userSelect,ue=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Se=me=>{var Ne;const ke=De.current;if(!ke)return;const fr=((Ne=r[ke.colIndex])==null?void 0:Ne.minWidth)??P,Xe=Math.max(fr,ke.startWidth+(me.clientX-ke.startX));Ie(Ve=>Ve[ke.colIndex]===Xe?Ve:{...Ve,[ke.colIndex]:Xe})},Te=()=>{document.removeEventListener("mousemove",Se),document.removeEventListener("mouseup",Te),document.body.style.userSelect=J,document.body.style.cursor=ue,De.current=null,S&&Ie(me=>(S(me),me))};document.addEventListener("mousemove",Se),document.addEventListener("mouseup",Te)};return e.jsx("div",{ref:He,children:e.jsxs($.Table,{fullWidth:!0,children:[e.jsx($.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs($.Tr,{children:[r.map((E,N)=>{var nr,Or;const j=p>0&&N<p,q=Ce[N]??0,J=Q(E),Se=N===r.length-1&&K&&x,Te=X(E),me=!!E.sortable&&!!Te,ke=me&&(G==null?void 0:G.key)===Te?G.direction:null,fr=E.title||((nr=E.accessor)==null?void 0:nr.toString())||"",Xe=(Or=E.headerTooltip)!=null&&Or.showIcon?e.jsx(m.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Ne=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:fr}),Ve=me?e.jsxs("button",{type:"button",onClick:()=>ie(E),title:ke==="asc"?"Sorted ascending — click to sort descending":ke==="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:E.textAlign==="text-right"?"right":E.textAlign==="text-center"?"center":"left"},children:[Ne,Xe,e.jsx(kl,{direction:ke})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Ne,Xe]});return e.jsxs($.Th,{style:{position:"sticky",top:0,left:j?q:void 0,zIndex:j?4:2,paddingLeft:N===0?"12px":"",borderRight:d&&!Se&&!j?ne:void 0,borderBottom:d?ne:void 0,boxShadow:d&&j?pe:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:E.textAlign==="text-right"?"right":E.textAlign==="text-center"?"center":"left",...F(N,E.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[E.headerTooltip?e.jsx(we.Tooltip,{label:E.headerTooltip.content,position:"bottom",children:Ve}):Ve,E.filter&&e.jsx(oo,{filter:E.filter,columnTitle:E.title}),C&&e.jsx("button",{onClick:()=>Ye(N),title:j?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:j?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:j?1:.45,transition:"opacity 0.15s"},children:e.jsx(Fl,{frozen:j})})]}),J&&e.jsx("div",{onMouseDown:gr=>U(gr,N),onClick:gr=>gr.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-${N}`)}),K?e.jsx($.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?ne:void 0,boxShadow:d&&x?fe:void 0}}):null]})}),e.jsx($.Tbody,{children:c?e.jsx($.Tr,{children:e.jsx($.Td,{colSpan:r.length+1,children:e.jsxs(u.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Ue.Skeleton,{variant:"list"}),e.jsx(Ue.Skeleton,{variant:"list"}),e.jsx(Ue.Skeleton,{variant:"list"}),e.jsx(Ue.Skeleton,{variant:"list"}),e.jsx(Ue.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&v?e.jsx($.Tr,{children:e.jsx($.Td,{colSpan:r.length+1,children:v})}):t==null?void 0:t.map((E,N)=>e.jsxs($.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:N===t.length-1&&Be?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:j=>{const q=j.currentTarget;q.style.backgroundColor=lo,Array.from(q.querySelectorAll("td")).forEach(J=>{J.style.position==="sticky"&&(J.style.backgroundColor=lo)})},onMouseLeave:j=>{const q=j.currentTarget;q.style.backgroundColor="",Array.from(q.querySelectorAll("td")).forEach(J=>{J.style.position==="sticky"&&(J.style.backgroundColor=Jr)})},children:[r.map((j,q)=>{const J=j.render?j.render(E,N,t):Ze(E,j.accessor),ue=p>0&&q<p,Se=Ce[q]??0,Te=ze[q]!==void 0,me=ue&&q===p-1;return e.jsx($.Td,{style:{position:ue?"sticky":void 0,left:ue?Se:void 0,zIndex:ue?1:void 0,backgroundColor:ue?Jr:void 0,transition:ue?"background-color 0.3s ease":void 0,paddingLeft:q===0?"12px":"",whiteSpace:"nowrap",overflow:Te?"hidden":void 0,borderLeft:j.showBorderLeft?ne:void 0,borderRight:j.showBorderRight?ne:void 0,boxShadow:me?pe:void 0,textAlign:j.textAlign==="text-right"?"right":j.textAlign==="text-center"?"center":"left",...F(q,j.width)},children:typeof J=="string"?e.jsx(D.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:j.textAlign==="text-right"?"right":j.textAlign==="text-center"?"center":"left"},children:J}):J},`row-${N}-col-${q}`)}),K?e.jsx($.Td,{style:{width:Ae,position:"sticky",right:0,zIndex:1,backgroundColor:Jr,boxShadow:x?fe:void 0,transition:"background-color 0.3s ease"},children:e.jsx(le.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:L.map(j=>{const q=N===t.length-1?"top":"bottom";return j==="detail"&&o&&(a==null?void 0:a(E))!==!1?e.jsx(we.Tooltip,{label:"Detail",position:q,children:e.jsx(V.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(E.id,E),iconLeft:e.jsx(m.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):j==="update"&&n&&(i==null?void 0:i(E))!==!1?e.jsx(we.Tooltip,{label:"Update",position:q,children:e.jsx(V.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(E),iconLeft:e.jsx(m.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):j==="delete"&&l&&(s==null?void 0:s(E))!==!1?e.jsx(we.Tooltip,{label:"Delete",position:q,children:e.jsx(V.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(E.id,E),iconLeft:e.jsx(m.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):j==="custom"?e.jsx(f.Fragment,{children:b==null?void 0:b(E)},"custom"):null})})}):null]},`${E}${N}`))})]})})},ml=({wrapperProps:r,dataTableProps:t,headerProps:o,footerProps:n})=>{var p;const l=f.useRef(null),[c,s]=f.useState((t==null?void 0:t.defaultFrozenCount)??0),i=(o==null?void 0:o.show)??!0,a=f.useRef(null),d=(p=t==null?void 0:t.pagination)==null?void 0:p.totalData;typeof d=="number"&&(a.current=d);const y=(n==null?void 0:n.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(eo,{...r,children:[i&&e.jsx(ro,{...o}),e.jsx(u.Box,{direction:"column",ref:l,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(no,{...t,scrollParentRef:l,frozenCount:t!=null&&t.enableFreezeColumns?c:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?s:void 0}):null}),y&&e.jsx(to,{pagination:t==null?void 0:t.pagination,pageKey:t==null?void 0:t.pageKey,perPageKey:t==null?void 0:t.perPageKey,defaultPerPage:t==null?void 0:t.defaultPerPage,showPagination:t==null?void 0:t.showPagination,totalData:n==null?void 0:n.totalData})]})};function Ml(r){return f.memo(r)}const El=Ml(ml),co=200,Yr="1px solid var(--sa-border-subtle, #0b120e24)",Ll=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M7 9l5-5 5 5M7 15l5 5 5-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),kr=({icon:r,label:t,active:o,danger:n,onClick:l})=>{const c=n?"var(--sa-color-error-600, #c9184a)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:l,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:o?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:c,textAlign:"left"},onMouseEnter:s=>{o||(s.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:s=>{s.currentTarget.style.background=o?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(m.Icon,{name:r,size:"sm",style:{color:c,flexShrink:0}}),e.jsx(D.Text,{as:"span",style:{color:c},children:t})]})},io=({active:r,canSort:t,canHide:o,sortDir:n,frozen:l,onSort:c,onClearSort:s,onToggleFreeze:i,onHide:a})=>{const[d,y]=f.useState(!1),p=f.useRef(null),C=f.useRef(null),[b,L]=f.useState({top:0,left:0});f.useEffect(()=>{if(d&&p.current){const B=p.current.getBoundingClientRect(),T=B.left+co>window.innerWidth;L({top:B.bottom+6,...T?{right:window.innerWidth-B.right}:{left:B.left}})}},[d]),f.useEffect(()=>{if(!d)return;const B=T=>{C.current&&!C.current.contains(T.target)&&p.current&&!p.current.contains(T.target)&&y(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[d]);const v=B=>{B(),y(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:p,type:"button",className:"sa-tl-menu-trigger","data-active":r||d?"true":"false",onClick:B=>{B.stopPropagation(),y(T=>!T)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:Yr,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(Ll,{})}),d&&e.jsxs(u.Box,{ref:C,onClick:B=>B.stopPropagation(),style:{position:"fixed",top:`${b.top}px`,...b.left!==void 0?{left:`${b.left}px`}:{right:`${b.right}px`},minWidth:co,backgroundColor:"var(--sa-background-primary, #ffffff)",border:Yr,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"0 6px 24px rgba(0,0,0,0.12)",zIndex:9999,paddingTop:4,paddingBottom:4,display:"flex",flexDirection:"column"},children:[t&&e.jsxs(e.Fragment,{children:[e.jsx(kr,{icon:"ArrowUp",label:"Ascending",active:n==="asc",onClick:()=>v(()=>n==="asc"?s():c("asc"))}),e.jsx(kr,{icon:"ArrowDown",label:"Descending",active:n==="desc",onClick:()=>v(()=>n==="desc"?s():c("desc"))}),e.jsx("div",{style:{borderTop:Yr,margin:"4px 0"}})]}),e.jsx(kr,{icon:"Pin1",label:l?"Unfreeze":"Freeze",active:l,onClick:()=>v(i)}),o&&e.jsx(kr,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>v(a)})]})]})},so="1px solid var(--sa-border-subtle, #0b120e24)",Il="var(--sa-text-subtle, #8c8f97)",Xr="var(--sa-background-neutral, #f0f1f2)",ao="2px 0 4px -2px rgba(0,0,0,0.15)",Fr={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ho="sa-table-layout-styles",Tl=()=>{if(typeof document>"u"||document.getElementById(ho))return;const r=document.createElement("style");r.id=ho,r.textContent=`
|
|
2
|
+
.sa-table-layout tbody td { transition: background-color 0.15s ease; }
|
|
3
|
+
.sa-table-layout tbody tr:hover td {
|
|
4
|
+
background-color: var(--sa-background-primary-inverse, #f8f8f8);
|
|
5
|
+
}
|
|
6
|
+
.sa-table-layout td.sa-tl-frozen {
|
|
7
|
+
background-color: var(--sa-background-primary, #ffffff);
|
|
8
|
+
}
|
|
9
|
+
.sa-table-layout tbody tr:hover td.sa-tl-frozen {
|
|
10
|
+
background-color: var(--sa-background-primary-inverse, #f8f8f8);
|
|
11
|
+
}
|
|
12
|
+
.sa-tl-menu-trigger {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
transition: opacity 0.12s ease;
|
|
15
|
+
}
|
|
16
|
+
.sa-table-layout th:hover .sa-tl-menu-trigger,
|
|
17
|
+
.sa-tl-menu-trigger[data-active="true"] {
|
|
18
|
+
opacity: 1;
|
|
19
|
+
}
|
|
20
|
+
`,document.head.appendChild(r)},Kr=r=>r==="right"?"right":r==="center"?"center":"left",Ol=(r,t)=>{if(t)return r[t]},Wl=(r,t)=>r==null&&t==null?0:r==null?-1:t==null?1:typeof r=="number"&&typeof t=="number"?r-t:String(r).localeCompare(String(t)),zl=({columns:r,data:t,getRowKey:o,size:n="md",resizable:l=!1,widthStorageKey:c,columnState:s,onColumnStateChange:i,columnMenu:a=!1,sort:d,defaultSort:y,onSortChange:p,height:C,mobileLayout:b="cards",mobileBreakpoint:L="md",groupSeparator:v,summary:B,emptyState:T})=>{Tl();const P=!de.useMediaQuery(L)&&b!=="scroll",[w,W]=f.useState(()=>new Set),O=s!==void 0,[x,I]=f.useState({}),A=s??x,Z=k=>{i==null||i(k),O||I(k)},G=d!==void 0,[X,ie]=f.useState(y??null),se=G?d??null:X,ee=!p,re=k=>{p==null||p(k),G||ie(k)},{headerGroups:K,leafColumns:_,hasGroups:ne}=f.useMemo(()=>{var xe;const k=new Set(A.hidden??[]),z=(te,ye)=>te.key??(typeof te.accessor=="string"?te.accessor:`col-${ye}`),H=r.map((te,ye)=>{var Ge;if((Ge=te.children)!=null&&Ge.length){const cr=te.children.map((Ke,et)=>({col:Ke,key:z(Ke,`${ye}-${et}`)})).filter(Ke=>!k.has(Ke.key));return{col:te,key:te.key??`group-${ye}`,isGroup:!0,leaves:cr}}const Oe={col:te,key:z(te,`${ye}`)};return{col:te,key:Oe.key,isGroup:!1,leaves:k.has(Oe.key)?[]:[Oe]}}).filter(te=>te.leaves.length>0),ae=H.some(te=>te.isGroup);let be=H.flatMap(te=>te.leaves);if(!ae&&((xe=A.order)!=null&&xe.length)){const te=new Map(A.order.map((ye,Oe)=>[ye,Oe]));be=[...be].sort((ye,Oe)=>(te.get(ye.key)??1/0)-(te.get(Oe.key)??1/0))}return{headerGroups:H,leafColumns:be,hasGroups:ae}},[r,A]),fe=f.useMemo(()=>new Map(_.map((k,z)=>[k.key,z])),[_]),pe=_.map(k=>k.key).join("|"),Ae=(k,z)=>{const H=k.sortKey??(typeof k.accessor=="string"?k.accessor:void 0);return H?z[H]:void 0},Ze=k=>k.sortable??(!!k.sortKey||typeof k.accessor=="string"),Be=f.useMemo(()=>{if(!ee||!se)return t;const k=_.find(H=>H.key===se.key);if(!k)return t;const z=se.direction==="asc"?1:-1;return[...t].sort((H,ae)=>Wl(Ae(k.col,H),Ae(k.col,ae))*z)},[t,ee,se,_]),Le=!ne,He=!!c&&Le,[Ce,Pe]=$.useColumnWidths(c??""),ze=He?Ce:void 0,Ie=f.useRef(null),[De,Ye]=f.useState();f.useLayoutEffect(()=>{Ye(void 0)},[pe]),f.useLayoutEffect(()=>{if(!Le||De||!Ie.current)return;const k=Ie.current.querySelectorAll("th.sa-tl-leaf");Ye(Array.from(k).map(z=>z.offsetWidth))},[De,Le]);const[F,Q]=f.useState(0);f.useLayoutEffect(()=>{if(!ne||!Ie.current)return;const k=Ie.current.querySelector(":scope > tr");k&&Q(k.offsetHeight)},[ne,pe]);const U=(k,z)=>De?(ze==null?void 0:ze[z])??k.width:k.width,E=(k,z)=>typeof k.width=="number"?k.width:De==null?void 0:De[z],N=A.frozenKey&&!ne?_.findIndex(k=>k.key===A.frozenKey):-1,j=k=>k<=N,q=k=>{if(!De)return 0;let z=0;for(let H=0;H<k;H++)z+=De[H]??0;return z},J=f.useRef(null),[ue,Se]=f.useState("100vh");f.useLayoutEffect(()=>{if(C!==void 0)return;const k=()=>{if(J.current){const z=J.current.getBoundingClientRect().top;Se(`calc(100vh - ${z}px)`)}};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[C]);const Te=(k,z)=>o?o(k,z):z,me=(k,z,H)=>k.render?k.render(z,H,Be):Ol(z,k.accessor),ke=_.length,fr=(k,z)=>{z||Z({...A,hidden:[...A.hidden??[],k]})},Xe=k=>Z({...A,frozenKey:A.frozenKey===k?void 0:k}),Ne=(k,z)=>{const{col:H,key:ae}=k,be=fe.get(ae)??0,xe=j(be),te=xe&&be===N,ye=(se==null?void 0:se.key)===ae?se.direction:null,Oe=a&&!H.disableMenu?e.jsx(io,{active:!!ye||xe,canSort:Ze(H),canHide:!H.locked,sortDir:ye,frozen:xe,onSort:et=>re({key:ae,direction:et}),onClearSort:()=>re(null),onToggleFreeze:()=>Xe(ae),onHide:()=>fr(ae,H.locked)}):null,Ge=H.align==="right",cr=H.align==="right"?"flex-end":H.align==="center"?"center":"flex-start",Ke=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:cr,overflow:"hidden"},children:[H.icon&&e.jsx(m.Icon,{name:H.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Fr,children:H.title})]});return e.jsx($.Th,{className:`sa-tl-leaf${xe?" sa-tl-frozen":""}`,rowSpan:z==null?void 0:z.rowSpan,minWidth:H.minWidth,resizable:Le?H.resizable:!1,defaultWidth:E(H,be),style:{textAlign:Kr(H.align),width:U(H,be),position:"sticky",top:(z==null?void 0:z.top)??0,left:xe?q(be):void 0,zIndex:xe?3:2,backgroundColor:Xr,boxShadow:te?ao:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Ge?e.jsxs(e.Fragment,{children:[Oe,Ke]}):e.jsxs(e.Fragment,{children:[Ke,Oe]})})},`th-${ae}`)},Ve=_.filter(k=>!k.col.hideOnMobile),nr=Ve.find(k=>k.col.primary)??Ve[0],Or=Ve.filter(k=>k!==nr),gr=k=>W(z=>{const H=new Set(z);return H.has(k)?H.delete(k):H.add(k),H}),Co=(k,z)=>Or.map(({col:H,key:ae})=>{const be=me(H,k,z),xe=typeof be=="string"||typeof be=="number"?e.jsx(D.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:be}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:be});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof H.title=="string"?e.jsx(D.Text,{color:"subtle",fontWeight:"medium",style:{color:Il,flexShrink:0},children:H.title}):e.jsx("div",{style:{flexShrink:0},children:H.title}),xe]},ae)}),vo=(k,z)=>{const H=nr?me(nr.col,k,z):null;return typeof H=="string"||typeof H=="number"?e.jsx(D.Text,{as:"span",style:Fr,children:H}):e.jsx("span",{style:Fr,children:H})},Kn=Be.length===0?e.jsx(u.Box,{style:{padding:16,textAlign:"center"},children:T}):b==="expand"?e.jsx(u.Box,{style:{display:"flex",flexDirection:"column"},children:Be.map((k,z)=>{const H=Te(k,z),ae=w.has(H);return e.jsxs("div",{style:{borderBottom:so},children:[e.jsxs("button",{type:"button",onClick:()=>gr(H),style:{width:"100%",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:[vo(k,z),e.jsx(m.Icon,{name:ae?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),ae&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:Co(k,z)})]},H)})}):e.jsx(u.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Be.map((k,z)=>e.jsxs(u.Box,{style:{border:so,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6},children:[vo(k,z),Co(k,z)]},Te(k,z)))}),$n=e.jsxs($.Table,{className:"sa-table-layout",fullWidth:!0,size:n,resizable:l&&Le,onWidthsChange:He?Pe:void 0,children:[e.jsx($.Thead,{ref:Ie,children:ne?e.jsxs(e.Fragment,{children:[e.jsx($.Tr,{children:K.map(k=>k.isGroup?e.jsx($.Th,{colSpan:k.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:Xr},children:e.jsx("span",{style:Fr,children:k.col.title})},`grp-${k.key}`):Ne(k.leaves[0],{rowSpan:2}))}),e.jsx($.Tr,{children:K.flatMap(k=>k.isGroup?k.leaves.map(z=>Ne(z,{top:F})):[])})]}):e.jsx($.Tr,{children:_.map(k=>Ne(k))})}),e.jsx($.Tbody,{children:Be.length===0?e.jsx($.Tr,{children:e.jsx($.Td,{colSpan:ke,children:T})}):e.jsxs(e.Fragment,{children:[Be.map((k,z)=>{const H=v==null?void 0:v(k,z,z>0?Be[z-1]:void 0);return e.jsxs(f.Fragment,{children:[H!=null&&H!==!1&&e.jsx($.Tr,{children:e.jsx($.Td,{colSpan:ke,style:{backgroundColor:Xr},children:H})}),e.jsx($.Tr,{children:_.map(({col:ae,key:be},xe)=>{var cr;const te=(cr=ae.cellProps)==null?void 0:cr.call(ae,k,z,Be);if(te!=null&&te.hidden)return null;const ye=j(xe),Oe=ye&&xe===N,Ge=me(ae,k,z);return e.jsx($.Td,{className:ye?"sa-tl-frozen":void 0,colSpan:te==null?void 0:te.colSpan,rowSpan:te==null?void 0:te.rowSpan,style:{textAlign:Kr(ae.align),width:U(ae,xe),minWidth:ae.minWidth,position:ye?"sticky":void 0,left:ye?q(xe):void 0,zIndex:ye?1:void 0,boxShadow:Oe?ao:void 0},children:typeof Ge=="string"?e.jsx(D.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Kr(ae.align)},children:Ge}):Ge},`tl-cell-${z}-${be}`)})})]},Te(k,z))}),B!=null&&e.jsx($.Tr,{children:e.jsx($.Td,{colSpan:ke,children:B})})]})})]});return e.jsx(u.Box,{ref:J,fullWidth:!0,style:{overflow:"auto",height:C??ue},children:P?Kn:$n})},$r=r=>r==="asc"||r==="desc",Al=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:o="sortOrder",pageKey:n="page",defaultSort:l=null,paramKeys:c,scopeId:s,storage:i=Qr}=r,{searchParams:a,setSearchParams:d,searchQueries:y}=Fe(),p=a.toString(),C=s?dr.tableSort(s):void 0,b=f.useRef(!1);f.useEffect(()=>{if(b.current||(b.current=!0,!C)||a.has(t)||a.has(o))return;const P=i.get(C);!(P!=null&&P.key)||!$r(P.direction)||d({...Object.fromEntries(a.entries()),[t]:P.key,[o]:P.direction})},[]);const L=f.useMemo(()=>{const P=a.get(t),w=a.get(o);return P&&$r(w)?{key:P,direction:w}:l},[p,t,o,l]);f.useEffect(()=>{if(!C)return;const P=a.get(t),w=a.get(o);P&&$r(w)?i.set(C,{key:P,direction:w}):i.remove(C)},[p,C,t,o,i]);const v=(c==null?void 0:c.sortBy)??"sortBy",B=(c==null?void 0:c.sortOrder)??"sortOrder",T=f.useMemo(()=>L?{[v]:L.key,[B]:L.direction}:{},[L,v,B]),S=f.useCallback(P=>{const w={...y};P?(w[t]=P.key,w[o]=P.direction):(delete w[t],delete w[o]),delete w[n],d(w)},[y,t,o,n,d]);return{sort:L,setSort:S,params:T}},mr=({of:r,render:t})=>f.Children.toArray(r==null?void 0:r.map((o,n,l)=>t(o,n,l))),oe=({condition:r,fallback:t,children:o,loading:n,isLoading:l})=>e.jsx(e.Fragment,{children:l?n:r?o:t}),ce=r=>e.jsx(D.Text,{...r,fontFamily:"Poppins",fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),je=r=>e.jsx(D.Text,{color:"red-600",fontSize:"sm",children:r.message}),Hl=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(oe,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:l.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:l.title}),e.jsx(ce,{color:"error",fontSize:r,children:o}),e.jsx(oe,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(we.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(m.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!l.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(qe.Input,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default",fullWidth:!0}),!c&&l.errorMessage&&e.jsx(je,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},Vl=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(oe,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:l.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:l.title}),e.jsx(ce,{color:"error",fontSize:r,children:o}),e.jsx(oe,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(we.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(m.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!l.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(u.Box,{direction:"column",style:{width:l.inputProps.fullWidth?"100%":t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(er.Dropdown,{size:r,...l.inputProps,error:!!l.errorMessage})}),!c&&l.errorMessage&&e.jsx(je,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},jl=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Pl=r=>{var i;const[t,o]=f.useState(!1),n=a=>{a.preventDefault(),a.stopPropagation()},l=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&r.handleOnFileChange(a.dataTransfer.files.item(0))},c=a=>{a.preventDefault(),o(!0)},s=a=>{a.preventDefault(),o(!1)};return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:l,onDragEnter:c,onDragLeave:s,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${jl(r.errorMessage,r.status)}`},children:[e.jsx(m.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(le.Flex,{direction:"column",gap:"xs",children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",children:[e.jsx(D.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(D.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",children:(i=r.fileSupports)==null?void 0:i.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function Nl(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const fo=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},_l=r=>{const t={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},o=r.split(" ");if(o.length!==3)return null;const n=parseInt(o[0],10),l=t[o[1]],c=parseInt(o[2],10);return isNaN(n)||isNaN(l)||isNaN(c)?null:new Date(c,l,n)};function ql(r,t=!0){if(!r)return"Rp 0";const o=typeof r=="number"?r.toString():r;if(isNaN(Number(o)))return"Rp 0";const n=o.split("."),l=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),c=n.length===2?l+"."+n[1]:l;return t?"Rp"+c:c}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},String.prototype.toNumber=function(){return Number(this)};const Zl=r=>{const t=r.split(" ");let o=t[0].charAt(0);return t.length>1&&(o+=""+t[1].charAt(0)),o.toUpperCase()};function Gl(r){const t=typeof r=="string"?new Date(r):r;if(isNaN(t.getTime()))throw new Error("Invalid date format");const o=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0");return`${o}-${n}-${l}`}const Ql="sa-admin",We=r=>`var(--${Ql}-${r})`,Ul={base:{borderColor:We("base-border-color"),textColor:We("base-text-color"),iconColor:We("base-icon-color"),placeholderColor:We("base-placeholder-color")},document:{bgColor:We("document-bg-color")},sidebar:{bgColor:We("sidebar-bg-color"),borderColor:We("sidebar-border-color"),maxWidth:We("sidebar-max-width"),width:We("sidebar-width"),collapseWidth:We("sidebar-collapse-width"),collapseV2Width:We("sidebar-v2-collapse-width")}},Jl=24*60*60*1e3,Yl=r=>{const t="14px poppins",n=document.createElement("canvas").getContext("2d");n.font=t;const l=n.measureText(r).width;return Number(Math.ceil(l))},Xl=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Kl=/--+/,$l=/-$/;function Rl(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function en(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function rn(r){return/^[A-Za-z\s]+$/.test(r)}const tn=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&(r.key==="a"||r.key==="c"||r.key==="v")||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},on=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},ln=r=>{const t=/^[0-9.]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},nn=r=>Xl.test(r);function cn(r){return!(Kl.test(r)||$l.test(r))}const sn=r=>{const t=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((r.ctrlKey||r.metaKey)&&["a","c","v","x"].includes(r.key.toLowerCase()))return;const o=r.currentTarget.value;/^[0-9]$/.test(r.key)||r.key==="."&&!o.includes(".")||r.key==="-"&&o.length===0&&!o.includes("-")||t.includes(r.key)||r.preventDefault()},an=r=>{const t=document.getElementById(r);if(t){const o=t.getBoundingClientRect(),n=window.scrollY+o.top-80;window.scrollTo({top:n,behavior:"smooth"})}};function dn(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(c=>t.endsWith(c)))return r;const l=Number(r);if(isNaN(l))throw new Error("Invalid size format");return l>=1e6?`${(l/1e6).toFixed(2)}MB`:l>=1e3?`${(l/1e3).toFixed(2)}KB`:`${l}B`}function hn(r){const t=r.split("/");return t[t.length-1]}const fn=r=>{var t,o;return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:r.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(le.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(m.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(le.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(D.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?hn(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(m.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",children:dn(((o=r.fileSelected)==null?void 0:o.size.toString())||"100000")}),e.jsx(m.Icon,{name:"Dot",size:"xs"}),e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:fo(new Date)})]})]})]}),e.jsx(V.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(m.Icon,{name:"Trash1"})})]})},go=({status:r="default",labelPosition:t="outside-top",...o})=>{var C;const n=f.useRef(null),l=()=>{if(o.defaultFile){window.open(o.defaultFile.url);return}n.current&&n.current.click()},c=de.useMediaQuery("md"),s=r==="error"||typeof o.errorMessage=="string"&&!!o.errorMessage,i=o.label?e.jsxs(le.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(D.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:o.label}),o.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"4px",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),o.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=o.description?e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.description}):null,d=e.jsxs(e.Fragment,{children:[o.helperText&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.helperText}),o.errorText&&r==="error"&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorText}),o.errorMessage&&!o.errorText&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorMessage})]}),y=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:b=>{var L;return o.handleOnChangeFile(((L=b.target.files)==null?void 0:L.item(0))||null)},accept:(C=o.fileSupportOption)==null?void 0:C.map(b=>"."+(b==null?void 0:b.toLowerCase())).join(", ")}),p=e.jsxs(u.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...o.containerProps,children:[y,(o.fileSelected||o.defaultFile)&&e.jsx(fn,{fileSelected:o.fileSelected,defaultFile:o.defaultFile,handleOnDeleteFile:o.handleOnDeleteFile,handleOnClickFile:l}),!o.fileSelected&&!o.defaultFile&&e.jsx(Pl,{fileSupports:o.fileSupportOption,isDesktop:c,errorMessage:s?o.errorText||o.errorMessage||" ":void 0,status:s?"error":"default",handleOnClick:l,handleOnFileChange:o.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(le.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(le.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[i,a]}),e.jsxs(le.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[p,d]})]}):e.jsxs(le.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[i,a,p,d]})},gn=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(oe,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:l.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:l.title}),e.jsx(ce,{color:"error",fontSize:r,children:o}),e.jsx(oe,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(we.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(m.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!l.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(le.Flex,{direction:"column",gap:"xs",children:[e.jsx(go,{...l.inputProps,status:l.errorMessage?"error":"default"}),!c&&l.errorMessage&&e.jsx(je,{message:l.errorMessage})]})]})},un=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...c})=>{var a,d,y,p;const s=c.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(oe,{condition:!!l,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ce,{children:c.title}),e.jsx(Ee.Body3,{props:{color:"gray-500"},children:c.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:c.title}),e.jsx(ce,{color:"error",fontSize:r,children:o}),e.jsx(oe,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(we.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(y=c.tooltip)==null?void 0:y.arrowPosition,...c.tooltip,children:e.jsx(m.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!c.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsx(u.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(mr,{of:(p=c.checkBoxesList)==null?void 0:p.map(C=>({...C,isChecked:c.checkBoxesAreChecked.includes(C.id)})),render:C=>C.renderBadge?e.jsxs(u.Box,{direction:"row",justify:"space-between",gap:"lg",...c.badgeContainerProps,children:[e.jsx(lr.Checkbox,{name:C.name,value:C.id,checked:C.isChecked,onChange:b=>c.onChecked(b.target.value,C),label:C.name,description:C.description}),C.renderBadge]}):e.jsx(lr.Checkbox,{name:C.name,value:C.id,checked:C.isChecked,onChange:b=>c.onChecked(b.target.value,C),label:C.name,description:C.description})})}),!s&&c.errorMessage&&e.jsx(je,{message:c.errorMessage})]})},yn=({position:r="vertical",size:t="md",fullWidth:o=!1,...n})=>{var c;const l=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(oe,{condition:!!n.description||!!n.title,children:e.jsxs(u.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[n.title&&e.jsx(ce,{children:n.title}),e.jsx(oe,{condition:!!n.description,children:e.jsx(D.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(u.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(mr,{of:(c=n.radioList)==null?void 0:c.map(s=>({...s,isChecked:n.radioIsChecked===s.id})),render:({value:s,id:i,isChecked:a,subInput:d,label:y,description:p})=>e.jsxs(u.Box,{direction:"column",gap:"xs",customMaxWidth:l,children:[e.jsx(zr.Radio,{id:`${i.toString()}-${s}`,name:n.groupName||y,label:y,value:s,checked:a,onChange:C=>n.onChecked({id:i,label:C.target.name,value:C.target.value}),disabled:n.disableAll},i),p&&e.jsx(D.Text,{color:"gray-500",style:{marginLeft:28},children:p}),d]})})}),n.errorMessage&&e.jsx(je,{message:n.errorMessage})]})},pn=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(oe,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:l.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:l.title}),e.jsx(ce,{color:"error",fontSize:r,children:o}),e.jsx(oe,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(we.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(m.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!l.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(le.Flex,{direction:"column",gap:"xs",children:[e.jsx(Wr.Textarea,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default"}),!c&&l.errorMessage&&e.jsx(je,{message:l.errorMessage})]})]})},Cn=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",required:n=!1,fullWidth:l=!1,...c})=>{var i,a,d;const s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(oe,{condition:n,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:l,children:[e.jsx(ce,{children:c.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:l,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:c.title}),e.jsx(ce,{color:"error",fontSize:r,children:o}),e.jsx(oe,{condition:!!((i=c.tooltip)!=null&&i.label),children:e.jsx(we.Tooltip,{label:(a=c.tooltip)==null?void 0:a.label,arrowPosition:(d=c.tooltip)==null?void 0:d.arrowPosition,...c.tooltip,children:e.jsx(m.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!c.titleDescription,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})})]})}),e.jsx(or.Toggle,{checked:c.checked,onChange:c.onChange,label:c.label,description:c.description}),c.errorMessage&&e.jsx(je,{message:c.errorMessage})]})},vn=({variant:r="primary",size:t="md",...o})=>{const n=tr.useColor(),l=s=>{var a,d,y,p,C,b;if(!s)return;const i=o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary"?"var(--sa-text-subtle, #8c8f97)":r==="secondary-danger"?(d=(a=n==null?void 0:n.computed)==null?void 0:a.red)==null?void 0:d[600]:r==="secondary-primary"?(p=(y=n==null?void 0:n.computed)==null?void 0:y.blue)==null?void 0:p[700]:(b=(C=n==null?void 0:n.computed)==null?void 0:C.gray)==null?void 0:b[50];return e.jsx(m.Icon,{name:s,size:t,style:{color:i}})},c=()=>{var i,a,d,y;if(r!=="secondary-danger"&&r!=="secondary-primary")return o.title;const s={color:o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(i=n==null?void 0:n.computed)==null?void 0:i.red)==null?void 0:a[600]:(y=(d=n==null?void 0:n.computed)==null?void 0:d.blue)==null?void 0:y[700]};switch(t){case"xs":return e.jsx(Ee.Body2,{props:{style:s},children:o.title});case"sm":case"md":return e.jsx(Ee.SubH3,{props:{style:s},children:o.title});case"lg":return e.jsx(Ee.SubH2,{props:{style:s},children:o.title});default:return o.title}};return e.jsx(V.Button,{fullWidth:!0,disabled:o.disabled,primary:r==="primary",secondary:r==="secondary"||r==="secondary-danger"||r==="secondary-primary",success:r==="success",onClick:o.onClick,type:o.type,iconLeft:l(o.iconLeft),iconRight:l(o.iconRight),size:t,children:c()})},bn=r=>e.jsx(Ee.H5,{props:{...r},children:r.title}),xn=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,d;const c=l.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(oe,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:l.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:l.title}),e.jsx(ce,{color:"error",fontSize:r,children:o}),e.jsx(oe,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(we.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(d=l.tooltip)==null?void 0:d.arrowPosition,...l.tooltip,children:e.jsx(m.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!l.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(le.Flex,{direction:"column",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{width:t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(Qe.StarasiaDate,{size:r,...l.inputProps,status:l.errorMessage?"error":void 0})}),!c&&l.errorMessage&&e.jsx(je,{message:l.errorMessage})]})]})};async function wn(r,t){const o=new Image;o.src=r,await new Promise((c,s)=>{o.onload=c,o.onerror=s});const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const l=n.getContext("2d",{alpha:!0});if(!l)throw new Error("No 2D context");return l.drawImage(o,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((c,s)=>{n.toBlob(i=>{if(!i)return s("Canvas is empty");const a=new File([i],"cropped.png",{type:"image/png"});c(a)},"image/png")})}const uo={"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},yo=f.forwardRef(({handleUpload:r,urlImage:t,isUploading:o,croppedImage:n,setCroppedImage:l,size:c="96",aspect:s="1:1",containerProps:i,maxFileSize:a=2,onError:d},y)=>{const p=de.useMediaQuery("md"),[C,b]=f.useState(!1),[L,v]=f.useState(null),[B,T]=f.useState(!1),[S,P]=f.useState({x:0,y:0}),[w,W]=f.useState(1),[O,x]=f.useState(null);f.useEffect(()=>{t===null&&l(null)},[t]);const I=f.useCallback((K,_)=>{x(_)},[]),A=K=>{var fe;const _=(fe=K.target.files)==null?void 0:fe[0];if(!_)return;const ne=new FileReader;ne.onload=()=>{v(ne.result),T(!0)},ne.readAsDataURL(_)},Z=async()=>{if(!(!L||!O))try{const K=await wn(L,O);if(a&&K.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(K);const _=URL.createObjectURL(K);l(_,K),T(!1)}catch{d==null||d("Gagal memproses gambar")}},G=f.useRef(null),X=()=>{G.current&&G.current.click()};f.useImperativeHandle(y,()=>({openFileDialog:()=>{var K;(K=G.current)==null||K.click()}}));const ie=parseInt(c,10),se=uo[s];let ee,re;return se>=1?(re=ie,ee=ie*se):(ee=ie,re=ie/se),e.jsxs(u.Box,{direction:"column",display:"flex",position:"relative",bg:(i==null?void 0:i.bg)||"gray-200",borderStyle:(i==null?void 0:i.borderStyle)||"border-none",borderColor:(i==null?void 0:i.borderColor)||"gray-200",borderWidth:(i==null?void 0:i.borderWidth)||"border-2",borderRadius:(i==null?void 0:i.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:i!=null&&i.fullWidth?"100%":`${ee}px`,height:i!=null&&i.fullWidth?"auto":`${re}px`,aspectRatio:se,flexShrink:0},onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:[n||t?e.jsx("img",{src:n||t||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(u.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(m.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(c)/2<40?Number(c)/2:40,height:Number(c)/2<40?Number(c)/2:40}})}),e.jsxs(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214a)",opacity:C?1:0,transition:"opacity 0.3s ease-in-out"},onClick:X,children:[e.jsx("input",{ref:G,type:"file",accept:"image/*",onChange:A,disabled:o,style:{display:"none"}}),e.jsxs(u.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(m.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(oe,{condition:c.toNumber()>80,children:e.jsx(D.Text,{color:"gray-50",fontSize:c.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),o&&e.jsx(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f640)"},children:e.jsx(u.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),B&&Ar.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:()=>T(!1),children:e.jsxs("div",{style:{backgroundColor:"var(--sa-background-primary)",borderRadius:"var(--sa-radii-md)",boxShadow:"0 20px 60px rgba(0,0,0,0.3)",overflow:"hidden",width:p?s==="1:1"?"min(90vw, 480px)":`min(90vw, ${ee*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:K=>K.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:L&&e.jsx(bo,{image:L,crop:S,zoom:w,aspect:s?uo[s]:void 0,onCropChange:P,onZoomChange:W,onCropComplete:I,objectFit:"contain",minZoom:.5,restrictPosition:!1})}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--sa-border-subtle)"},children:[e.jsx(V.Button,{size:"sm",secondary:!0,onClick:()=>T(!1),children:"Cancel"}),e.jsx(V.Button,{size:"sm",primary:!0,onClick:Z,children:"Crop"})]})]})}),document.body)]})}),Dn=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...c})=>{var a,d,y;const s=c.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(oe,{condition:!!l,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ce,{children:c.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:c.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:c.title}),e.jsx(ce,{color:"error",fontSize:r,children:o}),e.jsx(oe,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(we.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(y=c.tooltip)==null?void 0:y.arrowPosition,...c.tooltip,children:e.jsx(m.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!c.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsxs(le.Flex,{direction:"column",gap:"xs",children:[e.jsx(yo,{...c.inputProps}),!s&&c.errorMessage&&e.jsx(je,{message:c.errorMessage})]})]})},Sn=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var s,i,a;const c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(oe,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ce,{children:l.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(le.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:l.title}),e.jsx(ce,{color:"error",fontSize:r,children:o}),e.jsx(oe,{condition:!!((s=l.tooltip)!=null&&s.label),children:e.jsx(we.Tooltip,{label:(i=l.tooltip)==null?void 0:i.label,arrowPosition:(a=l.tooltip)==null?void 0:a.arrowPosition,...l.tooltip,children:e.jsx(m.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!l.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),l.inputProps.extended&&l.inputProps.extended]})},Bn=({items:r,id:t,handleOnUpdate:o,width:n,toggleShow:l=!0,disabled:c=!1})=>{var y;const[s,i]=f.useState([]);f.useEffect(()=>{r&&i([...r.map(p=>({id:p.id,isActive:p.isActive}))])},[r]);const a=(y=s.find(p=>p.id===t))==null?void 0:y.isActive,d=f.useCallback(()=>{i(p=>p.map(C=>C.id===t?{...C,isActive:!C.isActive}:C)),o&&o(!a)},[t,o,a]);return e.jsx(u.Box,{direction:"row",gap:"md",style:{width:n},children:l&&e.jsx(or.Toggle,{disabled:c,checked:a,onChange:d,label:a?"Active":"Inactive"})})},kn={InputText:Hl,InputDropdown:Vl,InputSingleFile:gn,CheckBoxOptions:un,RadioOptions:yn,InputTextArea:pn,ToggleForm:Cn,ActionButton:vn,FormTitle:bn,InputDate:xn,InputImgFile:Dn,Custom:Sn},po=({customBottom:r})=>{const[t,o]=f.useState(!1),n=()=>{window.scrollY>window.screenY?o(!0):o(!1)},l=()=>{window.scrollTo({top:0,behavior:"smooth"})};return f.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(u.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(u.Box,{direction:"column",position:"absolute",style:{bottom:r||"1.6rem",right:"2rem",transform:t?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(V.Button,{secondary:!0,size:"xs",onClick:l,type:"button",iconLeft:e.jsx(m.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Fn=({pageLayout:r,children:t,wrapperProps:o,containerProps:n})=>{const l=de.useMediaQuery("md"),c=(n==null?void 0:n.customWidth)??264;return e.jsxs(u.Box,{display:"block",direction:"row",...o,style:{marginRight:l?c:24,...(o==null?void 0:o.style)??{}},children:[r,e.jsx(u.Box,{direction:"column",show:"desktop",as:"aside",position:"fixed",top:"top-0",bottom:"bottom-0",right:"right-0",customWidth:264,borderStyle:"border-solid-l",borderWidth:"border-l",...n,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},mn=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:o,containerProps:n})=>e.jsx(u.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 999)"},children:e.jsxs(u.Box,{position:"fixed",bottom:"bottom-0",right:"right-0",padding:"spacing-32",height:"height-24",bg:"gray-50",direction:"row",align:"center",display:"flex",style:{left:"var(--app-sidebar-width, 0px)",transition:"left 0.3s ease-in-out",borderColor:"var(--sa-border-subtle, #0b120e24)"},justify:(n==null?void 0:n.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx(po,{...o,customBottom:(o==null?void 0:o.customBottom)||"5.7rem"}),r]})}),Mn=({fields:r})=>e.jsx(u.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(mr,{of:r,render:(t,o)=>e.jsx(En,{...t},o)})}),En=({title:r,value:t,icon:o})=>e.jsxs(u.Box,{display:"flex",direction:"column",gap:"sm",children:[o?e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(m.Icon,{name:o,color:"subtle"}),e.jsx(D.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(D.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(D.Text,{variant:"sub-h3",children:t}):t]}),ge={silhouette:"#A7B0AC",accent:"#78867F"};function Ln({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r||"100",height:t||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:ge.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:ge.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:ge.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:ge.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:ge.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:ge.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:ge.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:ge.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:ge.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:ge.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:ge.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:ge.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:ge.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:ge.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:ge.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:ge.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:ge.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:ge.accent,fillOpacity:"0.65"})]})})}const In=({title:r="create",children:t,onClickAction:o,variant:n="primary",variantTitle:l,leftIcon:c,showButton:s=!0,customHeight:i,childrenButton:a,customIcon:d})=>{const y=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:c?e.jsx(V.Button,{primary:!0,iconLeft:c,onClick:o,children:a||r}):e.jsx(V.Button,{primary:!0,onClick:o,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:c?e.jsx(V.Button,{secondary:!0,iconLeft:c,onClick:o,children:l?e.jsx(D.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(V.Button,{secondary:!0,onClick:o,children:a||r})});case"success":return e.jsx(e.Fragment,{children:c?e.jsx(V.Button,{success:!0,iconLeft:c,onClick:o,children:a||r}):e.jsx(V.Button,{success:!0,onClick:o,children:a||r})});default:return e.jsx(e.Fragment,{children:c?e.jsx(V.Button,{primary:!0,iconLeft:c,onClick:o,children:a||r}):e.jsx(V.Button,{primary:!0,onClick:o,children:a||r})})}};return e.jsxs(u.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:i,children:[d||e.jsx(Ln,{}),e.jsx(u.Box,{direction:"column",children:t.map((p,C)=>e.jsx(Ee.Body1,{props:{align:"center",textAlign:"center"},children:C>2?null:p},C))}),s?y():null]})},Y={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function Tn({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:Y.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:Y.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:Y.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:Y.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:Y.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:Y.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:Y.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:Y.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:Y.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:Y.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:Y.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:Y.cFFFFFF,stroke:Y.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:Y.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:Y.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:Y.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:Y.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:Y.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:Y.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:Y.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:Y.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:Y.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:Y.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:Y.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:Y.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:Y.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:Y.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:Y.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:Y.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:Y.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:Y.c001A72})]})})}function On({onClick:r}){const t=de.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Tn,{width:t?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(D.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(V.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const R={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 Wn({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:R.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:R.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:R.cEFF3F8,stroke:R.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:R.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:R.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:R.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:R.c956847,stroke:R.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:R.c956847,stroke:R.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:R.cC8CEF4,stroke:R.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:R.cC8CEF4,stroke:R.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:R.cC8CEF4,stroke:R.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:R.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:R.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:R.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:R.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:R.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:R.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:R.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:R.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:R.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:R.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:R.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:R.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:R.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:R.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function zn({onClick:r}){const t=de.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Wn,{width:t?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(V.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const h={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 An({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:h.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:h.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:h.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:h.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:h.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:h.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:h.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:h.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:h.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:h.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:h.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:h.cFFFFFF,stroke:h.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:h.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:h.cFFFFFF,stroke:h.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:h.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:h.cFFFFFF,stroke:h.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:h.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:h.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:h.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:h.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:h.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:h.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:h.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:h.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:h.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:h.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:h.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:h.cE7EAE9,stroke:h.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:h.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:h.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:h.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:h.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:h.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:h.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:h.c000D58,stroke:h.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:h.c000D58,stroke:h.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:h.cFFFFFF,stroke:h.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:h.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:h.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:h.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:h.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:h.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:h.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:h.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:h.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:h.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:h.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:h.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:h.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:h.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Hn({onClick:r}){const t=de.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(An,{width:t?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(D.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(V.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const Vn=r=>{var o,n,l,c,s;const t=de.useMediaQuery("md");return e.jsxs(Me.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(Me.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(D.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Me.DialogBody,{children:typeof r.description=="string"?e.jsx(D.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(Me.DialogFooter,{children:e.jsx(u.Box,{display:"flex",direction:((o=r.containerConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((n=r.containerConfirmBtnProps)==null?void 0:n.justify)||"flex-end",...r.containerConfirmBtnProps,children:e.jsxs(u.Box,{display:"flex",direction:((l=r.wrapperConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((c=r.wrapperConfirmBtnProps)==null?void 0:c.justify)||"flex-end",gap:((s=r.wrapperConfirmBtnProps)==null?void 0:s.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(V.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(u.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(V.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},jn=f.memo(({children:r,height:t,minHeight:o,customHeight:n,paddingInline:l="spacing-0",paddingBlock:c="spacing-0",header:s,footer:i,title:a,titleTag:d,action:y,actionContainer:p,containerProps:C,bodyProps:b,headerProps:L={borderBottom:!0},footerProps:v={borderTop:!0},variantTag:B="info"})=>{const T=f.useRef(null),[S,P]=f.useState("100vh");f.useEffect(()=>{const x=()=>{if(T.current){const I=T.current.getBoundingClientRect().top;P(`calc(100vh - ${I}px)`)}};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]);const w=()=>d?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(D.Text,{fontWeight:"medium",children:a}),e.jsx(_e.Badges,{border:!0,text:d,variant:B})]}):e.jsx(D.Text,{fontWeight:"medium",children:a}),W=()=>s||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:a?w():null}),e.jsx(u.Box,{direction:"column",...p,children:y??null})]}),O=!!(s||a||y);return e.jsxs(u.Box,{ref:T,height:t,customMinHeight:o,customHeight:n,paddingBlock:c,paddingInline:l,bg:"white",direction:"column",...C,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:S,...(C==null?void 0:C.style)??{}},children:[s!==null&&O?e.jsx(Zr,{...L,children:W()}):null,e.jsx(u.Box,{direction:"column",padding:"spacing-0",...b,style:{flex:1,overflow:"auto",...(b==null?void 0:b.style)??{}},children:r}),i?e.jsx(Gr,{...v,children:i}):null]})}),Pn=f.memo(({value:r,options:t=[],onChange:o,multiple:n})=>{const l=(r==null?void 0:r.map(i=>i.value))||[],c=(t==null?void 0:t.filter(i=>l.includes(i.value)))||[],s=i=>{const a=[...c];let d=[];n?d=l.includes(i.value)?a.filter(y=>y.value!==i.value):[...a,i]:d=[i],o==null||o(d)};return e.jsx(u.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((i,a)=>e.jsx(V.Button,{...l.includes(i.value)?{primary:!0}:{secondary:!0},onClick:()=>s(i),children:i.label},a))})});function Mr(r){return null}Mr.displayName="LayoutDialog.Header";function Er(r){return null}Er.displayName="LayoutDialog.Body";function Lr(r){return null}Lr.displayName="LayoutDialog.Aside";function Ir(r){return null}Ir.displayName="LayoutDialog.Footer";const ve={"lyd-root":"_lyd-root_1e92c_1","lyd-backdrop":"_lyd-backdrop_1e92c_28","lyd-panel":"_lyd-panel_1e92c_37","lyd-modal":"_lyd-modal_1e92c_48","lyd-fullscreen":"_lyd-fullscreen_1e92c_58","lyd-sidebar":"_lyd-sidebar_1e92c_66","lyd-header":"_lyd-header_1e92c_94","lyd-header-content":"_lyd-header-content_1e92c_105","lyd-header-actions":"_lyd-header-actions_1e92c_113","lyd-main":"_lyd-main_1e92c_120","lyd-body":"_lyd-body_1e92c_127","lyd-aside":"_lyd-aside_1e92c_133","lyd-footer":"_lyd-footer_1e92c_149","lyd-vm-group":"_lyd-vm-group_1e92c_162","lyd-vm-btn":"_lyd-vm-btn_1e92c_170","lyd-close-btn":"_lyd-close-btn_1e92c_193"},Nn=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(qn,{})},{mode:"modal",label:"Modal",icon:e.jsx(m.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(m.Icon,{name:"Fullscreen",size:"sm"})}];function _n({value:r,onChange:t}){return e.jsx("div",{className:ve["lyd-vm-group"],role:"group","aria-label":"View mode",children:Nn.map(o=>e.jsx("button",{type:"button",className:ve["lyd-vm-btn"],"data-active":r===o.mode,"aria-label":`Switch to ${o.label} view`,"aria-pressed":r===o.mode,onClick:()=>t(o.mode),children:o.icon},o.mode))})}function qn(){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 Rr={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Zn(r){return r?r in Rr?Rr[r]:r:Rr.xl}function Tr(r,t){let o=null;return f.Children.forEach(r,n=>{f.isValidElement(n)&&n.type===t&&(o=n.props.children??null)}),o}function Gn(r){const{isOpen:t,onClose:o,viewMode:n,defaultViewMode:l="modal",onViewModeChange:c,showViewModeToggle:s=!0,showCloseButton:i=!0,size:a,asideWidth:d,disableEscapeClose:y=!1,disableBackdropClose:p=!1,lockBodyScroll:C=!0,children:b}=r,[L,v]=f.useState(l),B=n??L,S=de.useMediaQuery("md")?B:"fullscreen",P=f.useCallback(X=>{n===void 0&&v(X),c==null||c(X)},[n,c]),w=f.useRef(null);f.useEffect(()=>{if(!(!t||!C))return w.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=w.current??""}},[t,C]),f.useEffect(()=>{if(!t||y)return;const X=ie=>{ie.key==="Escape"&&o()};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[t,y,o]);const W=f.useMemo(()=>Tr(b,Mr),[b]),O=f.useMemo(()=>Tr(b,Er),[b]),x=f.useMemo(()=>Tr(b,Lr),[b]),I=f.useMemo(()=>Tr(b,Ir),[b]);if(!t)return null;const A=[ve["lyd-panel"],S==="modal"&&ve["lyd-modal"],S==="fullscreen"&&ve["lyd-fullscreen"],S==="sidebar"&&ve["lyd-sidebar"]].filter(Boolean).join(" "),Z={"--lyd-max-w":Zn(a),...d!==void 0&&{"--lyd-aside-w":d}},G=()=>{p||o()};return e.jsxs("div",{className:ve["lyd-root"],style:Z,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:ve["lyd-backdrop"],onClick:G,"aria-hidden":"true"}),e.jsxs("div",{className:A,children:[e.jsxs("div",{className:ve["lyd-header"],children:[e.jsx("div",{className:ve["lyd-header-content"],children:W}),e.jsxs("div",{className:ve["lyd-header-actions"],children:[s&&e.jsx(_n,{value:B,onChange:P}),i&&e.jsx("button",{type:"button",className:ve["lyd-close-btn"],onClick:o,"aria-label":"Close dialog",children:e.jsx(m.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:ve["lyd-main"],children:[e.jsx("div",{className:ve["lyd-body"],children:O}),x&&e.jsx("aside",{className:ve["lyd-aside"],children:x})]}),I&&e.jsx("div",{className:ve["lyd-footer"],children:I})]})]})}const hr=Gn;hr.Header=Mr,hr.Body=Er,hr.Aside=Lr,hr.Footer=Ir;function Qn({url:r,filename:t,onClose:o}){return f.useEffect(()=>{const n=l=>{l.key==="Escape"&&o()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[o]),e.jsxs("div",{onClick:o,style:{position:"fixed",inset:0,zIndex:9999,backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[e.jsxs("div",{onClick:n=>n.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:r,download:t,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:r,alt:t,onClick:n=>n.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:t})]})}const Un=r=>{const{defaultTab:t=0,paramKey:o="tab"}=r||{},[n,l]=he.useSearchParams(),c=rr.searchParamsToObject(n.toString());return{activeTab:c[o]?parseInt(c[o]):t,handleTabChange:a=>{l({...c,[o]:a.toString()})},searchQueries:c}};function Jn({appName:r,menuConfig:t,formatTitle:o}){const n=he.useLocation();f.useEffect(()=>{let l=null,c=null;for(const a of t){const d=a.items.find(y=>y.to?y.to==="/"?n.pathname==="/":!!(y.to===n.pathname||n.pathname.startsWith(y.to+"/")):!1);if(d){l=d,c=a;break}}const s=[];l!=null&&l.title&&s.push(l.title),c!=null&&c.name&&s.push(c.name.toTitleCase());const i=(a,d)=>a.length>0?`${a.join(" - ")} | ${d}`:d;document.title=(o||i)(s,r)},[n.pathname])}const Yn=()=>{const[r,t]=he.useSearchParams(),o=rr.searchParamsToObject(r.toString()),n=he.useParams(),l=he.useLocation(),c=n.id;return{setSearchParams:t,searchParams:r,searchQueries:o,isHasQuery:(y,p)=>r.has(y)&&r.get(y)===p,getQueryParam:y=>r.get(y),getRouteParam:y=>n[y],params:n,location:l,id:c,hasId:!!c}};function Xn(r){var n,l;const t=r.decodedAccessToken;return f.useMemo(()=>{var a,d;const c=((d=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:d.code)??"",s=Object.keys(r.role).reduce((y,p)=>{const C=`is${p.toLowerCase().replace(/(^\w|_\w)/g,b=>b.replace("_","").toUpperCase())}`;return{...y,[C]:!1}},{});return{...Object.keys(r.role).reduce((y,p)=>{const C=`is${p.toLowerCase().replace(/(^\w|_\w)/g,b=>b.replace("_","").toUpperCase())}`;return{...y,[C]:c===r.role[p]}},s),hasRole:y=>c===r.role[y],getRoleKey:()=>c}},[(l=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:l.code,r])}g.AdvanceFilterBar=jt,g.App=wo,g.AppComponent=ut,g.AppContext=Hr,g.AppLayout=ko,g.AsideBar=Fn,g.BackButton=mo,g.ColumnFilterDropdown=oo,g.ColumnMenu=io,g.ConfirmationDialog=Vn,g.DataTable=no,g.DecisionWrapper=oe,g.EachUtils=mr,g.EmptyStatePage=In,g.FilterBar=vl,g.FilterDrawer=Vt,g.FloatingFooter=mn,g.ForbiddenPage=zn,g.Form=kn,g.FullSection=jn,g.HeaderLeftSlot=Do,g.HeaderLeftSlotOutlet=Ct,g.HeaderLeftSlotProvider=pt,g.HorizontalField=To,g.ImagePreview=Qn,g.InputFile=go,g.InputImage=yo,g.LayoutDialog=hr,g.LayoutDialogAside=Lr,g.LayoutDialogBody=Er,g.LayoutDialogFooter=Ir,g.LayoutDialogHeader=Mr,g.ModuleSwitcher=Mo,g.ModuleSwitcherModal=Et,g.NotFoundPage=On,g.PageLayout=zo,g.Pressable=vr,g.RightDrawer=It,g.ScrollToTopButton=po,g.Section=jo,g.SectionFooter=Gr,g.SectionHeader=Zr,g.SelectButton=Pn,g.ServerErrorPage=Hn,g.SidebarBadgesProvider=ft,g.SidebarGroupSlot=So,g.SidebarGroupSlotOutlet=bt,g.SidebarGroupSlotProvider=vt,g.SidebarHeaderSlot=yt,g.TableFooter=to,g.TableHeader=ro,g.TableLayout=zl,g.TableSection=El,g.TableWrapper=eo,g.ToggleStatus=Bn,g.Typography=Ee,g.VerticalField=Mn,g.clearModuleSelection=Bo,g.createInitialFromUserName=Nl,g.cssVars=Ul,g.expandDateCompact=Sl,g.formHasChanged=Rl,g.formatDate=Gl,g.formatDateToIndonesian=fo,g.formatRupiah=ql,g.getDateFilterValue=Ht,g.getDateRangeFilterValue=qo,g.getInitials=Zl,g.getValueDropdownMultipleFilter=At,g.getValueRadioFilter=_o,g.getValueSearch=xr,g.getValuesFilter=br,g.handleChangeFilter=ar,g.handleOnScroll=an,g.isEmail=nn,g.isFilterActive=Zo,g.isOnlyLettersAndSpaces=rn,g.isPhoneNumber=en,g.isSlug=cn,g.localStorageAdapter=Qr,g.oneDayInMs=Jl,g.parseIndonesianDateToDate=_l,g.preventNonCoordinateInput=sn,g.preventNonNumberAndDecimalInput=ln,g.preventNonNumberInput=tn,g.preventNumberInput=on,g.resolveDateRangeValueToString=Wt,g.resolveDateValueToString=zt,g.resolveDropdownValueToString=Tt,g.resolveRadioValueToString=Ot,g.resolveSidebarBadge=yr,g.storageKeys=dr,g.textWidth=Yl,g.useApp=Vr,g.useAppState=dt,g.useAuthRole=Xn,g.useDynamicTitle=Jn,g.useFilterBarApiParams=Dl,g.useModuleSelection=_r,g.useRouteInfo=Fe,g.useRouteParams=Yn,g.useSidebarBadges=gt,g.useTabState=Un,g.useTableSortApiParams=Al,Object.keys($e).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>$e[r]})}),Object.keys(_e).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>_e[r]})}),Object.keys(u).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>u[r]})}),Object.keys(Re).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Re[r]})}),Object.keys(V).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>V[r]})}),Object.keys(rt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>rt[r]})}),Object.keys(Qe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Qe[r]})}),Object.keys(Me).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Me[r]})}),Object.keys(ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ur[r]})}),Object.keys(er).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>er[r]})}),Object.keys(de).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>de[r]})}),Object.keys(rr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>rr[r]})}),Object.keys(qe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>qe[r]})}),Object.keys(M).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>M[r]})}),Object.keys(ir).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ir[r]})}),Object.keys(sr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>sr[r]})}),Object.keys($).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>$[r]})}),Object.keys(tt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>tt[r]})}),Object.keys(Wr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Wr[r]})}),Object.keys(tr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>tr[r]})}),Object.keys(ot).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ot[r]})}),Object.keys(or).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>or[r]})}),Object.keys(we).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>we[r]})}),Object.keys(lr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>lr[r]})}),Object.keys(zr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>zr[r]})}),Object.keys(D).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>D[r]})}),Object.keys(m).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>m[r]})}),Object.keys(le).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>le[r]})}),Object.keys(lt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>lt[r]})}),Object.keys(nt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>nt[r]})}),Object.keys(ct).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ct[r]})}),Object.keys(it).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>it[r]})}),Object.keys(st).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>st[r]})}),Object.keys(Ue).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ue[r]})}),Object.keys(at).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>at[r]})}),Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|