1import{a as me}from"/build/_shared/chunk-F7NNLC42.js";import{a as g}from"/build/_shared/chunk-K5KFHDCA.js";import{a as Q,b as Y,c as Z,d as le,e as de,f as ee,g as te,h as oe}from"/build/_shared/chunk-R4S4GZJI.js";import{a as ce}from"/build/_shared/chunk-FXIBPATW.js";import"/build/_shared/chunk-6URBWI7Y.js";import"/build/_shared/chunk-MEEMDHJT.js";import"/build/_shared/chunk-FKM3AN4D.js";import"/build/_shared/chunk-62JUGQHE.js";import"/build/_shared/chunk-OIL7BHFR.js";import"/build/_shared/chunk-WOKVZE6Z.js";import"/build/_shared/chunk-GLQFIWLI.js";import"/build/_shared/chunk-6VXGDZTR.js";import{b as z,c as x,d as p,g as G,h as V,j as X,k as q,l as J,m as u,o as k,t as K}from"/build/_shared/chunk-7SQXQI2M.js";import"/build/_shared/chunk-E52O7DLK.js";import"/build/_shared/chunk-O54MRHGZ.js";import"/build/_shared/chunk-445DROUV.js";import"/build/_shared/chunk-7SLS667F.js";import"/build/_shared/chunk-VLZ43GVN.js";import"/build/_shared/chunk-QEVAJG33.js";import{a as F}from"/build/_shared/chunk-6ZHV4MO7.js";import"/build/_shared/chunk-RDD3XJIL.js";import"/build/_shared/chunk-HJCBO6NI.js";import"/build/_shared/chunk-MEKTO634.js";import{a as y}from"/build/_shared/chunk-HYYMZHF4.js";import{c as $}from"/build/_shared/chunk-26RFFLBD.js";import{Ba as _,Ca as T,Da as U,Ea as B,dc as W,ec as v,ya as M}from"/build/_shared/chunk-GD5FLZTZ.js";import"/build/_shared/chunk-UI25SDVZ.js";import{A as E,G as j,H as O,J as P}from"/build/_shared/chunk-4SM4LAKW.js";import"/build/_shared/chunk-L327ZUMW.js";import"/build/_shared/chunk-KJRACP7S.js";import{a as ie}from"/build/_shared/chunk-K4C4SRAU.js";import{a as se}from"/build/_shared/chunk-Q4AUU75K.js";import{d as h}from"/build/_shared/chunk-ZTJM3362.js";import"/build/_shared/chunk-RSV5R2LB.js";import{A as d,a as S,d as C,h as D,k as L,n as c,o as R,t as I,u as H}from"/build/_shared/chunk-32KJV3RQ.js";import{d as m}from"/build/_shared/chunk-DTKMK5PW.js";var ae=m(se());var s=m(S());var be=m(me()),he=m(le()),ve=m(ie()),ye=m(ce()),re=m(de());var w=m(S());var n=m(d()),f=new URLSearchParams;f.set("page","1");f.set("limit","25");var pe=[{type:"link",label:"Overview",link:"/advance",prefix:(0,n.jsx)(j,{size:24})},{type:"link",label:"Disbursement",link:`/advance/disbursements?${f}`,prefix:(0,n.jsx)(E,{size:24,strokeWidth:1.5})},{type:"link",label:"Repayment History",link:`/advance/repayments?${f}`,prefix:(0,n.jsx)(P,{size:24})},{type:"externalLink",label:"FAQ",link:"https://notes.chip-in.asia/share/a55yqqiyxc/p/chip-advance-OHc5Xs8uci",prefix:(0,n.jsx)(O,{size:24,strokeWidth:1.3})}],A=(0,w.memo)(({desktop:t,setSidebarOpen:a})=>(0,n.jsxs)(ee,{items:pe,activeModule:"advance",isMobile:!t,children:[(0,n.jsx)(oe,{}),(0,n.jsx)(W,{renderItems:(r,i,o)=>(0,n.jsx)(ue,{items:r,handleSetSidebar:i,optionalActiveLink:o})}),(0,n.jsx)(te,{setSidebarOpen:a})]})),ue=({items:t,handleSetSidebar:a,optionalActiveLink:r})=>{let i=o=>r?r===o:!1;return(0,n.jsx)(n.Fragment,{children:t.map(o=>o.type==="separator"?(0,n.jsx)("div",{className:"h-4"},o.key):o.type==="externalLink"?(0,n.jsx)(R,{to:o.link,target:"_blank",rel:"noopener noreferrer",onPointerUp:a,children:(0,n.jsx)(v,{icon:o.prefix,label:o.label})},o.link):o.type==="header"?(0,n.jsx)("div",{className:"px-3 pb-1 flex items-end text-xxs text-dim h-9 uppercase font-medium tracking-wide",children:o.label},o.key):(0,n.jsx)(fe,{link:o.link,label:o.label,prefix:o.prefix,handleSetSidebar:a,active:i(o.link)},o.link))})},fe=(0,w.memo)(({link:t,label:a,prefix:r,handleSetSidebar:i,active:o})=>(0,n.jsx)(c,{onPointerUp:i,to:t,prefetch:"intent",rel:"prefetch",end:!0,className:"group",children:({isActive:l})=>(0,n.jsx)(v,{active:l||o,icon:r,label:a})}));var e=m(d());var xe=()=>!1,ke=()=>x(k)&&(0,e.jsx)("div",{className:"sticky top-0 z-10 max-sm:h-0",children:(0,e.jsx)("div",{className:"w-full h-8",children:(0,e.jsx)("div",{className:"flex justify-center sm:items-center bg-black px-8 max-sm:h-1 sm:min-h-8 text-white",children:(0,e.jsx)("p",{className:"max-sm:flex max-sm:items-center max-sm:bg-black max-sm:px-2 max-sm:rounded-b-lg max-sm:h-7 text-center",children:(0,e.jsx)("span",{className:"font-medium",children:"Logged in as CHIP Admin"})})})})}),ge=()=>{let t=H();return(0,e.jsx)(z,{children:(0,e.jsxs)(Ne,{initialValues:[[X,t.companyData.id],[q,t.companyData],[J,t.user],[K,t.userRole],[u,null],[k,t.isAdmin]],children:[(0,e.jsx)(ke,{}),(0,e.jsx)(Ce,{}),(0,e.jsx)(Se,{}),(0,e.jsx)(Ae,{}),(0,e.jsx)(Y,{id:t.companyId+"/"+t.user.id,name:t.user.name,companyName:t.companyData.company.legal_name,identifierHash:t.chatwootIdentifierHash,description:t.companyData.company.external_company_id??"",baseUrl:t.chatWootBaseUrl??"",websiteToken:t.chatWootWebsiteToken??""})]})})},we=ge,Ae=()=>{let t=x(u),a=p(u),r=$(),i=D(),o=C(),l=async()=>(a(null),r.clear(),r.invalidateQueries(),i.revalidate(),o("/logout"));return(0,e.jsx)(M,{open:t!=null,children:(0,e.jsxs)(_,{children:[(0,e.jsxs)(T,{className:"pt-6 sm:pt-7 px-6 sm:px-7 pb-8 sm:pb-9 space-y-0.5",children:[(0,e.jsx)(B,{children:"Error"}),t?.message&&(0,e.jsx)("p",{className:"text-dim",children:t.message})]}),(0,e.jsx)(U,{className:"pb-6 sm:pb-7 px-6 sm:px-7",children:t?.code===500?(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(h,{type:"button",onClick:()=>location.reload(),children:"Refresh page"})}):(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(h,{type:"button",onClick:l,children:"Back to login page"})})})]})})},Ne=({initialValues:t,children:a})=>(Q(new Map(t)),a),Se=(0,s.memo)(()=>{let t=p(G),a=p(V),r=g("(max-width: 640px)"),i=g("(min-width: 1024px)");return(0,s.useEffect)(()=>{t(r)},[r]),(0,s.useEffect)(()=>{a(i)},[i]),(0,e.jsx)(e.Fragment,{})}),Ce=(0,s.memo)(()=>(0,e.jsx)("div",{className:"flex justify-center",children:(0,e.jsxs)("div",{className:"flex w-full max-w-[1800px]",children:[(0,e.jsx)("span",{className:"h-0 w-0","aria-hidden":!0,
1children:(0,e.jsx)(F,{className:"h-9"})}),(0,e.jsx)(A,{desktop:!0}),(0,e.jsx)("div",{className:"max-w-full w-full lg:w-[calc(100%-250px)] flex-grow flex justify-center",children:(0,e.jsxs)("div",{className:y("w-full max-sm:flex max-sm:flex-col-reverse max-w-[1390px]"),children:[(0,e.jsx)("div",{className:"px-5 min-[1640px]:px-10 md:px-10 lg:pt-6 lg:pr-10 lg:pl-6",children:(0,e.jsx)(L,{})}),(0,e.jsx)(De,{})]})})]})})),De=(0,s.memo)(()=>{let t=(0,s.useRef)(null),a=(0,s.useRef)(null),[r,i]=(0,s.useState)(!1),[o,l]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(t.current&&a.current){let N=new IntersectionObserver(ne=>{ne[0].isIntersecting?i(!1):i(!0)}),b=a.current;return N.observe(b),()=>{b&&N.unobserve(b)}}},[]),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{"data-scroll-interceptor":"",style:{position:"absolute",top:"0px"},ref:a}),(0,e.jsxs)("div",{className:y("h-14 sm:hidden sm:h-20 flex flex-none justify-between items-center mb-[22px] sm:mb-2 px-5 md:px-10 max-sm:shadow-[0_-1px_0_0_inset_#DFE3EA] sm:pb-[1px] max-sm:sticky max-sm:top-0 bg-white",r&&"max-sm:shadow-[0_3px_5px_0_rgba(0,0,0,0.10)]"),ref:t,children:[(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"flex gap-x-0.5 items-center text-xs text-dim py-2.5",children:(0,e.jsx)(Re,{})})}),(0,e.jsx)("div",{className:"flex gap-2 items-center",children:(0,e.jsx)("div",{className:"px-1 -mr-4",children:(0,e.jsx)("div",{className:"flex-none lg:hidden w-10 aspect-square",children:(0,e.jsx)(Z,{sidebarOpen:o,setSidebarOpen:l,children:(0,e.jsx)(A,{setSidebarOpen:l})})})})})]})]})}),Le=()=>{let t=[],a=I(),r=a[a.length-1].handle;return typeof r?.breadcrumb=="object"&&Array.isArray(r?.breadcrumb)&&r?.breadcrumb.length?t=r.breadcrumb:a.forEach(i=>{let l=i.handle?.breadcrumb;l&&t.push(l)}),t},Re=(0,s.memo)(()=>{let t=Le();return(0,e.jsx)(e.Fragment,{children:t.map((a,r)=>(0,e.jsxs)("div",{className:"contents",children:[r!==0?(0,e.jsx)("div",{className:"text-dim/80",children:(0,e.jsx)(Ie,{})}):"",r===t.length-1?(0,e.jsx)("div",{className:"font-medium",children:a.label}):(0,e.jsx)(c,{to:a.link,className:"text-primary font-medium",children:a.label})]},r))})}),Ie=(0,s.memo)(()=>(0,e.jsx)("svg",{width:"22",height:"22",fill:"none",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M10.75 8.75L14.25 12L10.75 15.25"})}));export{we as default,xe as shouldRevalidate};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.